Skip to content

Commit

Permalink
NOBUG: Updating flows to use Node 16. Minor sidebar and breadcrumb fi…
Browse files Browse the repository at this point in the history
…xes (#174)
  • Loading branch information
danieltruong authored Oct 20, 2022
1 parent 324aedd commit 8c78415
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -40,7 +40,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -63,7 +63,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- name: Check out the repo
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
environment: prod
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
environment: prod
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
environment: test
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
environment: test
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
environment: dev
strategy:
matrix:
node: ['14']
node: ['16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
21 changes: 14 additions & 7 deletions src/app/services/breadcrumb.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,29 @@ export class BreadcrumbService {
readonly breadcrumbs = this._breadcrumbs.asObservable();

constructor(private router: Router) {
// Initial seed
this.setBreadcrum();

this.router.events
.pipe(
// Filter the NavigationEnd events as the breadcrumb is updated only when the route reaches its end
filter((event) => event instanceof NavigationEnd)
)
.subscribe(() => {
// Construct the breadcrumb hierarchy
const root = this.router.routerState.snapshot.root;
const breadcrumbs: Breadcrumb[] = [];
this.addBreadcrumb(root, [], breadcrumbs);

// Emit the new hierarchy
this._breadcrumbs.next(breadcrumbs);
this.setBreadcrum();
});
}

private setBreadcrum() {
// Construct the breadcrumb hierarchy
const root = this.router.routerState.snapshot.root;
const breadcrumbs: Breadcrumb[] = [];
this.addBreadcrumb(root, [], breadcrumbs);

// Emit the new hierarchy
this._breadcrumbs.next(breadcrumbs);
}

private addBreadcrumb(
route: ActivatedRouteSnapshot,
parentUrl: string[],
Expand Down
2 changes: 2 additions & 0 deletions src/app/shared/components/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export class SidebarComponent implements OnDestroy {
return keyCloakService.isAllowed('export-reports');
} else if (obj.path === 'lock-records') {
return keyCloakService.isAllowed('lock-records');
} else if (obj.path === 'login') {
return keyCloakService.isAuthenticated() ? false : true;
} else {
return obj.path !== '**' && obj.path !== 'unauthorized';
}
Expand Down

0 comments on commit 8c78415

Please sign in to comment.