From 00724378a86009f91e4f81c5a24987d0a00276e9 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 17 Jun 2024 10:02:40 +0300 Subject: [PATCH 1/9] [develop]: Add extended method for stakeholders in irish service. Add getChartWidth and number to base component. --- .../manage-all.component.ts | 4 +- monitor-admin/topic/indicators.component.html | 9 +-- monitor-admin/topic/indicators.component.ts | 58 +++++-------------- .../utils/stakeholder-base.component.ts | 22 +++++++ .../browse-stakeholder-base.component.ts | 1 + ...or-indicator-stakeholder-base.component.ts | 20 ------- monitor/services/stakeholder.service.ts | 2 +- 7 files changed, 42 insertions(+), 74 deletions(-) diff --git a/monitor-admin/manageStakeholders/manage-all.component.ts b/monitor-admin/manageStakeholders/manage-all.component.ts index d36dee9f..18c3f3e6 100644 --- a/monitor-admin/manageStakeholders/manage-all.component.ts +++ b/monitor-admin/manageStakeholders/manage-all.component.ts @@ -1,5 +1,5 @@ import {Component, OnInit, QueryList, ViewChildren} from "@angular/core"; -import {ManageStakeholders} from "../../monitor/entities/stakeholder"; +import {ManageStakeholders, StakeholderType} from "../../monitor/entities/stakeholder"; import {Session} from "../../login/utils/helper.class"; import {StakeholderBaseComponent} from "../utils/stakeholder-base.component"; import {StakeholderService} from "../../monitor/services/stakeholder.service"; @@ -75,7 +75,7 @@ export class ManageAllComponent extends StakeholderBaseComponent implements OnIn * Filters */ public keyword: string; - public type: string = 'all'; + public type: StakeholderType | 'all' = 'all'; public types: Option[] = [{value: 'all', label: 'All'}].concat(this.stakeholderUtils.types); @ViewChildren(ManageStakeholdersComponent) manageStakeholdersList: QueryList; diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index d6f47d83..26d565d7 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -565,12 +565,9 @@
-
-
+
diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 49cae7bb..7accb1d7 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -380,26 +380,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } } - 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 addJsonPath(index: number) { if (index == 0 && this.getJsonPath(index).getRawValue()[index].indexOf(",") != -1) { //if in the first path there are more than one paths comma separated, split them and autogenerate the forms @@ -487,6 +467,19 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; } + public dataTitles(index: number): string[] { + let formControl: UntypedFormControl; + let i = 0; + let dataTitles: string[] = []; + formControl = this.getParameter(index, 'data_title_' + i); + while(formControl != null) { + dataTitles.push('data_title_' + i); + i++; + formControl = this.getParameter(index, 'data_title_' + i); + } + return dataTitles; + } + private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) { return this.sanitizer.bypassSecurityTrustResourceUrl( this.indicatorUtils.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath))); @@ -1283,30 +1276,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - migrateFromOldImportJsonFile(charts) { - // first section contains numbers - // second contains charts - let hasNumbers = false; - for (let chart of charts) { - if (chart['type'] == 'number') { - hasNumbers = true; - break; - } - } - let chartsSection = (hasNumbers ? 1 : 0); // no numbers: first sections contains charts - for (let chart of charts) { - if (chart['sectionIndex'] == null) { - chart['sectionIndex'] = chart['type'] == 'chart' ? chartsSection : 0; - } - if (chart.url && chart.jsonPath) { - chart.indicatorPaths = [{url: chart.url, jsonPath: chart.jsonPath}]; - } else if(chart.url) { - chart.indicatorPaths = [{url: chart.url}]; - } - } - return charts; - } - importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) { let sectionsToSave: Section[] = []; let countIndicators = 0; @@ -1321,7 +1290,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } // name description additionalDescription, height, width, visibility let duplicates = 0; - charts = this.migrateFromOldImportJsonFile(charts); for (let chart of charts) { chart.visibility = this.showVisibility ? chart.visibility : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities); if (!sectionsToSave[chart['sectionIndex']]) { diff --git a/monitor-admin/utils/stakeholder-base.component.ts b/monitor-admin/utils/stakeholder-base.component.ts index b8905a6e..79e70ee3 100644 --- a/monitor-admin/utils/stakeholder-base.component.ts +++ b/monitor-admin/utils/stakeholder-base.component.ts @@ -2,6 +2,8 @@ import {Directive} from "@angular/core"; import {BaseComponent} from "../../sharedComponents/base/base.component"; import {IndicatorUtils, StakeholderUtils} from "./indicator-utils"; import {ConnectHelper} from "../../connect/connectHelper"; +import {IndicatorSize} from "../../monitor/entities/stakeholder"; +import {statsToolParser} from "./cache-indicators/cache-indicators"; @Directive() export abstract class StakeholderBaseComponent extends BaseComponent { @@ -51,4 +53,24 @@ export abstract class StakeholderBaseComponent extends BaseComponent { export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseComponent { indicatorUtils: IndicatorUtils = new IndicatorUtils(); + + public getNumberClassBySize(size: IndicatorSize): string { + if (size === 'small') { + return 'uk-width-medium'; + } else if (size === 'medium') { + return 'uk-width-large'; + } else { + return 'uk-width-1-2@m uk-width-1-1'; + } + } + + public getChartClassBySize(size: IndicatorSize): string { + 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'; + } + } } diff --git a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts index a2615a23..3e50e18b 100644 --- a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts +++ b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts @@ -30,6 +30,7 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent parameters = {}; keywordControl: FormControl; hasPublications: boolean = true; + hasOpenAccess: boolean = true; /* Services */ protected layoutService: LayoutService; diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index c6d388e3..1ce52d99 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -386,26 +386,6 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator return indicators.filter(indicator => this.hasPermission(indicator.visibility)).length; } - 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): string { - 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(); } diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index fc582976..ba7bf5bb 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -129,7 +129,7 @@ export class StakeholderService { } getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { - return this.http.get(url + '/stakeholder' + ((type) ? ('?type=' + type) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { + return this.http.get(url + '/stakeholder' + ((type) ? ('?type=' + type) : (defaultId?'?defaultId=' + defaultId:'')) + ((type && defaultId) ? ('&defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } -- 2.17.1 From 56b597231634016bd4bb0043019f91d481aaf746 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 18 Jun 2024 10:07:44 +0300 Subject: [PATCH 2/9] [develop | CHANGED]: Change number class size for medium and large to uk-widht-max-content. --- monitor-admin/utils/stakeholder-base.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor-admin/utils/stakeholder-base.component.ts b/monitor-admin/utils/stakeholder-base.component.ts index 79e70ee3..76daa8f5 100644 --- a/monitor-admin/utils/stakeholder-base.component.ts +++ b/monitor-admin/utils/stakeholder-base.component.ts @@ -58,9 +58,9 @@ export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseC if (size === 'small') { return 'uk-width-medium'; } else if (size === 'medium') { - return 'uk-width-large'; + return 'uk-width-max-content'; } else { - return 'uk-width-1-2@m uk-width-1-1'; + return 'uk-width-max-content'; } } -- 2.17.1 From 12a94fae400b82867dff9b554c679627767af163 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 18 Jun 2024 14:43:14 +0300 Subject: [PATCH 3/9] [develop]: Use threshold parameter in observer of slider tabs. --- sharedComponents/tabs/slider-tabs.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts index ae37843d..095ef1d2 100644 --- a/sharedComponents/tabs/slider-tabs.component.ts +++ b/sharedComponents/tabs/slider-tabs.component.ts @@ -233,7 +233,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { }, 200); } }); - }, {threshold: 0.1}); + }, {threshold: this.scrollThreshold}); this.tabs.forEach(tab => { let element = document.getElementById(tab.id.toString()); if (element) { -- 2.17.1 From 51787e582a0f95c44a116df23dadb87ebc4bd7de Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jun 2024 10:17:02 +0300 Subject: [PATCH 4/9] [develop | DONE | CHANGED] indicator utils: change if/else block for comparing queries - separate if for start/end year --- monitor-admin/utils/indicator-utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index de473d15..d54c81e5 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -578,10 +578,11 @@ export class IndicatorUtils { } newJsonObject[this.getDescriptionObjectName(newJsonObject)]["colors"][queryIndex] = inActiveColors[queryIndex]; filterApplied = true; - } else if (filterType == "start_year" || filterType == "end_year") { + } + if (filterType == "start_year" || filterType == "end_year") { //if has date filter already // if (filterType == "start_year" && parseInt(filterValue) > parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) { - queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue; + //queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue; // } else if (filterType == "end_year" && parseInt(filterValue) < parseInt(queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0])) { queries["query"]["filters"][filterposition.filter]['groupFilters'][filterposition.groupFilter]["values"][0] = filterValue; // } -- 2.17.1 From deaa358cea4952fe27293e339c17822bbf0a3c08 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jun 2024 11:20:58 +0300 Subject: [PATCH 5/9] [develop | DONE | CHANGED] indicator form: show datatitles only if legend is enabled in chart --- monitor-admin/topic/indicators.component.html | 8 +++++--- monitor-admin/topic/indicators.component.ts | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 26d565d7..44ce49f5 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -565,9 +565,11 @@
-
+ +
+
diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 7accb1d7..f8f16df3 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -1547,4 +1547,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple get isEditable(): boolean { return this.stakeholder.copy || this.stakeholder.defaultId == null || this.stakeholder.defaultId == '-1'; } + + isLegendEnabled(indicator, i){ + let chartObject = JSON.parse(indicator.indicatorPaths[i].chartObject, indicator.indicatorPaths[i].chartObject) + return !chartObject || !chartObject.chartDescription.legend || chartObject.chartDescription.legend.enabled + } } -- 2.17.1 From 4ea707cbaf885a717c9349f61cac59f709c3de29 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jun 2024 11:28:09 +0300 Subject: [PATCH 6/9] [develop | DONE | CHANGED] links: organization links always pending --- claims/claim-utils/displayClaims/displayClaims.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index f2b50af5..28600ec4 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -366,6 +366,11 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { let lastUpdateDateStr = Dates.getDateToString(lastUpdateDate); let claimDate = new Date(claim.date); let claimDateStr = Dates.getDateToString(claimDate); + //TODO remove when organization links are integrated in Graph ------> + if(claim.sourceType == 'organization'){ + return false; + } + // remove until here <------- if (claimDateStr < lastUpdateDateStr) { return true; } else { -- 2.17.1 From feaa370338839f25601749ef9af324e977b17a6f Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 19 Jun 2024 11:28:32 +0300 Subject: [PATCH 7/9] [develop]: Add condition for environement in order to hide umbrella dashboards from production. --- monitor-admin/utils/indicator-utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index d54c81e5..0103e68f 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -53,7 +53,7 @@ export interface StakeholderCategory { export class StakeholderConfiguration { public static ENTITIES: Entities = new Entities(); - public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = [ + public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = (properties.environment !== 'production')?[ {name: 'All', plural: 'All', value: 'all'}, {name: 'Template', plural: 'Templates', value: 'templates'}, {name: 'Standalone', plural: 'Standalone', value: 'standalone'}, @@ -61,7 +61,12 @@ export class StakeholderConfiguration { {name: 'Integrated ', plural: 'Integrated', value: 'dependent', tooltip: 'A profile that doesn\'t have his own ' + StakeholderConfiguration.ENTITIES.stakeholder + ', but can be integrated into another ' + StakeholderConfiguration.ENTITIES.stakeholder + '.'} + ]:[ + {name: 'All', plural: 'All', value: 'all'}, + {name: 'Template', plural: 'Templates', value: 'templates'}, + {name: 'Profiles', plural: 'Profiles', value: 'standalone'}, ]; + public static TYPES: Option[] = [ {value: 'funder', label: StakeholderConfiguration.ENTITIES.funder}, {value: 'ri', label: StakeholderConfiguration.ENTITIES.ri}, -- 2.17.1 From f26c9e8f481a70d03f0392fe2a4fc9d9e9f40151 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jun 2024 12:14:15 +0300 Subject: [PATCH 8/9] [develop | DONE | FIXED ] Project/ Funder claim form: fix messages --- claims/claim-utils/claimProjectSearchForm.component.html | 2 +- claims/claim-utils/claimProjectSearchForm.component.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/claims/claim-utils/claimProjectSearchForm.component.html b/claims/claim-utils/claimProjectSearchForm.component.html index cf4806ef..b16a54f8 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.html +++ b/claims/claim-utils/claimProjectSearchForm.component.html @@ -13,7 +13,7 @@ searching for {{openaireEntities.PROJECTS.toLowerCase()}} to add them in the Basket -
+
Select funder or search for projects to proceed
diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 0c550313..b92df231 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -36,7 +36,7 @@ export class ClaimProjectsSearchFormComponent { public projects:string[]; public warningMessage = ""; openaireResults:ClaimEntity[] = []; - openaireResultsNum: number ; + openaireResultsNum: number = -1; openaireResultsPage : number = 1; openaireResultsStatus:number = this.errorCodes.NONE; page : number = 1; @@ -91,6 +91,7 @@ export class ClaimProjectsSearchFormComponent { this.selectedFunder = value; this.isNoProjectFunder = this.selectedFunder && this.selectedFunder.number == 1; this.openaireResults = []; + this.openaireResultsNum = -1; if(this.isNoProjectFunder){ this.showResults = true; this.search(1,1); -- 2.17.1 From 6a781dd4783e47a452b92b1e8abf947e221494e3 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 19 Jun 2024 12:28:45 +0300 Subject: [PATCH 9/9] [develop | DONE | CHANGED ] AdvancedSearchInputComponent: show the arrow down in all select inputs --- .../advanced-search-input/advanced-search-input.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/sharedComponents/advanced-search-input/advanced-search-input.component.ts b/sharedComponents/advanced-search-input/advanced-search-input.component.ts index 49aedc65..ebe50915 100644 --- a/sharedComponents/advanced-search-input/advanced-search-input.component.ts +++ b/sharedComponents/advanced-search-input/advanced-search-input.component.ts @@ -70,7 +70,6 @@ export class AdvancedSearchInputComponent implements AfterContentInit, OnDestroy init() { this.inputs.forEach(input => { input.inputClass = 'advanced-search'; - input.selectArrow = null; }); } -- 2.17.1