Add information to equipment select on bike page

whether equipment is already part of other bike
pull/8/head
Max Ehrlicher-Schmidt 4 years ago
parent 183b534775
commit 995e919d62

@ -3,6 +3,9 @@ fragment EquipmentFieldsForBikePage on Equipment {
serialNo serialNo
title title
description description
cargoBike {
name
}
} }
fragment EquipmentFieldsForTable on Equipment { fragment EquipmentFieldsForTable on Equipment {

@ -211,7 +211,7 @@ export class BikeComponent implements OnInit {
{ dataPath: 'description', translation: 'Beschreibung' }, { dataPath: 'description', translation: 'Beschreibung' },
], ],
nameToShowInSelection: (element) => { nameToShowInSelection: (element) => {
return element.title + ' (' + element.serialNo + ')'; return element.title + ' (' + element.serialNo + ')' + (element.cargoBike ? " [aktuell Teil von "+element.cargoBike.name+']' : '');
}, },
linkToTable: (element) => '/table/equipment', linkToTable: (element) => '/table/equipment',
linkToTableParams: (bike) => { linkToTableParams: (bike) => {

@ -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<string>, lockedUntil?: Maybe<any> }; export type EngagementTypeFieldsFragment = { __typename?: 'EngagementType', id: string, name: string, description: string, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any> };
export type EquipmentFieldsForBikePageFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe<string> }; export type EquipmentFieldsForBikePageFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe<string>, cargoBike?: Maybe<{ __typename?: 'CargoBike', name: string }> };
export type EquipmentFieldsForTableFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe<string>, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, cargoBike?: Maybe<{ __typename?: 'CargoBike', id: string, name: string }> }; export type EquipmentFieldsForTableFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe<string>, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, cargoBike?: Maybe<{ __typename?: 'CargoBike', id: string, name: string }> };
@ -2491,6 +2491,9 @@ export const EquipmentFieldsForBikePageFragmentDoc = gql`
serialNo serialNo
title title
description description
cargoBike {
name
}
} }
`; `;
export const EquipmentTypeFieldsFragmentDoc = gql` export const EquipmentTypeFieldsFragmentDoc = gql`

Loading…
Cancel
Save