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 2cba4e7..ac26813 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -24,6 +24,9 @@ import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
import {ResourcesService} from "./openaireLibrary/monitor/services/resources.service";
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
+import {
+ NotificationConfiguration
+} from "./openaireLibrary/notifications/notifications-sidebar/notifications-sidebar.component";
@Component({
@@ -41,13 +44,13 @@ export class AppComponent implements OnInit, OnDestroy {
hasAdminMenu: boolean = false;
hasInternalSidebar: boolean = false;
isFrontPage: boolean = false;
+ isMobile: boolean = false;
view: Visibility;
sideBarItems: MenuItem[] = [];
backItem: MenuItem = null;
menuItems: MenuItem[] = [];
- notificationGroups: Option[] = [];
- entities: string[];
notificationGroupsInitialized: boolean = false;
+ notificationConfiguration: NotificationConfiguration = new NotificationConfiguration();
stakeholderUtils: StakeholderUtils = new StakeholderUtils();
public stakeholderEntities = StakeholderEntities;
menuHeader: Header = {
@@ -118,6 +121,10 @@ export class AppComponent implements OnInit, OnDestroy {
this.isFrontPage = isFrontPage;
this.cdr.detectChanges();
}));
+ this.subscriptions.push(this.layoutService.isMobile.subscribe(isMobile => {
+ this.isMobile = isMobile;
+ this.cdr.detectChanges();
+ }));
this.route.queryParams.subscribe(params => {
this.view = params['view'];
if(this.stakeholder) {
@@ -132,16 +139,16 @@ export class AppComponent implements OnInit, OnDestroy {
}
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
- this.updateStakeholder = true;
+ this.updateStakeholder = !this.router.url.includes('user-info');
if (user) {
this.user = user;
if (!this.notificationGroupsInitialized) {
- this.setNotificationGroups();
+ this.setNotificationConfiguration();
}
} else if(this.user) {
this.user = user;
this.notificationGroupsInitialized = false;
- this.notificationGroups = [];
+ this.notificationConfiguration.availableGroups = [];
}
if(this.paramsSubscription) {
this.paramsSubscription.unsubscribe();
@@ -201,26 +208,27 @@ export class AppComponent implements OnInit, OnDestroy {
}
}
- public setNotificationGroups() {
- this.entities = this.stakeholderUtils.types.map(option => option.value);
- this.notificationGroups = [];
+ public setNotificationConfiguration() {
+ this.notificationConfiguration.entities = this.stakeholderUtils.types.map(option => option.value);
+ this.notificationConfiguration.service = 'monitor';
+ this.notificationConfiguration.availableGroups = [];
if (Session.isPortalAdministrator(this.user)) {
- this.notificationGroups.push({value: Role.PORTAL_ADMIN, label: 'Portal Administrators'});
+ this.notificationConfiguration.availableGroups.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.notificationGroups.push({value: Role.typeManager(type.value), label: type.label + ' Managers'});
- this.notificationGroups.push({value: Role.typeMember(type.value), label: type.label + ' Members'});
+ this.notificationConfiguration.availableGroups.push({value: Role.curator(type.value), label: type.label + ' Curators'});
+ this.notificationConfiguration.availableGroups.push({value: Role.typeManager(type.value), label: type.label + ' Managers'});
+ this.notificationConfiguration.availableGroups.push({value: Role.typeMember(type.value), label: type.label + ' Members'});
}
}
this.subscriptions.push(this.stakeholderService.getMyStakeholders(this.properties.monitorServiceAPIURL).subscribe(stakeholders => {
stakeholders.forEach(stakeholder => {
- this.notificationGroups.push({
+ this.notificationConfiguration.availableGroups.push({
value: Role.manager(stakeholder.type, stakeholder.alias),
label: stakeholder.name + ' Managers'
});
- this.notificationGroups.push({
+ this.notificationConfiguration.availableGroups.push({
value: Role.member(stakeholder.type, stakeholder.alias),
label: stakeholder.name + ' Members'
});
@@ -295,11 +303,11 @@ export class AppComponent implements OnInit, OnDestroy {
}
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'}));
+ this.adminMenuItems.push(new MenuItem("indicators", "Indicators", "", "/admin/" + this.stakeholder.alias + '/indicators', false, [], [], {}, {name: 'bar_chart'}, null, "uk-visible@m"));
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"));
+ this.adminMenuItems.push(new MenuItem("users", "Users", "", "/admin/" + this.stakeholder.alias + "/users", false, [], [], {}, {name: 'group'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/users"));
if (this.isCurator()) {
- 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.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/admin-tools"));
}
}
this.backItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'west'});
@@ -316,10 +324,10 @@ export class AppComponent implements OnInit, OnDestroy {
"", "/admin", false, [], [], {}));
}
if (Session.isPortalAdministrator(this.user)) {
- this.userMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}));
+ this.userMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {},null, null, "uk-visible@m"));
}
if (this.isCurator()) {
- this.userMenuItems.push(new MenuItem("monitorOptions", "Monitor options", "", "/admin/monitor/admin-tools/pages", false, [], [], {}));
+ this.userMenuItems.push(new MenuItem("monitorOptions", "Monitor options", "", "/admin/monitor/admin-tools/pages", false, [], [], {},null, null, "uk-visible@m"));
}
}
if (this.stakeholder) {
@@ -347,7 +355,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.menuItems.push(
new MenuItem("manage", "Manage",
"", "/admin/" + this.stakeholder.alias, false, [], null, {}
- , null, null, null, null)
+ , null, null, "uk-visible@m", null)
);
}
if (!this.hasAdminMenu && this.isFrontPage) {
@@ -405,10 +413,10 @@ export class AppComponent implements OnInit, OnDestroy {
this.backItem = null;
this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
if (Session.isPortalAdministrator(this.user)) {
- this.adminMenuItems.push(new MenuItem("super_admin", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, null, '/admin/admin-tools'));
+ this.adminMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/admin-tools'));
}
if (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user)) {
- this.adminMenuItems.push(new MenuItem("monitor", "Monitor options", "", "/admin/monitor/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, null, '/admin/monitor/admin-tools'));
+ this.adminMenuItems.push(new MenuItem("monitorOptions", "Monitor options", "", "/admin/monitor/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/monitor/admin-tools'));
}
this.hasAdminMenu = this.hasAdminMenu && this.adminMenuItems.length > 1;
}
diff --git a/src/app/general/general.component.html b/src/app/general/general.component.html
index 505a149..b6617a5 100644
--- a/src/app/general/general.component.html
+++ b/src/app/general/general.component.html
@@ -1,14 +1,7 @@
-
-
-
-
Manage Profile
-
{{stakeholder.name}} (unsaved changes)
-
-
-
-
+
+