diff --git a/src/app/graphqlOperations/bikes.graphql b/src/app/graphqlOperations/bikes.graphql index aa9b89d..05b0c3b 100644 --- a/src/app/graphqlOperations/bikes.graphql +++ b/src/app/graphqlOperations/bikes.graphql @@ -1,6 +1,5 @@ query GetCargoBikes { cargoBikes(limit: 100, offset: 0) { ...CargoBikeFields - } } diff --git a/src/app/pages/tables/bikes/bikes.component.ts b/src/app/pages/tables/bikes/bikes.component.ts index f37a34e..22ee353 100644 --- a/src/app/pages/tables/bikes/bikes.component.ts +++ b/src/app/pages/tables/bikes/bikes.component.ts @@ -9,6 +9,7 @@ import { filter } from 'graphql-anywhere'; import { CargoBikeFieldsMutableFragmentDoc, CargoBikeUpdateInput, + GetCargoBikesDocument } from 'src/generated/graphql'; import { SchemaService } from 'src/app/services/schema.service'; @@ -24,7 +25,7 @@ export class BikesComponent { { name: 'group', header: 'Gruppe'}, ]; - //properties that wont be shown in the table + // properties that wont be shown in the table blacklistedColumns = [ '__typename', 'isLocked', @@ -40,7 +41,7 @@ export class BikesComponent { loadingRowIds: string[] = []; - data = >[]; + data = [] as Array; selection = new SelectionModel(true, []); reloadingTable = false; @@ -68,7 +69,7 @@ export class BikesComponent { this.displayedColumns = []; this.dataColumns = []; - for (let index in this.data) { + for (const index in this.data) { this.data[index] = flatten(this.data[index]); } @@ -78,13 +79,13 @@ export class BikesComponent { } } - //sort, so the displayedColumns array is in the same order as the columnInfo + // sort, so the displayedColumns array is in the same order as the columnInfo this.dataColumns.sort((columnA, columnB) => { - const indexA = this.columnInfo.findIndex((c) => c.name == columnA); - const indexB = this.columnInfo.findIndex((c) => c.name == columnB); - if (indexA == -1) { + const indexA = this.columnInfo.findIndex((c) => c.name === columnA); + const indexB = this.columnInfo.findIndex((c) => c.name === columnB); + if (indexA === -1) { return 1; - } else if (indexB == -1) { + } else if (indexB === -1) { return -1; } else { return indexA - indexB; @@ -106,6 +107,8 @@ export class BikesComponent { } } }, this.relockingDuration); + + console.log(GetCargoBikesDocument); } ngOnDestroy() { @@ -120,9 +123,9 @@ export class BikesComponent { } getType(propertyName: string, row) { - //console.log(propertyName, this.schemaService.getPropertyTypeFromSchema("CargoBike", propertyName)) + // console.log(propertyName, this.schemaService.getPropertyTypeFromSchema("CargoBike", propertyName)) return ( - this.schemaService.getPropertyTypeFromSchema("CargoBike", propertyName) + this.schemaService.getPropertyTypeFromSchema('CargoBike', propertyName) ); } diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index 15bd29f..4ed9f3c 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -1677,7 +1677,45 @@ export type GetCargoBikeByIdQuery = ( { __typename?: 'Query' } & { cargoBikeById?: Maybe<( { __typename?: 'CargoBike' } - & CargoBikeFieldsFragment + & Pick + & { insuranceData: ( + { __typename?: 'InsuranceData' } + & Pick + ), dimensionsAndLoad: ( + { __typename?: 'DimensionsAndLoad' } + & Pick + ), security: ( + { __typename?: 'Security' } + & Pick + ), technicalEquipment?: Maybe<( + { __typename?: 'TechnicalEquipment' } + & Pick + )>, taxes?: Maybe<( + { __typename?: 'Taxes' } + & Pick + )>, provider?: Maybe<( + { __typename?: 'Provider' } + & Pick + & { privatePerson?: Maybe<( + { __typename?: 'ContactInformation' } + & Pick + & { person: ( + { __typename?: 'Person' } + & Pick + & { contactInformation?: Maybe + )>>> } + ) } + )> } + )>, lendingStation?: Maybe<( + { __typename?: 'LendingStation' } + & Pick + & { address: ( + { __typename?: 'Address' } + & Pick + ) } + )> } )> } ); @@ -1690,7 +1728,45 @@ export type UpdateCargoBikeMutation = ( { __typename?: 'Mutation' } & { updateCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsFragment + & Pick + & { insuranceData: ( + { __typename?: 'InsuranceData' } + & Pick + ), dimensionsAndLoad: ( + { __typename?: 'DimensionsAndLoad' } + & Pick + ), security: ( + { __typename?: 'Security' } + & Pick + ), technicalEquipment?: Maybe<( + { __typename?: 'TechnicalEquipment' } + & Pick + )>, taxes?: Maybe<( + { __typename?: 'Taxes' } + & Pick + )>, provider?: Maybe<( + { __typename?: 'Provider' } + & Pick + & { privatePerson?: Maybe<( + { __typename?: 'ContactInformation' } + & Pick + & { person: ( + { __typename?: 'Person' } + & Pick + & { contactInformation?: Maybe + )>>> } + ) } + )> } + )>, lendingStation?: Maybe<( + { __typename?: 'LendingStation' } + & Pick + & { address: ( + { __typename?: 'Address' } + & Pick + ) } + )> } ) } ); @@ -1703,7 +1779,45 @@ export type LockCargoBikeMutation = ( { __typename?: 'Mutation' } & { lockCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsFragment + & Pick + & { insuranceData: ( + { __typename?: 'InsuranceData' } + & Pick + ), dimensionsAndLoad: ( + { __typename?: 'DimensionsAndLoad' } + & Pick + ), security: ( + { __typename?: 'Security' } + & Pick + ), technicalEquipment?: Maybe<( + { __typename?: 'TechnicalEquipment' } + & Pick + )>, taxes?: Maybe<( + { __typename?: 'Taxes' } + & Pick + )>, provider?: Maybe<( + { __typename?: 'Provider' } + & Pick + & { privatePerson?: Maybe<( + { __typename?: 'ContactInformation' } + & Pick + & { person: ( + { __typename?: 'Person' } + & Pick + & { contactInformation?: Maybe + )>>> } + ) } + )> } + )>, lendingStation?: Maybe<( + { __typename?: 'LendingStation' } + & Pick + & { address: ( + { __typename?: 'Address' } + & Pick + ) } + )> } ) } ); @@ -1716,7 +1830,45 @@ export type UnlockCargoBikeMutation = ( { __typename?: 'Mutation' } & { unlockCargoBike: ( { __typename?: 'CargoBike' } - & CargoBikeFieldsFragment + & Pick + & { insuranceData: ( + { __typename?: 'InsuranceData' } + & Pick + ), dimensionsAndLoad: ( + { __typename?: 'DimensionsAndLoad' } + & Pick + ), security: ( + { __typename?: 'Security' } + & Pick + ), technicalEquipment?: Maybe<( + { __typename?: 'TechnicalEquipment' } + & Pick + )>, taxes?: Maybe<( + { __typename?: 'Taxes' } + & Pick + )>, provider?: Maybe<( + { __typename?: 'Provider' } + & Pick + & { privatePerson?: Maybe<( + { __typename?: 'ContactInformation' } + & Pick + & { person: ( + { __typename?: 'Person' } + & Pick + & { contactInformation?: Maybe + )>>> } + ) } + )> } + )>, lendingStation?: Maybe<( + { __typename?: 'LendingStation' } + & Pick + & { address: ( + { __typename?: 'Address' } + & Pick + ) } + )> } ) } ); @@ -1727,6 +1879,48 @@ export type GetCargoBikesQuery = ( { __typename?: 'Query' } & { cargoBikes: Array + & { insuranceData: ( + { __typename?: 'InsuranceData' } + & Pick + ), dimensionsAndLoad: ( + { __typename?: 'DimensionsAndLoad' } + & Pick + ), security: ( + { __typename?: 'Security' } + & Pick + ), technicalEquipment?: Maybe<( + { __typename?: 'TechnicalEquipment' } + & Pick + )>, taxes?: Maybe<( + { __typename?: 'Taxes' } + & Pick + )>, provider?: Maybe<( + { __typename?: 'Provider' } + & Pick + & { privatePerson?: Maybe<( + { __typename?: 'ContactInformation' } + & Pick + & { person: ( + { __typename?: 'Person' } + & Pick + & { contactInformation?: Maybe + )>>> } + ) } + )> } + )>, lendingStation?: Maybe<( + { __typename?: 'LendingStation' } + & Pick + & { address: ( + { __typename?: 'Address' } + & Pick + ) } + )> } + )>> } +======= & CargoBikeFieldsFragment )>> } ); @@ -1801,6 +1995,7 @@ export type ProviderFieldsGeneralFragment = ( )>>> } ) } )> } +>>>>>>> master ); export const BikeEventFieldsFragmentDoc = gql` @@ -1827,29 +2022,10 @@ export const CargoBikeFieldsMutableFragmentDoc = gql` insuranceData { billing hasFixedRate - name - benefactor - noPnP - maintenanceResponsible - maintenanceBenefactor - maintenanceAgreement - fixedRate - projectAllowance - notes } dimensionsAndLoad { bikeLength bikeWeight - bikeHeight - bikeWidth - boxHeight - boxLength - boxWidth - hasCoverBox - lockable - maxWeightBox - maxWeightLuggageRack - maxWeightTotal } numberOfChildren numberOfWheels