From da5dbee3aa382274df67ccc3e9f7bbe1f43136b0 Mon Sep 17 00:00:00 2001 From: Argiro Kokogiannaki Date: Thu, 25 Jun 2020 08:10:42 +0000 Subject: [PATCH] [Monitor Dashboard |Trunk] Admin and stakeholder page: -update titles (use stakeholder.name) -indicator description in the bottom Admin: -rename stakeholder to profile -update titles (use stakeholder.name) -add name when there is no logo -back button takes you to stakeholder page not /admin -indicator description in the bottom -Add sections for numbers is enabled only for administrators git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@58990 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/app.component.ts | 4 +-- .../manageStakeholders.component.html | 13 +++---- .../manageStakeholders.component.ts | 2 +- src/app/monitor/monitor.component.html | 5 +-- src/app/monitor/monitor.component.ts | 16 +++++---- .../stakeholder/stakeholder.component.html | 4 ++- src/app/stakeholder/stakeholder.component.ts | 34 +++++++++++++++++-- src/app/topic/indicators.component.html | 17 +++++----- src/app/topic/topic.component.html | 1 + src/app/topic/topic.component.ts | 2 +- 10 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4ccbf0b..6de4ab4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -136,7 +136,7 @@ export class AppComponent implements OnInit, OnDestroy { }*/ if (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || Session.isCommunityCurator(this.user)) { - this.userMenuItems.push(new MenuItem("", "Manage Stakeholders", + this.userMenuItems.push(new MenuItem("", "Manage profiles", "", "/admin", true, [], [], {})) } @@ -145,7 +145,7 @@ export class AppComponent implements OnInit, OnDestroy { } if (this.adminMenuItems.length == 0) { //nstructor(id: string, name: string, route: string, items: Item[], icon, open: boolean) { - this.adminMenuItems.push(new MenuItem("stakeholders", "Manage Stakeholders", "", "/admin", false, [], [], {}, "settings")); + this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, "settings")); /*let adminOptions = new MenuItem("adminOptions", "Admin Options", "", "", false, [], [], {}) adminOptions.items.push(new MenuItem("pages", "Pages", "", "/pages", false, [], [], {})); adminOptions.items.push(new MenuItem("portals", "Portals", "", "/portals", false, [], [], {})); diff --git a/src/app/manageStakeholders/manageStakeholders.component.html b/src/app/manageStakeholders/manageStakeholders.component.html index 2625764..bf29109 100644 --- a/src/app/manageStakeholders/manageStakeholders.component.html +++ b/src/app/manageStakeholders/manageStakeholders.component.html @@ -15,7 +15,7 @@
search -
+
- Create a new Stakeholder default profile. + Create a new default profile.
add @@ -112,7 +112,7 @@
-

Stakeholders

+

Profiles

add - Create a Stakeholder + Create a profile
- Create a new Stakeholder by selecting a default profile. + Create a new profile by selecting the type (Funder, Organization, Research Initiative or Project) and + select indicators based on a default or a blank profile.
add diff --git a/src/app/manageStakeholders/manageStakeholders.component.ts b/src/app/manageStakeholders/manageStakeholders.component.ts index 3907d47..94ceb6c 100644 --- a/src/app/manageStakeholders/manageStakeholders.component.ts +++ b/src/app/manageStakeholders/manageStakeholders.component.ts @@ -67,7 +67,7 @@ export class ManageStakeholdersComponent implements OnInit, OnDestroy { this.propertiesService.loadEnvironment() .then(properties => { this.properties = properties; - this.title.setTitle('Manage Stakeholders'); + this.title.setTitle('Manage profiles'); this.userManagementService.getUserInfo().subscribe(user => { this.user = user; }); diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 93276ac..503254e 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -110,7 +110,7 @@ (activeCategory && activeCategory.description && activeCategory.description.length > 0) || (activeTopic && activeTopic.description && activeTopic.description.length > 0))" class="uk-text-center"> -
+
{{activeSubCategory && activeSubCategory.description && activeSubCategory.description.length > 0 ? activeSubCategory.description : (activeCategory && activeCategory.description && activeCategory.description.length > 0 ? activeCategory.description : (activeTopic.description && activeTopic.description.length > 0 ? activeTopic.description : ""))}} @@ -174,7 +174,7 @@

{{indicator.name + " "}}

-
+
diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index 0d26ce0..9f5244e 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core'; +import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewRef} from '@angular/core'; import {ActivatedRoute, Params, Router} from '@angular/router'; import {DomSanitizer, Meta, Title} from '@angular/platform-browser'; import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; @@ -118,8 +118,8 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent if(stakeholder.isActive && (stakeholder.isPublic || this.isAdmin())) { this.seoService.createLinkForCanonicalURL(url, false); this._meta.updateTag({content: url}, "property='og:url'"); - var description = "Monitor Dashboard | " + this.stakeholder.index_name; - var title = "Monitor Dashboard | " + this.stakeholder.index_shortName; + var description = "Monitor Dashboard | " + this.stakeholder.name; + var title = "Monitor Dashboard | " + this.stakeholder.name; this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "property='og:description'"); this._meta.updateTag({content: title}, "property='og:title'"); @@ -135,7 +135,9 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent } else { this.privateStakeholder = true; // this.navigateToError(); - subscription.unsubscribe(); + if(subscription) { + subscription.unsubscribe(); + } } } }); @@ -332,7 +334,9 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent } }); }); - this.cdr.detectChanges(); + if (this.cdr && !(this.cdr as ViewRef).destroyed) { + this.cdr.detectChanges(); + } } public getUrlByStakeHolder(indicatorPath: IndicatorPath) { @@ -374,7 +378,7 @@ export class MonitorComponent implements OnInit, OnDestroy, IDeactivateComponent // // } if (this.user) { - this.userMenuItems.push(new MenuItem("", "Manage Stakeholders", "", "/admin", false, [], [], {})); + this.userMenuItems.push(new MenuItem("", "Manage profiles", "", "/admin", false, [], [], {})); } if (this.user) { this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {})); diff --git a/src/app/stakeholder/stakeholder.component.html b/src/app/stakeholder/stakeholder.component.html index 405bed6..149a08d 100644 --- a/src/app/stakeholder/stakeholder.component.html +++ b/src/app/stakeholder/stakeholder.component.html @@ -6,12 +6,14 @@
Default
+
{{stakeholder.name}}
+