Skip to content

Commit

Permalink
Add settings link to user menu
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Oct 31, 2024
1 parent c3e3b69 commit d640ee8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/gameboard-ui/src/app/services/router.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ export class RouterService implements OnDestroy {
return this.router.createUrlTree(["support", "tickets", ticketKey]);
}

public getUserSettingsUrl() {
return this.router.createUrlTree(["user", "settings"]);
}

public toChallenge(challengeId: string, playerId: string) {
return this.router.navigateByUrl(`/board/${playerId}/${challengeId}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
<li role="menuitem">
<a [routerLink]="profileLinks.history" class="dropdown-item">History</a>
</li>
<li role="menuitem" *appIfHasPermission="'Admin_View'">
<a [routerLink]="profileLinks.settings" class="dropdown-item">Settings</a>
</li>
</ng-container>
<li class="divider dropdown-divider"></li>
<li role="menuitem">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export class UserNavItemComponent implements OnInit {
certificates: string;
history: string;
profile: string;
settings: string;
};

async ngOnInit() {
this.profileLinks = {
certificates: this.routerService.getCertificateListUrl(),
history: this.routerService.getPlayHistoryUrl(),
profile: this.routerService.getProfileUrl()
profile: this.routerService.getProfileUrl(),
settings: this.routerService.getUserSettingsUrl().toString()
};
}

Expand Down

0 comments on commit d640ee8

Please sign in to comment.