Add graphql fragments

master
Max Ehrlicher-Schmidt 4 years ago
parent 8cec05431d
commit b79a7c7410

@ -102,7 +102,6 @@ export class TableComponent implements AfterViewInit {
ngAfterViewInit(): void { ngAfterViewInit(): void {
this.addColumnPropertiesFromGQLSchemaToColumnInfo(); this.addColumnPropertiesFromGQLSchemaToColumnInfo();
console.log(this.columnInfo)
this.data.paginator = this.paginator; this.data.paginator = this.paginator;
this.data.sortingDataAccessor = (item, columnName) => { this.data.sortingDataAccessor = (item, columnName) => {
if (typeof item[columnName] === 'string') { if (typeof item[columnName] === 'string') {

@ -4,10 +4,33 @@ fragment BikeEventFieldsForBikePage on BikeEvent {
...BikeEventTypeFields ...BikeEventTypeFields
} }
responsible { responsible {
...ParticipantFieldsForBikePage ...ParticipantFieldsGeneral
} }
date date
responsible { }
fragment BikeEventFieldsForTable on BikeEvent {
id
bikeEventType {
...BikeEventTypeFields
}
cargoBike {
id id
name
}
responsible {
...ParticipantFieldsGeneral
} }
related {
...ParticipantFieldsGeneral
}
date
description
documents
remark
isLockedByMe
isLocked
lockedBy
lockedUntil
} }

@ -1,7 +1,9 @@
fragment BikeEventTypeFields on BikeEventType { fragment BikeEventTypeFields on BikeEventType {
id id
name name
isLocked isLocked
isLockedByMe isLockedByMe
lockedBy
lockedUntil lockedUntil
} }

@ -1,17 +1,33 @@
fragment EngagementFieldsForBikePage on Engagement { fragment EngagementFieldsForBikePage on Engagement {
id id
engagementType { engagementType {
...EngagementTypeFields ...EngagementTypeFields
} }
dateRange { dateRange {
from from
to to
} }
participant { participant {
...ParticipantFieldsForBikePage ...ParticipantFieldsGeneral
} }
isLocked
isLocked
isLockedByMe isLockedByMe
lockedBy lockedBy
lockedUntil lockedUntil
} }
fragment EngagementFieldsForParticipant on Engagement {
id
engagementType {
...EngagementTypeFields
}
dateRange {
from
to
}
cargoBike {
id
name
}
}

@ -1,9 +1,10 @@
fragment EngagementTypeFields on EngagementType { fragment EngagementTypeFields on EngagementType {
id id
name name
description description
isLocked
isLocked
isLockedByMe isLockedByMe
lockedBy lockedBy
lockedUntil lockedUntil
} }

@ -1,17 +1,35 @@
fragment ParticipantFieldsForBikePage on Participant { fragment ParticipantFieldsGeneral on Participant {
id id
dateRange { dateRange {
from from
to to
} }
usernamefLotte contactInformation {
usernameSlack ...ContactInformationFieldsGeneral
contactInformation { }
...ContactInformationFieldsGeneral usernamefLotte
} usernameSlack
}
isLocked fragment ParticipantFieldsForTable on Participant {
...ParticipantFieldsGeneral
memberADFC
locationZIPs
memberCoreTeam
distributedActiveBikeParte
isLocked
isLockedByMe isLockedByMe
lockedBy lockedBy
lockedUntil lockedUntil
} }
fragment ParticipantFieldsForPage on Participant {
...ParticipantFieldsForTable
engagement {
...EngagementFieldsForParticipant
}
workshops {
...WorkshopFieldsGeneral
}
}

@ -0,0 +1,27 @@
fragment WorkshopFieldsGeneral on Workshop {
id
title
description
date
workshopType {
...WorkshopTypefieldsGeneral
}
trainer1 {
...ParticipantFieldsGeneral
}
trainer2 {
...ParticipantFieldsGeneral
}
}
fragment WorkshopFieldsForTable on Workshop {
...WorkshopFieldsGeneral
participants {
...ParticipantFieldsGeneral
}
isLocked
isLockedByMe
lockedBy
lockedUntil
}

@ -0,0 +1,12 @@
fragment WorkshopTypefieldsGeneral on WorkshopType {
id
name
}
fragment WorkshopTypefieldsForTable on WorkshopType {
...WorkshopTypefieldsGeneral
isLocked
isLockedByMe
lockedBy
lockedUntil
}

@ -2042,11 +2042,22 @@ export type BikeEventFieldsForBikePageFragment = { __typename?: 'BikeEvent', id:
{ __typename?: 'BikeEventType' } { __typename?: 'BikeEventType' }
& BikeEventTypeFieldsFragment & BikeEventTypeFieldsFragment
), responsible?: Maybe<( ), responsible?: Maybe<(
{ __typename?: 'Participant', id: string } { __typename?: 'Participant' }
& ParticipantFieldsForBikePageFragment & ParticipantFieldsGeneralFragment
)> };
export type BikeEventFieldsForTableFragment = { __typename?: 'BikeEvent', id: string, date: any, description?: Maybe<string>, documents: Array<string>, remark?: Maybe<string>, isLockedByMe: boolean, isLocked: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, bikeEventType: (
{ __typename?: 'BikeEventType' }
& BikeEventTypeFieldsFragment
), cargoBike: { __typename?: 'CargoBike', id: string, name: string }, responsible?: Maybe<(
{ __typename?: 'Participant' }
& ParticipantFieldsGeneralFragment
)>, related?: Maybe<(
{ __typename?: 'Participant' }
& ParticipantFieldsGeneralFragment
)> }; )> };
export type BikeEventTypeFieldsFragment = { __typename?: 'BikeEventType', id: string, name: string, isLocked: boolean, isLockedByMe: boolean, lockedUntil?: Maybe<any> }; export type BikeEventTypeFieldsFragment = { __typename?: 'BikeEventType', id: string, name: string, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any> };
export type ContactInformationFieldsGeneralFragment = { __typename?: 'ContactInformation', id: string, phone?: Maybe<string>, phone2?: Maybe<string>, email?: Maybe<string>, email2?: Maybe<string>, note?: Maybe<string>, person: ( export type ContactInformationFieldsGeneralFragment = { __typename?: 'ContactInformation', id: string, phone?: Maybe<string>, phone2?: Maybe<string>, email?: Maybe<string>, email2?: Maybe<string>, note?: Maybe<string>, person: (
{ __typename?: 'Person' } { __typename?: 'Person' }
@ -2063,9 +2074,14 @@ export type EngagementFieldsForBikePageFragment = { __typename?: 'Engagement', i
& EngagementTypeFieldsFragment & EngagementTypeFieldsFragment
), dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, participant: ( ), dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, participant: (
{ __typename?: 'Participant' } { __typename?: 'Participant' }
& ParticipantFieldsForBikePageFragment & ParticipantFieldsGeneralFragment
) }; ) };
export type EngagementFieldsForParticipantFragment = { __typename?: 'Engagement', id: string, engagementType: (
{ __typename?: 'EngagementType' }
& EngagementTypeFieldsFragment
), dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, cargoBike: { __typename?: 'CargoBike', id: string, name: string } };
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>, cargoBike?: Maybe<{ __typename?: 'CargoBike', name: string }> }; export type EquipmentFieldsForBikePageFragment = { __typename?: 'Equipment', id: string, serialNo: string, title: string, description?: Maybe<string>, cargoBike?: Maybe<{ __typename?: 'CargoBike', name: string }> };
@ -2125,11 +2141,27 @@ export type OrganisationFieldsForPageFragment = (
& OrganisationFieldsForTableFragment & OrganisationFieldsForTableFragment
); );
export type ParticipantFieldsForBikePageFragment = { __typename?: 'Participant', id: string, usernamefLotte?: Maybe<string>, usernameSlack?: Maybe<string>, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, contactInformation: ( export type ParticipantFieldsGeneralFragment = { __typename?: 'Participant', id: string, usernamefLotte?: Maybe<string>, usernameSlack?: Maybe<string>, dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, contactInformation: (
{ __typename?: 'ContactInformation' } { __typename?: 'ContactInformation' }
& ContactInformationFieldsGeneralFragment & ContactInformationFieldsGeneralFragment
) }; ) };
export type ParticipantFieldsForTableFragment = (
{ __typename?: 'Participant', memberADFC: boolean, locationZIPs: Array<Maybe<string>>, memberCoreTeam: boolean, distributedActiveBikeParte: boolean, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any> }
& ParticipantFieldsGeneralFragment
);
export type ParticipantFieldsForPageFragment = (
{ __typename?: 'Participant', engagement?: Maybe<Array<Maybe<(
{ __typename?: 'Engagement' }
& EngagementFieldsForParticipantFragment
)>>>, workshops?: Maybe<Array<Maybe<(
{ __typename?: 'Workshop' }
& WorkshopFieldsGeneralFragment
)>>> }
& ParticipantFieldsForTableFragment
);
export type PersonFieldsGeneralFragment = { __typename?: 'Person', id: string, name: string, firstName: string }; export type PersonFieldsGeneralFragment = { __typename?: 'Person', id: string, name: string, firstName: string };
export type PersonFieldsForTableFragment = { __typename?: 'Person', id: string, name: string, firstName: string, isLocked: boolean, isLockedByMe: boolean, lockedUntil?: Maybe<any> }; export type PersonFieldsForTableFragment = { __typename?: 'Person', id: string, name: string, firstName: string, isLocked: boolean, isLockedByMe: boolean, lockedUntil?: Maybe<any> };
@ -2169,6 +2201,32 @@ export type TimeFrameFieldsForLendingStationFragment = { __typename?: 'TimeFrame
export type TimeFrameFieldsFragment = { __typename?: 'TimeFrame', id: string, note?: Maybe<string>, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, lendingStation: { __typename?: 'LendingStation', id: string, name: string }, cargoBike: { __typename?: 'CargoBike', id: string, name: string } }; export type TimeFrameFieldsFragment = { __typename?: 'TimeFrame', id: string, note?: Maybe<string>, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, dateRange: { __typename?: 'DateRange', from: any, to?: Maybe<any> }, lendingStation: { __typename?: 'LendingStation', id: string, name: string }, cargoBike: { __typename?: 'CargoBike', id: string, name: string } };
export type WorkshopFieldsGeneralFragment = { __typename?: 'Workshop', id: string, title: string, description: string, date: any, workshopType: (
{ __typename?: 'WorkshopType' }
& WorkshopTypefieldsGeneralFragment
), trainer1: (
{ __typename?: 'Participant' }
& ParticipantFieldsGeneralFragment
), trainer2?: Maybe<(
{ __typename?: 'Participant' }
& ParticipantFieldsGeneralFragment
)> };
export type WorkshopFieldsForTableFragment = (
{ __typename?: 'Workshop', isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any>, participants?: Maybe<Array<Maybe<(
{ __typename?: 'Participant' }
& ParticipantFieldsGeneralFragment
)>>> }
& WorkshopFieldsGeneralFragment
);
export type WorkshopTypefieldsGeneralFragment = { __typename?: 'WorkshopType', id: string, name: string };
export type WorkshopTypefieldsForTableFragment = (
{ __typename?: 'WorkshopType', isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe<string>, lockedUntil?: Maybe<any> }
& WorkshopTypefieldsGeneralFragment
);
export type GetLendingStationsQueryVariables = Exact<{ [key: string]: never; }>; export type GetLendingStationsQueryVariables = Exact<{ [key: string]: never; }>;
@ -2711,25 +2769,22 @@ export const BikeEventTypeFieldsFragmentDoc = gql`
name name
isLocked isLocked
isLockedByMe isLockedByMe
lockedBy
lockedUntil lockedUntil
} }
`; `;
export const ParticipantFieldsForBikePageFragmentDoc = gql` export const ParticipantFieldsGeneralFragmentDoc = gql`
fragment ParticipantFieldsForBikePage on Participant { fragment ParticipantFieldsGeneral on Participant {
id id
dateRange { dateRange {
from from
to to
} }
usernamefLotte
usernameSlack
contactInformation { contactInformation {
...ContactInformationFieldsGeneral ...ContactInformationFieldsGeneral
} }
isLocked usernamefLotte
isLockedByMe usernameSlack
lockedBy
lockedUntil
} }
${ContactInformationFieldsGeneralFragmentDoc}`; ${ContactInformationFieldsGeneralFragmentDoc}`;
export const BikeEventFieldsForBikePageFragmentDoc = gql` export const BikeEventFieldsForBikePageFragmentDoc = gql`
@ -2739,16 +2794,12 @@ export const BikeEventFieldsForBikePageFragmentDoc = gql`
...BikeEventTypeFields ...BikeEventTypeFields
} }
responsible { responsible {
...ParticipantFieldsForBikePage ...ParticipantFieldsGeneral
id
} }
date date
responsible {
id
}
} }
${BikeEventTypeFieldsFragmentDoc} ${BikeEventTypeFieldsFragmentDoc}
${ParticipantFieldsForBikePageFragmentDoc}`; ${ParticipantFieldsGeneralFragmentDoc}`;
export const EquipmentFieldsForBikePageFragmentDoc = gql` export const EquipmentFieldsForBikePageFragmentDoc = gql`
fragment EquipmentFieldsForBikePage on Equipment { fragment EquipmentFieldsForBikePage on Equipment {
id id
@ -2793,7 +2844,7 @@ export const EngagementFieldsForBikePageFragmentDoc = gql`
to to
} }
participant { participant {
...ParticipantFieldsForBikePage ...ParticipantFieldsGeneral
} }
isLocked isLocked
isLockedByMe isLockedByMe
@ -2801,7 +2852,7 @@ export const EngagementFieldsForBikePageFragmentDoc = gql`
lockedUntil lockedUntil
} }
${EngagementTypeFieldsFragmentDoc} ${EngagementTypeFieldsFragmentDoc}
${ParticipantFieldsForBikePageFragmentDoc}`; ${ParticipantFieldsGeneralFragmentDoc}`;
export const TimeFrameFieldsForBikePageFragmentDoc = gql` export const TimeFrameFieldsForBikePageFragmentDoc = gql`
fragment TimeFrameFieldsForBikePage on TimeFrame { fragment TimeFrameFieldsForBikePage on TimeFrame {
id id
@ -2843,6 +2894,33 @@ ${EquipmentFieldsForBikePageFragmentDoc}
${EquipmentTypeFieldsFragmentDoc} ${EquipmentTypeFieldsFragmentDoc}
${EngagementFieldsForBikePageFragmentDoc} ${EngagementFieldsForBikePageFragmentDoc}
${TimeFrameFieldsForBikePageFragmentDoc}`; ${TimeFrameFieldsForBikePageFragmentDoc}`;
export const BikeEventFieldsForTableFragmentDoc = gql`
fragment BikeEventFieldsForTable on BikeEvent {
id
bikeEventType {
...BikeEventTypeFields
}
cargoBike {
id
name
}
responsible {
...ParticipantFieldsGeneral
}
related {
...ParticipantFieldsGeneral
}
date
description
documents
remark
isLockedByMe
isLocked
lockedBy
lockedUntil
}
${BikeEventTypeFieldsFragmentDoc}
${ParticipantFieldsGeneralFragmentDoc}`;
export const ContactInformationFieldsFragmentDoc = gql` export const ContactInformationFieldsFragmentDoc = gql`
fragment ContactInformationFields on ContactInformation { fragment ContactInformationFields on ContactInformation {
...ContactInformationFieldsGeneral ...ContactInformationFieldsGeneral
@ -2973,6 +3051,72 @@ export const OrganisationFieldsForPageFragmentDoc = gql`
} }
${OrganisationFieldsForTableFragmentDoc} ${OrganisationFieldsForTableFragmentDoc}
${ProviderFieldsForPageFragmentDoc}`; ${ProviderFieldsForPageFragmentDoc}`;
export const ParticipantFieldsForTableFragmentDoc = gql`
fragment ParticipantFieldsForTable on Participant {
...ParticipantFieldsGeneral
memberADFC
locationZIPs
memberCoreTeam
distributedActiveBikeParte
isLocked
isLockedByMe
lockedBy
lockedUntil
}
${ParticipantFieldsGeneralFragmentDoc}`;
export const EngagementFieldsForParticipantFragmentDoc = gql`
fragment EngagementFieldsForParticipant on Engagement {
id
engagementType {
...EngagementTypeFields
}
dateRange {
from
to
}
cargoBike {
id
name
}
}
${EngagementTypeFieldsFragmentDoc}`;
export const WorkshopTypefieldsGeneralFragmentDoc = gql`
fragment WorkshopTypefieldsGeneral on WorkshopType {
id
name
}
`;
export const WorkshopFieldsGeneralFragmentDoc = gql`
fragment WorkshopFieldsGeneral on Workshop {
id
title
description
date
workshopType {
...WorkshopTypefieldsGeneral
}
trainer1 {
...ParticipantFieldsGeneral
}
trainer2 {
...ParticipantFieldsGeneral
}
}
${WorkshopTypefieldsGeneralFragmentDoc}
${ParticipantFieldsGeneralFragmentDoc}`;
export const ParticipantFieldsForPageFragmentDoc = gql`
fragment ParticipantFieldsForPage on Participant {
...ParticipantFieldsForTable
engagement {
...EngagementFieldsForParticipant
}
workshops {
...WorkshopFieldsGeneral
}
}
${ParticipantFieldsForTableFragmentDoc}
${EngagementFieldsForParticipantFragmentDoc}
${WorkshopFieldsGeneralFragmentDoc}`;
export const PersonFieldsForTableFragmentDoc = gql` export const PersonFieldsForTableFragmentDoc = gql`
fragment PersonFieldsForTable on Person { fragment PersonFieldsForTable on Person {
id id
@ -3015,6 +3159,28 @@ export const TimeFrameFieldsFragmentDoc = gql`
lockedUntil lockedUntil
} }
`; `;
export const WorkshopFieldsForTableFragmentDoc = gql`
fragment WorkshopFieldsForTable on Workshop {
...WorkshopFieldsGeneral
participants {
...ParticipantFieldsGeneral
}
isLocked
isLockedByMe
lockedBy
lockedUntil
}
${WorkshopFieldsGeneralFragmentDoc}
${ParticipantFieldsGeneralFragmentDoc}`;
export const WorkshopTypefieldsForTableFragmentDoc = gql`
fragment WorkshopTypefieldsForTable on WorkshopType {
...WorkshopTypefieldsGeneral
isLocked
isLockedByMe
lockedBy
lockedUntil
}
${WorkshopTypefieldsGeneralFragmentDoc}`;
export const GetCargoBikesDocument = gql` export const GetCargoBikesDocument = gql`
query GetCargoBikes { query GetCargoBikes {
cargoBikes { cargoBikes {

Loading…
Cancel
Save