+
-
+
-
-
-
+
+
+
You are currently in a "Preview" mode. The current view of this dashboard may differ.
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 9a56bbf..1568ebe 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -18,7 +18,7 @@ import {LinksResolver} from "./search/links-resolver";
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
import {properties} from "../environments/environment";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
-import {StakeholderUtils} from "./utils/indicator-utils";
+import {StakeholderUtils} from "./openaireLibrary/monitor-admin/utils/indicator-utils";
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
import {ResourcesService} from "./openaireLibrary/monitor/services/resources.service";
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 7a3c945..d1594e6 100755
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,4 +1,4 @@
-import {NgModule} from '@angular/core';
+import {APP_ID, NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {CommonModule} from '@angular/common';
import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http";
@@ -21,7 +21,6 @@ import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
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";
@@ -29,7 +28,8 @@ import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
import {IconsModule} from "./openaireLibrary/utils/icons/icons.module";
import {IconsService} from "./openaireLibrary/utils/icons/icons.service";
import {incognito} from "./openaireLibrary/utils/icons/icons";
-import {CacheIndicatorsModule} from "./cache-indicators/cache-indicators.module";
+import {AdminDashboardGuard} from "./openaireLibrary/monitor-admin/utils/adminDashboard.guard";
+import {CacheIndicatorsModule} from "./openaireLibrary/monitor-admin/utils/cache-indicators/cache-indicators.module";
@NgModule({
@@ -43,13 +43,14 @@ import {CacheIndicatorsModule} from "./cache-indicators/cache-indicators.module"
NavigationBarModule,
BottomModule,
CookieLawModule,
- BrowserModule.withServerTransition({appId: 'serverApp'}),
+ BrowserModule,
AppRoutingModule,
SideBarModule, Schema2jsonldModule, RoleVerificationModule, LoadingModule, NotificationsSidebarModule, IconsModule, CacheIndicatorsModule
],
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],
providers: [
+ {provide: APP_ID, useValue: 'monitor-dashboard'},
AdminLoginGuard, AdminDashboardGuard, LoginGuard,
{
provide: HTTP_INTERCEPTORS,
diff --git a/src/app/cache-indicators/cache-indicators.component.less b/src/app/cache-indicators/cache-indicators.component.less
deleted file mode 100644
index 08d5c2a..0000000
--- a/src/app/cache-indicators/cache-indicators.component.less
+++ /dev/null
@@ -1,9 +0,0 @@
-@import (reference) "~src/assets/openaire-theme/less/_import-variables.less";
-
-.cache-progress {
- position: fixed;
- bottom: 0;
- right: 0;
- transform: translate(-50%, -50%);
- z-index: @global-z-index;
-}
diff --git a/src/app/cache-indicators/cache-indicators.component.ts b/src/app/cache-indicators/cache-indicators.component.ts
deleted file mode 100644
index 9a485ba..0000000
--- a/src/app/cache-indicators/cache-indicators.component.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import {Component, Inject, Input, OnChanges, OnDestroy, OnInit, PLATFORM_ID, SimpleChanges} from "@angular/core";
-import {Report} from "../../cache-indicators";
-import {CacheIndicatorsService} from "../utils/services/cache-indicators.service";
-import {interval, Subject, Subscription} from "rxjs";
-import {map, switchMap, takeUntil} from "rxjs/operators";
-
-@Component({
- selector: 'cache-indicators',
- template: `
-
- `,
- styleUrls: ['cache-indicators.component.less']
-})
-export class CacheIndicatorsComponent implements OnInit, OnChanges, OnDestroy {
- report: Report;
- subscriptions: Subscription[] = [];
- interval: number = 10000;
- readonly destroy$ = new Subject();
- @Input() alias: string;
-
- constructor(private cacheIndicatorsService: CacheIndicatorsService,
- @Inject(PLATFORM_ID) private platformId) {
- }
-
- ngOnInit() {
- this.getReport();
- }
-
- ngOnChanges(changes: SimpleChanges) {
- if(changes.alias) {
- this.getReport();
- }
- }
-
- getReport() {
- this.clear();
- this.subscriptions.push(this.cacheIndicatorsService.getReport(this.alias).subscribe(report => {
- this.getReportInterval(report);
- }));
- }
-
- getReportInterval(report: Report) {
- if(this.isBrowser && (this.report || !report?.completed)) {
- this.report = report;
- this.subscriptions.push(interval(this.interval).pipe(
- map(() => this.cacheIndicatorsService.getReport(this.alias)),
- switchMap(report => report),
- takeUntil(this.destroy$)).subscribe(report => {
- console.log(this.alias);
- this.report = report;
- if(this.report.completed) {
- this.destroy$.next();
- }
- }));
- }
- }
-
- clear() {
- this.subscriptions.forEach(subscription => {
- subscription.unsubscribe();
- })
- this.report = null;
- }
-
-
- get isBrowser() {
- return this.platformId === 'browser';
- }
-
- ngOnDestroy() {
- this.clear();
- }
-}
diff --git a/src/app/cache-indicators/cache-indicators.module.ts b/src/app/cache-indicators/cache-indicators.module.ts
deleted file mode 100644
index aa9cd99..0000000
--- a/src/app/cache-indicators/cache-indicators.module.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import {NgModule} from "@angular/core";
-import {CommonModule} from "@angular/common";
-import {CacheIndicatorsComponent} from "./cache-indicators.component";
-import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
-
-@NgModule({
- imports: [CommonModule, IconsModule],
- declarations: [CacheIndicatorsComponent],
- exports: [CacheIndicatorsComponent]
-})
-export class CacheIndicatorsModule {}
diff --git a/src/app/develop/develop.component.ts b/src/app/develop/develop.component.ts
index 6a7b6e5..0847e04 100644
--- a/src/app/develop/develop.component.ts
+++ b/src/app/develop/develop.component.ts
@@ -6,7 +6,7 @@ import {Meta, Title} from "@angular/platform-browser";
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {properties} from "../../environments/environment";
import {Router} from "@angular/router";
-import {StakeholderUtils} from "../utils/indicator-utils";
+import {StakeholderUtils} from "../openaireLibrary/monitor-admin/utils/indicator-utils";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.component.less b/src/app/general/edit-stakeholder/edit-stakeholder.component.less
deleted file mode 100644
index e5f71cd..0000000
--- a/src/app/general/edit-stakeholder/edit-stakeholder.component.less
+++ /dev/null
@@ -1,10 +0,0 @@
-.uk-border-circle {
- width: 100px;
- height: 100px;
- position: relative;
-
- & > img {
- max-width: 64px;
- max-height: 64px;
- }
-}
diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts b/src/app/general/edit-stakeholder/edit-stakeholder.component.ts
deleted file mode 100644
index 93c418b..0000000
--- a/src/app/general/edit-stakeholder/edit-stakeholder.component.ts
+++ /dev/null
@@ -1,443 +0,0 @@
-import {Component, Input, OnDestroy, ViewChild} from "@angular/core";
-import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
-import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms";
-import {StakeholderUtils} from "../../utils/indicator-utils";
-import {Option} from "../../openaireLibrary/sharedComponents/input/input.component";
-import {Subscription} from "rxjs";
-import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
-import {properties} from "../../../environments/environment";
-import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service";
-import {UtilitiesService} from "../../openaireLibrary/services/utilities.service";
-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";
-import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler";
-import {StatsProfilesService} from "../../utils/services/stats-profiles.service";
-
-@Component({
- selector: 'edit-stakeholder',
- template: `
-
-
- `,
- styleUrls: ['edit-stakeholder.component.less']
-})
-export class EditStakeholderComponent implements OnDestroy {
- @Input()
- public disableAlias: boolean = false;
- public stakeholderFb: UntypedFormGroup;
- public secure: boolean = false;
- public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
- public defaultStakeholdersOptions: Option[];
- public defaultStakeholders: Stakeholder[];
- public alias: string[];
- public stakeholder: Stakeholder;
- public isDefault: boolean;
- public isNew: boolean;
- public loading: boolean = false;
- public types: Option[];
- public statsProfiles: string[];
- public properties: EnvProperties = properties;
- private subscriptions: any[] = [];
- /**
- * Photo upload
- * */
- public file: File;
- public photo: string | ArrayBuffer;
- public uploadError: string;
- public deleteCurrentPhoto: boolean = false;
- private maxsize: number = 200 * 1024;
- user: User;
- @ViewChild('notify', {static: true}) notify: NotifyFormComponent;
- private notification: Notification;
-
- constructor(private fb: UntypedFormBuilder,
- private stakeholderService: StakeholderService,
- private statsProfileService: StatsProfilesService,
- private utilsService: UtilitiesService, private userManagementService: UserManagementService,) {
- }
-
- ngOnDestroy() {
- this.reset();
- }
-
- public init(stakeholder: Stakeholder, alias: string[], defaultStakeholders: Stakeholder[], isDefault: boolean, isNew: boolean) {
- this.reset();
- this.deleteCurrentPhoto = false;
- this.stakeholder = stakeholder;
- this.alias = alias;
- this.defaultStakeholders = defaultStakeholders;
- this.isDefault = isDefault;
- this.isNew = isNew;
- this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
- this.user = user;
- if (this.isCurator) {
- this.subscriptions.push(this.statsProfileService.getStatsProfiles().subscribe(statsProfiles => {
- this.statsProfiles = statsProfiles;
- }, error => {
- this.statsProfiles = [];
- }));
- } else {
- this.statsProfiles = [];
- }
- this.types = this.stakeholderUtils.getTypesByUserRoles(this.user, this.stakeholder.alias);
- this.stakeholderFb = this.fb.group({
- _id: this.fb.control(this.stakeholder._id),
- defaultId: this.fb.control(this.stakeholder.defaultId),
- name: this.fb.control(this.stakeholder.name, Validators.required),
- description: this.fb.control(this.stakeholder.description),
- index_name: this.fb.control(this.stakeholder.index_name, Validators.required),
- index_id: this.fb.control(this.stakeholder.index_id, Validators.required),
- index_shortName: this.fb.control(this.stakeholder.index_shortName, Validators.required),
- statsProfile: this.fb.control(this.stakeholder.statsProfile, Validators.required),
- locale: this.fb.control(this.stakeholder.locale, Validators.required),
- projectUpdateDate: this.fb.control(this.stakeholder.projectUpdateDate),
- creationDate: this.fb.control(this.stakeholder.creationDate),
- alias: this.fb.control(this.stakeholder.alias,
- [
- Validators.required,
- this.stakeholderUtils.aliasValidatorString(
- this.alias.filter(alias => alias !== this.stakeholder.alias)
- )]
- ),
- isDefault: this.fb.control((this.isDefault)),
- visibility: this.fb.control(this.stakeholder.visibility, Validators.required),
- type: this.fb.control(this.stakeholder.type, Validators.required),
- topics: this.fb.control(this.stakeholder.topics),
- isUpload: this.fb.control(this.stakeholder.isUpload),
- logoUrl: this.fb.control(this.stakeholder.logoUrl),
- });
- if (this.stakeholder.isUpload) {
- this.stakeholderFb.get('logoUrl').clearValidators();
- this.stakeholderFb.get('logoUrl').updateValueAndValidity();
- } else {
- this.stakeholderFb.get('logoUrl').setValidators([StringUtils.urlValidator()]);
- this.stakeholderFb.get('logoUrl').updateValueAndValidity();
- }
- this.subscriptions.push(this.stakeholderFb.get('isUpload').valueChanges.subscribe(value => {
- if (value == true) {
- this.stakeholderFb.get('logoUrl').clearValidators();
- this.stakeholderFb.updateValueAndValidity();
- } else {
- this.stakeholderFb.get('logoUrl').setValidators([StringUtils.urlValidator()]);
- this.stakeholderFb.updateValueAndValidity();
- }
- }));
- this.secure = (!this.stakeholderFb.get('logoUrl').value || this.stakeholderFb.get('logoUrl').value.includes('https://'));
- this.subscriptions.push(this.stakeholderFb.get('logoUrl').valueChanges.subscribe(value => {
- this.secure = (!value || value.includes('https://'));
- }));
- this.initPhoto();
- this.subscriptions.push(this.stakeholderFb.get('type').valueChanges.subscribe(value => {
- this.onTypeChange(value, defaultStakeholders);
- }));
- this.stakeholderFb.setControl('defaultId', this.fb.control(stakeholder.defaultId, (this.isDefault && !this.isNew)?[]:Validators.required));
- if (!this.isNew) {
- this.notification = NotificationUtils.editStakeholder(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name);
- this.notify.reset(this.notification.message);
- if (this.isAdmin) {
- if (this.disableAlias) {
- setTimeout(() => {
- this.stakeholderFb.get('alias').disable();
- }, 0);
- }
- } else {
- if (!this.isCurator) {
- setTimeout(() => {
- this.stakeholderFb.get('statsProfile').disable();
- }, 0);
- }
- setTimeout(() => {
- this.stakeholderFb.get('alias').disable();
- this.stakeholderFb.get('index_id').disable();
- this.stakeholderFb.get('index_name').disable();
- this.stakeholderFb.get('index_shortName').disable();
- }, 0);
- }
- setTimeout(() => {
- this.stakeholderFb.get('type').disable();
- }, 0);
- } else {
- this.notification = NotificationUtils.createStakeholder(this.user.firstname + ' ' + this.user.lastname);
- this.notify.reset(this.notification.message);
- setTimeout(() => {
- this.stakeholderFb.get('type').enable();
- }, 0);
- }
- }));
- }
-
- public get isAdmin() {
- return Session.isPortalAdministrator(this.user);
- }
-
- public get isCurator() {
- return this.stakeholder && (this.isAdmin || Session.isCurator(this.stakeholder.type, this.user));
- }
-
- public get disabled(): boolean {
- return (this.stakeholderFb && this.stakeholderFb.invalid) ||
- (this.stakeholderFb && this.stakeholderFb.pristine && !this.isNew && !this.file) ||
- (this.uploadError && this.uploadError.length > 0);
- }
-
- public get dirty(): boolean {
- return this.stakeholderFb && this.stakeholderFb.dirty;
- }
-
- public get canChooseTemplate(): boolean {
- return this.isNew && this.stakeholderFb.get('type').valid && !!this.defaultStakeholdersOptions;
- }
-
- reset() {
- this.uploadError = null;
- this.stakeholderFb = null;
- this.subscriptions.forEach(subscription => {
- if (subscription instanceof Subscription) {
- subscription.unsubscribe();
- }
- });
- }
-
- onTypeChange(value, defaultStakeholders: Stakeholder[]) {
- this.stakeholderFb.setControl('defaultId', this.fb.control(this.stakeholder.defaultId, (this.isDefault && !this.isNew)?[]:Validators.required));
- this.defaultStakeholdersOptions = [{
- label: 'New blank profile',
- value: '-1'
- }];
- defaultStakeholders.filter(stakeholder => stakeholder.type === value).forEach(stakeholder => {
- this.defaultStakeholdersOptions.push({
- label: 'Use ' + stakeholder.name + ' profile',
- value: stakeholder._id
- })
- });
- }
-
- public save(callback: Function, errorCallback: Function = null) {
- this.loading = true;
- if (this.file) {
- this.subscriptions.push(this.utilsService.uploadPhoto(this.properties.utilsService + "/upload/" + encodeURIComponent(this.stakeholderFb.getRawValue().type) + "/" + encodeURIComponent(this.stakeholderFb.getRawValue().alias), this.file).subscribe(res => {
- this.deletePhoto();
- this.stakeholderFb.get('logoUrl').setValue(res.filename);
- this.removePhoto();
- this.saveStakeholder(callback, errorCallback);
- }, error => {
- this.uploadError = "An error has been occurred during upload your image. Try again later";
- this.saveStakeholder(callback, errorCallback);
- }));
- } else if (this.deleteCurrentPhoto) {
- this.deletePhoto();
- this.saveStakeholder(callback, errorCallback);
- } else {
- this.saveStakeholder(callback, errorCallback);
- }
- }
-
- public saveStakeholder(callback: Function, errorCallback: Function = null) {
- if (this.isNew) {
- let defaultStakeholder = this.defaultStakeholders.find(value => value._id === this.stakeholderFb.getRawValue().defaultId);
- this.stakeholderFb.setValue(this.stakeholderUtils.createFunderFromDefaultProfile(this.stakeholderFb.getRawValue(),
- (defaultStakeholder ? defaultStakeholder.topics : []), this.stakeholderFb.getRawValue().isDefault));
- this.removePhoto();
- if(this.stakeholderFb.getRawValue().isDefault) {
- this.stakeholderFb.get('defaultId').setValue(null);
- }
- this.subscriptions.push(this.stakeholderService.buildStakeholder(this.properties.monitorServiceAPIURL,
- this.stakeholderFb.getRawValue()).subscribe(stakeholder => {
- this.notification.entity = stakeholder._id;
- this.notification.stakeholder = stakeholder.alias;
- this.notification.stakeholderType = stakeholder.type;
- this.notification.groups = [Role.curator(stakeholder.type)];
- this.notify.sendNotification(this.notification);
- NotificationHandler.rise(stakeholder.name + ' has been
successfully created');
- callback(stakeholder);
- this.loading = false;
- }, error => {
- NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
- if (errorCallback) {
- errorCallback(error)
- }
- this.loading = false;
- }));
- } else {
- this.subscriptions.push(this.stakeholderService.saveElement(this.properties.monitorServiceAPIURL, this.stakeholderFb.getRawValue()).subscribe(stakeholder => {
- this.notification.entity = stakeholder._id;
- this.notification.stakeholder = stakeholder.alias;
- this.notification.stakeholderType = stakeholder.type;
- this.notification.groups = [Role.curator(stakeholder.type), Role.manager(stakeholder.type, stakeholder.alias)];
- this.notify.sendNotification(this.notification);
- NotificationHandler.rise(stakeholder.name + ' has been
successfully saved');
- callback(stakeholder);
- this.loading = false;
- }, error => {
- NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
- if (errorCallback) {
- errorCallback(error)
- }
- this.loading = false;
- }));
- }
- }
-
- fileChangeEvent(event) {
- if (event.target.files && event.target.files[0]) {
- this.file = event.target.files[0];
- if (this.file.type !== 'image/png' && this.file.type !== 'image/jpeg') {
- this.uploadError = 'You must choose a file with type: image/png or image/jpeg!';
- this.stakeholderFb.get('isUpload').setValue(false);
- this.stakeholderFb.get('isUpload').markAsDirty();
- this.removePhoto();
- } else if (this.file.size > this.maxsize) {
- this.uploadError = 'File exceeds size\'s limit! Maximum resolution is 256x256 pixels.';
- this.stakeholderFb.get('isUpload').setValue(false);
- this.stakeholderFb.get('isUpload').markAsDirty();
- this.removePhoto();
- } else {
- this.uploadError = null;
- const reader = new FileReader();
- reader.readAsDataURL(this.file);
- reader.onload = () => {
- this.photo = reader.result;
- this.stakeholderFb.get('isUpload').setValue(true);
- this.stakeholderFb.get('isUpload').markAsDirty();
- };
- }
- }
- }
-
- initPhoto() {
- if (this.stakeholderFb.getRawValue().isUpload) {
- this.photo = this.properties.utilsService + "/download/" + this.stakeholderFb.get('logoUrl').value;
- }
- }
-
- removePhoto() {
- if (this.file) {
- if (typeof document != 'undefined') {
- (
document.getElementById("photo")).value = "";
- }
- this.initPhoto();
- this.file = null;
- }
- }
-
- remove() {
- this.stakeholderFb.get('isUpload').setValue(false);
- this.stakeholderFb.get('isUpload').markAsDirty();
- this.removePhoto();
- this.stakeholderFb.get('logoUrl').setValue(null);
- if (this.stakeholder.isUpload) {
- this.deleteCurrentPhoto = true;
- }
- }
-
- public deletePhoto() {
- if (this.stakeholder.logoUrl && this.stakeholder.isUpload) {
- this.subscriptions.push(this.utilsService.deletePhoto(this.properties.utilsService + '/delete/' +
- encodeURIComponent(this.stakeholder.type) + "/" + encodeURIComponent(this.stakeholder.alias) + "/" + this.stakeholder.logoUrl).subscribe());
- }
- }
-}
diff --git a/src/app/general/edit-stakeholder/edit-stakeholder.module.ts b/src/app/general/edit-stakeholder/edit-stakeholder.module.ts
deleted file mode 100644
index 6f08416..0000000
--- a/src/app/general/edit-stakeholder/edit-stakeholder.module.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import {NgModule} from "@angular/core";
-import {EditStakeholderComponent} from "./edit-stakeholder.component";
-import {CommonModule} from "@angular/common";
-import {InputModule} from "../../openaireLibrary/sharedComponents/input/input.module";
-import {ReactiveFormsModule} from "@angular/forms";
-import {IconsModule} from "../../openaireLibrary/utils/icons/icons.module";
-import {NotifyFormModule} from "../../openaireLibrary/notifications/notify-form/notify-form.module";
-
-@NgModule({
- imports: [CommonModule, InputModule, ReactiveFormsModule, IconsModule, NotifyFormModule],
- declarations: [EditStakeholderComponent],
- exports: [EditStakeholderComponent]
-})
-export class EditStakeholderModule {}
diff --git a/src/app/general/general-routing.module.ts b/src/app/general/general-routing.module.ts
deleted file mode 100644
index 0dec748..0000000
--- a/src/app/general/general-routing.module.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import {NgModule} from '@angular/core';
-import {RouterModule} from '@angular/router';
-import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
-import {GeneralComponent} from "./general.component";
-
-@NgModule({
- imports: [
- RouterModule.forChild([
- {
- path: '',
- component: GeneralComponent,
- canDeactivate: [PreviousRouteRecorder],
- data: {hasSidebar: true}
- }
- ])
- ]
-})
-export class GeneralRoutingModule {
-}
diff --git a/src/app/general/general.component.html b/src/app/general/general.component.html
deleted file mode 100644
index b6617a5..0000000
--- a/src/app/general/general.component.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
diff --git a/src/app/general/general.component.ts b/src/app/general/general.component.ts
deleted file mode 100644
index 03045f0..0000000
--- a/src/app/general/general.component.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from "@angular/core";
-import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
-import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
-import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder";
-import { Subscription, zip} from "rxjs";
-import {EditStakeholderComponent} from "./edit-stakeholder/edit-stakeholder.component";
-import {properties} from "../../environments/environment";
-import {Title} from "@angular/platform-browser";
-
-@Component({
- selector: 'general',
- templateUrl: "./general.component.html"
-})
-export class GeneralComponent implements OnInit, OnDestroy {
-
- public stakeholder: Stakeholder;
- public alias: string[];
- public properties: EnvProperties = properties;
- public defaultStakeholders: Stakeholder[];
- public loading: boolean = false;
- private subscriptions: any[] = [];
- @ViewChild('editStakeholderComponent') editStakeholderComponent: EditStakeholderComponent;
-
- constructor(private stakeholderService: StakeholderService,
- private cdr: ChangeDetectorRef,
- private title: Title) {
- }
-
- ngOnInit() {
- this.loading = true;
- this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
- this.stakeholder = stakeholder;
- this.cdr.detectChanges();
- if(this.stakeholder) {
- this.title.setTitle(this.stakeholder.name + " | General");
- let data = zip(
- this.stakeholderService.getDefaultStakeholders(this.properties.monitorServiceAPIURL),
- this.stakeholderService.getAlias(this.properties.monitorServiceAPIURL)
- );
- this.subscriptions.push(data.subscribe(res => {
- this.defaultStakeholders = res[0];
- this.alias = res[1];
- this.reset();
- this.loading = false;
- }));
- }
- }));
- }
-
- public reset() {
- this.editStakeholderComponent.init(this.stakeholder, this.alias, this.defaultStakeholders, this.stakeholder.defaultId == null, false)
- }
-
-
- public save() {
- this.loading = true;
- this.editStakeholderComponent.save((stakeholder) => {
- this.stakeholder = stakeholder;
- this.stakeholderService.setStakeholder(this.stakeholder);
- this.reset();
- this.loading = false;
- }, (error) => {
- console.error(error);
- this.loading = false;
- });
- }
-
- ngOnDestroy() {
- this.subscriptions.forEach(subscription => {
- if(subscription instanceof Subscription) {
- subscription.unsubscribe();
- }
- });
- }
-}
diff --git a/src/app/general/general.module.ts b/src/app/general/general.module.ts
deleted file mode 100644
index 054c309..0000000
--- a/src/app/general/general.module.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import {NgModule} from "@angular/core";
-import {GeneralComponent} from "./general.component";
-import {GeneralRoutingModule} from "./general-routing.module";
-import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
-import {CommonModule} from "@angular/common";
-import {RouterModule} from "@angular/router";
-import {InputModule} from "../openaireLibrary/sharedComponents/input/input.module";
-import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
-import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
-import {ReactiveFormsModule} from "@angular/forms";
-import {EditStakeholderModule} from "./edit-stakeholder/edit-stakeholder.module";
-import {PageContentModule} from "../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
-import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module";
-import {
- SidebarMobileToggleModule
-} from "../openaireLibrary/dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
-
-@NgModule({
- declarations: [GeneralComponent],
- imports: [
- GeneralRoutingModule,
- CommonModule,
- RouterModule,
- InputModule,
- LoadingModule,
- AlertModalModule,
- ReactiveFormsModule,
- EditStakeholderModule,
- PageContentModule,
- LogoUrlPipeModule,
- SidebarMobileToggleModule
- ],
- providers: [
- PreviousRouteRecorder,
- ],
- exports: [GeneralComponent]
-})
-export class GeneralModule {
-
-}
diff --git a/src/app/manageStakeholders/manageStakeholders.component.ts b/src/app/manageStakeholders/manageStakeholders.component.ts
index 90cccdc..094e045 100644
--- a/src/app/manageStakeholders/manageStakeholders.component.ts
+++ b/src/app/manageStakeholders/manageStakeholders.component.ts
@@ -3,17 +3,17 @@ import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholde
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {Stakeholder, StakeholderEntities, Visibility} from "../openaireLibrary/monitor/entities/stakeholder";
import {Subscriber, zip} from "rxjs";
-import {StakeholderUtils} from "../utils/indicator-utils";
+import {StakeholderUtils} from "../openaireLibrary/monitor-admin/utils/indicator-utils";
import {UntypedFormBuilder, UntypedFormGroup} from "@angular/forms";
import {AlertModal} from "../openaireLibrary/utils/modal/alert";
import {Option} from "../openaireLibrary/sharedComponents/input/input.component";
import {Title} from "@angular/platform-browser";
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
import {Session} from "../openaireLibrary/login/utils/helper.class";
-import {EditStakeholderComponent} from "../general/edit-stakeholder/edit-stakeholder.component";
+import {EditStakeholderComponent} from "../openaireLibrary/monitor-admin/general/edit-stakeholder/edit-stakeholder.component";
import {properties} from "../../environments/environment";
import {ActivatedRoute} from "@angular/router";
-import {CacheIndicatorsService} from "../utils/services/cache-indicators.service";
+import {CacheIndicatorsService} from "../openaireLibrary/monitor-admin/utils/cache-indicators/cache-indicators.service";
import {NotificationHandler} from "../openaireLibrary/utils/notification-handler";
type Tab = 'all' | 'templates'| 'profiles';
diff --git a/src/app/manageStakeholders/manageStakeholders.module.ts b/src/app/manageStakeholders/manageStakeholders.module.ts
index 612c671..230c644 100644
--- a/src/app/manageStakeholders/manageStakeholders.module.ts
+++ b/src/app/manageStakeholders/manageStakeholders.module.ts
@@ -8,7 +8,6 @@ import {InputModule} from "../openaireLibrary/sharedComponents/input/input.modul
import {LoadingModule} from "../openaireLibrary/utils/loading/loading.module";
import {AlertModalModule} from "../openaireLibrary/utils/modal/alertModal.module";
import {ReactiveFormsModule} from "@angular/forms";
-import {EditStakeholderModule} from "../general/edit-stakeholder/edit-stakeholder.module";
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
import {IconsService} from "../openaireLibrary/utils/icons/icons.service";
import {earth, incognito, restricted} from "../openaireLibrary/utils/icons/icons";
@@ -19,6 +18,7 @@ import {
SidebarMobileToggleModule
} from "../openaireLibrary/dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module";
import {SliderTabsModule} from "../openaireLibrary/sharedComponents/tabs/slider-tabs.module";
+import {EditStakeholderModule} from "../openaireLibrary/monitor-admin/general/edit-stakeholder/edit-stakeholder.module";
@NgModule({
declarations: [ManageStakeholdersComponent],
diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html
index 84ff408..6733d43 100644
--- a/src/app/monitor/monitor.component.html
+++ b/src/app/monitor/monitor.component.html
@@ -277,14 +277,14 @@