]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Moved router.url logic inside html template
authorbryanmontalvan <68972382+bryanmontalvan@users.noreply.github.com>
Fri, 22 Jul 2022 18:44:43 +0000 (14:44 -0400)
committerPedro Gonzalez Gomez <pegonzal@redhat.com>
Tue, 30 Aug 2022 11:05:15 +0000 (13:05 +0200)
This commit removes the `this.router.url` logic which was located in the
`workbench-layout.component.ts` file and moved it into the HTML template
section.

Signed-off-by: bryanmontalvan <bmontalv@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.html
src/pybind/mgr/dashboard/frontend/src/app/core/layouts/workbench-layout/workbench-layout.component.ts

index 3979ad7a4a95e20cdcc26b3145fc7dfd7b7535bf..d8c1891fc2129f79c88885d536f395a8dc3def63 100644 (file)
@@ -1,8 +1,8 @@
 <block-ui>
   <cd-navigation>
     <div class="container-fluid h-100"
-         [ngClass]="{'dashboard':isDashboardPage()} ">
-      <cd-context></cd-context>
+         [ngClass]="{'dashboard': (router.url == '/dashboard' || router.url == '/dashboard_3')}">
+    <cd-context></cd-context>
       <cd-breadcrumbs></cd-breadcrumbs>
       <router-outlet></router-outlet>
     </div>
index 3840cbe3561cf96ced298c889119b13222d146a7..afc7a83bb277e5d1fdf9156eec57b22062c98701 100644 (file)
@@ -17,7 +17,7 @@ export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
   private subs = new Subscription();
 
   constructor(
-    private router: Router,
+    public router: Router,
     private summaryService: SummaryService,
     private taskManagerService: TaskManagerService,
     private faviconService: FaviconService
@@ -32,8 +32,4 @@ export class WorkbenchLayoutComponent implements OnInit, OnDestroy {
   ngOnDestroy() {
     this.subs.unsubscribe();
   }
-
-  isDashboardPage() {
-    return this.router.url === '/dashboard' || this.router.url === '/dashboard_3';
-  }
 }