From bf1b9840dcccc23801c08fd78ce61a1d93809b3b Mon Sep 17 00:00:00 2001 From: Stephan Girod Date: Tue, 10 Dec 2024 18:50:15 +0100 Subject: [PATCH] feat: add stage(ctx) as queryparam --- .../resource-edit-page.component.html | 0 .../resource-edit-page.component.spec.ts | 0 .../resource-edit-page.component.ts | 13 +++++++------ .../resources-list/resources-list.component.html | 5 ++++- AMW_angular/io/src/app/resources/resources.route.ts | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) rename AMW_angular/io/src/app/resources/{resource-edit => resource-edit-page}/resource-edit-page.component.html (100%) rename AMW_angular/io/src/app/resources/{resource-edit => resource-edit-page}/resource-edit-page.component.spec.ts (100%) rename AMW_angular/io/src/app/resources/{resource-edit => resource-edit-page}/resource-edit-page.component.ts (80%) diff --git a/AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.html b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.html similarity index 100% rename from AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.html rename to AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.html diff --git a/AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.spec.ts b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts similarity index 100% rename from AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.spec.ts rename to AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.spec.ts diff --git a/AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.ts b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts similarity index 80% rename from AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.ts rename to AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts index 3d3e1a5b7..4affc9d83 100644 --- a/AMW_angular/io/src/app/resources/resource-edit/resource-edit-page.component.ts +++ b/AMW_angular/io/src/app/resources/resource-edit-page/resource-edit-page.component.ts @@ -18,17 +18,18 @@ export class ResourceEditPageComponent { private route = inject(ActivatedRoute); resource: Signal = this.resourceService.resource; - resourceId = toSignal( - this.route.paramMap.pipe( - map((params) => +params.get('id')), + ids = toSignal( + this.route.queryParamMap.pipe( + map((params) => params), distinctUntilChanged(), ), - -1, + [], ); isLoading = computed(() => { - if (this.resourceId() > -1) { - this.resourceService.getResource(this.resourceId()); + if (this.ids().keys) { + // TODO show correct STAGE by context id + this.resourceService.getResource(Number(this.ids().get('id'))); return false; } }); diff --git a/AMW_angular/io/src/app/resources/resources-list/resources-list.component.html b/AMW_angular/io/src/app/resources/resources-list/resources-list.component.html index 7f0be2562..3f5654451 100644 --- a/AMW_angular/io/src/app/resources/resources-list/resources-list.component.html +++ b/AMW_angular/io/src/app/resources/resources-list/resources-list.component.html @@ -30,7 +30,10 @@

{{ resourceType().name }}

> - + diff --git a/AMW_angular/io/src/app/resources/resources.route.ts b/AMW_angular/io/src/app/resources/resources.route.ts index fc24e4759..7a350c41f 100644 --- a/AMW_angular/io/src/app/resources/resources.route.ts +++ b/AMW_angular/io/src/app/resources/resources.route.ts @@ -1,7 +1,7 @@ import { ResourcesPageComponent } from './resources-page.component'; -import { ResourceEditPageComponent } from './resource-edit/resource-edit-page.component'; +import { ResourceEditPageComponent } from './resource-edit-page/resource-edit-page.component'; export const resourcesRoute = [ { path: 'resources', component: ResourcesPageComponent }, - { path: 'resource/edit/:id', component: ResourceEditPageComponent }, + { path: 'resource/edit', component: ResourceEditPageComponent }, ];