From 8cec05431dcc818ec21fc16aec061713b498b08a Mon Sep 17 00:00:00 2001 From: Max Ehrlicher-Schmidt Date: Sun, 6 Dec 2020 23:42:29 +0100 Subject: [PATCH] Add provider --- src/app/app-routing.module.ts | 6 +- src/app/app.module.ts | 8 +- .../data-page/data-page.component.html | 32 ++- .../data-page/data-page.component.scss | 4 + .../data-page/data-page.component.ts | 6 + src/app/components/table/table.component.ts | 1 + .../fragments/organisation.graphql | 2 +- src/app/graphqlOperations/provider.graphql | 45 +++ .../pages/dataPages/bike/bike.component.ts | 68 ++++- .../lending-station.component.ts | 34 ++- .../organisation/organisation.component.ts | 37 +-- .../provider/provider.component.html | 13 +- .../provider/provider.component.spec.ts | 25 -- .../dataPages/provider/provider.component.ts | 112 +++++++- .../table-overview.component.html | 2 +- .../tables/provider/provider.component.html | 1 - .../provider/provider.component.spec.ts | 25 -- .../tables/provider/provider.component.ts | 15 - .../tables/providers/providers.component.html | 14 + .../providers.component.scss} | 0 .../tables/providers/providers.component.ts | 131 +++++++++ src/app/services/provider.service.ts | 160 +++++++++++ src/generated/graphql.schema.json | 52 +--- src/generated/graphql.ts | 266 ++++++++++++++++-- 24 files changed, 860 insertions(+), 199 deletions(-) create mode 100644 src/app/graphqlOperations/provider.graphql delete mode 100644 src/app/pages/dataPages/provider/provider.component.spec.ts delete mode 100644 src/app/pages/tables/provider/provider.component.html delete mode 100644 src/app/pages/tables/provider/provider.component.spec.ts delete mode 100644 src/app/pages/tables/provider/provider.component.ts create mode 100644 src/app/pages/tables/providers/providers.component.html rename src/app/pages/tables/{provider/provider.component.scss => providers/providers.component.scss} (100%) create mode 100644 src/app/pages/tables/providers/providers.component.ts create mode 100644 src/app/services/provider.service.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1312681..1df2a75 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -16,9 +16,10 @@ import { ProfileComponent } from './pages/profile/profile.component'; import { PersonsComponent } from './pages/tables/persons/persons.component'; import { ContactInformationComponent } from './pages/tables/contact-information/contact-information.component'; import { OrganisationsComponent } from './pages/tables/organisations/organisations.component'; -import { ProviderComponent } from './pages/tables/provider/provider.component'; +import { ProvidersComponent } from './pages/tables/providers/providers.component'; import { PersonComponent } from './pages/dataPages/person/person.component'; import { OrganisationComponent } from './pages/dataPages/organisation/organisation.component'; +import { ProviderComponent } from './pages/dataPages/provider/provider.component'; const routes: Routes = [ { path: 'login', component: LoginComponent }, @@ -35,9 +36,10 @@ const routes: Routes = [ { path: 'table/persons', component: PersonsComponent, canActivate: [AuthGuard] }, { path: 'table/contactInformation', component: ContactInformationComponent, canActivate: [AuthGuard] }, { path: 'table/organisations', component: OrganisationsComponent, canActivate: [AuthGuard] }, - { path: 'table/providers', component: ProviderComponent, canActivate: [AuthGuard] }, + { path: 'table/providers', component: ProvidersComponent, canActivate: [AuthGuard] }, { path: 'lendingStation/:id', component: LendingStationComponent, canActivate: [AuthGuard] }, { path: 'person/:id', component: PersonComponent, canActivate: [AuthGuard] }, + { path: 'provider/:id', component: ProviderComponent, canActivate: [AuthGuard] }, { path: 'organisation/:id', component: OrganisationComponent, canActivate: [AuthGuard] }, { path: '', redirectTo: 'tableOverview', pathMatch: 'full' }, { path: 'table', redirectTo: 'tableOverview', pathMatch: 'full' }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a51f0f7..38572fd 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -71,9 +71,10 @@ import { HttpLinkModule } from 'apollo-angular-link-http'; import { PersonsComponent } from './pages/tables/persons/persons.component'; import { ContactInformationComponent } from './pages/tables/contact-information/contact-information.component'; import { OrganisationsComponent } from './pages/tables/organisations/organisations.component'; -import { ProviderComponent } from './pages/tables/provider/provider.component'; +import { ProvidersComponent } from './pages/tables/providers/providers.component'; import { OrganisationComponent } from './pages/dataPages/organisation/organisation.component'; import { PersonComponent } from './pages/dataPages/person/person.component'; +import { ProviderComponent } from './pages/dataPages/provider/provider.component'; @@ -109,9 +110,10 @@ import { PersonComponent } from './pages/dataPages/person/person.component'; PersonsComponent, ContactInformationComponent, OrganisationsComponent, - ProviderComponent, + ProvidersComponent, OrganisationComponent, - PersonComponent + PersonComponent, + ProviderComponent ], imports: [ BrowserModule, diff --git a/src/app/components/data-page/data-page.component.html b/src/app/components/data-page/data-page.component.html index b2e8db9..ece11b1 100644 --- a/src/app/components/data-page/data-page.component.html +++ b/src/app/components/data-page/data-page.component.html @@ -9,11 +9,17 @@

- {{ data[headlineDataPath] }} + {{ getHeadline !== undefined ? getHeadline(data) : data[headlineDataPath] }} {{ headlineIconName }}

- +

{{ object.title }}