diff --git a/src/app/admin-tools/admin-tools-routing.module.ts b/src/app/admin-tools/admin-tools-routing.module.ts
index 1d9fc44..577f642 100644
--- a/src/app/admin-tools/admin-tools-routing.module.ts
+++ b/src/app/admin-tools/admin-tools-routing.module.ts
@@ -9,20 +9,20 @@ import {RouterModule} from '@angular/router';
loadChildren: '../openaireLibrary/dashboard/entity/entities.module#EntitiesModule',
pathMatch: 'full'
},
-/* {
- path: 'classContents',
- loadChildren: '../openaireLibrary/dashboard/divhelpcontent/div-help-contents.module#DivHelpContentsModule'
- },
- {
- path: 'classContents/new',
- loadChildren: '../openaireLibrary/dashboard/divhelpcontent/new-div-help-content.module#NewDivHelpContentModule',
- pathMatch: 'full'
- },
- {
- path: 'classContents/edit',
- loadChildren: '../openaireLibrary/dashboard/divhelpcontent/edit-div-help-content.module#EditDivHelpContentModule',
- pathMatch: 'full'
- },*/
+ /* {
+ path: 'classContents',
+ loadChildren: '../openaireLibrary/dashboard/divhelpcontent/div-help-contents.module#DivHelpContentsModule'
+ },
+ {
+ path: 'classContents/new',
+ loadChildren: '../openaireLibrary/dashboard/divhelpcontent/new-div-help-content.module#NewDivHelpContentModule',
+ pathMatch: 'full'
+ },
+ {
+ path: 'classContents/edit',
+ loadChildren: '../openaireLibrary/dashboard/divhelpcontent/edit-div-help-content.module#EditDivHelpContentModule',
+ pathMatch: 'full'
+ },*/
{
path: 'helptexts',
loadChildren: '../openaireLibrary/dashboard/helpTexts/page-help-contents.module#PageHelpContentsModule',
@@ -30,7 +30,7 @@ import {RouterModule} from '@angular/router';
},
{
path: 'helptexts/edit',
- loadChildren: '../openaireLibrary/dashboard/helpTexts/edit-page-help-content.module#EditPageHelpContentModule',
+ loadChildren: '../openaireLibrary/dashboard/helpTexts/page-help-content-form.module#PageHelpContentFormModule',
pathMatch: 'full'
},
{
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 5a32966..e7a2b57 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -25,5 +25,7 @@
[centered]="true" [properties]="properties" [showMenuItems]="true">
+
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 4fe323c..c03b87e 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -2,7 +2,7 @@ import {ChangeDetectorRef, Component, HostListener, OnDestroy, OnInit} from '@an
import {ActivatedRoute, NavigationEnd, Params, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
-import {Session, User} from './openaireLibrary/login/utils/helper.class';
+import {Role, Session, User} from './openaireLibrary/login/utils/helper.class';
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
import {StakeholderService} from "./openaireLibrary/monitor/services/stakeholder.service";
import {BehaviorSubject, Subscriber} from "rxjs";
@@ -14,6 +14,8 @@ 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";
+import {StakeholderUtils} from "./utils/indicator-utils";
@Component({
@@ -33,6 +35,9 @@ export class AppComponent implements OnInit, OnDestroy {
sideBarItems: MenuItem[] = [];
specialSideBarMenuItem: MenuItem = null;
menuItems: RootMenuItem[] = [];
+ notificationGroups: Option[] = [];
+ notificationGroupsInitialized: boolean = false;
+ stakeholderUtils: StakeholderUtils = new StakeholderUtils();
menuHeader: Header = {
route: "/",
url: null,
@@ -169,10 +174,32 @@ export class AppComponent implements OnInit, OnDestroy {
this.user = user;
if (user) {
this.buildMenu();
+ if(!this.notificationGroupsInitialized && this.properties.environment === 'development') {
+ this.setNotificationGroups();
+ }
}
}));
}
+ public setNotificationGroups() {
+ this.notificationGroups = [];
+ if(Session.isPortalAdministrator(this.user)) {
+ this.notificationGroups.push({value: Role.PORTAL_ADMIN, label: 'Portal Administrators'});
+ }
+ for(let type of this.stakeholderUtils.types) {
+ if(Session.isCurator(type.value, this.user) || Session.isPortalAdministrator(this.user)) {
+ this.notificationGroups.push({value: Role.curator(type.value), label: type.label + ' Curators'});
+ }
+ }
+ this.subscriptions.push(this.stakeholderService.getMyStakeholders(this.properties.monitorServiceAPIURL).subscribe(stakeholders => {
+ stakeholders.forEach(stakeholder => {
+ this.notificationGroups.push({value: Role.manager(stakeholder.type, stakeholder.alias), label: stakeholder.name + ' Managers'});
+ this.notificationGroups.push({value: Role.member(stakeholder.type, stakeholder.alias), label: stakeholder.name + ' Members'});
+ });
+ this.notificationGroupsInitialized = true;
+ }));
+ }
+
public ngOnDestroy() {
this.subscriptions.forEach(value => {
if (value instanceof Subscriber) {
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index f85c363..476b8f9 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -24,6 +24,7 @@ import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-int
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
import {AdminDashboardGuard} from "./utils/adminDashboard.guard";
+import {NotificationsSidebarModule} from "./openaireLibrary/notifications/notifications-sidebar/notifications-sidebar.module";
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
@NgModule({
@@ -41,7 +42,7 @@ import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
BrowserModule.withServerTransition({appId: 'my-app'}),
AppRoutingModule,
BrowserTransferStateModule,
- SideBarModule, Schema2jsonldModule, RoleVerificationModule, LoadingModule
+ SideBarModule, Schema2jsonldModule, RoleVerificationModule, LoadingModule, NotificationsSidebarModule
],
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],
diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts
index 2848db4..edfdf6b 100644
--- a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts
+++ b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input, OnDestroy} from "@angular/core";
+import {Component, Input, OnDestroy, ViewChild} from "@angular/core";
import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
import {StakeholderUtils} from "../../utils/indicator-utils";
@@ -8,99 +8,98 @@ import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properti
import {properties} from "../../../environments/environment";
import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service";
import {UtilitiesService} from "../../openaireLibrary/services/utilities.service";
-import {Session, User} from "../../openaireLibrary/login/utils/helper.class";
+import {Role, Session, User} from "../../openaireLibrary/login/utils/helper.class";
import {UserManagementService} from "../../openaireLibrary/services/user-management.service";
import {StringUtils} from "../../openaireLibrary/utils/string-utils.class";
+import {NotifyFormComponent} from "../../openaireLibrary/notifications/notify-form/notify-form.component";
+import {NotificationUtils} from "../../openaireLibrary/notifications/notification-utils";
+import {Notification} from "../../openaireLibrary/notifications/notifications";
declare var UIkit;
@Component({
selector: 'edit-stakeholder',
template: `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-