From 27c85f102e2203bf0750dab51a8b8d0c337ee03a Mon Sep 17 00:00:00 2001
From: "k.triantafyllou"
Date: Sun, 26 Jun 2022 23:33:02 +0300
Subject: [PATCH] Finish UI of Manage communities and manage managers
---
src/app/app.component.ts | 6 ++--
src/app/openaireLibrary | 2 +-
.../manage-communities.component.ts | 35 ++++---------------
.../users-managers.component.ts | 24 +++++++------
.../users-managers/users-managers.module.ts | 3 +-
src/app/pages/users/users-routing.module.ts | 6 ++--
.../users-subscribers.component.ts | 2 +-
src/app/pages/users/users-tabs.component.ts | 17 +++++----
src/assets/dashboard-theme | 2 +-
9 files changed, 39 insertions(+), 58 deletions(-)
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index fe78800..c407212 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -230,9 +230,9 @@ export class AppComponent implements OnInit {
};
this.sideBarItems.push(new MenuItem("communities", "Manage Communities", "", "/", false, [], [], {}, {name: 'settings'}));
if (Session.isPortalAdministrator(this.user)) {
- this.sideBarItems.push(new MenuItem("super_admin", "Super Admin Options", "", "/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, 'admin/admin-tools'));
- this.sideBarItems.push(new MenuItem("connect", "Connect Options", "", "/connect/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, 'admin/monitor/admin-tools'));
- this.sideBarItems.push(new MenuItem("explore", "Explore Options", "", "/openaire/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, 'admin/monitor/admin-tools'));
+ this.sideBarItems.push(new MenuItem("super_admin", "Super Admin Options", "", "/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, '/admin-tools'));
+ this.sideBarItems.push(new MenuItem("connect", "Connect Options", "", "/connect/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, '/connect/admin-tools'));
+ this.sideBarItems.push(new MenuItem("explore", "Explore Options", "", "/openaire/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, '/openaire/admin-tools'));
}
this.specialSideBarMenuItem = null;
}
diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary
index 4966a1d..5e1fde7 160000
--- a/src/app/openaireLibrary
+++ b/src/app/openaireLibrary
@@ -1 +1 @@
-Subproject commit 4966a1d342ae711a1a84ee924ab23e2f79271ec9
+Subproject commit 5e1fde78411e2913c3757534a073ace32a4eacf2
diff --git a/src/app/pages/manage-communities/manage-communities.component.ts b/src/app/pages/manage-communities/manage-communities.component.ts
index ec6b730..cb1c3bc 100644
--- a/src/app/pages/manage-communities/manage-communities.component.ts
+++ b/src/app/pages/manage-communities/manage-communities.component.ts
@@ -23,15 +23,16 @@ type Tab = 'all' | 'communities' | 'ris';
- Admin Dashboard - Manage Research Community Dasbhoards
+ Admin Dashboard - Manage Communities
+
Research Communities & Initiatives
@@ -94,12 +95,8 @@ type Tab = 'all' | 'communities' | 'ris';
-
![]()
-
-
-
@@ -148,13 +145,6 @@ export class ManageCommunitiesComponent implements OnInit, OnDestroy {
this.loading = true;
this.title.setTitle('Administrator Dashboard | Manage Communities');
- this.subscriptions.push(this.route.fragment.subscribe((fragment: Tab) => {
- if (this.isTab(fragment)) {
- this.tab = fragment;
- } else {
- this.tab = 'all';
- }
- }));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
if (this.user) {
@@ -195,19 +185,6 @@ export class ManageCommunitiesComponent implements OnInit, OnDestroy {
(this.tab === "ris" && this.ris.length === 0);
}
- private isTab(tab: Tab): boolean {
- switch (tab) {
- case "all":
- return true;
- case "communities":
- return true;
- case "ris":
- return true;
- default:
- return false;
- }
- }
-
public applyFilters() {
this.filteredCommunities = this.communities.filter(community => community.shortTitle.toLowerCase().includes(this.searchText) || community.title.toLowerCase().includes(this.searchText) || community.communityId.toLowerCase().includes(this.searchText));
this.filteredRis = this.ris.filter(community => community.shortTitle.toLowerCase().includes(this.searchText) || community.title.toLowerCase().includes(this.searchText) || community.communityId.toLowerCase().includes(this.searchText));
diff --git a/src/app/pages/users/users-managers/users-managers.component.ts b/src/app/pages/users/users-managers/users-managers.component.ts
index f7af221..f500f37 100644
--- a/src/app/pages/users/users-managers/users-managers.component.ts
+++ b/src/app/pages/users/users-managers/users-managers.component.ts
@@ -6,20 +6,25 @@ import {Subscriber} from "rxjs";
import {Email} from "../../../openaireLibrary/utils/email/email";
import {Composer} from "../../../openaireLibrary/utils/email/composer";
import {properties} from "../../../../environments/environment";
+import {CommunityInfo} from "../../../openaireLibrary/connect/community/communityInfo";
@Component({
selector: 'users-managers',
template: `
-
+
+
+
+
Admin Dashboard - Manage Users
+
{{community.shortTitle}}
+
+
`
})
export class UsersManagersComponent implements OnInit {
- public communityId: string;
- public name: string;
- public type: string;
+ public community: CommunityInfo;
public link: string;
public loading: boolean;
public message: string;
@@ -27,6 +32,7 @@ export class UsersManagersComponent implements OnInit {
public emailComposer: Function = (name, recipient, role):Email => {
return Composer.composeEmailForCommunityDashboard(name, recipient);
}
+ public stickyPageHeader: boolean = false;
private subscriptions: any[] = [];
constructor(private communityService: CommunityService,
@@ -38,11 +44,9 @@ export class UsersManagersComponent implements OnInit {
this.loading = true;
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if(community) {
- this.communityId = community.communityId;
- this.name = community.shortTitle;
- this.title.setTitle(this.communityId.toUpperCase() + " | Managers");
- this.type = 'community';
- this.link = this.getURL(this.communityId);
+ this.community = community;
+ this.title.setTitle(this.community.communityId.toUpperCase() + " | Managers");
+ this.link = this.getURL(this.community.communityId);
this.message = 'A manager has the right to access the administration part of Research Community Dashboard, ' +
'where he is able to customize and manage the content, invite other users as managers or to subscribe.';
if(community.status === "hidden") {
diff --git a/src/app/pages/users/users-managers/users-managers.module.ts b/src/app/pages/users/users-managers/users-managers.module.ts
index 4f6b423..68bb874 100644
--- a/src/app/pages/users/users-managers/users-managers.module.ts
+++ b/src/app/pages/users/users-managers/users-managers.module.ts
@@ -5,11 +5,12 @@ import {LoadingModule} from "../../../openaireLibrary/utils/loading/loading.modu
import {RouterModule} from "@angular/router";
import {RoleUsersModule} from "../../../openaireLibrary/dashboard/users/role-users/role-users.module";
import {UsersTabsModule} from '../users-tabs.module';
+import {LogoUrlPipeModule} from "../../../openaireLibrary/utils/pipes/logoUrlPipe.module";
@NgModule({
imports: [CommonModule, LoadingModule, RoleUsersModule, RouterModule.forChild([
{path: '', component: UsersManagersComponent}
- ]), UsersTabsModule],
+ ]), UsersTabsModule, LogoUrlPipeModule],
declarations: [UsersManagersComponent],
exports: [UsersManagersComponent]
})
diff --git a/src/app/pages/users/users-routing.module.ts b/src/app/pages/users/users-routing.module.ts
index 39a58ec..ca14bf5 100644
--- a/src/app/pages/users/users-routing.module.ts
+++ b/src/app/pages/users/users-routing.module.ts
@@ -4,9 +4,9 @@ import {RouterModule} from '@angular/router';
@NgModule({
imports: [
RouterModule.forChild([
- {path: '', redirectTo: 'managers', pathMatch: 'full'},
- {path: 'managers', loadChildren: () => import('./users-managers/users-managers.module').then(m => m.UsersManagersModule)},
- {path: 'subscribers', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)},
+ {path: '', redirectTo: 'manager', pathMatch: 'full'},
+ {path: 'manager', loadChildren: () => import('./users-managers/users-managers.module').then(m => m.UsersManagersModule)},
+ {path: 'subscriber', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)},
{
path: 'notifications',
loadChildren: () => import('../usernotifications/manage-user-notifications.module').then(m => m.ManageUserNotificationsModule)
diff --git a/src/app/pages/users/users-subscribers/users-subscribers.component.ts b/src/app/pages/users/users-subscribers/users-subscribers.component.ts
index 9a96fc0..4ace622 100644
--- a/src/app/pages/users/users-subscribers/users-subscribers.component.ts
+++ b/src/app/pages/users/users-subscribers/users-subscribers.component.ts
@@ -8,7 +8,7 @@ import {Subscriber} from "rxjs";
selector: 'users-subscribers',
template: `
-
+
`
})
diff --git a/src/app/pages/users/users-tabs.component.ts b/src/app/pages/users/users-tabs.component.ts
index a2ddf80..6dc4ca8 100644
--- a/src/app/pages/users/users-tabs.component.ts
+++ b/src/app/pages/users/users-tabs.component.ts
@@ -7,14 +7,13 @@ import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'users-tabs',
template: `
-
- - Managers
- - Subscribers
- - Notification settings
- - links
- - Personal info
+
`
})
@@ -22,7 +21,7 @@ export class UsersTabsComponent implements OnInit {
@Input()
public type: string;
@Input()
- public tab: "managers"| "members" | "notifications" | "claims" | "personal" = 'managers';
+ public tab: "manager"| "subscriber" | "notifications" | "claims" | "personal" = 'manager';
private subscriptions = [];
isAManager: boolean = false;
canManageNotifications: boolean = false;
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