diff --git a/package.json b/package.json index c18590c..13ecf4c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "rxjs": "^6.5.1", "ts-md5": "^1.2.0", "tslib": "^2.0.0", - "uikit": "3.12.0", + "uikit": "3.12.2", "zone.js": "~0.11.4" }, "devDependencies": { diff --git a/src/app/app.component.html b/src/app/app.component.html index 6b0bc58..8b1bf09 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -6,7 +6,8 @@ [class.sidebar_mini]="!open && (hasSidebar || hasAdminMenu || hasInternalSidebar)" [class.sidebar_hover]="hover"> - +
@@ -15,8 +16,7 @@ - +
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)

-
-
-
-
+ +
diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index ce435ad..4bf9845 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -11,15 +11,18 @@ import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service"; import { - Category, Indicator, - IndicatorPath, IndicatorSize, Section, + Category, + Indicator, + IndicatorPath, + IndicatorSize, + Section, Stakeholder, SubCategory, Topic, Visibility } from "../openaireLibrary/monitor/entities/stakeholder"; import {StatisticsService} from "../utils/services/statistics.service"; -import {IndicatorUtils, StakeholderUtils} from "../utils/indicator-utils"; +import {IndicatorUtils} from "../utils/indicator-utils"; import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; import {UntypedFormBuilder, UntypedFormControl} from "@angular/forms"; import {Subscriber, Subscription} from "rxjs"; @@ -51,7 +54,6 @@ export class MonitorComponent implements OnInit, OnDestroy { public loading: boolean = true; public view: Visibility; public indicatorUtils: IndicatorUtils = new IndicatorUtils(); - public stakeholderUtils: StakeholderUtils = new StakeholderUtils(); public activeTopic: Topic = null; public activeCategory: Category = null; public activeSubCategory: SubCategory = null; @@ -78,7 +80,6 @@ export class MonitorComponent implements OnInit, OnDestroy { privateStakeholder = false; public keyword: UntypedFormControl; public statsUpdateDate: Date; - public showDescriptionOverlay: boolean[] = []; public isFullscreen: boolean = false; public isMobile: boolean = false; @@ -487,21 +488,23 @@ export class MonitorComponent implements OnInit, OnDestroy { this.subscriptions.push(this.statisticsService.getNumbers(this.statisticsService.getSourceType(pair[0]), pair[1]).subscribe(response => { if(activeSubcategory === this.activeSubCategory._id) { indexes.forEach(([i, j]) => { - let result = JSON.parse(JSON.stringify(response)); - this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => { - if (result) { - result = result[jsonPath]; - } - }); - if (typeof result === 'string' || typeof result === 'number') { - result = Number(result); - if (result === Number.NaN) { + if( this.activeSubCategory?.numbers[i]?.indicators[j]) { + let result = JSON.parse(JSON.stringify(response)); + this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => { + if (result) { + result = result[jsonPath]; + } + }); + if (typeof result === 'string' || typeof result === 'number') { + result = Number(result); + if (result === Number.NaN) { + result = 0; + } + } else { result = 0; } - } else { - result = 0; + this.numberResults.set(i + '-' + j, result); } - this.numberResults.set(i + '-' + j, result); }); } })); @@ -609,14 +612,14 @@ export class MonitorComponent implements OnInit, OnDestroy { this.userManagementService.login(); } - toggleDescriptionOverlay(event, j) { + toggleDescriptionOverlay(event, indicator: Indicator) { event.stopPropagation(); - this.showDescriptionOverlay[j] = !this.showDescriptionOverlay[j]; + indicator.descriptionOverlay = !indicator.descriptionOverlay; } - closeDescriptionOverlay(event: ClickEvent,j) { - if(event.clicked && this.showDescriptionOverlay[j]) { - this.showDescriptionOverlay[j] = false; + closeDescriptionOverlay(event: ClickEvent, indicator: Indicator) { + if(event.clicked && indicator.descriptionOverlay) { + indicator.descriptionOverlay = false; } } } diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 4c19e65..f49149c 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 4c19e65edb3db3b546eda029ea90a58298a1f0ad +Subproject commit f49149c99e7bf08179d95b56a1aac9848a850344 diff --git a/src/app/topic/topic.component.html b/src/app/topic/topic.component.html index c17d7b8..620ad35 100644 --- a/src/app/topic/topic.component.html +++ b/src/app/topic/topic.component.html @@ -189,174 +189,131 @@
-
-
-
-
-
Manage Indicators
-

{{stakeholder.name}}

+ -
-
-
-
-
Manage Users
-

{{stakeholder.name}}

-
-
  • Managers
  • Members
  • diff --git a/src/assets/common-assets b/src/assets/common-assets index 95c2b50..ca209a5 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 95c2b50a57696a80dd3dd376880f26cb21d65817 +Subproject commit ca209a54baaa2d9e0004613a68088fdcf4bee43a diff --git a/src/assets/monitor-dashboard-custom.less b/src/assets/monitor-dashboard-custom.less index a522978..f96d4f6 100644 --- a/src/assets/monitor-dashboard-custom.less +++ b/src/assets/monitor-dashboard-custom.less @@ -56,6 +56,7 @@ /* Dashboard */ @dashboard-page-content-background: @monitor-dashboard-background; @dashboard-primary-background: @monitor-color; + @dashboard-menu-section-sublist-border: fade(@monitor-color, 30%); & #filters_icon .start { stop-color: @monitor-light-color; @@ -94,6 +95,13 @@ top: 400px !important; } +@media (max-width: @breakpoint-small-max) { + #filters_switcher_toggle { + top: unset !important; + bottom: 10vh; + } +} + /* Quick fix for svgs with a class that makes their opacity: 0.5*/ svg .a { opacity: 1 !important; diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index c4e2781..aa1e6c9 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit c4e2781acc42f281265a70d6cd75616cdd6fa762 +Subproject commit aa1e6c9df390a4ba0919b5f8591374f7eec75089