+ [header]="header" [user]="user" [userMenuItems]="userMenuItems">
@@ -34,12 +34,13 @@ export class AppComponent extends StakeholderBaseComponent implements OnInit {
header: Header = {
route: "/",
title: "Noami",
- logoUrl: "",
+ logoUrl: 'assets/main.svg',
logoSmallUrl: null,
position: 'left',
badge: true,
};
menuItems:MenuItem[] = [];
+ userMenuItems: MenuItem[] = [];
irish: Irish = new Irish();
user: User;
@@ -68,12 +69,24 @@ export class AppComponent extends StakeholderBaseComponent implements OnInit {
initialize() {
this.menuItems = [
- new MenuItem("national", this.stakeholderUtils.entities.country + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/", false, [], null, {}, null, null, null, null),
+ new MenuItem("national", this.stakeholderUtils.entities.country + ' ' + this.stakeholderUtils.entities.stakeholder, "", "/", false, [], null, {}, null, null, null, null),
new MenuItem("rpo", this.stakeholderUtils.entities.organization + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rpo", false, [], null, {}, null, null, null, null),
new MenuItem("rfo", this.stakeholderUtils.entities.funder + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rfo", false, [], null, {}, null, null, null, null),
new MenuItem("researcher", "Researcher Monitors", "", "/researcher", false, [], null, {}, null, null, null, null),
+/*
new MenuItem("repository", "Repository Monitors", "", "/", false, [], null, {}, null, null, null, null),
- new MenuItem("upload-dois", "Upload DOIs", "", "/upload-dois", false, [], null, {}, null, null, null, null)
+*/
];
+
+ if(this.user) {
+ this.userMenuItems = [new MenuItem("upload-dois", "Upload DOIs", "", "/upload-dois", false, [], null, {}, null, null, null, null)];
+ if(this.isAdmin) {
+ this.userMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
+ }
+ }
+ }
+
+ public get isAdmin() {
+ return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user);
}
}
diff --git a/src/app/national/national.component.ts b/src/app/national/national.component.ts
index 27a06e0..713a304 100644
--- a/src/app/national/national.component.ts
+++ b/src/app/national/national.component.ts
@@ -1,4 +1,4 @@
-import {Component, OnDestroy, OnInit} from "@angular/core";
+import {Component, OnInit} from "@angular/core";
import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder";
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
import {BaseComponent} from "../openaireLibrary/sharedComponents/base/base.component";
@@ -13,16 +13,19 @@ import {CustomFilterService} from "../shared/customFilter.service";
@Component({
selector: 'national',
template: `
-
-
-
-
+
+
+
+
+
+
`
})
export class NationalComponent extends BaseComponent implements OnInit {
stakeholder: Stakeholder;
+ loading: boolean = true;
constructor(private stakeholderService: StakeholderService,
protected _router: Router,
@@ -34,23 +37,18 @@ export class NationalComponent extends BaseComponent implements OnInit {
private _customFilterService:CustomFilterService) {
super();
super.initRouterParams(this._route);
-
}
ngOnInit() {
- this.title = 'National Monitor';
- this.description = 'National Monitor';
- this.setMetadata();
- /* this.params.subscribe(params => {
- console.log("")
- if(!params || !params['stakeholder']) {*/
+ this.stakeholderService.getStakeholder(this._route.snapshot.data.stakeholder).subscribe(stakeholder => {
+ this.stakeholder = stakeholder;
+ if(this.stakeholder) {
+ this._customFilterService.setCustomFilter([new SearchCustomFilter("National", "country", "IE", "Irish National Monitor")]);
+ LinksResolver.setProperties("");
+ this.loading = false;
+ } else {
- this._customFilterService.setCustomFilter([new SearchCustomFilter("National", "country", "IE", "Irish National Monitor")]);
- LinksResolver.setProperties("");
-
- // TODO not correct id/ no author // no irish author?
-
- // }
- // });
+ }
+ });
}
}
diff --git a/src/app/national/national.module.ts b/src/app/national/national.module.ts
index bab49c0..b357cdc 100644
--- a/src/app/national/national.module.ts
+++ b/src/app/national/national.module.ts
@@ -5,12 +5,9 @@ import {NationalComponent} from "./national.component";
const routes: Route[] = [
{
path: '', component: NationalComponent, children: [
- /* {
- path: '',
- loadChildren: () => import('../shared/browse-stakeholders/browse-stakeholder.module').then(m => m.BrowseStakeholderModule)
- },*/
+ {path: '', loadChildren: () => import('../shared/monitor/monitor.module').then(m => m.MonitorModule)},
{path: 'search', loadChildren: () => import('../search/search.module').then(m => m.SearchModule)}
- ]
+ ], data: {stakeholder: 'tubitak'}
}
];
diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary
index e80f73f..a8c91dc 160000
--- a/src/app/openaireLibrary
+++ b/src/app/openaireLibrary
@@ -1 +1 @@
-Subproject commit e80f73f9a9ceb65bff5b326e5b187b943415d7ad
+Subproject commit a8c91dc04cb65db6d09b21d6159319dc3294f2a8
diff --git a/src/app/rfo/rfo.component.ts b/src/app/rfo/rfo.component.ts
index 75808cc..47498f1 100644
--- a/src/app/rfo/rfo.component.ts
+++ b/src/app/rfo/rfo.component.ts
@@ -17,15 +17,16 @@ import {CustomFilterService} from "../shared/customFilter.service";
+
Browse results