From 4c66995fb273fb0ca7e6955899306b4f756f4036 Mon Sep 17 00:00:00 2001 From: Abhishek Negi Date: Fri, 29 Mar 2024 10:53:36 +0530 Subject: [PATCH 1/6] added params in route --- .../core/admin/admin-entity/admin-entity.component.ts | 10 +++++++++- .../entity-details/entity-details.component.html | 2 ++ .../entity-list/entity-list/entity-list.component.html | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/core/admin/admin-entity/admin-entity.component.ts b/src/app/core/admin/admin-entity/admin-entity.component.ts index 4e1afb9e96..04e58d89eb 100644 --- a/src/app/core/admin/admin-entity/admin-entity.component.ts +++ b/src/app/core/admin/admin-entity/admin-entity.component.ts @@ -28,7 +28,7 @@ import { MatSidenavContent, } from "@angular/material/sidenav"; import { FaIconComponent } from "@fortawesome/angular-fontawesome"; -import { RouterLink } from "@angular/router"; +import { RouterLink, ActivatedRoute } from "@angular/router"; import { MatListItem, MatNavList } from "@angular/material/list"; import { AdminEntityDetailsComponent } from "../admin-entity-details/admin-entity-details/admin-entity-details.component"; @@ -72,10 +72,18 @@ export class AdminEntityComponent implements OnInit { private location: Location, private entityMapper: EntityMapperService, private entityActionsService: EntityActionsService, + private routes: ActivatedRoute, ) {} ngOnInit(): void { this.init(); + this.routes.queryParams.subscribe((params) => { + if (params.mode === "details") { + this.mode = "details"; + } else if (params.mode === "list") { + this.mode = "list"; + } + }); } private init() { diff --git a/src/app/core/entity-details/entity-details/entity-details.component.html b/src/app/core/entity-details/entity-details/entity-details.component.html index 58d5043fcf..bcbc5eded0 100644 --- a/src/app/core/entity-details/entity-details/entity-details.component.html +++ b/src/app/core/entity-details/entity-details/entity-details.component.html @@ -32,6 +32,8 @@