From 3caedbc0cab394d73b9ab505d6a0d3d655387ceb Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 7 Apr 2022 01:25:36 +0300 Subject: [PATCH] Change icons for admin sidebar. Some changes in general, manage stakeholders, users and Indicators page --- src/app/app-routing.module.ts | 1 - src/app/app.component.html | 5 +- src/app/app.component.ts | 18 +- src/app/general/general.component.html | 9 +- .../manageStakeholders.component.html | 91 ++-- .../manageStakeholders.component.ts | 57 +-- src/app/monitor/monitor-routing.module.ts | 7 +- src/app/openaireLibrary | 2 +- src/app/topic/indicators.component.html | 2 +- src/app/topic/topic.component.html | 413 +++++++++--------- src/app/topic/topic.component.ts | 1 + src/app/users/users.component.html | 4 +- src/assets/dashboard-theme | 2 +- src/assets/openaire-theme | 2 +- 14 files changed, 255 insertions(+), 359 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 3bf9f7e..7d15630 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -24,7 +24,6 @@ const routes: Routes = [ { path: 'admin', loadChildren: () => import('./manageStakeholders/manageStakeholders.module').then(m => m.ManageStakeholdersModule), - data: {hasAdminMenu: true}, canActivateChild: [LoginGuard] }, { diff --git a/src/app/app.component.html b/src/app/app.component.html index 0bc74dd..7a4d88f 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,7 +4,7 @@
diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 6de1adf..661f0d0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -10,7 +10,6 @@ import {MenuItem, RootMenuItem} from "./openaireLibrary/sharedComponents/menu"; import {Stakeholder, Topic, Visibility} from "./openaireLibrary/monitor/entities/stakeholder"; import {LinksResolver} from "./search/links-resolver"; import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component"; -import {arrow_left} from "./openaireLibrary/utils/icons/icons"; import {properties} from "../environments/environment"; import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service"; import {Option} from "./openaireLibrary/sharedComponents/input/input.component"; @@ -32,7 +31,6 @@ export class AppComponent implements OnInit, OnDestroy { hasHeader: boolean = false; hasAdminMenu: boolean = false; isFrontPage: boolean = false; - isDashboard: boolean = false; isViewPublic: boolean = false; sideBarItems: MenuItem[] = []; specialSideBarMenuItem: MenuItem = null; @@ -111,10 +109,6 @@ export class AppComponent implements OnInit, OnDestroy { this.isFrontPage = isFrontPage; this.cdr.detectChanges(); })); - this.subscriptions.push(this.layoutService.isDashboard.subscribe(isDashboard => { - this.isDashboard = isDashboard; - this.cdr.detectChanges(); - })); this.route.queryParams.subscribe(params => { this.isViewPublic = (params['view'] == 'public'); }); @@ -241,9 +235,8 @@ export class AppComponent implements OnInit, OnDestroy { if (this.isPublicOrIsMember(topic.visibility)) { let topicItem: MenuItem = new MenuItem(topic.alias, topic.name, "", ( '/' + this.stakeholder.alias + '/' + topic.alias), - null, [], [], {}, null, null, null, ( + null, [], [], {}, {svg: topic.icon}, null, null, ( '/' + this.stakeholder.alias + '/' + topic.alias)); - topicItem.icon = topic.icon; items.push(topicItem); } }); @@ -339,16 +332,16 @@ export class AppComponent implements OnInit, OnDestroy { // rootItem: new MenuItem("", "Dashboard", // "", '/' + this.stakeholder.alias + '/', false, [], null, {}), items: [] // }); - this.adminMenuItems.push(new MenuItem("general", "General", "", "/admin/" + this.stakeholder.alias, false, [], [], {}, "")); - this.adminMenuItems.push(new MenuItem("indicators", "Indicators", "", "/admin/" + this.stakeholder.alias + '/indicators', false, [], [], {}, "")); + this.adminMenuItems.push(new MenuItem("general", "General", "", "/admin/" + this.stakeholder.alias, false, [], [], {}, {name: 'badge'})); + this.adminMenuItems.push(new MenuItem("indicators", "Indicators", "", "/admin/" + this.stakeholder.alias + '/indicators', false, [], [], {}, {name: 'analytics'})); if (this.stakeholder.defaultId) { - this.adminMenuItems.push(new MenuItem("users", "Users", "", "/admin/" + this.stakeholder.alias + "/users", false, [], [], {}, "", null, null, "/admin/" + this.stakeholder.alias+"/users")); + this.adminMenuItems.push(new MenuItem("users", "Users", "", "/admin/" + this.stakeholder.alias + "/users", false, [], [], {}, {name: 'group'}, null, null, "/admin/" + this.stakeholder.alias+"/users")); if (Session.isPortalAdministrator(this.user)) { this.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, null, null, null, "/admin/" + this.stakeholder.alias + "/admin-tools")); } } this.specialSideBarMenuItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}); - this.specialSideBarMenuItem.icon = '' + arrow_left.data + ''; // ''; + this.specialSideBarMenuItem.icon = {name: 'search', class: 'uk-text-secondary'}; this.specialSideBarMenuItem.customClass = 'uk-text-uppercase uk-text-bold uk-text-secondary'; } } else { @@ -393,7 +386,6 @@ export class AppComponent implements OnInit, OnDestroy { }; this.adminMenuItems = []; this.specialSideBarMenuItem = null; - this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, "")); } } diff --git a/src/app/general/general.component.html b/src/app/general/general.component.html index 7f2dc2b..2ccfb4c 100644 --- a/src/app/general/general.component.html +++ b/src/app/general/general.component.html @@ -9,13 +9,12 @@
- -
diff --git a/src/app/manageStakeholders/manageStakeholders.component.html b/src/app/manageStakeholders/manageStakeholders.component.html index 23bed01..5817357 100644 --- a/src/app/manageStakeholders/manageStakeholders.component.html +++ b/src/app/manageStakeholders/manageStakeholders.component.html @@ -1,45 +1,27 @@
-
+
+
+
-
+
-
Profile Templates
+

Profile Templates

- +
@@ -53,10 +35,10 @@
-
Profiles
+

Profiles

- +
@@ -72,47 +54,32 @@
-
-
- -
+
+ -
- - - -
-
diff --git a/src/app/manageStakeholders/manageStakeholders.component.ts b/src/app/manageStakeholders/manageStakeholders.component.ts index c8daecd..5229399 100644 --- a/src/app/manageStakeholders/manageStakeholders.component.ts +++ b/src/app/manageStakeholders/manageStakeholders.component.ts @@ -13,8 +13,6 @@ import {Session} from "../openaireLibrary/login/utils/helper.class"; import {EditStakeholderComponent} from "../general/edit-stakeholder/edit-stakeholder.component"; import {properties} from "../../environments/environment"; import {ActivatedRoute} from "@angular/router"; -import {SearchInputComponent} from "../openaireLibrary/sharedComponents/search-input/search-input.component"; -import {SearchUtilsClass} from '../openaireLibrary/searchPages/searchUtils/searchUtils.class'; type Tab = 'all' | 'templates'| 'profiles'; @@ -35,7 +33,7 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { public stakeholder: Stakeholder; public index: number; public user = null; - public communitySearchUtils: SearchUtilsClass = new SearchUtilsClass(); + public tab: Tab = 'all'; /** * Filtered Stakeholders */ @@ -60,14 +58,6 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { @ViewChild('deleteStakeholderModal', { static: true }) deleteStakeholderModal: AlertModal; @ViewChild('editStakeholderComponent', { static: true }) editStakeholderComponent: EditStakeholderComponent; - tab: Tab = 'all'; - - // Search - @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; - filterForm: FormGroup; - private searchText: string = ''; - public keyword: string = ''; - constructor(private stakeholderService: StakeholderService, private userManagementService: UserManagementService, private route: ActivatedRoute, @@ -76,17 +66,6 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { } ngOnInit(): void { - this.communitySearchUtils.keyword = ""; - - this.filterForm = this.fb.group({ - keyword: [''], - }); - - this.subscriptions.push(this.filterForm.get('keyword').valueChanges.subscribe(value => { - this.searchText = value.toLowerCase(); - this.applyFilters(); - })); - this.subscriptions.push(this.route.fragment.subscribe((fragment: Tab) => { if (this.isTab(fragment)) { this.tab = fragment; @@ -113,7 +92,7 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { this.alias = res[2]; this.loading = false; })); - + this.subscriptions.push(UIkit.util.on(document, 'hidden', '#edit_modal', (): void => { this.editStakeholderComponent.removePhoto(); })); @@ -166,7 +145,7 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { } private filterByKeyword(stakeholders: Stakeholder[], value): Stakeholder[] { - if (value === null || value === '') { + if (!value) { return stakeholders; } else { return stakeholders.filter(stakeholder => @@ -194,17 +173,17 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, isDefault, this.index === -1); if (this.index !== -1) { this.callback = (stakeholder: Stakeholder) => { - let index = -1; + let index: number; if (stakeholder.defaultId == null) { - index = this.alias.findIndex(value => value == this.defaultStakeholders[this.index].alias); + index = this.alias.findIndex(value => value == this.defaultStakeholders[this.index].alias); this.defaultStakeholders[this.index] = stakeholder; } else { - index = this.alias.findIndex(value => value == this.stakeholders[this.index].alias); + index = this.alias.findIndex(value => value == this.stakeholders[this.index].alias); this.stakeholders[this.index] = stakeholder; } - if(index != -1) { - this.alias[index] = stakeholder.alias; - } + if(index != -1) { + this.alias[index] = stakeholder.alias; + } }; this.editStakeholderModal.okButtonText = 'Save Changes'; } else { @@ -212,9 +191,9 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { if (stakeholder.defaultId === null) { this.defaultStakeholders.push(stakeholder); } else { - this.stakeholders.push(stakeholder); + this.stakeholders.push(stakeholder); } - this.alias.push(stakeholder.alias); + this.alias.push(stakeholder.alias); }; this.editStakeholderModal.okButtonText = 'Create'; } @@ -307,19 +286,5 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { default: return false; } - } - - public applyFilters() { - this.displayDefaultStakeholders = this.defaultStakeholders.filter(stakeholder => stakeholder.alias.toLowerCase().includes(this.searchText) || stakeholder.name.toLowerCase().includes(this.searchText) || stakeholder.description?.toLowerCase().includes(this.searchText)); - this.displayStakeholders = this.stakeholders.filter(stakeholder => stakeholder.alias.toLowerCase().includes(this.searchText) || stakeholder.name.toLowerCase().includes(this.searchText) || stakeholder.description?.toLowerCase().includes(this.searchText)); - } - - public onSearchClose() { - this.communitySearchUtils.keyword = this.filterForm.get('keyword').value; - } - - public resetInput() { - this.communitySearchUtils.keyword = null; - this.searchInputComponent.reset() } } diff --git a/src/app/monitor/monitor-routing.module.ts b/src/app/monitor/monitor-routing.module.ts index 411d6ec..c66868f 100644 --- a/src/app/monitor/monitor-routing.module.ts +++ b/src/app/monitor/monitor-routing.module.ts @@ -20,8 +20,7 @@ import {MonitorComponent} from "./monitor.component"; loadChildren: () => import('../develop/develop.module').then(m => m.DevelopModule), canDeactivate: [PreviousRouteRecorder], data: { - hasSidebar: false, - isDashboard: true + hasSidebar: false } }, { @@ -29,8 +28,7 @@ import {MonitorComponent} from "./monitor.component"; loadChildren: () => import('../methodology/methodology.module').then(m => m.MethodologyModule), canDeactivate: [PreviousRouteRecorder], data: { - hasSidebar: false, - isDashboard: true + hasSidebar: false } }, { @@ -39,7 +37,6 @@ import {MonitorComponent} from "./monitor.component"; canDeactivate: [PreviousRouteRecorder], data: { hasSidebar: false, - isDashboard: true, activeMenuItem: "search" } }, diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index acca43d..ad20ad1 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit acca43d45a4c95c0ad3426077c72b8fb08ac6e61 +Subproject commit ad20ad1ea93725fe725f84a7f51629f15bb26577 diff --git a/src/app/topic/indicators.component.html b/src/app/topic/indicators.component.html index 2e647a9..fc5bc47 100644 --- a/src/app/topic/indicators.component.html +++ b/src/app/topic/indicators.component.html @@ -1,4 +1,4 @@ -
+
Number Indicators
diff --git a/src/app/topic/topic.component.html b/src/app/topic/topic.component.html index 4022c2f..1e44515 100644 --- a/src/app/topic/topic.component.html +++ b/src/app/topic/topic.component.html @@ -1,222 +1,219 @@ -
+
- +
+
+ -
-
-
-
-
-
-
+
+
+
+
- - - - - - diff --git a/src/app/topic/topic.component.ts b/src/app/topic/topic.component.ts index facc727..484c069 100644 --- a/src/app/topic/topic.component.ts +++ b/src/app/topic/topic.component.ts @@ -27,6 +27,7 @@ export class TopicComponent implements OnInit, OnDestroy, IDeactivateComponent { public properties: EnvProperties = properties; public stakeholderUtils: StakeholderUtils = new StakeholderUtils(); public loading: boolean = true; + public stickyPageHeader: boolean = false; public stakeholder: Stakeholder; /** * Stakeholder change event diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html index 18646b8..4a7946f 100644 --- a/src/app/users/users.component.html +++ b/src/app/users/users.component.html @@ -15,8 +15,8 @@ [emailComposer]="emailComposer" [notificationFn]="notificationFn" (stickyEmitter)="stickyPageHeader = $event">
-
-
Admin Dashboard
+
+
Admin Dashboard - Manage Users

{{name}}

diff --git a/src/assets/dashboard-theme b/src/assets/dashboard-theme index 4b1a2b4..cc7e379 160000 --- a/src/assets/dashboard-theme +++ b/src/assets/dashboard-theme @@ -1 +1 @@ -Subproject commit 4b1a2b4fc40adc7259404f25dd259ceeac2a556d +Subproject commit cc7e37999cab199017f19189df402cc431bdbbaa diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 8b322ab..09341b1 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 8b322abc3f960c9b8ca29441f80c0184ed7e8a39 +Subproject commit 09341b18896d4582455a99ef50944bd544bb10df