Skip to content

Commit

Permalink
Moved router.url logic inside html template
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bryanmontalvan authored and Pegonzal committed Aug 3, 2022
1 parent 9abb91b commit 176649c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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';
}
}

0 comments on commit 176649c

Please sign in to comment.