From 8ad033a7316072cd82f6fa55081a07110e089077 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 30 Oct 2023 17:26:03 +0200 Subject: [PATCH 01/14] [develop | DONE | CHANGED]: Revert version of UIkit to version 3.16.14 because of parallax. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e621943..36a556c 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "rxjs": "^6.5.1", "ts-md5": "^1.2.0", "tslib": "^2.0.0", - "uikit": "3.16.24", + "uikit": "3.16.14", "zone.js": "~0.13.1" }, "devDependencies": { From 66856bbb2c17b076398e784b14a2e6d67b9bb7f8 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 30 Oct 2023 17:59:10 +0200 Subject: [PATCH 02/14] Update library --- src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index aaf970f..5af67f7 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit aaf970fae4014b0d546fdbf677c6c8a9b56c3e83 +Subproject commit 5af67f738570647ee61fb4d9ccb211bfae2890ae From caa99db22766adcbed6bae751bf631923d589de6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 14 Nov 2023 10:18:29 +0200 Subject: [PATCH 03/14] [irish-monitor | DONE]: App component: use sidebar-base component. Monitor component: use monitor-indicator-stakeholder-base component. --- src/app/app.component.ts | 72 +--- src/app/monitor/monitor.component.html | 8 +- src/app/monitor/monitor.component.ts | 515 ++----------------------- src/app/openaireLibrary | 2 +- 4 files changed, 56 insertions(+), 541 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1568ebe..cbb8682 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 "./openaireLibrary/monitor-admin/utils/indicator-utils"; +import {StakeholderConfiguration, 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"; @@ -26,6 +26,8 @@ import {StringUtils} from "./openaireLibrary/utils/string-utils.class"; import { NotificationConfiguration } from "./openaireLibrary/notifications/notifications-sidebar/notifications-sidebar.component"; +import {StakeholderBaseComponent} from "./openaireLibrary/monitor-admin/utils/stakeholder-base.component"; +import {SidebarBaseComponent} from "./openaireLibrary/dashboard/sharedComponents/sidebar/sidebar-base.component"; @Component({ @@ -33,12 +35,9 @@ import { templateUrl: './app.component.html', styleUrls: ['app.component.less'] }) -export class AppComponent implements OnInit, OnDestroy { - properties: EnvProperties = properties; +export class AppComponent extends SidebarBaseComponent implements OnInit { user: User; updateStakeholder: boolean = true; - params: BehaviorSubject = new BehaviorSubject(null); - data: BehaviorSubject = new BehaviorSubject(null); hasSidebar: boolean = false; hasHeader: boolean = false; hasAdminMenu: boolean = false; @@ -46,13 +45,10 @@ export class AppComponent implements OnInit, OnDestroy { isFrontPage: boolean = false; isMobile: boolean = false; view: Visibility; - sideBarItems: MenuItem[] = []; - backItem: MenuItem = null; menuItems: MenuItem[] = []; notificationGroupsInitialized: boolean = false; notificationConfiguration: NotificationConfiguration = new NotificationConfiguration(); stakeholderUtils: StakeholderUtils = new StakeholderUtils(); - public stakeholderEntities = StakeholderEntities; menuHeader: Header = { route: "/", url: null, @@ -73,38 +69,25 @@ export class AppComponent implements OnInit, OnDestroy { innerWidth; projectUpdate: 'danger' | 'warning'; paramsSubscription: Subscription; - private subscriptions: any[] = []; - - constructor(private route: ActivatedRoute, - private router: Router, + + constructor(protected _route: ActivatedRoute, + protected _router: Router, + protected layoutService: LayoutService, + protected cdr: ChangeDetectorRef, private userManagementService: UserManagementService, - private layoutService: LayoutService, private smoothScroll: SmoothScroll, private stakeholderService: StakeholderService, - private cdr: ChangeDetectorRef, private configurationService: ConfigurationService, private resourcesService: ResourcesService) { - this.subscriptions.push(this.router.events.subscribe(event => { - if (event instanceof NavigationEnd) { - let r = this.route; - while (r.firstChild) { - r = r.firstChild; - } - this.paramsResolved = true; - this.params.next(r.snapshot.params); - this.data.next(r.snapshot.data); - } - })); + super(); + this.initRouterParams(_route); } - + ngOnInit() { + super.ngOnInit(); if (typeof document !== 'undefined' && window) { this.innerWidth = window.innerWidth; } - this.subscriptions.push(this.layoutService.hasSidebar.subscribe(hasSidebar => { - this.hasSidebar = hasSidebar; - this.cdr.detectChanges(); - })); this.subscriptions.push(this.layoutService.hasHeader.subscribe(hasHeader => { this.hasHeader = hasHeader; this.cdr.detectChanges(); @@ -113,10 +96,6 @@ export class AppComponent implements OnInit, OnDestroy { this.hasAdminMenu = hasAdminMenu; this.cdr.detectChanges(); })); - this.subscriptions.push(this.layoutService.hasInternalSidebar.subscribe(hasInternalSidebar => { - this.hasInternalSidebar = hasInternalSidebar; - this.cdr.detectChanges(); - })); this.subscriptions.push(this.layoutService.isFrontPage.subscribe(isFrontPage => { this.isFrontPage = isFrontPage; this.cdr.detectChanges(); @@ -125,13 +104,12 @@ export class AppComponent implements OnInit, OnDestroy { this.isMobile = isMobile; this.cdr.detectChanges(); })); - this.route.queryParams.subscribe(params => { + this._route.queryParams.subscribe(params => { this.view = params['view']; if(this.stakeholder) { this.setSideBar(); } }); - this.layoutService.setOpen(true); this.subscriptions.push(this.data.subscribe(data => { if (data && data.portal) { this.setProperties(data.portal); @@ -139,7 +117,7 @@ export class AppComponent implements OnInit, OnDestroy { } })); this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { - this.updateStakeholder = !this.router.url.includes('user-info'); + this.updateStakeholder = !this._router.url.includes('user-info'); if (user) { this.user = user; if (!this.notificationGroupsInitialized) { @@ -258,14 +236,10 @@ export class AppComponent implements OnInit, OnDestroy { } public ngOnDestroy() { + super.ngOnDestroy(); if(this.paramsSubscription) { this.paramsSubscription.unsubscribe(); } - this.subscriptions.forEach(value => { - if (value instanceof Subscriber) { - value.unsubscribe(); - } - }); this.userManagementService.clearSubscriptions(); this.layoutService.clearSubscriptions(); this.stakeholderService.clearSubscriptions(); @@ -274,25 +248,17 @@ export class AppComponent implements OnInit, OnDestroy { } private navigateToError() { - this.router.navigate([this.properties.errorLink], {queryParams: {'page': this.properties.baseLink + this.router.url}}); + this._router.navigate([this.properties.errorLink], {queryParams: {'page': this.properties.baseLink + this._router.url}}); } public removeView() { - this.router.navigate([], {relativeTo: this.route}); + this._router.navigate([], {relativeTo: this._route}); } public login() { this.userManagementService.login(); } - public get open() { - return this.layoutService.open; - } - - public get hover() { - return this.layoutService.hover; - } - get isHidden() { return this.stakeholder && !this.hasPermission(this.view?this.view:this.stakeholder.visibility); } @@ -419,7 +385,7 @@ export class AppComponent implements OnInit, OnDestroy { menuPosition: "center" }; this.menuItems.push( - new MenuItem("stakeholders", "Browse " + this.stakeholderEntities.STAKEHOLDERS, + new MenuItem("stakeholders", "Browse " + this.stakeholderUtils.entities.stakeholders, this.monitorLink + '/browse', "", false, [], null, {}, null, null, null, null, "_self") ); this.resourcesService.setResources(this.menuItems, '', this.monitorLink); diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 6733d43..9747be2 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -47,7 +47,7 @@
-
-
-
{{indicator.name + " "}}
+
+ {{indicator.name + " "}}
- diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index 0f8b30f..b08809b 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -1,115 +1,47 @@ -import {ChangeDetectorRef, Component, HostListener, OnDestroy, OnInit, ViewChild, ViewRef} from '@angular/core'; -import {ActivatedRoute, Params, Router} from '@angular/router'; +import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from '@angular/router'; import {DomSanitizer, Meta, Title} from '@angular/platform-browser'; -import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {Dates, StringUtils} from '../openaireLibrary/utils/string-utils.class'; -import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; -import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; -import {HelperService} from "../openaireLibrary/utils/helper/helper.service"; +import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service"; import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service"; -import { - Category, - Indicator, - IndicatorPath, - IndicatorSize, - Section, - Stakeholder, - SubCategory, - Topic, - Visibility -} from "../openaireLibrary/monitor/entities/stakeholder"; +import {IndicatorPath} from "../openaireLibrary/monitor/entities/stakeholder"; import {StatisticsService} from "../openaireLibrary/monitor-admin/utils/services/statistics.service"; -import {IndicatorUtils} from "../openaireLibrary/monitor-admin/utils/indicator-utils"; import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; -import {UntypedFormBuilder, UntypedFormControl} from "@angular/forms"; -import {Subscriber, Subscription} from "rxjs"; -import {Session, User} from "../openaireLibrary/login/utils/helper.class"; +import {Subscription} from "rxjs"; import {UserManagementService} from "../openaireLibrary/services/user-management.service"; -import {RangeFilter} from "../openaireLibrary/utils/rangeFilter/rangeFilterHelperClasses.class"; -import {Filter, Value} from "../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; -import {RouterHelper} from "../openaireLibrary/utils/routerHelper.class"; -import {properties} from "../../environments/environment"; import {IndexInfoService} from "../openaireLibrary/utils/indexInfo.service"; -import {ConfigurationService} from "../openaireLibrary/utils/configuration/configuration.service"; -import {ClickEvent} from '../openaireLibrary/utils/click/click-outside-or-esc.directive'; import {RangeFilterComponent} from "../openaireLibrary/utils/rangeFilter/rangeFilter.component"; +import { + MonitorIndicatorStakeholderBaseComponent +} from "../openaireLibrary/monitor/monitor-indicator-stakeholder-base.component"; @Component({ selector: 'monitor', templateUrl: 'monitor.component.html', styleUrls: ['monitor.component.less'] }) -export class MonitorComponent implements OnInit, OnDestroy { - public user: User; - public subscriptions: any[] = []; - title; - description; - public pageContents = null; - public divContents = null; - public status: number; - public loading: boolean = true; - public view: Visibility; - public indicatorUtils: IndicatorUtils = new IndicatorUtils(); - public activeTopic: Topic = null; - public activeCategory: Category = null; - public activeSubCategory: SubCategory = null; - public errorCodes: ErrorCodes; - public stakeholder: Stakeholder; - public numberResults: Map = new Map(); - public chartsActiveType: Map = new Map(); - private errorMessages: ErrorMessagesComponent; - properties: EnvProperties = properties; - public routerHelper: RouterHelper = new RouterHelper(); - filters: Filter[] = []; - queryParams = {}; - public currentYear = new Date().getFullYear(); - periodFilter: RangeFilter = { - title: "Time range", - filterId: "year", - originalFilterIdFrom: null, - originalFilterIdTo: null, - selectedFromValue: null, - selectedToValue: null, - selectedFromAndToValues: "" - }; +export class MonitorComponent extends MonitorIndicatorStakeholderBaseComponent implements OnInit { @ViewChild('rangeFilter') rangeFilter: RangeFilterComponent; privateStakeholder = false; - public keyword: UntypedFormControl; public statsUpdateDate: Date; - public isFullscreen: boolean = false; - public isMobile: boolean = false; - - - @HostListener('fullscreenchange', ['$event']) - @HostListener('webkitfullscreenchange', ['$event']) - @HostListener('mozfullscreenchange', ['$event']) - @HostListener('MSFullscreenChange', ['$event']) - screenChange(event) { - this.isFullscreen = !this.isFullscreen; - } constructor( - private route: ActivatedRoute, - private _router: Router, - private _meta: Meta, - private _title: Title, - private _piwikService: PiwikService, - private helper: HelperService, + protected _route: ActivatedRoute, + protected _router: Router, + protected _meta: Meta, + protected _title: Title, + protected _piwikService: PiwikService, + protected seoService: SEOService, + protected sanitizer: DomSanitizer, + protected cdr: ChangeDetectorRef, + protected layoutService: LayoutService, + protected statisticsService: StatisticsService, private stakeholderService: StakeholderService, private userManagementService: UserManagementService, - private statisticsService: StatisticsService, - private layoutService: LayoutService, - private seoService: SEOService, - private cdr: ChangeDetectorRef, - private indexInfoService: IndexInfoService, - private sanitizer: DomSanitizer, private _fb: UntypedFormBuilder, private router: Router, - private configurationService: ConfigurationService) { - this.errorCodes = new ErrorCodes(); - this.errorMessages = new ErrorMessagesComponent(); - this.status = this.errorCodes.LOADING; + private indexInfoService: IndexInfoService) { + super(); } public ngOnInit() { @@ -120,15 +52,11 @@ export class MonitorComponent implements OnInit, OnDestroy { } })); } - this.keyword = this._fb.control(''); let subscription: Subscription; - this.layoutService.isMobile.subscribe(isMobile => { - this.isMobile = isMobile; - this.cdr.detectChanges(); - }); + this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; - this.subscriptions.push(this.route.params.subscribe(params => { + this.subscriptions.push(this._route.params.subscribe(params => { this.loading = true; this.activeTopic = null; this.activeCategory = null; @@ -136,9 +64,7 @@ export class MonitorComponent implements OnInit, OnDestroy { if (subscription) { subscription.unsubscribe(); } - var url = properties.domain + properties.baseLink + this._router.url; if (!this.stakeholder || this.stakeholder.alias !== params['stakeholder']) { - this.status = this.errorCodes.LOADING; this.numberResults = new Map(); this.chartsActiveType = new Map(); subscription = this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { @@ -174,25 +100,15 @@ export class MonitorComponent implements OnInit, OnDestroy { , filterOperator: "or", valueIsExact: true, filterType: "checkbox", radioValue: "" }); } - this.subscriptions.push(this.route.queryParams.subscribe( queryParams => { + this.subscriptions.push(this._route.queryParams.subscribe(queryParams => { this.handleQueryParams(queryParams, params); - this.seoService.createLinkForCanonicalURL(url, false); - this._meta.updateTag({content: url}, "property='og:url'"); - this.description = "Monitor Dashboard | " + this.stakeholder.name; this.title = "Monitor Dashboard | " + this.stakeholder.name; - this._meta.updateTag({content: this.description}, "name='description'"); - this._meta.updateTag({content: this.description}, "property='og:description'"); - this._meta.updateTag({content: this.title}, "property='og:title'"); - this._title.setTitle(this.title); - this.subscriptions.push(this._piwikService.trackView(this.properties, this.title).subscribe()); + this.description = "Monitor Dashboard | " + this.stakeholder.name; + this.setMetadata(); if (this.hasPermission((this.view && this.isManager(this.stakeholder))?this.view:this.stakeholder.visibility)) { - //this.getDivContents(); - // this.getPageContents(); - this.status = this.errorCodes.DONE; this.setView(params); } else { this.privateStakeholder = true; - // this.navigateToError(); if (subscription) { subscription.unsubscribe(); } @@ -207,8 +123,8 @@ export class MonitorComponent implements OnInit, OnDestroy { }); this.subscriptions.push(subscription); } else { - this.subscriptions.push(this._piwikService.trackView(this.properties, this.title).subscribe()); - this.subscriptions.push(this.route.queryParams.subscribe( queryParams => { + this.trackView(); + this.subscriptions.push(this._route.queryParams.subscribe(queryParams => { this.handleQueryParams(queryParams, params); })); } @@ -216,207 +132,6 @@ export class MonitorComponent implements OnInit, OnDestroy { })); } - get monitorLink() { - return "https://" + (this.properties.environment == 'beta' ? 'beta.' : '') + 'monitor.openaire.eu'; - } - - private handleQueryParams(queryParams, params) { - this.queryParams = Object.assign({}, queryParams); - this.initializeFilters(); - this.setView(params); - if(!this.user && (this.filters.filter(filter => this.queryParams[filter.filterId]).length > 0 || this.queryParams['year'])) { - if(queryParams['view']) { - this.router.navigate([], {queryParams: {view: queryParams['view']}}); - } else { - this.router.navigate([], {queryParams: {}}); - } - } - this.view = queryParams['view']; - } - - private initializeFilters() { - this.periodFilter.selectedFromValue = (this.queryParams['year'] && this.queryParams['year'].indexOf("range") == 0) ? this.queryParams['year'].split("range")[1].split(":")[0] : ""; - this.periodFilter.selectedToValue = (this.queryParams['year'] && this.queryParams['year'].indexOf("range") == 0) ? this.queryParams['year'].split("range")[1].split(":")[1] : ""; - this.validateYearRange(false); - - for (let filter of this.filters) { - if (this.queryParams[filter.filterId]) { - for (let value of filter.values) { - if (value.id == StringUtils.URIDecode(StringUtils.unquote(this.queryParams[filter.filterId]))) { - value.selected = true; - filter.countSelectedValues = 1; - break; - } - } - } else { - this.clearFilter(filter); - } - } - - } - - private validateYearRange(navigateTo: boolean = false) { - let validYears = true; - - if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, Dates.currentYear - 20, Dates.currentYear))) { - this.periodFilter.selectedToValue = Dates.currentYear + ""; - validYears = false; - } - if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, Dates.currentYear - 20, Dates.currentYear))) { - this.periodFilter.selectedFromValue = Dates.currentYear - 20 + ""; - validYears = false; - } - if (this.periodFilter.selectedFromValue && this.periodFilter.selectedFromValue.length && this.periodFilter.selectedToValue && this.periodFilter.selectedToValue.length > 0 && parseInt(this.periodFilter.selectedFromValue, 10) > parseInt(this.periodFilter.selectedToValue, 10)) { - this.periodFilter.selectedFromValue = this.periodFilter.selectedToValue; - validYears = false; - } - if (!validYears || navigateTo) { - if (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue) { - this.queryParams["year"] = 'range' + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : '') + ":" + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : ""); - } else { - delete this.queryParams["year"]; - } - // this.location.go(location.pathname, this.routerHelper.createQueryParamsString( Object.keys(this.queryParams), Object.values(this.queryParams))); - this.router.navigate([], {queryParams: this.queryParams}); - this.setIndicators(); - } - } - - clearAll() { - for (let filter of this.filters) { - this.clearFilter(filter); - } - this.periodFilter.selectedFromValue = ""; - this.periodFilter.selectedToValue = ""; - this.validateYearRange(true) - } - - clearFilter(filter: Filter) { - filter.countSelectedValues = 0; - filter.radioValue = ""; - for (let value of filter.values) { - if (value.selected) { - value.selected = false; - } - } - if (this.queryParams[filter.filterId]) { - delete this.queryParams[filter.filterId]; - } - } - - countSelectedFilters(): number { - let count = 0; - if (this.periodFilter.selectedFromAndToValues.length > 0) { - count += 1; - } - for (let filter of this.filters) { - count += filter.countSelectedValues; - } - return count; - } - - public get open() { - return this.layoutService.open; - } - - private getPageContents() { - this.subscriptions.push(this.helper.getPageHelpContents(this.properties, this.properties.adminToolsCommunity, this._router.url).subscribe(contents => { - this.pageContents = contents; - })); - } - - private getDivContents() { - this.subscriptions.push(this.helper.getDivHelpContents(this.properties, this.properties.adminToolsCommunity, this._router.url).subscribe(contents => { - this.divContents = contents; - })); - } - - private setView(params: Params) { - this.loading = false; - if (params['topic']) { - this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.hasPermission(topic.visibility)); - if (this.activeTopic) { - if (params['category']) { - this.activeCategory = this.activeTopic.categories.find(category => - (category.alias === params['category']) && this.hasPermission(category.visibility)); - if (!this.activeCategory) { - this.navigateToError(); - return; - } - } else { - this.activeCategory = this.activeTopic.categories.find(category => this.hasPermission(category.visibility)); - if (this.activeCategory) { - this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => - this.hasPermission(subCategory.visibility)); - if (this.activeSubCategory) { - this.setIndicators(); - } - } - return; - } - if (this.activeCategory) { - if (params['subCategory']) { - this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => - (subCategory.alias === params['subCategory'] && this.hasPermission(subCategory.visibility))); - if (!this.activeSubCategory) { - this.navigateToError(); - return; - } - } else { - this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => - this.hasPermission(subCategory.visibility)); - } - if (this.activeSubCategory) { - this.setIndicators(); - } else { - this.navigateToError(); - } - return; - } else { - this.activeSubCategory = null; - } - } else { - this.navigateToError(); - return; - } - } else { - this.activeTopic = this.stakeholder.topics.find(topic => this.hasPermission(topic.visibility)); - if (this.activeTopic) { - this.activeCategory = this.activeTopic.categories.find(category => this.hasPermission(category.visibility)); - if (this.activeCategory) { - this.activeSubCategory = this.activeCategory.subCategories.find(subCategory => this.hasPermission(subCategory.visibility)); - if (this.activeSubCategory) { - this.setIndicators(); - } - } - } - } - } - - filter() { - this.validateYearRange(true); - } - - filterChanged($event, navigate: boolean = true) { - let selected = ""; - for (let value of $event.value.values) { - if (value.selected) { - selected = value.id; - break; - } - } - if (selected) { - this.queryParams[$event.value.filterId] = StringUtils.quote(StringUtils.URIEncode(selected)); - } else { - delete this.queryParams[$event.value.filterId]; - } - if (navigate) { - this.router.navigate([], {queryParams: this.queryParams}); - this.setIndicators(); - } - - } - private getfl0() { if (this.queryParams["relfundinglevel0_id"] && this.filters.length > 0) { let value = StringUtils.URIDecode(StringUtils.unquote(this.queryParams["relfundinglevel0_id"])); @@ -424,189 +139,23 @@ export class MonitorComponent implements OnInit, OnDestroy { } return null; } - + private getCoFunded() { if (this.queryParams["co-funded"] && this.filters.length > 0) { return this.queryParams["co-funded"] && StringUtils.URIDecode(StringUtils.unquote(this.queryParams["co-funded"])) == "co-funded-results"; } return false; } - - clearPeriodFilter() { - if (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue) { - this.periodFilter.selectedFromValue = ""; - this.periodFilter.selectedToValue = ""; - if(this.rangeFilter) { - this.rangeFilter.clearFilter(); - } - this.filter(); - } - } - - clearFilterValue(filter: Filter, value: Value) { - value.selected = false; - filter.radioValue = ''; - filter.countSelectedValues = filter.countSelectedValues - 1; - this.filterChanged({ - value:filter - }); - } - - private setIndicators() { - this.periodFilter.selectedFromAndToValues = (this.periodFilter.selectedFromValue || this.periodFilter.selectedToValue ? ((this.periodFilter.selectedFromValue && !this.periodFilter.selectedToValue ? "From " : "") + (!this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? "Until " : "") + (this.periodFilter.selectedFromValue ? this.periodFilter.selectedFromValue : "") + - (this.periodFilter.selectedFromValue && this.periodFilter.selectedToValue ? " - " : "") + (this.periodFilter.selectedToValue ? this.periodFilter.selectedToValue : "")) : ""); - //clear numbers when filters change - this.numberResults.clear(); - let urls: Map = new Map(); - this.activeSubCategory.numbers.forEach((section, i) => { - section.indicators.forEach((number, j) => { - if (this.hasPermission(number.visibility)) { - let url = this.indicatorUtils.getFullUrlWithFilters(this.stakeholder, number.indicatorPaths[0], this.getfl0(), this.periodFilter.selectedFromValue, this.periodFilter.selectedToValue, this.getCoFunded()); - const pair = JSON.stringify([number.indicatorPaths[0].source, url]); - const indexes = urls.get(pair) ? urls.get(pair) : []; - indexes.push([i, j]); - urls.set(pair, indexes); - } - }); - }); - urls.forEach((indexes, pair) => { - pair = JSON.parse(pair); - let activeSubcategory = this.activeSubCategory._id; - this.subscriptions.push(this.statisticsService.getNumbers(this.indicatorUtils.getSourceType(pair[0]), pair[1]).subscribe(response => { - if(activeSubcategory === this.activeSubCategory._id) { - indexes.forEach(([i, j]) => { - 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; - } - this.numberResults.set(i + '-' + j, result); - } - }); - } - })); - }); - this.activeSubCategory.charts.forEach((section, i) => { - section.indicators.forEach((indicator, j) => { - if (indicator.indicatorPaths.length > 0) { - indicator.indicatorPaths[0].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[0]); - this.chartsActiveType.set(i + '-' + j, indicator.indicatorPaths[0]); - } - }); - }); - if (this.cdr && !(this.cdr as ViewRef).destroyed) { - this.cdr.detectChanges(); - } - } - - public getUrlByStakeHolder(indicatorPath: IndicatorPath) { - return this.sanitizer.bypassSecurityTrustResourceUrl( - this.indicatorUtils.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrlWithFilters(this.stakeholder, indicatorPath, this.getfl0(), this.periodFilter.selectedFromValue, this.periodFilter.selectedToValue, this.getCoFunded()))); - } - - public setActiveChart(i: number, j: number, type: string) { - let activeChart = this.activeSubCategory.charts[i].indicators[j].indicatorPaths.filter(indicatorPath => indicatorPath.type === type)[0]; - activeChart.safeResourceUrl = this.getUrlByStakeHolder(activeChart); - this.chartsActiveType.set(i + '-' + j, activeChart); - } - - private navigateToError() { - this._router.navigate([this.properties.errorLink], {queryParams: {'page': this._router.url}}); - } - - public quote(param: string): string { - return StringUtils.quote(param); - } - - public ngOnDestroy() { - this.subscriptions.forEach(subscription => { - if (subscription instanceof Subscriber) { - subscription.unsubscribe(); - } - }); - } - - public isMember(stakeholder: Stakeholder) { - return this.user && (Session.isPortalAdministrator(this.user) || Session.isCurator(stakeholder.type, this.user) - || Session.isManager(stakeholder.type, stakeholder.alias, this.user) || Session.isMember(stakeholder.type, stakeholder.alias, this.user)); - } - - public isManager(stakeholder: Stakeholder) { - return this.user && (Session.isPortalAdministrator(this.user) || Session.isCurator(stakeholder.type, this.user) || Session.isManager(stakeholder.type, stakeholder.alias, this.user)); - } - - public hasPermission(visibility: Visibility): boolean { - if(visibility === 'PUBLIC') { - return true; - } else if(visibility === 'RESTRICTED') { - return (!this.view || this.view === 'RESTRICTED') && this.isMember(this.stakeholder); - } else { - return !this.view && this.isManager(this.stakeholder); - } - } - - public countSubCategoriesToShow(category: Category): number { - return category.subCategories.filter(subCategory => this.hasPermission(subCategory.visibility)).length; - } - - public countSectionsWithIndicatorsToShow(sections: Section[]):number { - return sections.map(section => this.countIndicatorsToShow(section.indicators)).reduce((sum, current) => sum + current, 0); - } - - public countIndicatorsToShow(indicators: Indicator[]): number { - return indicators.filter(indicator => this.hasPermission(indicator.visibility)).length; + + public getFullUrl(indicatorPath: IndicatorPath) { + return this.indicatorUtils.getFullUrlWithFilters(this.stakeholder, indicatorPath, this.getfl0(), this.periodFilter.selectedFromValue, this.periodFilter.selectedToValue, this.getCoFunded()); } public get feedback() { return "mailto:" + this.properties.feedbackmail + "?subject=%5BOpenAIRE%20Monitor%5D%20" + (this.stakeholder ? this.stakeholder.name : "") + "%20dashboard%20feedback" } - - public getNumberClassBySize(size: IndicatorSize) { - if (size === 'small') { - return 'uk-width-medium@m uk-width-1-1'; - } else if (size === 'medium') { - return 'uk-width-1-4@l uk-width-1-2@m uk-width-1-1'; - } else { - return 'uk-width-1-2@l uk-width-1-1@m uk-width-1-1'; - } - } - - public getChartClassBySize(size: IndicatorSize) { - if (size === 'small') { - return 'uk-width-1-3@xl uk-width-1-2@m uk-width-1-1'; - } else if (size === 'medium') { - return 'uk-width-1-2@l uk-width-1-1'; - } else { - return 'uk-width-1-1'; - } - } - - public printReport() { - window.print(); - } logIn() { this.userManagementService.login(); } - - toggleDescriptionOverlay(event, indicator: Indicator) { - event.stopPropagation(); - indicator.descriptionOverlay = !indicator.descriptionOverlay; - } - - closeDescriptionOverlay(event: ClickEvent, indicator: Indicator) { - if(event.clicked && indicator.descriptionOverlay) { - indicator.descriptionOverlay = false; - } - } } diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 293be5e..edda550 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 293be5e1d23e6f0f89344407331983b3e66afc9c +Subproject commit edda550b6374d3282471407f78db6a5f763bf80e From 0145245206bd0cb6e267bf83f131f130e9567af1 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Mon, 18 Dec 2023 13:52:18 +0200 Subject: [PATCH 04/14] [irish-monitor] change the overlay functionality of the indicators based on the new irish-monitors overlay, update submodules --- src/app/monitor/monitor.component.html | 29 +++++++++++++------------- src/app/monitor/monitor.component.less | 2 +- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 9747be2..96d5301 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -103,7 +103,7 @@
-
+
{{indicator.name}}
+ (clickOutside)="closeOverlay($event, indicator, 'desc')">
+ (click)="toggleOverlay($event, indicator, 'desc')"> @@ -154,7 +154,7 @@
-
+
{{indicator.name}}
@@ -212,23 +212,22 @@ class="uk-width-1-1 uk-blend-multiply" [ngClass]="'uk-height-' + (indicator.height?indicator.height.toLowerCase():'medium')">
-
- + -
-
+
+
-
diff --git a/src/app/monitor/monitor.component.less b/src/app/monitor/monitor.component.less index c50e616..ba5dd89 100644 --- a/src/app/monitor/monitor.component.less +++ b/src/app/monitor/monitor.component.less @@ -6,7 +6,7 @@ } } -.indicator-description { +.indicator-overlay { position: absolute; top: 0; left: 0; diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index edda550..52d63ec 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit edda550b6374d3282471407f78db6a5f763bf80e +Subproject commit 52d63ece254ac132f6b42f9fe6ac804a651cfa39 diff --git a/src/assets/common-assets b/src/assets/common-assets index 6bb1e61..afde9cf 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 6bb1e61b059bef1bff3bfb0611b0df46f7840426 +Subproject commit afde9cf3fa4722e8559c5ce4da6800edde283546 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 5e8c1ad..821f1e6 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 5e8c1addb1ebfa508aac8cb9540a755940c95b79 +Subproject commit 821f1e658b1da0dbf7c3a8374398f7eef29cd1f1 From 7d5a5ca8995d75ec05f21f71a7865b6d0561cbf4 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 Jan 2024 09:31:31 +0200 Subject: [PATCH 05/14] [develop | FIXED]: Add indicators.less in monitor style. --- src/assets/monitor-dashboard-custom.less | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/monitor-dashboard-custom.less b/src/assets/monitor-dashboard-custom.less index f96d4f6..f7b2375 100644 --- a/src/assets/monitor-dashboard-custom.less +++ b/src/assets/monitor-dashboard-custom.less @@ -4,6 +4,7 @@ @import (multiple) "~src/assets/common-assets/less/general"; @import (multiple) "~src/assets/common-assets/less/user"; @import (multiple) "~src/assets/common-assets/less/dashboard"; + @import (multiple) "~src/assets/common-assets/less/indicators"; @import (multiple) "~src/assets/common-assets/less/landing"; @monitor-dashboard-background: #F3F3F3; From e5b1b8da168cf18fe44efd73a8fa9a4fa6be6c06 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 Jan 2024 10:38:25 +0200 Subject: [PATCH 06/14] [irish-monitor]: Update libraries --- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 52d63ec..b83101f 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 52d63ece254ac132f6b42f9fe6ac804a651cfa39 +Subproject commit b83101fd740bc6dfdb3271526772083f8236a014 diff --git a/src/assets/common-assets b/src/assets/common-assets index afde9cf..ee22e97 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit afde9cf3fa4722e8559c5ce4da6800edde283546 +Subproject commit ee22e97b114be823b7ab4e6c41a9cbff93b24e3a diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 821f1e6..52eca9a 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 821f1e658b1da0dbf7c3a8374398f7eef29cd1f1 +Subproject commit 52eca9abe84c941a7e78a5690f273d8c8e3194f9 From bf1a44ac052db46554f08cd60cd7c684bbbf4dae Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 Jan 2024 14:07:46 +0200 Subject: [PATCH 07/14] Update library --- src/app/openaireLibrary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 41adaa3..5699aed 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 41adaa308d96de18d14a7113ab7dd706c110044a +Subproject commit 5699aed59942a94e0d004023a09bc7994458cfe9 From f3a434ade02d90cc06a4a916a79edf66a04e4391 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 24 Jan 2024 14:37:05 +0200 Subject: [PATCH 08/14] [develop]: Update uikit and remove common properties --- package.json | 2 +- src/app/openaireLibrary | 2 +- src/environments/environment.beta.ts | 109 ++------------------------ src/environments/environment.prod.ts | 110 +++------------------------ src/environments/environment.ts | 93 ++-------------------- 5 files changed, 25 insertions(+), 291 deletions(-) diff --git a/package.json b/package.json index 36a556c..e621943 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "rxjs": "^6.5.1", "ts-md5": "^1.2.0", "tslib": "^2.0.0", - "uikit": "3.16.14", + "uikit": "3.16.24", "zone.js": "~0.13.1" }, "devDependencies": { diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 5699aed..2b99535 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 5699aed59942a94e0d004023a09bc7994458cfe9 +Subproject commit 2b9953503aeadeca356e6942a1e60c43f8b04d5b diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index eb73b59..63893dd 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -1,118 +1,23 @@ import {EnvProperties} from "../app/openaireLibrary/utils/properties/env-properties"; +import {common, commonBeta} from "../app/openaireLibrary/utils/properties/environments/environment"; -export let properties: EnvProperties = { - environment: "beta", +let props: EnvProperties = { dashboard: 'monitor', isDashboard: true, enablePiwikTrack: true, useCache: false, useLongCache: true, showContent: true, - statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", - statisticsFrameAPIURL: "https://beta.openaire.eu/stats/", - statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/", - useNewStatistisTool: true, monitorStatsFrameUrl:"https://beta.services.openaire.eu/stats-tool/", useOldStatisticsSchema: true, - claimsAPIURL: "https://beta.services.openaire.eu/claims/rest/claimsService/", - searchAPIURLLAst: "https://beta.services.openaire.eu/search/v2/api/", - searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", - openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", - csvAPIURL: "https://beta.services.openaire.eu/search/v2/api/reports", - searchCrossrefAPIURL: "https://api.crossref.org/works", - searchDataciteAPIURL: "https://api.datacite.org/works", - searchOrcidURL: "https://pub.orcid.org/v2.1/", - orcidURL: "https://orcid.org/", - doiURL: "https://doi.org/", - pmcURL: "http://europepmc.org/articles/", - pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", - handleURL: "http://hdl.handle.net/", - cordisURL: "http://cordis.europa.eu/projects/", - openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", - r3DataURL: "http://service.re3data.org/repository/", - swhURL: "https://archive.softwareheritage.org/", - fairSharingURL: "https://fairsharing.org/", - eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", - sherpaURL: 'http://sherpa.ac.uk/romeo/issn/', - sherpaURLSuffix: '/', - zenodo: "https://zenodo.org/", - zenodoCommunities: "https://zenodo.org/api/communities/", - helpdesk: 'https://www.openaire.eu/support/helpdesk', - helpdeskEmail: 'helpdesk@openaire.eu', - utilsService: "https://demo.openaire.eu/utils-service", - - vocabulariesAPI: "https://beta.services.openaire.eu/provision/mvc/vocabularies/", - - piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=", - loginUrl: "https://beta.services.openaire.eu/login-service/openid_connect_login", - userInfoUrl: "https://beta.services.openaire.eu/login-service/userInfo", - registryUrl: 'https://beta.services.openaire.eu/uoa-user-management/api/registry/', - logoutUrl: "https://beta.services.openaire.eu/login-service/openid_logout", - cookieDomain: ".openaire.eu", - - feedbackmail: "feedback@openaire.eu", - - cacheUrl: "https://demo.openaire.eu/cache/get?url=", - - monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service", adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service/", notificationsAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service/notification/", adminToolsCommunity: "monitor", useHelpTexts:true, - datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/", - contextsAPI: "https://beta.services.openaire.eu/openaire/context", - communityAPI: "https://beta.services.openaire.eu/openaire/community/", - communitiesAPI: "https://beta.services.openaire.eu/openaire/community/communities", - - csvLimit: 2000, - pagingLimit: 20, - resultsPerPage: 10, - baseLink: "/dashboard", - domain: "https://beta.monitor.openaire.eu", - searchLinkToResult: "/search/result?id=", - searchLinkToPublication: "/search/publication?articleId=", - searchLinkToProject: "/search/project?projectId=", - searchLinkToDataProvider: "/search/dataprovider?datasourceId=", - searchLinkToDataset: "/search/dataset?datasetId=", - searchLinkToSoftwareLanding: "/search/software?softwareId=", - searchLinkToOrganization: "/search/organization?organizationId=", - searchLinkToOrp: "/search/other?orpId=", - searchLinkToResults: "/search/find/research-outcomes", - searchLinkToCommunities: "/search/find/communities", - searchLinkToPublications: '/search/find/research-outcomes?type="publications"', - searchLinkToDataProviders: "/search/find/dataproviders", - searchLinkToProjects: "/search/find/projects", - searchLinkToDatasets: '/search/find/research-outcomes?type="datasets"', - searchLinkToSoftware: '/search/find/research-outcomes?type="software"', - searchLinkToOrps: '/search/find/research-outcomes?type="other"', - searchLinkToOrganizations: "/search/find/organizations", - searchLinkToCompatibleDataProviders: "/search/content-providers", - searchLinkToEntityRegistriesDataProviders: "/search/entity-registries", - searchLinkToJournals: "/search/journals", - searchLinkToAdvancedResults: "/search/advanced/research-outcomes", - searchLinkToAdvancedPublications: "/search/advanced/publications", - searchLinkToAdvancedProjects: "/search/advanced/projects", - searchLinkToAdvancedDatasets: "/search/advanced/datasets", - searchLinkToAdvancedSoftware: "/search/advanced/software", - searchLinkToAdvancedOrps: "/search/advanced/other", - searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", - searchLinkToAdvancedOrganizations: "/search/advanced/organizations", - errorLink: '/error', - lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows", - showLastIndexInformationLink: true, - bipFrameAPIURL: "https://bip.imsi.athenarc.gr/api/impact-chart?id=", - widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", - claimsInformationLink: "https://beta.openaire.eu/linking", - - depositLearnHowPage: "/participate/deposit/learn-how", - depositSearchPage: "/participate/deposit/search", - shareInZenodoPage: "/participate/deposit/zenodo", - - reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", - - admins: ["helpdesk@openaire.eu"], - lastIndexUpdate: "2019-08-07", - indexInfoAPI: "http://beta.services.openaire.eu/openaire/info/", - altMetricsAPIURL: "https://api.altmetric.com/v1/doi/" + domain: "https://beta.monitor.openaire.eu" }; + +export let properties: EnvProperties = { + ...common, ...commonBeta, ...props +} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 5e2335e..33366fc 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -1,115 +1,23 @@ import {EnvProperties} from "../app/openaireLibrary/utils/properties/env-properties"; +import {common, commonProd} from "../app/openaireLibrary/utils/properties/environments/environment"; -export let properties: EnvProperties = { - environment: "production", +let props: EnvProperties = { dashboard: 'monitor', isDashboard: true, enablePiwikTrack: true, useCache: false, useLongCache: true, showContent: true, - statisticsAPIURL: "https://services.openaire.eu/stats-api/", - statisticsFrameAPIURL: "https://www.openaire.eu/stats/", - statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/", - useNewStatistisTool: true, - monitorStatsFrameUrl:"https://services.openaire.eu/stats-tool/", + monitorStatsFrameUrl: "https://services.openaire.eu/stats-tool/", useOldStatisticsSchema: false, - claimsAPIURL: "https://services.openaire.eu/claims/rest/claimsService/", - searchAPIURLLAst: "https://services.openaire.eu/search/v2/api/", - searchResourcesAPIURL: "https://services.openaire.eu/search/v2/api/resources", - openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", - csvAPIURL: "https://services.openaire.eu/search/v2/api/reports", - searchCrossrefAPIURL: "https://api.crossref.org/works", - searchDataciteAPIURL: "https://api.datacite.org/works", - searchOrcidURL: "https://pub.orcid.org/v2.1/", - orcidURL: "https://orcid.org/", - doiURL: "https://doi.org/", - pmcURL: "http://europepmc.org/articles/", - pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", - handleURL: "http://hdl.handle.net/", - cordisURL: "http://cordis.europa.eu/projects/", - openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", - r3DataURL: "http://service.re3data.org/repository/", - swhURL: "https://archive.softwareheritage.org/", - fairSharingURL: "https://fairsharing.org/", - eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", - sherpaURL: 'http://sherpa.ac.uk/romeo/issn/', - sherpaURLSuffix: '/', - zenodo: "https://zenodo.org/", - zenodoCommunities: "https://zenodo.org/api/communities/", - helpdesk: 'https://www.openaire.eu/support/helpdesk', - helpdeskEmail: 'helpdesk@openaire.eu', - utilsService: "https://explore.openaire.eu/utils-service", - - vocabulariesAPI: "https://services.openaire.eu/provision/mvc/vocabularies/", - - piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=", - loginUrl: "https://services.openaire.eu/login-service/openid_connect_login", - registryUrl: 'https://services.openaire.eu/uoa-user-management/api/registry/', - userInfoUrl: "https://services.openaire.eu/login-service/userInfo", - logoutUrl: "https://services.openaire.eu/login-service/openid_logout", - cookieDomain: ".openaire.eu", - - feedbackmail: "feedback@openaire.eu", - - cacheUrl: "https://explore.openaire.eu/cache/get?url=", - - monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service", adminToolsAPIURL: "https://services.openaire.eu/uoa-monitor-service/", notificationsAPIURL: "https://services.openaire.eu/uoa-monitor-service/notification/", adminToolsCommunity: "monitor", - useHelpTexts:true, - datasourcesAPI: "https://services.openaire.eu/openaire/ds/search/", - contextsAPI: "https://services.openaire.eu/openaire/context", - communityAPI: "https://services.openaire.eu/openaire/community/", - communitiesAPI: "https://services.openaire.eu/openaire/community/communities", - - csvLimit: 2000, - pagingLimit: 20, - resultsPerPage: 10, - + useHelpTexts: true, baseLink: "/dashboard", - domain: "https://monitor.openaire.eu", - searchLinkToResult: "/search/result?id=", - searchLinkToPublication: "/search/publication?articleId=", - searchLinkToProject: "/search/project?projectId=", - searchLinkToDataProvider: "/search/dataprovider?datasourceId=", - searchLinkToDataset: "/search/dataset?datasetId=", - searchLinkToSoftwareLanding: "/search/software?softwareId=", - searchLinkToOrp: "/search/other?orpId=", - searchLinkToOrganization: "/search/organization?organizationId=", - searchLinkToResults: "/search/find/research-outcomes", - searchLinkToPublications: '/search/find/research-outcomes?type="publications"', - searchLinkToDataProviders: "/search/find/dataproviders", - searchLinkToProjects: "/search/find/projects", - searchLinkToDatasets: '/search/find/research-outcomes?type="datasets"', - searchLinkToSoftware: '/search/find/research-outcomes?type="software"', - searchLinkToOrps: '/search/find/research-outcomes?type="other"', - searchLinkToOrganizations: "/search/find/organizations", - searchLinkToCompatibleDataProviders: "/search/content-providers", - searchLinkToEntityRegistriesDataProviders: "/search/entity-registries", - searchLinkToJournals: "/search/journals", - searchLinkToAdvancedResults: "/search/advanced/research-outcomes", - searchLinkToAdvancedPublications: "/search/advanced/publications", - searchLinkToAdvancedProjects: "/search/advanced/projects", - searchLinkToAdvancedDatasets: "/search/advanced/datasets", - searchLinkToAdvancedSoftware: "/search/advanced/software", - searchLinkToAdvancedOrps: "/search/advanced/other", - searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", - searchLinkToAdvancedOrganizations: "/search/advanced/organizations", - errorLink: '/error', - lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows", - showLastIndexInformationLink: true, - bipFrameAPIURL: "https://bip.imsi.athenarc.gr/api/impact-chart?id=", - widgetLink: "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", - claimsInformationLink: "https://www.openaire.eu/linking", - depositLearnHowPage: "/participate/deposit/learn-how", - depositSearchPage: "/participate/deposit/search", - shareInZenodoPage: "/participate/deposit/zenodo", - reCaptchaSiteKey: "6LezhVIUAAAAAOb4nHDd87sckLhMXFDcHuKyS76P", - - admins: ["argirok@di.uoa.gr"], - lastIndexUpdate: "2019-07-24", - indexInfoAPI: "http://services.openaire.eu/openaire/info/", - altMetricsAPIURL: "https://api.altmetric.com/v1/doi/" + domain: "https://monitor.openaire.eu" }; + +export let properties: EnvProperties = { + ...common, ...commonProd, ...props +} diff --git a/src/environments/environment.ts b/src/environments/environment.ts index aa6bb86..719f438 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,9 +4,9 @@ // The list of which env maps to which file can be found in `.angular-cli.json`. import {EnvProperties} from "../app/openaireLibrary/utils/properties/env-properties"; +import {common, commonDev} from "../app/openaireLibrary/utils/properties/environments/environment"; -export let properties: EnvProperties = { - environment: "development", +let props: EnvProperties = { dashboard: 'monitor', adminToolsPortalType: "monitor", isDashboard: true, @@ -14,97 +14,18 @@ export let properties: EnvProperties = { useCache: false, useLongCache: false, showContent: true, - statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", - statisticsFrameAPIURL: "https://beta.openaire.eu/stats/", - statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/", - useNewStatistisTool: true, monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/", useOldStatisticsSchema: false, disableFrameLoad: true, - claimsAPIURL: "http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/", - searchAPIURLLAst: "https://beta.services.openaire.eu/search/v2/api/", - searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", - openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", - csvAPIURL: "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/reports", - searchCrossrefAPIURL: "https://api.crossref.org/works", - searchDataciteAPIURL: "https://api.datacite.org/works", - searchOrcidURL: "https://pub.orcid.org/v2.1/", - orcidURL: "https://orcid.org/", - doiURL: "https://doi.org/", - pmcURL: "http://europepmc.org/articles/", - pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", - handleURL: "http://hdl.handle.net/", - cordisURL: "http://cordis.europa.eu/projects/", - openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", - r3DataURL: "http://service.re3data.org/repository/", - swhURL: "https://archive.softwareheritage.org/", - fairSharingURL: "https://fairsharing.org/", - eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", - sherpaURL: 'http://sherpa.ac.uk/romeo/issn/', - sherpaURLSuffix: '/', - zenodo: "https://zenodo.org/", - zenodoCommunities: "https://zenodo.org/api/communities/", - helpdesk: 'https://www.openaire.eu/support/helpdesk', - helpdeskEmail: 'helpdesk@openaire.eu', - utilsService: "http://mpagasas.di.uoa.gr:8000", - vocabulariesAPI: "https://dev-openaire.d4science.org/provision/mvc/vocabularies/", - piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=", - registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/', - loginUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_connect_login", - userInfoUrl: "http://mpagasas.di.uoa.gr:19080/login-service/userInfo", - logoutUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_logout", - cookieDomain: ".di.uoa.gr", - feedbackmail: "openaire.test@gmail.com", - cacheUrl: "http://scoobydoo.di.uoa.gr:3000/get?url=", - monitorServiceAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service", adminToolsAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service/", notificationsAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service/notification/", adminToolsCommunity: "monitor", useHelpTexts: true, - datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/", - contextsAPI: "https://dev-openaire.d4science.org/openaire/context", - communityAPI: "https://dev-openaire.d4science.org/openaire/community/", - communitiesAPI: "https://dev-openaire.d4science.org/openaire/community/communities", - csvLimit: 2000, - pagingLimit: 20, - resultsPerPage: 10, baseLink: "/", domain: "http://mpagasas.di.uoa.gr:4600", - searchLinkToResult: "/search/result?id=", - searchLinkToPublication: "/search/publication?articleId=", - searchLinkToPublications: '/search/find/research-outcomes?type="publications"', - searchLinkToProject: "/search/project?projectId=", - searchLinkToDataProvider: "/search/dataprovider?datasourceId=", - searchLinkToDataset: "/search/dataset?datasetId=", - searchLinkToSoftwareLanding: "/search/software?softwareId=", - searchLinkToOrganization: "/search/organization?organizationId=", - searchLinkToOrp: "/search/other?orpId=", - searchLinkToResults: "/search/find/research-outcomes", - searchLinkToDataProviders: "/search/find/dataproviders", - searchLinkToProjects: "/search/find/projects", - searchLinkToOrganizations: "/search/find/organizations", - searchLinkToDatasets: '/search/find/research-outcomes?type="datasets"', - searchLinkToSoftware: '/search/find/research-outcomes?type="software"', - searchLinkToOrps: '/search/find/research-outcomes?type="other"', - searchLinkToCompatibleDataProviders: "/search/content-providers", - searchLinkToEntityRegistriesDataProviders: "/search/entity-registries", - searchLinkToJournals: "/search/journals", - searchLinkToAdvancedResults: "/search/advanced/research-outcomes", - searchLinkToAdvancedProjects: "/search/advanced/projects", - searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders", - searchLinkToAdvancedOrganizations: "/search/advanced/organizations", - errorLink: '/error', - lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows", - showLastIndexInformationLink: true, - bipFrameAPIURL: "https://bip.imsi.athenarc.gr/api/impact-chart?id=", - widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=", - claimsInformationLink: "https://beta.openaire.eu/linking", - depositLearnHowPage: "/participate/deposit/learn-how", - depositSearchPage: "/participate/deposit/search", - shareInZenodoPage: "/participate/deposit/zenodo", - reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu", - admins: ["kostis30fylloy@gmail.com", "argirok@di.uoa.gr"], - lastIndexUpdate: "2019-05-16", - indexInfoAPI: "http://beta.services.openaire.eu/openaire/info/", - altMetricsAPIURL: "https://api.altmetric.com/v1/doi/" + reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu" }; + +export let properties: EnvProperties = { + ...common, ...commonDev, ...props +} From f12adb614fadc8c9bd3e9fc582996b9b63856159 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 13 Feb 2024 10:40:32 +0200 Subject: [PATCH 09/14] [irish-monitor]: Update libraries before merge to develop --- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 340dd96..14cd46b 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 340dd96dc21697a0e1ecf9a76b63e646c14a3490 +Subproject commit 14cd46bdb4ee59fc887e017b1c0ee027b6da3e05 diff --git a/src/assets/common-assets b/src/assets/common-assets index ee22e97..6cef9eb 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit ee22e97b114be823b7ab4e6c41a9cbff93b24e3a +Subproject commit 6cef9ebed0db7ecbcca023bae824239106907960 From 40f694cec9e762a0ecc88d0fde857e989a9b9fac Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 13 Feb 2024 11:02:52 +0200 Subject: [PATCH 10/14] [irish-monitor]: Fix toggle overlay --- src/app/monitor/monitor.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 3168ac9..4d19a00 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -114,7 +114,7 @@
+ (click)="changeOverlay($event, indicator, 'description')"> @@ -124,10 +124,10 @@
+ (clickOutside)="closeOverlay($event, indicator)">
+ (click)="changeOverlay($event, indicator, false)"> From 61a98e851f2601a38efacb4889569fff92477fd2 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 22 Feb 2024 10:38:03 +0200 Subject: [PATCH 11/14] [develop]: Update libraries and change userInfoUrl from userManagementService. --- server.ts | 3 ++- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server.ts b/server.ts index cbf797e..00c29ff 100644 --- a/server.ts +++ b/server.ts @@ -14,6 +14,7 @@ import axios, {AxiosHeaders} from "axios"; import {Stakeholder} from "./src/app/openaireLibrary/monitor/entities/stakeholder"; import {CacheIndicators} from "./src/app/openaireLibrary/monitor-admin/utils/cache-indicators/cache-indicators"; import {Session, User} from "./src/app/openaireLibrary/login/utils/helper.class"; +import {UserManagementService} from "./src/app/openaireLibrary/services/user-management.service"; var bodyParser = require('body-parser'); var jsonParser = bodyParser.json(); @@ -72,7 +73,7 @@ export function app() { async function checkPermissions(req, res, access: (stakeholder, user) => void) { let headers: AxiosHeaders = new AxiosHeaders(); headers.set('Cookie', req.headers.cookie); - let userinfoRes = (await axios.get(properties.userInfoUrl, { + let userinfoRes = (await axios.get(UserManagementService.userInfoUrl(), { withCredentials: true, headers: headers }).catch(error => { diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 14cd46b..a451225 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 14cd46bdb4ee59fc887e017b1c0ee027b6da3e05 +Subproject commit a45122565a997bb25cb319a0ba72ea59f549fff6 diff --git a/src/assets/common-assets b/src/assets/common-assets index 6cef9eb..651102a 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 6cef9ebed0db7ecbcca023bae824239106907960 +Subproject commit 651102a5ba049b71bed8eb6a85a8d02cefcb24cc diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 52eca9a..37639ea 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 52eca9abe84c941a7e78a5690f273d8c8e3194f9 +Subproject commit 37639eab68c63a506b7df10c42e3379c4a05d94d From db44041bd2062145a33fd7fe18a28a589bfa3b30 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 22 Feb 2024 15:13:12 +0200 Subject: [PATCH 12/14] [develop]: Update libraries and remove old properties --- src/app/openaireLibrary | 2 +- src/environments/environment.beta.ts | 3 --- src/environments/environment.prod.ts | 3 --- src/environments/environment.ts | 6 +----- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index a451225..e71aa35 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit a45122565a997bb25cb319a0ba72ea59f549fff6 +Subproject commit e71aa35b983fb5706470141805da27e50a59abc2 diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index 63893dd..3273100 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -5,9 +5,6 @@ let props: EnvProperties = { dashboard: 'monitor', isDashboard: true, enablePiwikTrack: true, - useCache: false, - useLongCache: true, - showContent: true, monitorStatsFrameUrl:"https://beta.services.openaire.eu/stats-tool/", useOldStatisticsSchema: true, adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service/", diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 33366fc..d2aac67 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -5,9 +5,6 @@ let props: EnvProperties = { dashboard: 'monitor', isDashboard: true, enablePiwikTrack: true, - useCache: false, - useLongCache: true, - showContent: true, monitorStatsFrameUrl: "https://services.openaire.eu/stats-tool/", useOldStatisticsSchema: false, adminToolsAPIURL: "https://services.openaire.eu/uoa-monitor-service/", diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 719f438..5f6d27b 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -11,9 +11,6 @@ let props: EnvProperties = { adminToolsPortalType: "monitor", isDashboard: true, enablePiwikTrack: false, - useCache: false, - useLongCache: false, - showContent: true, monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/", useOldStatisticsSchema: false, disableFrameLoad: true, @@ -22,8 +19,7 @@ let props: EnvProperties = { adminToolsCommunity: "monitor", useHelpTexts: true, baseLink: "/", - domain: "http://mpagasas.di.uoa.gr:4600", - reCaptchaSiteKey: "6LcVtFIUAAAAAB2ac6xYivHxYXKoUvYRPi-6_rLu" + domain: "http://mpagasas.di.uoa.gr:4600" }; export let properties: EnvProperties = { From bdd13890fe2cba4463b54075137da7d193337dc2 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 26 Feb 2024 09:47:29 +0200 Subject: [PATCH 13/14] [develop]: Fix mixYear and maxYear in range-year filter in monitor component --- src/app/monitor/monitor.component.html | 5 ++--- src/app/openaireLibrary | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 4d19a00..5f707ca 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -301,9 +301,8 @@
Sign in to apply filters.
  • - +
  • diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index e71aa35..79d39db 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit e71aa35b983fb5706470141805da27e50a59abc2 +Subproject commit 79d39db833a8207513bcf350c02262baf56da4da From 2ac08895b5a18364b8bf3c5a972260e03aedc861 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 28 Mar 2024 12:52:21 +0200 Subject: [PATCH 14/14] Update libraries before deploy --- src/app/openaireLibrary | 2 +- src/assets/common-assets | 2 +- src/assets/openaire-theme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 79d39db..b6cda48 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 79d39db833a8207513bcf350c02262baf56da4da +Subproject commit b6cda48e2fa1db6a2361a862c1fd959077fde58c diff --git a/src/assets/common-assets b/src/assets/common-assets index 651102a..8d2f834 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 651102a5ba049b71bed8eb6a85a8d02cefcb24cc +Subproject commit 8d2f8348d8a601fad14844d920791fe7370bd4a2 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index 37639ea..954a1fe 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit 37639eab68c63a506b7df10c42e3379c4a05d94d +Subproject commit 954a1fe8af0653740882c7db4b9bf92b8f9000f4