Skip to content

Commit a32a259

Browse files
Added global admin role to username if applicable
1 parent 1173ad8 commit a32a259

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

src/app/navbar/navbar.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<nav
2-
class="navbar-container navbar navbar-expand-md navbar-light d-md-flex align-items-md-start flex-md-column p-3 no-shadow"
3-
aria-expanded="false"
42
[class.nav-visible]="isVisible"
3+
aria-expanded="false"
4+
class="navbar-container navbar navbar-expand-md navbar-light d-md-flex align-items-md-start flex-md-column p-3 no-shadow"
55
>
66
<img [src]="imagePath" alt="OS2IoT-logo" class="img-logo"/>
77

@@ -129,6 +129,6 @@
129129
</ng-template>
130130
</nav>
131131

132-
<div [class.nav-visible-button]="isVisible" class="toggle-button" (click)="toggleNavbar()">
132+
<div (click)="toggleNavbar()" [class.nav-visible-button]="isVisible" class="toggle-button">
133133
<mat-icon class="icon-arrow-nav rotate" svgIcon="nav-arrow"></mat-icon>
134134
</div>

src/app/navbar/navbar.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ button:focus,
119119

120120
.no-shadow {
121121
box-shadow: none;
122-
z-index: 10000;
122+
z-index: 100;
123123
}
124124

125125
::ng-deep .mdc-notched-outline__leading {
@@ -147,6 +147,7 @@ button:focus,
147147
padding: 0 2px 0 0;
148148
border-radius: 0 5px 5px 0;
149149
transition: left 0.3s ease-in-out, border-radius 0.3s ease-in-out;
150+
z-index: 101;
150151

151152
&:hover {
152153
background-color: $color-link-active-bg;
@@ -160,6 +161,7 @@ button:focus,
160161
border-radius: 5px 0 0 5px;
161162
left: 248px;
162163
padding: 0 0 0 2px;
164+
163165
.icon-arrow-nav {
164166
transform: rotate(0deg);
165167
}

src/app/shared/components/top-bar/top-bar.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
<div class="user-information-container">
2929
<div class="name-and-title-container">
3030
<div class="name-container">{{ getUsername() }}</div>
31-
<!-- <div class="title-container">Global Admin</div> -->
31+
<div *ngIf="meService.hasGlobalAdmin()"
32+
class="title-container">{{ 'PERMISSION-TYPE.GlobalAdmin' | translate }}
33+
</div>
3234
</div>
3335
<div>
3436
<mat-icon class="angle-down-icon" svgIcon="angle-down"></mat-icon>

src/app/shared/components/top-bar/top-bar.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { QuickActionButton } from "@shared/models/quick-action-button.model";
2222
import { Sort } from "@shared/models/sort.model";
2323
import { LoggedInService } from "@shared/services/loggedin.service";
2424
import { SharedVariableService } from "@shared/shared-variable/shared-variable.service";
25+
import { MeService } from "@shared/services/me.service";
2526

2627
@Component({
2728
selector: "app-top-bar",
@@ -79,7 +80,8 @@ export class TopBarComponent implements OnInit {
7980
private authService: AuthService,
8081
private loggedInService: LoggedInService,
8182
private matIconRegistry: MatIconRegistry,
82-
private domSanitizer: DomSanitizer
83+
private domSanitizer: DomSanitizer,
84+
public meService: MeService
8385
) {
8486
translate.use("da");
8587

@@ -100,8 +102,6 @@ export class TopBarComponent implements OnInit {
100102
this.domSanitizer.bypassSecurityTrustResourceUrl("../../../../assets/images/search.svg"),
101103
{}
102104
);
103-
104-
this.sharedVariableService.getUserInfo;
105105
}
106106

107107
ngOnInit(): void {

0 commit comments

Comments
 (0)