diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7b36107..ea28bb8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -117,18 +117,14 @@ export class AppComponent implements OnInit, OnDestroy { this.subscriptions.push(this.params.subscribe(params => { if (this.paramsResolved) { this.loading = true; - let isSearch = this.router.url.includes('/search/'); if (params && params['stakeholder']) { - // this.stakeholder = this.stakeholderService.stakeholder; if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) { this.subscriptions.push(this.stakeholderService.getStakeholder(params['stakeholder']).subscribe(stakeholder => { if (stakeholder) { this.stakeholder = stakeholder; LinksResolver.setProperties(this.stakeholder.alias); this.setProperties(this.stakeholder.alias, this.stakeholder.type); - if (isSearch) { - this.activeTopic = null; - } else if (params && params['topic'] && !this.activeTopic) { + if (params && params['topic'] && !this.activeTopic) { this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility)); } else { this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility)); @@ -146,9 +142,7 @@ export class AppComponent implements OnInit, OnDestroy { })); } else { this.buildMenu(); - if (isSearch) { - this.activeTopic = null; - } else if (params && params['topic']) { + if (params && params['topic']) { this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility)); } else { this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility)); @@ -156,11 +150,12 @@ export class AppComponent implements OnInit, OnDestroy { this.loading = false; } } else { - LinksResolver.resetProperties(); - this.stakeholderService.setStakeholder(null); - this.layoutService.setOpen(!(this.innerWidth && this.innerWidth <= 640)); - this.stakeholder = null; - this.buildMenu(); + if(this.stakeholder) { + LinksResolver.resetProperties(); + this.stakeholderService.setStakeholder(null); + this.stakeholder = null; + this.buildMenu(); + } this.loading = false; } } @@ -244,13 +239,25 @@ export class AppComponent implements OnInit, OnDestroy { items.push(new MenuItem('noTopics', 'No topics available yet', "", "", false, [], [], {})); } } + this.adminMenuItems = []; + 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: 'bar_chart'})); + if (this.stakeholder.defaultId) { + 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, [], [], {}, {name: 'description'}, null, null, "/admin/" + this.stakeholder.alias + "/admin-tools")); + } + } + this.specialSideBarMenuItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, { + name: 'search', + class: 'uk-text-secondary' + }); this.sideBarItems = items; this.hasSidebar = this.hasSidebar && this.sideBarItems.length > 0; } buildMenu() { this.menuItems = []; - this.adminMenuItems = []; this.userMenuItems = []; if (this.user) { if (this.isCurator()) { @@ -325,19 +332,6 @@ export class AppComponent implements OnInit, OnDestroy { stickyAnimation: true, menuPosition: "center" }; - // this.menuItems.push({ - // rootItem: new MenuItem("", "Dashboard", - // "", '/' + this.stakeholder.alias + '/', false, [], null, {}), items: [] - // }); - 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: 'bar_chart'})); - if (this.stakeholder.defaultId) { - 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, [], [], {}, {name: 'description'}, null, null, "/admin/" + this.stakeholder.alias + "/admin-tools")); - } - } - this.specialSideBarMenuItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'search', class: 'uk-text-secondary'}); } } else { if (this.isFrontPage || !this.hasAdminMenu) { diff --git a/src/app/error/errorPage.component.ts b/src/app/error/errorPage.component.ts index dd793f3..b3965ca 100644 --- a/src/app/error/errorPage.component.ts +++ b/src/app/error/errorPage.component.ts @@ -3,12 +3,9 @@ import {Component} from '@angular/core'; @Component({ selector: 'openaire-error', template: ` -
+
` }) -export class OpenaireErrorPageComponent { - - constructor() {} -} +export class OpenaireErrorPageComponent {} diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts index e0ed6ee..9607989 100644 --- a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts +++ b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts @@ -69,16 +69,16 @@ declare var UIkit;
-
- -
-
- -
+
+ +
+
+ +
{{uploadError}}
diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.module.ts b/src/app/general/edit-stakeholder/edit-stakeholder.module.ts index 8a1f440..6f08416 100644 --- a/src/app/general/edit-stakeholder/edit-stakeholder.module.ts +++ b/src/app/general/edit-stakeholder/edit-stakeholder.module.ts @@ -11,6 +11,4 @@ import {NotifyFormModule} from "../../openaireLibrary/notifications/notify-form/ declarations: [EditStakeholderComponent], exports: [EditStakeholderComponent] }) -export class EditStakeholderModule { - constructor() {} -} +export class EditStakeholderModule {} diff --git a/src/app/general/general.component.html b/src/app/general/general.component.html index fbfd343..8debd1f 100644 --- a/src/app/general/general.component.html +++ b/src/app/general/general.component.html @@ -22,7 +22,7 @@
-
+
diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index fd6f85e..0882851 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -63,7 +63,7 @@
-
+