From d7c332a501e74d5c1cd08acd59488d1cb0acec55 Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Thu, 3 Dec 2020 22:06:37 +0100 Subject: [PATCH] Add timeFrames to lendingStation page --- .../fragments/participant.graphql | 6 ++-- .../pages/dataPages/bike/bike.component.ts | 10 ++++-- .../lending-station.component.ts | 32 +++---------------- 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/app/graphqlOperations/fragments/participant.graphql b/src/app/graphqlOperations/fragments/participant.graphql index 2d9fc72..d82450d 100644 --- a/src/app/graphqlOperations/fragments/participant.graphql +++ b/src/app/graphqlOperations/fragments/participant.graphql @@ -1,7 +1,9 @@ fragment ParticipantFieldsForBikePage on Participant { id - start - end + dateRange { + from + to + } usernamefLotte usernameSlack contactInformation { diff --git a/src/app/pages/dataPages/bike/bike.component.ts b/src/app/pages/dataPages/bike/bike.component.ts index a9eda96..8ed87ea 100644 --- a/src/app/pages/dataPages/bike/bike.component.ts +++ b/src/app/pages/dataPages/bike/bike.component.ts @@ -226,10 +226,14 @@ export class BikeComponent implements OnInit { dataService: null, columnInfo: [ { dataPath: 'dateRange', translation: 'Zeitraum' }, - { dataPath: 'lendingStation.name', translation: 'Standort' }, + { + dataPath: 'lendingStation.name', + translation: 'Standort', + link: (row) => '/lendingStation/' + row["lendingStation.id"], + }, ], editableReferences: false, - linkToTable: (element) => '/table/timeFrames', + linkToTable: () => '/table/timeFrames', linkToTableParams: (bike) => { return { filter: bike.name }; }, @@ -237,7 +241,7 @@ export class BikeComponent implements OnInit { ]; headlineDataPath = 'name'; - headlineIconName = 'directions_bike' + headlineIconName = 'directions_bike'; pageDataGQLType: string = 'CargoBike'; pageDataGQLUpdateInputType: string = 'CargoBikeUpdateInput'; diff --git a/src/app/pages/dataPages/lending-station/lending-station.component.ts b/src/app/pages/dataPages/lending-station/lending-station.component.ts index b689c97..b2d6f76 100644 --- a/src/app/pages/dataPages/lending-station/lending-station.component.ts +++ b/src/app/pages/dataPages/lending-station/lending-station.component.ts @@ -115,26 +115,6 @@ export class LendingStationComponent implements OnInit { { dataPath: 'contactInformationExtern.note', translation: 'Anmerkung' }, ], }, - /* - { - type: 'ReferenceTable', - title: 'Equipment', - dataPath: 'equipment', - dataService: null, - columnInfo: [ - { dataPath: 'serialNo', translation: 'Seriennummer' }, - { dataPath: 'title', translation: 'Name' }, - { dataPath: 'description', translation: 'Beschreibung' }, - ], - nameToShowInSelection: (element) => { - return element.title + ' (' + element.serialNo + ')'; - }, - linkToTable: (element) => '/table/equipment', - linkToTableParams: (lendingStation) => { - return { filter: lendingStation.name }; - }, - propertyNameOfUpdateInput: 'equipmentIds', - }, { type: 'ReferenceTable', title: 'Zeitscheiben', @@ -142,14 +122,15 @@ export class LendingStationComponent implements OnInit { dataService: null, columnInfo: [ { dataPath: 'dateRange', translation: 'Zeitraum' }, - { dataPath: 'lendingStation.name', translation: 'Standort' }, + { dataPath: 'cargoBike.name', translation: 'Lastenrad', + link: (row) => '/bike/' + row["cargoBike.id"], }, ], editableReferences: false, - linkToTable: (element) => '/table/timeFrames', + linkToTable: () => '/table/timeFrames', linkToTableParams: (lendingStation) => { return { filter: lendingStation.name }; }, - },*/ + }, ]; headlineDataPath = 'name'; @@ -161,11 +142,8 @@ export class LendingStationComponent implements OnInit { constructor( private lendingStationsService: LendingStationsService, - private contactInformationService: ContactInformationService + private contactInformationService: ContactInformationService, ) { - /*this.propertiesInfo.find( - (prop) => prop.dataPath === 'equipmentType' - ).dataService = this.equipmentTypeService;*/ this.contactInformationService.loadTableData(); this.contactInformationService.tableData.subscribe((data) => { this.propertiesInfo.find(