Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Enable default link behaviors on nav bar and side nav links #1182

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions frontend/src/app/general/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,25 @@
</div>

<div class="hidden gap-2 xl:flex">
<div
*ngFor="let item of navBarService.navBarItems"
[routerLink]="item.routerLink"
>
<a
mat-raised-button
color="primary"
*ngIf="userService.validateUserRole(item.requiredRole)"
[attr.href]="item.href"
[attr.target]="item.target"
>
{{ item.name }} <mat-icon *ngIf="item.icon">{{ item.icon }}</mat-icon>
</a>
<div *ngFor="let item of navBarService.navBarItems">
<ng-container *ngIf="userService.validateUserRole(item.requiredRole)">
<ng-container *ngIf="item.href; else router">
<a
mat-raised-button
color="primary"
[attr.href]="item.href"
[attr.target]="item.target"
>
{{ item.name }}
<mat-icon *ngIf="item.icon">{{ item.icon }}</mat-icon>
</a>
</ng-container>
<ng-template #router>
<a mat-raised-button color="primary" [routerLink]="item.routerLink">
{{ item.name }}
</a>
</ng-template>
</ng-container>
</div>
</div>
<div>
Expand Down
38 changes: 24 additions & 14 deletions frontend/src/app/general/nav-bar-menu/nav-bar-menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,30 @@

<mat-list>
<div *ngFor="let item of navBarService.navBarItems">
<div [routerLink]="item.routerLink">
<a
mat-list-item
(click)="navBarService.toggle()"
*ngIf="userService.validateUserRole(item.requiredRole)"
[attr.href]="item.href"
[attr.target]="item.target"
>
{{ item.name }}
<mat-icon class="open-in-new" *ngIf="item.icon">{{
item.icon
}}</mat-icon>
</a>
</div>
<ng-container *ngIf="userService.validateUserRole(item.requiredRole)">
<ng-container *ngIf="item.href; else router">
<a
mat-list-item
(click)="navBarService.toggle()"
[attr.href]="item.href"
[attr.target]="item.target"
>
{{ item.name }}
<mat-icon class="open-in-new" *ngIf="item.icon">{{
item.icon
}}</mat-icon>
</a>
</ng-container>
<ng-template #router>
<a
mat-list-item
(click)="navBarService.toggle()"
[routerLink]="item.routerLink"
>
{{ item.name }}
</a>
</ng-template>
</ng-container>
<mat-divider></mat-divider>
</div>
<mat-divider></mat-divider>
Expand Down
Loading