diff --git a/src/app/components/shared/header/header.component.html b/src/app/components/shared/header/header.component.html index 0e259e40f1b844231781329f63615d9bde829c42..e0fd699bf2c9f2344483b4964cb002b9431410d1 100644 --- a/src/app/components/shared/header/header.component.html +++ b/src/app/components/shared/header/header.component.html @@ -194,7 +194,7 @@ <button mat-menu-item tabindex="0" - *ngIf="user && user.role >0 && deviceType !== 'mobile' && !router.url.endsWith('moderator/comments')" + *ngIf="user && user.role > 0 && deviceType !== 'mobile' && !router.url.endsWith('moderator/comments')" routerLink="participant/room/{{shortId}}/comments/questionwall"> <mat-icon class="beamer-icon" svgIcon="beamer"> @@ -231,7 +231,8 @@ </ng-container> <!-- Session --> - <ng-container *ngIf="!router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> + <ng-container + *ngIf="!router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> <!-- app-room-participant-page --> <ng-container *ngIf="router.url.includes('/participant/room/')"> @@ -266,7 +267,7 @@ <!-- Room General Options - bot --> <ng-container - *ngIf="user && user.role == 3 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> + *ngIf="user && user.role > 0 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> <button mat-menu-item (click)="navigateModerator()" @@ -317,7 +318,7 @@ </button> <button mat-menu-item - *ngIf="user && user.role >0 && router.url.endsWith('/tagcloud')" + *ngIf="user && user.role > 0 && router.url.endsWith('/tagcloud')" tabindex="0" (click)="navigateTopicCloudConfig()"> <mat-icon aria-label="Configuration Icon">cloud</mat-icon> @@ -325,7 +326,7 @@ </button> <button mat-menu-item - *ngIf="user && user.role >0 && router.url.endsWith('/tagcloud')" + *ngIf="user && user.role > 0 && router.url.endsWith('/tagcloud')" tabindex="0" (click)="navigateTopicCloudAdministration()"> <mat-icon aria-hidden="false" @@ -354,7 +355,7 @@ <button mat-menu-item tabindex="0" - *ngIf="user && user.role == 3 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')" + *ngIf="user && user.role > 0 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')" (click)="blockQuestions()" [ngClass]="{'color-warn': room && room.questionsBlocked}" > @@ -461,7 +462,7 @@ *ngIf="user" (click)="showMotdDialog()"> <mat-icon class="faq"> - {{ motdState ? 'notifications_active' : 'help' }} + {{ motdState?'notifications_active':'help' }} </mat-icon> <span>{{'header.motd' | translate}}</span> </button> diff --git a/src/app/components/shared/header/header.component.ts b/src/app/components/shared/header/header.component.ts index 8bf64ce5745a23bb16723a140fbd32a84c50a12b..d5202e5fc97acac51b8b6af2827e78a80487fa88 100644 --- a/src/app/components/shared/header/header.component.ts +++ b/src/app/components/shared/header/header.component.ts @@ -47,10 +47,11 @@ export class HeaderComponent implements OnInit { commentsCountUsers = 0; commentsCountKeywords = 0; isAdminConfigEnabled = false; - private _subscriptionRoomService = null; toggleUserActivity = false; userActivity = 0; deviceType = localStorage.getItem('deviceType'); + userRole = -1; + private _subscriptionRoomService = null; constructor(public location: Location, private authenticationService: AuthenticationService, diff --git a/src/app/services/http/authentication.service.ts b/src/app/services/http/authentication.service.ts index f15756273f272d6bdee73ad862a8978716b0ec4d..633262d91f4b8e7eb2b4185e65047723c9aefd31 100644 --- a/src/app/services/http/authentication.service.ts +++ b/src/app/services/http/authentication.service.ts @@ -77,7 +77,7 @@ export class AuthenticationService extends BaseHttpService { return this.checkLogin(this.http.post<ClientAuthentication>(connectionUrl, { loginId: email, - password: password + password }, this.httpOptions), userRole, false).pipe( tap(x => { if (x === 'true') { @@ -154,10 +154,8 @@ export class AuthenticationService extends BaseHttpService { return this.http.post<boolean>(connectionUrl, { loginId: email, - password: password - }, this.httpOptions).pipe(map(() => { - return true; - })); + password + }, this.httpOptions).pipe(map(() => true)); } resetPassword(email: string): Observable<string> { @@ -172,11 +170,7 @@ export class AuthenticationService extends BaseHttpService { key: null, password: null }, this.httpOptions).pipe( - catchError(err => { - return of(err.error.message); - }), map((result) => { - return result; - }) + catchError(err => of(err.error.message)), map((result) => result) ); } @@ -189,14 +183,10 @@ export class AuthenticationService extends BaseHttpService { this.apiUrl.resetPassword; return this.http.post(connectionUrl, { - key: key, - password: password + key, + password }, this.httpOptions).pipe( - catchError(err => { - return of(err.error.message); - }), map((result) => { - return result; - }) + catchError(err => of(err.error.message)), map((result) => result) ); } @@ -289,7 +279,7 @@ export class AuthenticationService extends BaseHttpService { saveAccessToLocalStorage(): void { const arr = new Array(); - this.roomAccess.forEach(function (key, value) { + this.roomAccess.forEach(function(key, value) { arr.push(key + '_' + String(value)); }); localStorage.setItem(this.ROOM_ACCESS, JSON.stringify(arr));