diff --git a/dashboard/sharedComponents/input/input.component.ts b/dashboard/sharedComponents/input/input.component.ts index fa414df6..6718bba8 100644 --- a/dashboard/sharedComponents/input/input.component.ts +++ b/dashboard/sharedComponents/input/input.component.ts @@ -48,7 +48,7 @@ export interface Option { - {{formControl.errors.error}} + {{formControl.errors.error}} {{warning}} diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index f6a35d97..5007348e 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -6,6 +6,9 @@ import {UserRegistryService} from "../../../services/user-registry.service"; import {EnvProperties} from "../../../utils/properties/env-properties"; import {properties} from "../../../../../environments/environment"; import {Session} from "../../../login/utils/helper.class"; +import {UserManagementService} from "../../../services/user-management.service"; +import {Router} from "@angular/router"; +import {LoginErrorCodes} from "../../../login/utils/guardHelper.class"; declare var UIkit; @@ -44,11 +47,23 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { @ViewChild('createRoleModal') createRoleModal: AlertModal; constructor(private userRegistryService: UserRegistryService, + private userManagementService: UserManagementService, + private router: Router, private fb: FormBuilder) { } ngOnInit() { this.updateLists(); + this.userManagementService.getUserInfo().subscribe(user => { + if(!Session.isPortalAdministrator(user) && !Session.isCurator(this.type, user) && !Session.isManager(this.type, this.id, user)) { + this.router.navigate(['/user-info'], { + queryParams: { + "errorCode": LoginErrorCodes.NOT_AUTHORIZED, + "redirectUrl": this.router.url + } + }); + } + }); } ngOnChanges(changes: SimpleChanges) { @@ -129,6 +144,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { this.loadActive = true; this.userRegistryService.remove(this.type, this.id, this.selectedUser, this.role).subscribe(() => { this.active = this.active.filter(user => user.email != this.selectedUser); + this.userManagementService.updateUserInfo(); this.loadActive = false; this.error = null; }, error => { diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 13f8c03d..95ca6479 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -17,10 +17,10 @@ import {AlertModal} from "../utils/modal/alert"; Fill in the verification code, sent to your email, to accept the invitation request. -
- -
{{error}}
+
+
+
{{error}}
+
@@ -42,10 +42,10 @@ import {AlertModal} from "../utils/modal/alert"; your email, to accept the invitation request.
-
- -
{{error}}
+
+
+
{{error}}
+
@@ -166,7 +166,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy { this.error = null; this.errorModal.cancelButton = false; this.errorModal.okButtonText = 'Ok'; - this.errorModal.alertTitle = 'Cannot Complete Invitation'; + this.errorModal.alertTitle = 'Invalid request'; this.errorModal.open(); } @@ -193,7 +193,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy { this.error = null; this.subs.push(this.userManagementService.getUserInfo(false).subscribe(user => { this.user = user; - this.memberModal.cancel(); + this.isMember = true; })); }, error => { this.loading = false; diff --git a/role-verification/role-verification.module.ts b/role-verification/role-verification.module.ts index 72bff06d..1346bfda 100644 --- a/role-verification/role-verification.module.ts +++ b/role-verification/role-verification.module.ts @@ -4,9 +4,10 @@ import {RoleVerificationComponent} from "./role-verification.component"; import {AlertModalModule} from "../utils/modal/alertModal.module"; import {ReactiveFormsModule} from "@angular/forms"; import {LoadingModule} from "../utils/loading/loading.module"; +import {InputModule} from "../dashboard/sharedComponents/input/input.module"; @NgModule({ - imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule], + imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule, InputModule], declarations: [RoleVerificationComponent], exports: [RoleVerificationComponent] }) diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index 15ca55e0..bef27701 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -38,7 +38,7 @@ export class MenuItem { if (!menu.markAsActive) { return false; } - if (menu.route.length > 0 && (currentRoute == menu.route || currentRoute.indexOf(menu.route) != -1)) { + if (menu.route.length > 0 && (currentRoute == menu.route)) { return true; } else if (menu.items.length > 0) { for (let menuItem of menu.items) {