Skip to content

Commit

Permalink
added support for app names translation
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfrancoys committed Nov 23, 2024
1 parent aa11d40 commit b4e5e2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/apps.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="container">
<div class="brand-logo" [style.background-image]="'url(' + url_brand_logo + ')'"></div>
<div class="container-header">
<button mat-button [matMenuTriggerFor]="auth_menu" title="{{user.login}}"><strong>{{user.name}} ({{user.login}})</strong></button>
<button mat-button [matMenuTriggerFor]="auth_menu" title="{{user.login}}"><strong>{{getUserName()}}</strong></button>
<mat-menu #auth_menu="matMenu" class="auth-menu" backdropClass="auth-menu">
<button mat-menu-item (click)="onclickDisconnect()">Se déconnecter</button>
</mat-menu>
Expand Down Expand Up @@ -41,7 +41,7 @@
height: 18px;
text-align: left;
font-size: 18px;
text-overflow: ellipsis;">{{apps[app].name}}</div>
text-overflow: ellipsis;">{{apps[app].name | translate}}</div>
<div style="
text-align: left;
font-size: 11px;
Expand Down
7 changes: 7 additions & 0 deletions src/app/apps.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export class AppsComponent implements OnInit {
return text_color;
}

public getUserName() {
if(this.user.hasOwnProperty('name') && this.user.hasOwnProperty('login')) {
return this.user.name + ' (' + this.user.login + ')';
}
return '';
}

public isGranted(app_name:string) {
let app = this.apps[app_name];
if(app.access?.groups && app.show_in_apps) {
Expand Down

0 comments on commit b4e5e2c

Please sign in to comment.