feat(portal-beheer): default-fill editor page + nav (refs #131)
This commit is contained in:
@@ -1 +1,5 @@
|
|||||||
|
<nav aria-label="Beheer" class="utrecht-theme">
|
||||||
|
<a routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">Catalogus</a>
|
||||||
|
<a routerLink="/default-fill" routerLinkActive="active">Default-fill</a>
|
||||||
|
</nav>
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { Route } from '@angular/router';
|
import { Route } from '@angular/router';
|
||||||
import { authenticatedGuard } from 'auth';
|
import { authenticatedGuard } from 'auth';
|
||||||
import { CatalogusPage } from './catalogus/catalogus-page';
|
import { CatalogusPage } from './catalogus/catalogus-page';
|
||||||
|
import { DefaultFillPage } from './default-fill/default-fill-page';
|
||||||
|
|
||||||
export const appRoutes: Route[] = [
|
export const appRoutes: Route[] = [
|
||||||
{ path: '', component: CatalogusPage, canActivate: [authenticatedGuard] },
|
{ path: '', component: CatalogusPage, canActivate: [authenticatedGuard] },
|
||||||
|
{ path: 'default-fill', component: DefaultFillPage, canActivate: [authenticatedGuard] },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -25,10 +25,48 @@ export class DefaultFillPage {
|
|||||||
protected readonly saved = signal(false);
|
protected readonly saved = signal(false);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// ponytail: stub for the red test; the real load lands in the green commit.
|
this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
load(): void {
|
||||||
|
this.loading.set(true);
|
||||||
|
this.failed.set(false);
|
||||||
|
this.saved.set(false);
|
||||||
|
this.bff.getBeheerDefaultFill().subscribe({
|
||||||
|
next: (d: BeheerDefaultFill) => {
|
||||||
|
this.bronorganisatie.set(d.bronorganisatie);
|
||||||
|
this.verantwoordelijkeOrganisatie.set(d.verantwoordelijkeOrganisatie);
|
||||||
|
this.vertrouwelijkheidaanduiding.set(d.vertrouwelijkheidaanduiding);
|
||||||
|
this.loading.set(false);
|
||||||
|
this.loaded.set(true);
|
||||||
|
},
|
||||||
|
error: () => {
|
||||||
|
this.loading.set(false);
|
||||||
|
this.loaded.set(true);
|
||||||
|
this.failed.set(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
save(): void {
|
save(): void {
|
||||||
// ponytail: stub for the red test; the real save lands in the green commit.
|
this.saving.set(true);
|
||||||
|
this.failed.set(false);
|
||||||
|
this.saved.set(false);
|
||||||
|
this.bff
|
||||||
|
.putBeheerDefaultFill({
|
||||||
|
bronorganisatie: this.bronorganisatie(),
|
||||||
|
verantwoordelijkeOrganisatie: this.verantwoordelijkeOrganisatie(),
|
||||||
|
vertrouwelijkheidaanduiding: this.vertrouwelijkheidaanduiding(),
|
||||||
|
})
|
||||||
|
.subscribe({
|
||||||
|
next: () => {
|
||||||
|
this.saving.set(false);
|
||||||
|
this.saved.set(true);
|
||||||
|
},
|
||||||
|
error: () => {
|
||||||
|
this.saving.set(false);
|
||||||
|
this.failed.set(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user