diff --git a/src/app/components/shared/header/header.component.html b/src/app/components/shared/header/header.component.html index e0fd699bf2c9f2344483b4964cb002b9431410d1..0e259e40f1b844231781329f63615d9bde829c42 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,8 +231,7 @@ </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/')"> @@ -267,7 +266,7 @@ <!-- Room General Options - bot --> <ng-container - *ngIf="user && user.role > 0 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> + *ngIf="user && user.role == 3 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')"> <button mat-menu-item (click)="navigateModerator()" @@ -318,7 +317,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> @@ -326,7 +325,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" @@ -355,7 +354,7 @@ <button mat-menu-item tabindex="0" - *ngIf="user && user.role > 0 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')" + *ngIf="user && user.role == 3 && !router.url.includes('/participant') && !router.url.endsWith('/comments') && !router.url.includes('/comment/') && !router.url.endsWith('tagcloud')" (click)="blockQuestions()" [ngClass]="{'color-warn': room && room.questionsBlocked}" > @@ -462,7 +461,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 d5202e5fc97acac51b8b6af2827e78a80487fa88..8bf64ce5745a23bb16723a140fbd32a84c50a12b 100644 --- a/src/app/components/shared/header/header.component.ts +++ b/src/app/components/shared/header/header.component.ts @@ -47,11 +47,10 @@ 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 633262d91f4b8e7eb2b4185e65047723c9aefd31..f15756273f272d6bdee73ad862a8978716b0ec4d 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,8 +154,10 @@ export class AuthenticationService extends BaseHttpService { return this.http.post<boolean>(connectionUrl, { loginId: email, - password - }, this.httpOptions).pipe(map(() => true)); + password: password + }, this.httpOptions).pipe(map(() => { + return true; + })); } resetPassword(email: string): Observable<string> { @@ -170,7 +172,11 @@ export class AuthenticationService extends BaseHttpService { key: null, password: null }, this.httpOptions).pipe( - catchError(err => of(err.error.message)), map((result) => result) + catchError(err => { + return of(err.error.message); + }), map((result) => { + return result; + }) ); } @@ -183,10 +189,14 @@ export class AuthenticationService extends BaseHttpService { this.apiUrl.resetPassword; return this.http.post(connectionUrl, { - key, - password + key: key, + password: password }, this.httpOptions).pipe( - catchError(err => of(err.error.message)), map((result) => result) + catchError(err => { + return of(err.error.message); + }), map((result) => { + return result; + }) ); } @@ -279,7 +289,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));