From 54a6eef2e428ed2b43c80b11572f1f8f7fd5cd08 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 11 Dec 2020 13:13:44 +0100 Subject: [PATCH] Split PLZ and City, Add remark and holiday to loanPeriod, add remark to LS --- .../data-page/data-page.component.ts | 3 +- .../graphqlOperations/bikeEventType.graphql | 4 +- .../fragments/address.graphql | 1 + .../fragments/lendingStation.graphql | 3 + .../pages/dataPages/bike/bike.component.ts | 16 ++- .../lending-station.component.ts | 8 +- .../organisation/organisation.component.ts | 1 + .../dataPages/provider/provider.component.ts | 7 +- src/app/pages/tables/bikes/bikes.component.ts | 10 +- .../lending-stations.component.ts | 3 + .../organisations/organisations.component.ts | 1 + src/app/services/schema.service.ts | 5 + src/generated/graphql.schema.json | 117 +++++++++++++++++- src/generated/graphql.ts | 30 +++-- 14 files changed, 182 insertions(+), 27 deletions(-) diff --git a/src/app/components/data-page/data-page.component.ts b/src/app/components/data-page/data-page.component.ts index 5d4530a..6cbbff2 100644 --- a/src/app/components/data-page/data-page.component.ts +++ b/src/app/components/data-page/data-page.component.ts @@ -74,7 +74,7 @@ export class DataPageComponent implements OnInit, OnDestroy { @Output() cancelEvent = new EventEmitter(); id: string; - data: any; + data: any = null; isLoading: boolean = false; isSavingOrLocking: boolean = false; @@ -88,6 +88,7 @@ export class DataPageComponent implements OnInit, OnDestroy { ngOnInit(): void { this.addPropertiesFromGQLSchemaToObject(this.propertiesInfo); + console.log(this.propertiesInfo); this.id = this.route.snapshot.paramMap.get('id'); this.reloadPageData(); this.dataService.pageData.subscribe((data) => { diff --git a/src/app/graphqlOperations/bikeEventType.graphql b/src/app/graphqlOperations/bikeEventType.graphql index aa489d2..ffe2ccf 100644 --- a/src/app/graphqlOperations/bikeEventType.graphql +++ b/src/app/graphqlOperations/bikeEventType.graphql @@ -4,8 +4,8 @@ query GetBikeEventTypes { } } -mutation CreateBikeEventType($bikeEventType: String!) { - createBikeEventType(name: $bikeEventType) { +mutation CreateBikeEventType($bikeEventType: BikeEventTypeCreateInput!) { + createBikeEventType(bikeEventType: $bikeEventType) { ...BikeEventTypeFields } } diff --git a/src/app/graphqlOperations/fragments/address.graphql b/src/app/graphqlOperations/fragments/address.graphql index 5b1c2fb..bff8a60 100644 --- a/src/app/graphqlOperations/fragments/address.graphql +++ b/src/app/graphqlOperations/fragments/address.graphql @@ -2,4 +2,5 @@ fragment AddressFields on Address { street number zip + city } \ No newline at end of file diff --git a/src/app/graphqlOperations/fragments/lendingStation.graphql b/src/app/graphqlOperations/fragments/lendingStation.graphql index bce564c..86c322b 100644 --- a/src/app/graphqlOperations/fragments/lendingStation.graphql +++ b/src/app/graphqlOperations/fragments/lendingStation.graphql @@ -24,6 +24,7 @@ fragment LendingStationFieldsForTable on LendingStation { organisation { ...OrganisationFieldsGeneral } + remark isLocked isLockedByMe lockedBy @@ -40,6 +41,8 @@ fragment LendingStationFieldsForPage on LendingStation { ...TimeFrameFieldsForLendingStation } loanPeriod { + generalRemark + holidays mo tu we diff --git a/src/app/pages/dataPages/bike/bike.component.ts b/src/app/pages/dataPages/bike/bike.component.ts index 3553de1..57e8222 100644 --- a/src/app/pages/dataPages/bike/bike.component.ts +++ b/src/app/pages/dataPages/bike/bike.component.ts @@ -212,11 +212,17 @@ export class BikeComponent implements OnInit { type: 'Group', title: 'Standort', properties: [ - { dataPath: 'lendingStation.id', translation: '' }, - { dataPath: 'lendingStation.name', translation: '' }, - { dataPath: 'lendingStation.address.number', translation: '' }, - { dataPath: 'lendingStation.address.street', translation: '' }, - { dataPath: 'lendingStation.address.zip', translation: '' }, + { + dataPath: 'lendingStation.name', + translation: 'Standort', + link: (row: any) => { + return '/lendingStation/' + row['lendingStation.id']; + }, + }, + { dataPath: 'lendingStation.address.street', translation: 'Straße' }, + { dataPath: 'lendingStation.address.number', translation: 'Hausnummer' }, + { dataPath: 'lendingStation.address.zip', translation: 'PLZ' }, + { dataPath: 'lendingStation.address.city', translation: 'Ort' }, ], }, { 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 37d1ed2..396d8db 100644 --- a/src/app/pages/dataPages/lending-station/lending-station.component.ts +++ b/src/app/pages/dataPages/lending-station/lending-station.component.ts @@ -14,22 +14,25 @@ export class LendingStationComponent implements OnInit { title: 'Allgemein', properties: [ { dataPath: 'name', translation: 'Name' }, - { dataPath: 'organisation.name', translation: 'Organisation' }, + { dataPath: 'remark', translation: 'Anmerkung' }, ], }, { type: 'Group', title: 'Adresse', properties: [ - { dataPath: 'address.number', translation: 'Hausnummer' }, { dataPath: 'address.street', translation: 'Straße' }, + { dataPath: 'address.number', translation: 'Hausnummer' }, { dataPath: 'address.zip', translation: 'Postleitzahl' }, + { dataPath: 'address.city', translation: 'Ort' }, ], }, { type: 'Group', title: 'Ausleihzeiten', properties: [ + { dataPath: 'loanPeriod.generalRemark', translation: 'Anmerkung' }, + { dataPath: 'loanPeriod.holidays', translation: 'An Feiertagen' }, { dataPath: 'loanPeriod.mo', translation: 'Montag' }, { dataPath: 'loanPeriod.tu', translation: 'Dienstag' }, { dataPath: 'loanPeriod.we', translation: 'Mittwoch' }, @@ -51,6 +54,7 @@ export class LendingStationComponent implements OnInit { { dataPath: 'organisation.address.street', translation: 'Straße' }, { dataPath: 'organisation.address.number', translation: 'Hausnummer' }, { dataPath: 'organisation.address.zip', translation: 'Postleitzahl' }, + { dataPath: 'organisation.address.city', translation: 'Ort' }, { dataPath: 'organisation.associationNo', translation: 'Nummer' }, ], }, diff --git a/src/app/pages/dataPages/organisation/organisation.component.ts b/src/app/pages/dataPages/organisation/organisation.component.ts index 39c5593..5bb6261 100644 --- a/src/app/pages/dataPages/organisation/organisation.component.ts +++ b/src/app/pages/dataPages/organisation/organisation.component.ts @@ -17,6 +17,7 @@ export class OrganisationComponent implements OnInit { { dataPath: 'address.street', translation: 'Straße' }, { dataPath: 'address.number', translation: 'Hausnummer' }, { dataPath: 'address.zip', translation: 'Postleitzahl' }, +{ dataPath: 'address.city', translation: 'Ort' }, { dataPath: 'associationNo', translation: 'Vereinsnummer' }, { dataPath: 'registeredAt', translation: 'Registergericht' }, diff --git a/src/app/pages/dataPages/provider/provider.component.ts b/src/app/pages/dataPages/provider/provider.component.ts index 0972839..5d0a5d9 100644 --- a/src/app/pages/dataPages/provider/provider.component.ts +++ b/src/app/pages/dataPages/provider/provider.component.ts @@ -17,6 +17,7 @@ export class ProviderComponent implements OnInit { title: 'Allgemein', hideCondition: (data) => data.privatePerson === null, properties: [ + { dataPath: 'formName', translation: 'Formular Name' }, { type: 'Link', linkText: "Zur Person", @@ -47,6 +48,7 @@ export class ProviderComponent implements OnInit { title: 'Allgemein', hideCondition: (data) => data.organisation === null, properties: [ + { dataPath: 'formName', translation: 'Formular Name' }, { type: 'Link', linkText: "Zum Organisation", @@ -54,10 +56,11 @@ export class ProviderComponent implements OnInit { return '/organisation/' + data['organisation.id']; }, }, - { dataPath: 'organisation.name', translation: 'Name' }, - { dataPath: 'organisation.address.street', translation: 'Straße' }, + { dataPath: 'organisation.name', translation: 'Name Organisation' }, { dataPath: 'organisation.address.number', translation: 'Hausnummer' }, + { dataPath: 'organisation.address.street', translation: 'Straße' }, { dataPath: 'organisation.address.zip', translation: 'Postleitzahl' }, + { dataPath: 'organisation.address.city', translation: 'Ort' }, ], }, { diff --git a/src/app/pages/tables/bikes/bikes.component.ts b/src/app/pages/tables/bikes/bikes.component.ts index 170f65e..9b6d8e2 100644 --- a/src/app/pages/tables/bikes/bikes.component.ts +++ b/src/app/pages/tables/bikes/bikes.component.ts @@ -111,17 +111,17 @@ export class BikesComponent implements OnInit { dataPath: 'provider.privatePerson.person.contactInformation.email', translation: '', }, - { dataPath: 'lendingStation.id', translation: '' }, { dataPath: 'lendingStation.name', - translation: '', + translation: 'Standort', link: (row: any) => { return '/lendingStation/' + row['lendingStation.id']; }, }, - { dataPath: 'lendingStation.address.number', translation: '' }, - { dataPath: 'lendingStation.address.street', translation: '' }, - { dataPath: 'lendingStation.address.zip', translation: '' }, + { dataPath: 'lendingStation.address.street', translation: 'Straße' }, + { dataPath: 'lendingStation.address.number', translation: 'Hausnummer' }, + { dataPath: 'lendingStation.address.zip', translation: 'PLZ' }, + { dataPath: 'lendingStation.address.city', translation: 'Ort' }, ]; dataService: any; diff --git a/src/app/pages/tables/lending-stations/lending-stations.component.ts b/src/app/pages/tables/lending-stations/lending-stations.component.ts index 237a39b..86d4eb3 100644 --- a/src/app/pages/tables/lending-stations/lending-stations.component.ts +++ b/src/app/pages/tables/lending-stations/lending-stations.component.ts @@ -19,6 +19,9 @@ export class LendingStationsComponent implements OnInit { { dataPath: 'address.number', translation: 'Hausnummer' }, { dataPath: 'address.street', translation: 'Straße' }, { dataPath: 'address.zip', translation: 'Postleitzahl' }, + { dataPath: 'address.city', translation: 'Ort' }, + + { dataPath: 'remark', translation: 'Anmerkung' }, { dataPath: 'organisation.name', translation: 'Organisation' }, diff --git a/src/app/pages/tables/organisations/organisations.component.ts b/src/app/pages/tables/organisations/organisations.component.ts index 2b62023..6814652 100644 --- a/src/app/pages/tables/organisations/organisations.component.ts +++ b/src/app/pages/tables/organisations/organisations.component.ts @@ -19,6 +19,7 @@ export class OrganisationsComponent implements OnInit { { dataPath: 'address.number', translation: 'Hausnummer' }, { dataPath: 'address.street', translation: 'Straße' }, { dataPath: 'address.zip', translation: 'Postleitzahl' }, +{ dataPath: 'address.city', translation: 'Ort' }, { dataPath: 'associationNo', translation: 'Vereinsnummer' }, { dataPath: 'registeredAt', translation: 'Registergericht' }, diff --git a/src/app/services/schema.service.ts b/src/app/services/schema.service.ts index 80bbba0..2adb5cd 100644 --- a/src/app/services/schema.service.ts +++ b/src/app/services/schema.service.ts @@ -27,6 +27,7 @@ export class SchemaService { (type) => type.name === startingObjectName ); if (!startingObject) { + //console.error("Did't found " + startingObjectName + " in ", startingObject); return { isPartOfType: false, type: '', @@ -36,6 +37,8 @@ export class SchemaService { } const fields = startingObject.fields || startingObject.inputFields; if (!fields) { + //console.error("Did't found fields in ", startingObject); + return { isPartOfType: false, type: '', @@ -45,6 +48,8 @@ export class SchemaService { } const field = fields.find((field) => field.name === variablePath[0]); if (!field) { + //console.error("[" + startingObjectName + ", " + variable + "] " + "Did't found field in ", fields); + return { isPartOfType: false, type: '', diff --git a/src/generated/graphql.schema.json b/src/generated/graphql.schema.json index 2484aa8..1dedee3 100644 --- a/src/generated/graphql.schema.json +++ b/src/generated/graphql.schema.json @@ -5044,6 +5044,31 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "BikeEventTypeCreateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "Provider", @@ -6373,6 +6398,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "remark", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "isLocked", "description": null, @@ -6508,6 +6545,16 @@ "ofType": null }, "defaultValue": null + }, + { + "name": "remark", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null } ], "interfaces": null, @@ -6594,6 +6641,16 @@ }, "defaultValue": null }, + { + "name": "remark", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "keepLock", "description": null, @@ -6626,6 +6683,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "holidays", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "mo", "description": null, @@ -6732,6 +6801,16 @@ }, "defaultValue": null }, + { + "name": "holidays", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "mo", "description": null, @@ -7214,6 +7293,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "city", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -7268,6 +7359,16 @@ } }, "defaultValue": null + }, + { + "name": "city", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null } ], "interfaces": null, @@ -7309,6 +7410,16 @@ "ofType": null }, "defaultValue": null + }, + { + "name": "city", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null } ], "interfaces": null, @@ -9521,14 +9632,14 @@ "description": "BIKEEVENT", "args": [ { - "name": "name", + "name": "bikeEventType", "description": null, "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "INPUT_OBJECT", + "name": "BikeEventTypeCreateInput", "ofType": null } }, diff --git a/src/generated/graphql.ts b/src/generated/graphql.ts index b764fe8..b047b52 100644 --- a/src/generated/graphql.ts +++ b/src/generated/graphql.ts @@ -722,6 +722,10 @@ export type BikeEventTypeUpdateInput = { keepLock?: Maybe; }; +export type BikeEventTypeCreateInput = { + name: Scalars['String']; +}; + /** (dt. Anbieter) bezieht sich auf die Beziehung einer Person oder Organisation zum Lastenrad */ export type Provider = { __typename?: 'Provider'; @@ -876,6 +880,7 @@ export type LendingStation = { /** Total amount of cargoBikes currently assigned to the lending station */ numCargoBikes: Scalars['Int']; organisation?: Maybe; + remark?: Maybe; isLocked: Scalars['Boolean']; isLockedByMe: Scalars['Boolean']; /** null if not locked by other user */ @@ -891,6 +896,7 @@ export type LendingStationCreateInput = { address: AddressCreateInput; loanPeriod?: Maybe; organisationId?: Maybe; + remark?: Maybe; }; /** If you want to create LendingStation with cargoBikes, use createTimeFrame and set to: Date = null */ @@ -902,6 +908,7 @@ export type LendingStationUpdateInput = { address?: Maybe; loanPeriod?: Maybe; organisationId?: Maybe; + remark?: Maybe; keepLock?: Maybe; }; @@ -909,6 +916,7 @@ export type LendingStationUpdateInput = { export type LoanPeriod = { __typename?: 'LoanPeriod'; generalRemark?: Maybe; + holidays?: Maybe; mo?: Maybe; tu?: Maybe; we?: Maybe; @@ -921,6 +929,7 @@ export type LoanPeriod = { /** (dt. Ausleihzeiten) */ export type LoanPeriodInput = { generalRemark?: Maybe; + holidays?: Maybe; mo?: Maybe; tu?: Maybe; we?: Maybe; @@ -983,18 +992,21 @@ export type Address = { street: Scalars['String']; number: Scalars['String']; zip: Scalars['String']; + city?: Maybe; }; export type AddressCreateInput = { street: Scalars['String']; number: Scalars['String']; zip: Scalars['String']; + city?: Maybe; }; export type AddressUpdateInput = { street?: Maybe; number?: Maybe; zip?: Maybe; + city?: Maybe; }; export type ActionLog = { @@ -1504,7 +1516,7 @@ export type MutationDeleteTimeFrameArgs = { export type MutationCreateBikeEventTypeArgs = { - name: Scalars['String']; + bikeEventType: BikeEventTypeCreateInput; }; @@ -1942,7 +1954,7 @@ export type GetBikeEventTypesQuery = { __typename?: 'Query', bikeEventTypes?: Ma )>> }; export type CreateBikeEventTypeMutationVariables = Exact<{ - bikeEventType: Scalars['String']; + bikeEventType: BikeEventTypeCreateInput; }>; @@ -2263,7 +2275,7 @@ export type DeleteEquipmentTypeMutationVariables = Exact<{ export type DeleteEquipmentTypeMutation = { __typename?: 'Mutation', deleteEquipmentType: boolean }; -export type AddressFieldsFragment = { __typename?: 'Address', street: string, number: string, zip: string }; +export type AddressFieldsFragment = { __typename?: 'Address', street: string, number: string, zip: string, city?: Maybe }; export type CargoBikeFieldsForTableFragment = { __typename?: 'CargoBike', id: string, group: Group, name: string, modelName?: Maybe, state?: Maybe, numberOfChildren?: Maybe, numberOfWheels?: Maybe, forCargo?: Maybe, forChildren?: Maybe, stickerBikeNameState?: Maybe, note?: Maybe, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe, lockedUntil?: Maybe, insuranceData?: Maybe<{ __typename?: 'InsuranceData', billing?: Maybe, hasFixedRate?: Maybe, name?: Maybe, benefactor?: Maybe, noPnP?: Maybe, maintenanceResponsible?: Maybe, maintenanceBenefactor?: Maybe, maintenanceAgreement?: Maybe, fixedRate?: Maybe, projectAllowance?: Maybe, notes?: Maybe }>, dimensionsAndLoad?: Maybe<{ __typename?: 'DimensionsAndLoad', bikeLength?: Maybe, bikeWeight?: Maybe, bikeHeight?: Maybe, bikeWidth?: Maybe, hasCoverBox?: Maybe, lockable?: Maybe, maxWeightBox?: Maybe, maxWeightLuggageRack?: Maybe, maxWeightTotal?: Maybe, boxHeightRange?: Maybe<{ __typename?: 'NumRange', max?: Maybe, min?: Maybe }>, boxLengthRange?: Maybe<{ __typename?: 'NumRange', min?: Maybe, max?: Maybe }>, boxWidthRange?: Maybe<{ __typename?: 'NumRange', min?: Maybe, max?: Maybe }> }>, security?: Maybe<{ __typename?: 'Security', frameNumber?: Maybe, adfcCoding?: Maybe, keyNumberAXAChain?: Maybe, keyNumberFrameLock?: Maybe, policeCoding?: Maybe }>, technicalEquipment?: Maybe<{ __typename?: 'TechnicalEquipment', bicycleShift?: Maybe, isEBike?: Maybe, hasLightSystem?: Maybe, specialFeatures?: Maybe }>, taxes?: Maybe<{ __typename?: 'Taxes', costCenter?: Maybe, organisationArea?: Maybe }>, provider?: Maybe<( { __typename?: 'Provider' } @@ -2369,7 +2381,7 @@ export type LendingStationFieldsForBikePageFragment = { __typename?: 'LendingSta & OrganisationFieldsGeneralFragment )> }; -export type LendingStationFieldsForTableFragment = { __typename?: 'LendingStation', id: string, name: string, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe, lockedUntil?: Maybe, contactInformationIntern?: Maybe<( +export type LendingStationFieldsForTableFragment = { __typename?: 'LendingStation', id: string, name: string, remark?: Maybe, isLocked: boolean, isLockedByMe: boolean, lockedBy?: Maybe, lockedUntil?: Maybe, contactInformationIntern?: Maybe<( { __typename?: 'ContactInformation' } & ContactInformationFieldsGeneralFragment )>, contactInformationExtern?: Maybe<( @@ -2387,7 +2399,7 @@ export type LendingStationFieldsForPageFragment = ( { __typename?: 'LendingStation', cargoBikes?: Maybe>, timeFrames: Array<( { __typename?: 'TimeFrame' } & TimeFrameFieldsForLendingStationFragment - )>, loanPeriod?: Maybe<{ __typename?: 'LoanPeriod', mo?: Maybe, tu?: Maybe, we?: Maybe, th?: Maybe, fr?: Maybe, sa?: Maybe, su?: Maybe }> } + )>, loanPeriod?: Maybe<{ __typename?: 'LoanPeriod', generalRemark?: Maybe, holidays?: Maybe, mo?: Maybe, tu?: Maybe, we?: Maybe, th?: Maybe, fr?: Maybe, sa?: Maybe, su?: Maybe }> } & LendingStationFieldsForTableFragment ); @@ -3104,6 +3116,7 @@ export const AddressFieldsFragmentDoc = gql` street number zip + city } `; export const OrganisationFieldsGeneralFragmentDoc = gql` @@ -3472,6 +3485,7 @@ export const LendingStationFieldsForTableFragmentDoc = gql` organisation { ...OrganisationFieldsGeneral } + remark isLocked isLockedByMe lockedBy @@ -3505,6 +3519,8 @@ export const LendingStationFieldsForPageFragmentDoc = gql` ...TimeFrameFieldsForLendingStation } loanPeriod { + generalRemark + holidays mo tu we @@ -3999,8 +4015,8 @@ export const GetBikeEventTypesDocument = gql` } } export const CreateBikeEventTypeDocument = gql` - mutation CreateBikeEventType($bikeEventType: String!) { - createBikeEventType(name: $bikeEventType) { + mutation CreateBikeEventType($bikeEventType: BikeEventTypeCreateInput!) { + createBikeEventType(bikeEventType: $bikeEventType) { ...BikeEventTypeFields } }