diff --git a/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts b/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts index 31fdce0..2e83db4 100644 --- a/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts +++ b/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts @@ -11,6 +11,11 @@ import {RouterModule} from "@angular/router"; }, { path: 'users', + redirectTo: 'users/manager', + pathMatch: 'full' + }, + { + path: 'users/:user_type', loadChildren: () => import('../users/users.module').then(m => m.UsersModule), data: {hasAdminMenu: true}, pathMatch: 'full' diff --git a/src/app/general/general.component.html b/src/app/general/general.component.html index 6b57f0a..102b7cd 100644 --- a/src/app/general/general.component.html +++ b/src/app/general/general.component.html @@ -2,8 +2,7 @@
- - +
Admin Dashboard - Manage Profile

{{stakeholder.name}} (unsaved changes)

diff --git a/src/app/general/general.module.ts b/src/app/general/general.module.ts index a0895b2..4a198a2 100644 --- a/src/app/general/general.module.ts +++ b/src/app/general/general.module.ts @@ -10,6 +10,7 @@ import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module import {ReactiveFormsModule} from "@angular/forms"; import {EditStakeholderModule} from "./edit-stakeholder/edit-stakeholder.module"; import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; +import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module"; @NgModule({ declarations: [GeneralComponent], @@ -22,7 +23,8 @@ import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/p AlertModalModule, ReactiveFormsModule, EditStakeholderModule, - PageContentModule + PageContentModule, + LogoUrlPipeModule ], providers: [ PreviousRouteRecorder, diff --git a/src/app/manageStakeholders/manageStakeholders.component.html b/src/app/manageStakeholders/manageStakeholders.component.html index e37c846..cd896a6 100644 --- a/src/app/manageStakeholders/manageStakeholders.component.html +++ b/src/app/manageStakeholders/manageStakeholders.component.html @@ -1,11 +1,11 @@
-
+
Admin Dashboard - Manage profiles
+

Profile Templates & Profiles

    @@ -26,7 +26,7 @@

    Profile Templates

    -
    +
    @@ -42,7 +42,7 @@

    Profiles

    -
    +
    @@ -96,18 +96,14 @@

    - - - OpenAIRE placeholder logo - +
    - -
    +
    {{text}} @@ -118,7 +114,7 @@
    -
    +
    - - - OpenAIRE placeholder logo - +
    Dashboard

    {{stakeholder.name}}

    diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 950f500..5e1fde7 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 950f50030fa8256f90b577dc5866526ff98fcda1 +Subproject commit 5e1fde78411e2913c3757534a073ace32a4eacf2 diff --git a/src/app/topic/topic.component.html b/src/app/topic/topic.component.html index 4e46122..3a4bd20 100644 --- a/src/app/topic/topic.component.html +++ b/src/app/topic/topic.component.html @@ -114,8 +114,7 @@
    - - +
    Admin Dashboard - Manage Indicators

    {{stakeholder.name}}

    diff --git a/src/app/topic/topic.module.ts b/src/app/topic/topic.module.ts index 39f3917..d383cdb 100644 --- a/src/app/topic/topic.module.ts +++ b/src/app/topic/topic.module.ts @@ -18,11 +18,12 @@ import {IconsModule} from "../openaireLibrary/utils/icons/icons.module"; import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module"; import {NotifyFormModule} from "../openaireLibrary/notifications/notify-form/notify-form.module"; +import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module"; @NgModule({ imports: [ CommonModule, TopicRoutingModule, ClickModule, RouterModule, FormsModule, AlertModalModule, - ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule + ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule, LogoUrlPipeModule ], declarations: [ TopicComponent, IndicatorsComponent diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html index 5e7cc88..2caef88 100644 --- a/src/app/users/users.component.html +++ b/src/app/users/users.component.html @@ -6,19 +6,18 @@ -
    - - +
    -
    Admin Dashboard - Manage Users
    -

    {{name}}

    +
    Admin Dashboard - Manage {{users}}
    +

    {{stakeholder.name}}

    diff --git a/src/app/users/users.component.ts b/src/app/users/users.component.ts index bb2da85..1dda6b3 100644 --- a/src/app/users/users.component.ts +++ b/src/app/users/users.component.ts @@ -11,6 +11,8 @@ import {Notification} from "../openaireLibrary/notifications/notifications"; import {User} from "../openaireLibrary/login/utils/helper.class"; import {UserManagementService} from "../openaireLibrary/services/user-management.service"; import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties"; +import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder"; +import {StringUtils} from "../openaireLibrary/utils/string-utils.class"; type Tab = 'member' | 'manager'; @@ -19,11 +21,8 @@ type Tab = 'member' | 'manager'; templateUrl: 'users.component.html' }) export class UsersComponent implements OnInit { - - public alias: string; - public name: string; - public logo: string; - public type: string; + + public stakeholder: Stakeholder; public link: string; public loading: boolean; public messages: Map = new Map(); @@ -38,10 +37,10 @@ export class UsersComponent implements OnInit { if(invitation) { invitation.link = this.link + invitation.link; } - let notification: Notification = NotificationUtils.invite(this.name, role, 'user', invitation); + let notification: Notification = NotificationUtils.invite(this.stakeholder.name, role, 'user', invitation); notification.entity = recipient; - notification.stakeholderType = this.type; - notification.stakeholder = this.alias; + notification.stakeholderType = this.stakeholder.type; + notification.stakeholder = this.stakeholder.alias; notification.name = this.user.firstname; notification.surname = this.user.lastname; notification.groups = [recipient]; @@ -57,21 +56,21 @@ export class UsersComponent implements OnInit { ngOnInit() { this.loading = true; - this.subscriptions.push(this.route.fragment.subscribe((fragment: Tab) => { - if (this.isTab(fragment)) { - this.tab = fragment; + this.subscriptions.push(this.route.params.subscribe(params => { + if (this.isTab(params['user_type'])) { + this.tab = params['user_type']; } else { this.tab = 'manager'; } + if(this.stakeholder) { + this.title.setTitle(this.stakeholder.name + " | " + this.users); + } })); this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { if (stakeholder) { - this.alias = stakeholder.alias; - this.name = stakeholder.name; - this.logo = stakeholder.logoUrl; - this.title.setTitle(this.name + " | Users"); - this.type = stakeholder.type; - this.link = this.getURL(this.alias); + this.stakeholder = stakeholder; + this.title.setTitle(this.stakeholder.name + " | " + this.users); + this.link = this.getURL(this.stakeholder.alias); this.messages.set("member", 'A member has the right to view the restricted access areas of this indicator\'s profile. ' + 'A member has no access to the administration part of the profile.'); this.messages.set("manager", 'A manager has the right to access the administration part of this indicator\'s profile, ' + @@ -92,6 +91,10 @@ export class UsersComponent implements OnInit { }); } + get users(): string { + return StringUtils.capitalize(this.tab) + 's'; + } + private isTab(tab: Tab): boolean { switch (tab) { case "manager": diff --git a/src/app/users/users.module.ts b/src/app/users/users.module.ts index 41add57..424ec79 100644 --- a/src/app/users/users.module.ts +++ b/src/app/users/users.module.ts @@ -6,9 +6,10 @@ import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module"; import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; import {RoleUsersModule} from "../openaireLibrary/dashboard/users/role-users/role-users.module"; import {RouterModule} from "@angular/router"; +import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module"; @NgModule({ - imports: [CommonModule, UsersRoutingModule, LoadingModule, PageContentModule, RoleUsersModule, RouterModule], + imports: [CommonModule, UsersRoutingModule, LoadingModule, PageContentModule, RoleUsersModule, RouterModule, LogoUrlPipeModule], declarations: [UsersComponent], exports: [UsersComponent] }) diff --git a/src/assets/dashboard-theme b/src/assets/dashboard-theme index 635d56f..cd1a176 160000 --- a/src/assets/dashboard-theme +++ b/src/assets/dashboard-theme @@ -1 +1 @@ -Subproject commit 635d56f198026c2d24a923ad58b813254591fa33 +Subproject commit cd1a176ceb3aaa3493e16fc4d7ef67749655f351