From 995e919d62c0d70e332b8a06498c21c1eff1e9b2 Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Thu, 3 Dec 2020 23:27:46 +0100 Subject: [PATCH] Add information to equipment select on bike page whether equipment is already part of other bike --- src/app/graphqlOperations/fragments/equipment.graphql | 3 +++ src/app/pages/dataPages/bike/bike.component.ts | 2 +- src/generated/graphql.ts | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/graphqlOperations/fragments/equipment.graphql b/src/app/graphqlOperations/fragments/equipment.graphql index a777431..b2579b2 100644 --- a/src/app/graphqlOperations/fragments/equipment.graphql +++ b/src/app/graphqlOperations/fragments/equipment.graphql @@ -3,6 +3,9 @@ fragment EquipmentFieldsForBikePage on Equipment { serialNo title description + cargoBike { + name + } } fragment EquipmentFieldsForTable on Equipment { diff --git a/src/app/pages/dataPages/bike/bike.component.ts b/src/app/pages/dataPages/bike/bike.component.ts index 8ed87ea..3092149 100644 --- a/src/app/pages/dataPages/bike/bike.component.ts +++ b/src/app/pages/dataPages/bike/bike.component.ts @@ -211,7 +211,7 @@ export class BikeComponent implements OnInit { { dataPath: 'description', translation: 'Beschreibung' }, ], nameToShowInSelection: (element) => { - return element.title + ' (' + element.serialNo + ')'; + return element.title + ' (' + element.serialNo + ')' + (element.cargoBike ? " [aktuell Teil von "+element.cargoBike.name+']' : ''); }, linkToTable: (element) => '/table/equipment', linkToTableParams: (bike) => { diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 16ecf26..2852913 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -2071,7 +2071,7 @@ export type EngagementFieldsForBikePageFragment = { __typename?: 'Engagement', i export type EngagementTypeFieldsFragment = { __typename?: 'EngagementType', id: string, name: string, description: string, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe, lockedUntil?: Maybe }; -export type EquipmentFieldsForBikePageFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe }; +export type EquipmentFieldsForBikePageFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe, cargoBike?: Maybe<{ __typename?: 'CargoBike', name: string }> }; export type EquipmentFieldsForTableFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe, lockedUntil?: Maybe, cargoBike?: Maybe<{ __typename?: 'CargoBike', id: string, name: string }> }; @@ -2491,6 +2491,9 @@ export const EquipmentFieldsForBikePageFragmentDoc = gql` serialNo title description + cargoBike { + name + } } `; export const EquipmentTypeFieldsFragmentDoc = gql`