From ac200a89ac959ddfff1309f0abec2bb3a34b071f Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 17 Jul 2024 13:10:44 +0300 Subject: [PATCH 01/16] [develop | DONE | FIX] Change Sorting options Dsc. to Desc. --- monitor/browse-stakeholder/browse-stakeholder-base.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts index a0fd6112..c26df7f6 100644 --- a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts +++ b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts @@ -20,7 +20,7 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent gridView: boolean = true; sortOptions: Option[] = [ {value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'}, - {value: 'alphDsc', label: 'Alphabetically Dsc. (Z-A)'}, + {value: 'alphDsc', label: 'Alphabetically Desc. (Z-A)'}, ]; pageOptions: number[] = [10, 20, 30, 40]; sortBy: string = null; From ed7ee4b4a3aaea68d32750649ac567161383071e Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 17 Jul 2024 13:25:44 +0300 Subject: [PATCH 02/16] [develop | DONE | ADDED] Add Organization refine field in results for Connect --- connect/connectHelper.ts | 2 +- utils/properties/env-properties.ts | 1 + utils/properties/searchFields.base.ts | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/connect/connectHelper.ts b/connect/connectHelper.ts index 18c60846..0e9d1e43 100644 --- a/connect/connectHelper.ts +++ b/connect/connectHelper.ts @@ -12,7 +12,7 @@ export class ConnectHelper { if(properties.environment == "development" && (properties.adminToolsPortalType == "connect" || properties.adminToolsPortalType == "community" || properties.adminToolsPortalType == "aggregator" || properties.adminToolsPortalType == "eosc")) { - domain = "covid-19.openaire.eu"; //for testing + // domain = "covid-19.openaire.eu"; //for testing } domain = domain.indexOf("//") != -1? domain.split("//")[1]:domain; //remove https:// prefix if (domain.indexOf('eosc-portal.eu') != -1) { diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 1932596d..f518f97f 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -8,6 +8,7 @@ export interface EnvProperties { adminToolsPortalType?: PortalType; dashboard?: Dashboard; isDashboard?: boolean; + plan?:string; domain?: string; enablePiwikTrack?: boolean; useCache?: boolean; diff --git a/utils/properties/searchFields.base.ts b/utils/properties/searchFields.base.ts index 4d25b6ec..effe8ade 100644 --- a/utils/properties/searchFields.base.ts +++ b/utils/properties/searchFields.base.ts @@ -349,7 +349,15 @@ export class SearchFieldsBase { operator: "hl", equalityOperator: " = ", filterType: "triplet" - } + }, + ["relorganization"]: { + name: OpenaireEntities.ORGANIZATION, + type: "refine", + param: "organization", + operator: "or", + equalityOperator: " exact ", + filterType: "checkbox" + }, }; public RESULT_STATIC_FIELD_VALUES: { [key: string]: {"name": string, "id": string, "count": string}[] } = { From dd4d785d966a040bbc3f8cbebb2374bdab6eebb9 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 18 Jul 2024 15:48:20 +0300 Subject: [PATCH 03/16] [develop | DONE | CHANGED]: [Performance improvement] resultLanding.component: Added fields "impactClicked" and "altMetricsClicked", to initalize and show the relative content only on click | entity-actions.component.ts: Added field "addThisClicked" to call only on click. --- .../result/resultLanding.component.html | 72 ++++++++++--------- .../result/resultLanding.component.ts | 14 ++++ .../entity-actions.component.ts | 4 +- 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 7621c2a0..f3a0de11 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -1000,10 +1000,10 @@ Overview
  • - Impact + Impact
  • - Social + Social
  • Usage @@ -1092,44 +1092,46 @@
  • -
    -
    - - - - - - - - - - -
    - - - {{measure.name}} - - - {{isNumber(measure.value) ? formatNumber(measure.value) : measure.value}} -
    + +
    +
    + + + + + + + + + + +
    + + + {{measure.name}} + + + {{isNumber(measure.value) ? formatNumber(measure.value) : measure.value}} +
    +
    +
    + +
    -
    - +
    + Powered by + + BIP! + BIP! +
    -
    -
    - Powered by - - BIP! - BIP! - -
    +
  • - +
  • diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index 8596a08b..910897ff 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -79,6 +79,8 @@ export class ResultLandingComponent { public descriptionClicked: boolean; // Metrics tab variables + public impactClicked: boolean; + public altMetricsClicked: boolean; public metricsClicked: boolean; public hasAltMetrics: boolean = false; public viewsFrameUrl: string; @@ -1126,6 +1128,18 @@ export class ResultLandingComponent { this.descriptionModal.open(); } + public clickedImpactIndicators() { + setTimeout( () => { + this.impactClicked = true; + }); + } + + public clickedAltMetrics() { + setTimeout( () => { + this.altMetricsClicked = true; + }); + } + public clickedUsageMetrics() { setTimeout( () => { this.metricsClicked = true; diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index b4d218e0..36be6079 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -58,7 +58,7 @@ import {EnvProperties} from "../properties/env-properties"; [type]="getTypeName().toLowerCase()"> - +
    @@ -98,6 +98,7 @@ export class EntityActionsComponent implements OnInit { @Input() showTooltip: boolean = true; @Input() compactView: boolean = false; // if true, do not show label for actions public citeThisClicked: boolean; + public addThisClicked: boolean; public routerHelper: RouterHelper = new RouterHelper(); @ViewChild('citeModal') citeModal; @ViewChild('embedResultsModal') embedResultsModal; @@ -140,6 +141,7 @@ export class EntityActionsComponent implements OnInit { } public openAddThisModal() { + this.addThisClicked = true; this.addThisModal.cancelButton = false; this.addThisModal.okButton = false; this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks"; From ed8f4f54d1f5cb8ea9546e4705952a5f5769eb16 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 22 Jul 2024 10:28:17 +0300 Subject: [PATCH 04/16] [develop | DONE]: Remove condition for hiding umbrella in production. --- monitor-admin/utils/indicator-utils.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 5a17a189..a30172dd 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -53,18 +53,16 @@ export interface StakeholderCategory { export class StakeholderConfiguration { public static ENTITIES: Entities = new Entities(); - public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = (properties.environment !== 'production')?[ + public static STAKEHOLDER_CATEGORIES: StakeholderCategory[] = [ {name: 'All', plural: 'All', value: 'all'}, {name: 'Template', plural: 'Templates', value: 'templates'}, {name: 'Standalone', plural: 'Standalone', value: 'standalone'}, {name: 'Umbrella', plural: 'Umbrella', value: 'umbrella'}, - {name: 'Integrated ', plural: 'Integrated', value: 'dependent', + { + 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'}, + ', but can be integrated into another ' + StakeholderConfiguration.ENTITIES.stakeholder + '.' + } ]; public static TYPES: Option[] = [ @@ -734,7 +732,7 @@ export class IndicatorUtils { if (indicatorPath.type == null) { indicatorPath.type = this.defaultChartType; } - if(tab) { + if (tab) { indicatorPath.parameters.tab = tab; } return indicatorPath; @@ -783,7 +781,7 @@ export class IndicatorUtils { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches - gfilter["values"][0] = replacedValue; + gfilter["values"][0] = replacedValue; } } } From 7bb45fefa04f7dea80d7679b507030fb22ac7cba Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 22 Jul 2024 11:47:31 +0300 Subject: [PATCH 05/16] [develop | FIXED]: Add ts-ignore in axios import statement. --- monitor-admin/utils/cache-indicators/cache-indicators.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor-admin/utils/cache-indicators/cache-indicators.ts b/monitor-admin/utils/cache-indicators/cache-indicators.ts index 8b7418b3..c3b577c8 100644 --- a/monitor-admin/utils/cache-indicators/cache-indicators.ts +++ b/monitor-admin/utils/cache-indicators/cache-indicators.ts @@ -1,4 +1,5 @@ import {IndicatorType, Stakeholder} from "../../../monitor/entities/stakeholder"; +// @ts-ignore import axios from "axios"; import {IndicatorUtils} from "../indicator-utils"; import {Composer} from "../../../utils/email/composer"; From e4956f8392c7b71052b05ef3d2ef440da924fd31 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 24 Jul 2024 15:18:12 +0300 Subject: [PATCH 06/16] [develop | DONE | CHANGED]: newSearchPage.component.html: Reordered buttons - moved compact results button before download button. --- .../searchUtils/newSearchPage.component.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 67044711..32d762b0 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -367,6 +367,14 @@
    + + + + +
    @@ -381,14 +389,6 @@
    - - - - - From 310f06b2348977c64825231fff79180f70fb404d Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 25 Jul 2024 10:31:08 +0300 Subject: [PATCH 07/16] [develop]: Make some improvements regarding import/export indicators and editing an indicator. --- monitor-admin/topic/indicators.component.html | 314 ++++++++---------- monitor-admin/topic/indicators.component.ts | 85 ++--- monitor-admin/utils/indicator-utils.ts | 10 - .../utils/stakeholder-base.component.ts | 14 +- monitor/entities/stakeholder.ts | 25 ++ sharedComponents/tabs/slider-tab.component.ts | 2 + .../tabs/slider-tabs.component.ts | 146 ++++---- 7 files changed, 278 insertions(+), 318 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 44ce49f5..8b5ad4c2 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -6,7 +6,8 @@
    - @@ -20,66 +21,67 @@
    -
    {{numberSections.at(i).get('title').value}}
    +
    {{ numberSections.at(i).get('title').value }}
    - -
    -
    -
    - +
    +
    +
    + - - - - -
    - -
    -
    -
    {{ indicator.name }}
    -
    - - -- + + + + +
    +
    +
    {{ indicator.name }}
    +
    + + -- +
    - +
    @@ -99,7 +101,14 @@
    - +
    +
    + +
    +
    @@ -125,24 +134,30 @@
    -
    {{chartSections.at(i).get('title').value}}
    +
    {{ chartSections.at(i).get('title').value }}
    - -
    -
    + [attr.uk-sortable]="isEditable ? 'group: chart': null" uk-grid> +
    +
    +
    + +
    -
    - {{ indicator.name }} -
    +
    + {{ indicator.name + " " }} +
    -
    +
    -
    +
    - - - -
    + + + + +
    - +
    @@ -235,7 +251,14 @@
    - +
    +
    + +
    +
    @@ -269,68 +292,8 @@

    -
    -
    +
    @@ -388,8 +351,8 @@ - - + +
    -
    + -
    -
    +
    +
    -
    -
    @@ -641,13 +603,3 @@ Are you sure you want to proceed?
    - -
    -
    - -
    -
    -
    diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 5f2eab4e..97c148c3 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -10,8 +10,8 @@ import { ViewChild } from "@angular/core"; import { - Format, - Indicator, + Format, ImportIndicators, + Indicator, IndicatorImport, IndicatorPath, IndicatorSize, IndicatorType, @@ -79,7 +79,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple * Editable indicator */ public section: Section; - public indicator: Indicator; public index: number = -1; public editing: boolean = false; public dragging: boolean = false; @@ -102,7 +101,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple @ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent; @ViewChild('deleteNotify', {static: true}) deleteNotify: NotifyFormComponent; /* Transition Groups */ - @ViewChild('numbersTransition') numbersTransition: TransitionGroupComponent; @ViewChild('chartsTransition') chartsTransition: TransitionGroupComponent; public isFullscreen: boolean = false; @@ -581,26 +579,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } } - public removeNumberIndicatorPath(index: number) { - this.numberIndicatorPaths.removeAt(index); - this.indicator.indicatorPaths.splice(index, 1); - this.numbersTransition.init(); - if (this.indicator.activePath === index) { - this.activeNumberIndicatorPath(Math.max(0, index - 1)); - } else if (this.indicator.activePath > index) { - this.activeNumberIndicatorPath(this.indicator.activePath - 1); - } - this.numberIndicatorFb.markAsDirty(); - } - public removeChartIndicatorPath(index: number) { this.chartIndicatorPaths.removeAt(index); this.indicator.indicatorPaths.splice(index, 1); this.chartsTransition.init(); if (this.indicator.activePath === index) { - this.activeChartIndicatorPath(Math.max(0, index - 1)); + this.setActiveChartIndicatorPath(Math.max(0, index - 1)); } else if (this.indicator.activePath > index) { - this.activeChartIndicatorPath(this.indicator.activePath - 1); + this.setActiveChartIndicatorPath(this.indicator.activePath - 1); } this.chartIndicatorFb.markAsDirty(); } @@ -609,9 +595,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple type: 'number' | 'chart', index: number, newIndex: number = index - 1) { let indicatorPaths = type == 'number'?this.numberIndicatorPaths:this.chartIndicatorPaths; - if(type == 'number') { - this.numbersTransition.init(); - } else { + if(type == 'chart') { this.chartsTransition.init(); } let a = indicatorPaths.at(index); @@ -627,16 +611,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple form.markAsDirty(); } - public activeNumberIndicatorPath(index: number) { - let paths = this.numberIndicatorPaths; - if (index == paths.length) { - this.addNumberIndicatorPath(); - this.numbersTransition.init(); - } - this.indicator.activePath = index; - } - - public activeChartIndicatorPath(index: number) { + public setActiveChartIndicatorPath(index: number) { let paths = this.chartIndicatorPaths; if (index == paths.length) { this.addChartIndicatorPath(); @@ -1008,8 +983,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); } else if (type === 'number') { let indicatorPath = this.numberIndicatorPaths.at(index).value; - indicatorPath.parameters.forEach(parameter => { - if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { + indicatorPath.parameters.forEach((parameter: { value: any; key: string | number; }) => { + if (!parameter.value && !this.indicator.indicatorPaths[index].parameters[parameter.key]) { + return; + } else if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { hasDifference = true; return; } @@ -1027,6 +1004,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } refreshIndicator(type: IndicatorType = 'chart') { + let activePath = this.indicator.activePath; if (type === 'chart') { this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart'); this.indicator.indicatorPaths.forEach(indicatorPath => { @@ -1038,6 +1016,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.validateJsonPath(index); }); } + this.indicator.activePath = activePath; } deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) { @@ -1276,10 +1255,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) { + importIndicatorsAndSave(importIndicators: ImportIndicators) { let sectionsToSave: Section[] = []; let countIndicators = 0; - if (stakeholder.type !== this.stakeholder.type) { + if (importIndicators.stakeholder.type !== this.stakeholder.type) { UIkit.notification("The type of this profile is not the same with the file's one!", { status: 'warning', timeout: 6000, @@ -1290,26 +1269,26 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } // name description additionalDescription, height, width, visibility let duplicates = 0; - for (let chart of charts) { - chart.visibility = this.showVisibility ? chart.visibility : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities); - if (!sectionsToSave[chart['sectionIndex']]) { - let sectionToSave = new Section(chart['sectionType'] ? chart['sectionType'] : chart['type'], chart['sectionTitle']); + for (let indicator of importIndicators.indicators) { + indicator.visibility = this.showVisibility ? indicator.visibility : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities); + if (!sectionsToSave[indicator['sectionIndex']]) { + let sectionToSave = new Section(indicator['sectionType'] ? indicator['sectionType'] : indicator['type'], indicator['sectionTitle']); sectionToSave.indicators = []; - sectionsToSave[chart['sectionIndex']] = sectionToSave; + sectionsToSave[indicator['sectionIndex']] = sectionToSave; } let exists = false; let indicatorPaths: IndicatorPath[] = []; // validate indicators' schema from file let invalid_file_message; - if (!chart.type) { + if (!indicator.type) { invalid_file_message = "No indicator type is specified. Type should be chart or number."; - } else if (chart.type != "chart" && chart.type != "number") { + } else if (indicator.type != "chart" && indicator.type != "number") { invalid_file_message = "Invalid indicator type. Type should be chart or number."; - } else if (chart.indicatorPaths.length === 0) { + } else if (indicator.indicatorPaths.length === 0) { invalid_file_message = "No indicator paths are specified." - } else if (chart.type == "number" && chart.indicatorPaths.filter(path => !path.jsonPath).length > 0) { + } else if (indicator.type == "number" && indicator.indicatorPaths.filter(path => !path.jsonPath).length > 0) { invalid_file_message = "No jsonPath is specified for number indicator." - } else if (chart.indicatorPaths.filter(path => !path.url).length > 0) { + } else if (indicator.indicatorPaths.filter(path => !path.url).length > 0) { invalid_file_message = "No indicator url is specified."; } @@ -1323,8 +1302,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple break; } - if (chart.type == "chart") { - indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder, path.tab)); + if (indicator.type == "chart") { + indicatorPaths = indicator.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, null, importIndicators.stakeholder, path.tab)); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => { section.indicators.forEach(indicator => { indicator.indicatorPaths.forEach(path => { @@ -1337,10 +1316,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); }); }); - } else if (chart.type == "number") { - indicatorPaths = chart.indicatorPaths.map(path => + } else if (indicator.type == "number") { + indicatorPaths = indicator.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(path.url), path.url, - stakeholder, path.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(path.url)))); + importIndicators.stakeholder, path.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(path.url)))); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers.forEach((section: Section) => { section.indicators.forEach(indicator => { indicator.indicatorPaths.forEach(path => { @@ -1355,8 +1334,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); } if (indicatorPaths.length > 0) { - let i: Indicator = new Indicator(chart.name, chart.description, chart.additionalDescription, chart.type, chart.width, chart.height, this.showVisibility ? "RESTRICTED" : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities), indicatorPaths); - sectionsToSave[chart['sectionIndex']].indicators.push(i); + let i: Indicator = new Indicator(indicator.name, indicator.description, indicator.additionalDescription, indicator.type, indicator.width, indicator.height, this.showVisibility ? "RESTRICTED" : this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities), indicatorPaths); + sectionsToSave[indicator['sectionIndex']].indicators.push(i); countIndicators++; } } @@ -1498,7 +1477,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); this.finish(); } else { - this.importIndicatorsAndSave(json.stakeholder, json.indicators); + this.importIndicatorsAndSave(json); } }, (error) => { console.error("Error importing files", error); diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index a30172dd..767d23fa 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -84,8 +84,6 @@ export class StakeholderConfiguration { {icon: 'incognito', value: "PRIVATE", label: 'Private'}, ]; public static CACHE_INDICATORS: boolean = true; - public static NUMBER_MULTI_INDICATOR_PATHS = false; - public static CHART_MULTI_INDICATOR_PATHS = true; public static openAccess: Map = new Map(); } @@ -119,14 +117,6 @@ export class StakeholderUtils { return StakeholderConfiguration.CACHE_INDICATORS; } - get hasMultiNumberIndicatorPaths() { - return StakeholderConfiguration.NUMBER_MULTI_INDICATOR_PATHS; - } - - get hasMultiChartIndicatorPaths() { - return StakeholderConfiguration.CHART_MULTI_INDICATOR_PATHS; - } - get openAccess(): Map { return StakeholderConfiguration.openAccess; } diff --git a/monitor-admin/utils/stakeholder-base.component.ts b/monitor-admin/utils/stakeholder-base.component.ts index 76daa8f5..6526f041 100644 --- a/monitor-admin/utils/stakeholder-base.component.ts +++ b/monitor-admin/utils/stakeholder-base.component.ts @@ -2,7 +2,7 @@ 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 {Indicator, IndicatorSize} from "../../monitor/entities/stakeholder"; import {statsToolParser} from "./cache-indicators/cache-indicators"; @Directive() @@ -53,6 +53,7 @@ export abstract class StakeholderBaseComponent extends BaseComponent { export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseComponent { indicatorUtils: IndicatorUtils = new IndicatorUtils(); + indicator: Indicator; public getNumberClassBySize(size: IndicatorSize): string { if (size === 'small') { @@ -73,4 +74,15 @@ export abstract class IndicatorStakeholderBaseComponent extends StakeholderBaseC return 'uk-width-1-1'; } } + + public getActivePathIndex(indicator: Indicator = this.indicator): number { + return indicator?.activePath ? indicator.activePath : 0; + } + + public getActiveIndicatorPath(indicator: Indicator = this.indicator) { + if(indicator?.indicatorPaths.length > this.getActivePathIndex(indicator)) { + return indicator.indicatorPaths[this.getActivePathIndex(indicator)]; + } + return null; + } } diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 277e2388..25f72033 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -16,6 +16,31 @@ export type Format = 'NUMBER' | 'PERCENTAGE'; export type Visibility = 'PUBLIC' | 'PRIVATE' | 'RESTRICTED'; export type Overlay = 'embed' | 'description' | false; +export interface IndicatorImport { + indicatorPaths?: IndicatorPathImport[]; + type: IndicatorType, + name: string, + description: string, + additionalDescription: string, + visibility: Visibility, + width: IndicatorSize, + height: IndicatorSize, + sectionTitle: string, + sectionType: IndicatorType, + sectionIndex: number +} + +export interface IndicatorPathImport { + jsonPath?: string[], + tab: string, + url: string +} + +export interface ImportIndicators { + stakeholder: Stakeholder, + indicators: IndicatorImport[] +} + export class ManageStakeholders { templates: (Stakeholder & StakeholderInfo)[]; standalone: (Stakeholder & StakeholderInfo)[]; diff --git a/sharedComponents/tabs/slider-tab.component.ts b/sharedComponents/tabs/slider-tab.component.ts index f585e095..b2113b55 100644 --- a/sharedComponents/tabs/slider-tab.component.ts +++ b/sharedComponents/tabs/slider-tab.component.ts @@ -15,6 +15,8 @@ export class SliderTabComponent { @Input() public disabled: boolean = false; @Input() + public invisible: boolean = false; + @Input() public align: 'left' | 'right' = 'left'; @Input() public routerLink: any[] | string | null | undefined = null; diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts index 095ef1d2..ae72cece 100644 --- a/sharedComponents/tabs/slider-tabs.component.ts +++ b/sharedComponents/tabs/slider-tabs.component.ts @@ -21,71 +21,71 @@ declare var UIkit; @Component({ selector: 'slider-tabs', template: ` -
    `, }) export class SliderTabsComponent implements AfterViewInit, OnDestroy { @@ -149,18 +149,18 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { private observer: IntersectionObserver; private timeout: Timeout; isServer: boolean; - + constructor(private route: ActivatedRoute, private router: Router, private cdr: ChangeDetectorRef, @Inject(PLATFORM_ID) private platform: any) { this.isServer = isPlatformServer(this.platform); } - + ngAfterViewInit() { this.initTabs(); this.tabs.changes.subscribe(() => { - this.initTabs(); + this.initTabs(); }); } @@ -194,7 +194,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { }); } } - + private scrollToStart() { this.subscriptions.push(UIkit.util.on(this.connect, 'shown', (event): void => { let index = event.detail[0].index(); @@ -204,7 +204,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { } })); } - + private scrollable(slider = null) { this.activeFragment(this.route.snapshot.fragment, slider); this.subscriptions.push(this.route.fragment.subscribe(fragment => { @@ -212,7 +212,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { })); this.setObserver(); } - + private setObserver() { if (this.observer) { this.observer.disconnect(); @@ -249,7 +249,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { this.slider.show(this.activeIndex); } } - + private activeFragment(fragment, slider) { let index = 0; if (fragment) { @@ -268,15 +268,15 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { }); this.cdr.detectChanges(); } - + get leftTabs(): SliderTabComponent[] { return this.tabs.toArray().filter(tab => tab.align === 'left'); } - + get rightTabs(): SliderTabComponent[] { return this.tabs.toArray().filter(tab => tab.align === 'right'); } - + ngOnDestroy() { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscription) { From 0d0c077a4c553193a79b17c78754406de2ca6808 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Fri, 26 Jul 2024 11:38:57 +0300 Subject: [PATCH 08/16] [develop | DONE | FIXED] indicator-utils: add 'return null' on 2 methods (triggered error on validator project) --- monitor-admin/utils/indicator-utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 767d23fa..613bc1c2 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -734,6 +734,7 @@ export class IndicatorUtils { } else if ((obj[this.getDescriptionObjectName(obj)]).hasOwnProperty("queries")) { return "queries"; } + return null; } private getDescriptionObjectName(obj) { @@ -746,6 +747,7 @@ export class IndicatorUtils { } else if (obj.hasOwnProperty("series")) { return "series"; } + return null; } private extractType(obj, indicatorPath: IndicatorPath): IndicatorPathType { From 8d6c45abe39953e70764bca0fb0e5446055d6325 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 1 Aug 2024 14:06:12 +0300 Subject: [PATCH 09/16] [develop | DONE | CHANGED]: fos/fos.component.html & fos/fos.component.ts & landing-utils/fos.component.ts & ISVocabularies.service.ts & resultLanding.service.ts: hide L3 & L4 FoS. --- fos/fos.component.html | 110 +++++++++--------- fos/fos.component.ts | 36 +++--- landingPages/landing-utils/fos.component.ts | 7 +- landingPages/result/resultLanding.service.ts | 19 ++- .../ISVocabularies.service.ts | 3 +- 5 files changed, 101 insertions(+), 74 deletions(-) diff --git a/fos/fos.component.html b/fos/fos.component.html index d5d67d7f..eaec9981 100644 --- a/fos/fos.component.html +++ b/fos/fos.component.html @@ -157,51 +157,54 @@ {{child.id}} + + - +
    @@ -223,19 +226,22 @@ class="uk-link-text" [innerHTML]="highlightKeyword(subItem.id)"> -
    - - + + +
    + + - -
    - - -
    -
    -
    + +
    + + +
    +
    +
    +
    diff --git a/fos/fos.component.ts b/fos/fos.component.ts index e86317ea..88177849 100644 --- a/fos/fos.component.ts +++ b/fos/fos.component.ts @@ -184,7 +184,8 @@ export class FosComponent implements OnInit, OnDestroy { if(fos.children) { fos.children.forEach(l2 => { this.fosOptions.push(l2.id); - if(l2.children) { + // hide L3 & L4 FoS + if(l2.children && properties.environment == "development") { l2.children.forEach(l3 => { this.fosOptions.push(l3.id); if(l3.children) { @@ -212,20 +213,25 @@ export class FosComponent implements OnInit, OnDestroy { if(item.children?.length && !matchLevel1) { item.children = item.children.filter(subItem => { matchLevel2 = !!subItem.id.includes(value?.toLowerCase()); - // 3rd level search - if(subItem.children?.length && !matchLevel2) { - subItem.children = subItem.children.filter(subSubItem => { - matchLevel3 = subSubItem.id.includes(value?.toLowerCase()); - // 4th level search - if(subSubItem.children?.length && !matchLevel3) { - subSubItem.children = subSubItem.children.filter(level4Item => { - return level4Item.id.toLowerCase().includes(value?.toLowerCase()) - }); - } - return subSubItem.children?.length > 0 || matchLevel3; - }); - } - return subItem.children?.length > 0; + // hide L3 & L4 FoS + if(properties.environment == "development") { + // 3rd level search + if(subItem.children?.length && !matchLevel2) { + subItem.children = subItem.children.filter(subSubItem => { + matchLevel3 = subSubItem.id.includes(value?.toLowerCase()); + // 4th level search + if (subSubItem.children?.length && !matchLevel3) { + subSubItem.children = subSubItem.children.filter(level4Item => { + return level4Item.id.toLowerCase().includes(value?.toLowerCase()) + }); + } + return subSubItem.children?.length > 0 || matchLevel3; + }); + } + return subItem.children?.length > 0; + } else { + return matchLevel2; + } }); } return item.children?.length > 0; diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index e489cbd9..d91c8f97 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -22,12 +22,13 @@ import {SearchFields} from "../../utils/properties/searchFields"; (click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate"> View all - + + - View all & suggest + View all & suggest - Suggest
    diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 24913d76..10bef9c3 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -344,9 +344,22 @@ export class ResultLandingService { if (subjectResults[3]) { let searchFieldsHelper: SearchFields = new SearchFields(); subjectResults[3].forEach(element => { - this.resultLandingInfo.fos.push( - {id: element, label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element} - ); + // hide L3 & L4 FoS + let add = true; + if(element) { + let id = element.split(" ")[0]; + if(id.length > 4 && properties.environment != "development") { + add = false; + } + } + if(add) { + this.resultLandingInfo.fos.push( + { + id: element, + label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element + } + ); + } }); } if (this.resultLandingInfo.fos) { diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 7a880f44..a015d7f0 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -150,7 +150,8 @@ export class ISVocabulariesService { value.id = fos.id;//data[i].code; value.label = fos.label; array.push(value); - if(fos.children && fos.children.length > 0) { + // hide L3 & L4 FoS + if(fos.children && fos.children.length > 0 && (fos.level == 1)) { for (let i=fos.children.length-1; i>=0; i--) { children.push(fos.children[i]); } From d5a51bf0fcca7dbf12f58703f5c3012645bb9c14 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 30 Aug 2024 10:11:52 +0300 Subject: [PATCH 10/16] [develop | DONE | FIXED ] fix the routes in the edit forms of plugins --- .../plugin-gateway-information.form.component.ts | 6 +++--- .../search-bar/plugin-search-bar.form.component.ts | 2 +- .../plugin-search-deposit-link.form.component.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dashboard/plugins/components/gateway-information/plugin-gateway-information.form.component.ts b/dashboard/plugins/components/gateway-information/plugin-gateway-information.form.component.ts index b9250902..85b1eaed 100644 --- a/dashboard/plugins/components/gateway-information/plugin-gateway-information.form.component.ts +++ b/dashboard/plugins/components/gateway-information/plugin-gateway-information.form.component.ts @@ -89,7 +89,7 @@ import {PluginBaseFormComponent} from "../../utils/base-plugin.form.component"; Subjects
    -
    Manage community info here.
    +
    Manage community info here.
    Pages & menus
    @@ -148,10 +148,10 @@ import {PluginBaseFormComponent} from "../../utils/base-plugin.form.component";
    If some information is enabled here, - but still not visible, please check related entity or page. + but still not visible, please check related entity or page.
    - Change the custom section background options here. + Change the custom section background options here.
    `, diff --git a/dashboard/plugins/components/search-bar/plugin-search-bar.form.component.ts b/dashboard/plugins/components/search-bar/plugin-search-bar.form.component.ts index fc196e8e..f3858ea5 100644 --- a/dashboard/plugins/components/search-bar/plugin-search-bar.form.component.ts +++ b/dashboard/plugins/components/search-bar/plugin-search-bar.form.component.ts @@ -30,7 +30,7 @@ import {PluginSearchBar} from "./plugin-search-bar.component";
    -
    Manage community info here.
    +
    Manage community info here.
    `, diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts index 1bf696a2..c3e97e27 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts @@ -33,7 +33,7 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
    - Change the custom section background options here. + Change the custom section background options here.
    From 616577897085e984f80a7d53b23f66e6e186f38b Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 30 Aug 2024 10:13:14 +0300 Subject: [PATCH 11/16] [develop | DONE | CHANGED ] Change the sidebar menu divide menu items to community profile and content config --- .../plugin-suggested-repositories.form.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.form.component.ts b/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.form.component.ts index 45e2f597..3d1edf93 100644 --- a/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.form.component.ts +++ b/dashboard/plugins/components/suggested-repositories/plugin-suggested-repositories.form.component.ts @@ -11,7 +11,7 @@ import {PluginSuggestedRepositories} from "./plugin-suggested-repositories.compo
    Manage the content providers list in - Community info by adding them in deposit.
    + community content config by adding them in deposit.
    `, From 9b88d4be2a930a8d6c8fa6f0bad80ad65502a806 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 30 Aug 2024 13:09:03 +0300 Subject: [PATCH 12/16] [develop | DONE | ADDED ] Customization add custom css --- connect/community/CustomizationOptions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/connect/community/CustomizationOptions.ts b/connect/community/CustomizationOptions.ts index 78a8e890..133ffed3 100644 --- a/connect/community/CustomizationOptions.ts +++ b/connect/community/CustomizationOptions.ts @@ -91,6 +91,7 @@ export class CustomizationOptions { identity: { mainColor: string; secondaryColor: string; + customCss: string; }; identityIsCustom: boolean; backgroundsIsCustom: boolean; @@ -114,11 +115,12 @@ export class CustomizationOptions { darkBackground: ButtonsCustomization; lightBackground: ButtonsCustomization; }; - + constructor(mainColor: string = null, secondaryColor: string = null) { this.identity = { mainColor: mainColor ? mainColor : CustomizationOptions.getIdentity().mainColor, secondaryColor: secondaryColor ? secondaryColor : CustomizationOptions.getIdentity().secondaryColor, + customCss: "" }; this.identityIsCustom = false; this.backgroundsIsCustom = false; @@ -185,6 +187,9 @@ export class CustomizationOptions { if (current.identity && current.identity.mainColor && current.identity.secondaryColor) { updated = new CustomizationOptions(current.identity.mainColor, current.identity.secondaryColor); } + if(!current.identity.customCss){ + current.identity.customCss = defaultCO.identity.customCss; + } if (!current.backgrounds) { current.backgrounds = Object.assign({}, updated.backgrounds); } From 57628f6af7f68de8aeb2c9f952631369190f78b9 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 4 Sep 2024 09:46:37 +0300 Subject: [PATCH 13/16] [develop | DONE | FIXED ] project title for unidentified projects --- .../entityFormatter/projectTitleFormatter.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts b/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts index 75013234..35690c2a 100644 --- a/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts +++ b/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts @@ -11,15 +11,17 @@ import {properties} from "../../../../../environments/environment";

    - {{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} + {{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} + {{project['funderName']}} - {{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} + {{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}} + {{project['funderName']}}

    - + Funder: {{project['funderName']}} ` From ad17ffaf9510b1252964834aa2f5c2c695201009 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 5 Sep 2024 12:59:25 +0300 Subject: [PATCH 14/16] [develop | DONE | CHANGED] monitorServiceAPIURL, notificationsAPIURL, adminToolsAPIURL: add '/' at the end of these string properties and remove any unnecessary after them --- connect/curators/curator.service.ts | 2 +- monitor/services/resources.service.ts | 2 +- monitor/services/stakeholder.service.ts | 32 ++++++++++---------- services/customization.service.ts | 8 ++--- services/plugins.service.ts | 6 ++-- utils/configuration/configuration.service.ts | 2 +- utils/email/email.service.ts | 8 ++--- utils/helper/helper.service.ts | 8 ++--- utils/properties/environments/environment.ts | 8 ++--- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/connect/curators/curator.service.ts b/connect/curators/curator.service.ts index cf28ceff..52516530 100644 --- a/connect/curators/curator.service.ts +++ b/connect/curators/curator.service.ts @@ -12,7 +12,7 @@ export class CuratorService { } public getCurators(properties: EnvProperties, communityId: string): Observable { - let url: string = properties.adminToolsAPIURL + '/' + communityId + '/curator'; + let url: string = properties.adminToolsAPIURL + communityId + '/curator'; return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); } diff --git a/monitor/services/resources.service.ts b/monitor/services/resources.service.ts index 8884ed22..657e6bca 100644 --- a/monitor/services/resources.service.ts +++ b/monitor/services/resources.service.ts @@ -68,7 +68,7 @@ export class ResourcesService { } public isPagesEnabled() { - let url = properties.adminToolsAPIURL + "/monitor/monitor/pages"; + let url = properties.adminToolsAPIURL + "monitor/monitor/pages"; return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(pages => { let result = this.routes.map(() => false); diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index ba7bf5bb..65b8a403 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -57,7 +57,7 @@ export class StakeholderService { getStakeholder(alias: string, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); @@ -74,7 +74,7 @@ export class StakeholderService { getChildStakeholder(parent: string, type: string, child: string, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== child || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(parent) + '/' + type + '/' + encodeURIComponent(child), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent(parent) + '/' + type + '/' + encodeURIComponent(child), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); @@ -91,7 +91,7 @@ export class StakeholderService { getResearcherStakeholder(orcid, name, results, shouldUpdate: boolean = false): Observable { if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== orcid || shouldUpdate) { this.promise = new Promise((resolve, reject) => { - this.sub = this.http.get(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { + this.sub = this.http.get(properties.monitorServiceAPIURL + 'stakeholder/' + encodeURIComponent("researcher"), CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { stakeholder.index_id = orcid; @@ -123,19 +123,19 @@ export class StakeholderService { } getAlias(url: string): Observable { - return this.http.get(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { + return this.http.get(url + 'stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { return HelperFunctions.copy(stakeholders); })); } getStakeholders(url: string, type: string = null, defaultId: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { - return this.http.get(url + '/stakeholder' + ((type) ? ('?type=' + type) : (defaultId?'?defaultId=' + defaultId:'')) + ((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)); })); } getMyStakeholders(url: string, type: string = null): Observable { - return this.http.get(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(manageStakeholder => { + return this.http.get(url + 'my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(manageStakeholder => { return HelperFunctions.copy({ templates: Stakeholder.checkIsUpload(manageStakeholder.templates), standalone: Stakeholder.checkIsUpload(manageStakeholder.standalone), @@ -155,20 +155,20 @@ export class StakeholderService { umbrella: umbrella, standalone: standalone } - return this.http.post(url + '/build-stakeholder', buildStakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { + return this.http.post(url + 'build-stakeholder', buildStakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })); } changeVisibility(url: string, path: string[], visibility: Visibility, propagate: boolean = false): Observable { - return this.http.post(url + '/' + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); + return this.http.post(url + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); } saveElement(url: string, element: any, path: string[] = [], isFull: boolean = false): Observable { if (element.alias && element.alias.startsWith('/')) { element.alias = element.alias.slice(1); } - return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post(url + path.join('/') + '/save' + (isFull ? '/full' : ''), element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); @@ -179,7 +179,7 @@ export class StakeholderService { } saveBulkElements(url: string, indicators, path: string[] = []): Observable { - return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post(url + path.join('/') + '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); @@ -190,7 +190,7 @@ export class StakeholderService { } saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
    { - return this.http.post
    (url + ((path.length > 0) ? '/' : '') + path.join('/') + + return this.http.post
    (url + path.join('/') + '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { return HelperFunctions.copy(element); })); @@ -201,27 +201,27 @@ export class StakeholderService { if (childrenAction) { params = "?children=" + childrenAction; } - return this.http.delete(url + '/' + path.join('/') + '/delete' + params, CustomOptions.registryOptions()); + return this.http.delete(url + path.join('/') + '/delete' + params, CustomOptions.registryOptions()); } reorderElements(url: string, path: string[], ids: string[]): Observable { - return this.http.post(url + '/' + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); + return this.http.post(url + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); } reorderIndicators(url: string, path: string[], indicators: string[]): Observable { - return this.http.post(url + '/' + path.join('/') + '/reorder', indicators, CustomOptions.registryOptions()).pipe(map(indicators => { + return this.http.post(url + path.join('/') + '/reorder', indicators, CustomOptions.registryOptions()).pipe(map(indicators => { return HelperFunctions.copy(indicators); })); } moveIndicator(url: string, path: string[], moveIndicator: MoveIndicator): Observable { - return this.http.post(url + '/' + path.join('/') + '/moveIndicator', moveIndicator, CustomOptions.registryOptions()).pipe(map(subCategory => { + return this.http.post(url + path.join('/') + '/moveIndicator', moveIndicator, CustomOptions.registryOptions()).pipe(map(subCategory => { return HelperFunctions.copy(subCategory); })); } updateUmbrella(url: string, id: string, update: UpdateUmbrella): Observable { - return this.http.post(url + '/' + id + '/umbrella', update, CustomOptions.registryOptions()).pipe(map(umbrella => { + return this.http.post(url + id + '/umbrella', update, CustomOptions.registryOptions()).pipe(map(umbrella => { return HelperFunctions.copy(umbrella); })); } diff --git a/services/customization.service.ts b/services/customization.service.ts index e4dd4933..c95a1cc3 100644 --- a/services/customization.service.ts +++ b/services/customization.service.ts @@ -26,19 +26,19 @@ export class CustomizationService { saveLayout(properties: EnvProperties, pid: string, layout: Layout, portalType = null): Observable { CustomizationService.removeNulls(layout); - return this.http.post(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + return this.http.post(properties.adminToolsAPIURL + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', layout, CustomOptions.getAuthOptionsWithBody()); } deleteLayout(properties: EnvProperties, pid: string, portalType = null): Observable { - return this.http.delete(properties.adminToolsAPIURL + '/' + (portalType?portalType: properties.adminToolsPortalType) + '/' + return this.http.delete(properties.adminToolsAPIURL + (portalType?portalType: properties.adminToolsPortalType) + '/' + pid + '/layout', CustomOptions.getAuthOptionsWithBody()); } getLayout(properties: EnvProperties, pid: string): Observable { - return this.http.get(properties.adminToolsAPIURL+"/" + properties.adminToolsPortalType + '/' + return this.http.get(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + pid + '/layout'); } getLayouts(properties: EnvProperties): Observable { - return this.http.get(properties.adminToolsAPIURL+'/community/layouts'); + return this.http.get(properties.adminToolsAPIURL + 'community/layouts'); } mockLayout(): any { return this.http.get('./assets/customizationOptions.json') ; diff --git a/services/plugins.service.ts b/services/plugins.service.ts index ad6e9bd9..38af2426 100644 --- a/services/plugins.service.ts +++ b/services/plugins.service.ts @@ -43,7 +43,7 @@ export class PluginsService { } countPluginTemplatePerPageForAllPortals(api: string) { - return this.http.get(api + '/pluginTemplate/page/count'); + return this.http.get(api + 'pluginTemplate/page/count'); } getPluginsByPage(api: string, pid: string, pageId: string) { @@ -66,11 +66,11 @@ export class PluginsService { return this.http.post(api + 'community/' + community + '/plugin/status/' + id, status, CustomOptions.getAuthOptionsWithBody()); } getPluginById(api: string, id: string) { - return this.http.get(api + '/plugin/' + id); + return this.http.get(api + 'plugin/' + id); } getPluginTemplateById(api: string, id: string) { - return this.http.get(api + '/pluginTemplates/' + id); + return this.http.get(api + 'pluginTemplates/' + id); } } diff --git a/utils/configuration/configuration.service.ts b/utils/configuration/configuration.service.ts index 43f804bb..c5edcd36 100644 --- a/utils/configuration/configuration.service.ts +++ b/utils/configuration/configuration.service.ts @@ -35,7 +35,7 @@ export class ConfigurationService { public initPortal(properties: EnvProperties, pid: string) { if (pid == null || this.portal?.getValue()?.static) return; - let url = properties.adminToolsAPIURL + "/" + properties.adminToolsPortalType + "/" + pid + "/full"; + let url = properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + pid + "/full"; this.promise = new Promise(resolve => { this.sub = this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload?'&forceReload=true':'')) :*/ url).subscribe( (portal: Portal) => { diff --git a/utils/email/email.service.ts b/utils/email/email.service.ts index 2dab2857..95bcf4ed 100644 --- a/utils/email/email.service.ts +++ b/utils/email/email.service.ts @@ -16,22 +16,22 @@ export class EmailService { } notifyManagers(pid: string, role: "manager" | "subscriber", email: Email) { - return this.http.post(properties.adminToolsAPIURL + '/notifyManagers/' + pid + '/' + role, email, CustomOptions.getAuthOptions()) + return this.http.post(properties.adminToolsAPIURL + 'notifyManagers/' + pid + '/' + role, email, CustomOptions.getAuthOptions()) } notifyNewManager(email: Email) { - return this.http.post(properties.adminToolsAPIURL + '/notifyNewManager', email, CustomOptions.getAuthOptions()) + return this.http.post(properties.adminToolsAPIURL + 'notifyNewManager', email, CustomOptions.getAuthOptions()) } sendEmail(properties: EnvProperties, email: Email) { - return this.http.post(properties.adminToolsAPIURL + "/sendMail/", email, CustomOptions.registryOptions()); + return this.http.post(properties.adminToolsAPIURL + "sendMail/", email, CustomOptions.registryOptions()); } contact(properties: EnvProperties, email: Email, recaptcha: string = null):Observable { const data: EmailRecaptcha = new EmailRecaptcha(); data.email = email; data.recaptcha = recaptcha; - return this.http.post(properties.adminToolsAPIURL + '/contact', data); + return this.http.post(properties.adminToolsAPIURL + 'contact', data); } } diff --git a/utils/helper/helper.service.ts b/utils/helper/helper.service.ts index 639f913b..3d5c621d 100644 --- a/utils/helper/helper.service.ts +++ b/utils/helper/helper.service.ts @@ -19,9 +19,9 @@ export class HelperService { let url = properties.adminToolsAPIURL; if (div) { - url += '/divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div; + url += 'divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div; } else { - url += '/pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position; + url += 'pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position; if (before) { url += '&before=' + before; } @@ -42,7 +42,7 @@ export class HelperService { if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + + url += portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + ((page_route.indexOf("/" + portal + "/") != -1) ? ("/" + page_route.split("/" + portal + "/")[1]) : page_route); return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); } else { @@ -60,7 +60,7 @@ export class HelperService { if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/' + properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' + + url += properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' + ((page_route.indexOf("/" + communityId + "/") != -1) ? ("/" + page_route.split("/" + communityId + "/")[1]) : page_route); return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload ? '&forceReload=true' : '')) : url); } else { diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 8f0b7308..94f0cea2 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -116,7 +116,7 @@ export let commonDev: EnvProperties = { cookieDomain: ".di.uoa.gr", feedbackmail: "kostis30fylloy@gmail.com", cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=", - monitorServiceAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service", + monitorServiceAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service/", adminToolsAPIURL: "http://duffy.di.uoa.gr:19280/uoa-admin-tools/", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", contextsAPI: "https://dev-openaire.d4science.org/openaire/context", @@ -152,7 +152,7 @@ export let commonTest: EnvProperties = { loginServiceURL: " https://services.openaire.eu/login-service/", cacheUrl: "https://explore.openaire.eu/cache/get?url=", datasourcesAPI: "https://services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://services.openaire.eu/openaire/context", communityAPI: "https://services.openaire.eu/openaire/community/", @@ -181,7 +181,7 @@ export let commonBeta: EnvProperties = { loginServiceURL: "https://beta.services.openaire.eu/login-service/", cacheUrl: "https://demo.openaire.eu/cache/get?url=", datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://beta.services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://beta.services.openaire.eu/openaire/context", communityAPI: "https://beta.services.openaire.eu/openaire/community/", @@ -220,7 +220,7 @@ export let commonProd: EnvProperties = { loginServiceURL: "https://services.openaire.eu/login-service/", cacheUrl: "https://explore.openaire.eu/cache/get?url=", datasourcesAPI: "https://services.openaire.eu/openaire/ds/api/", - monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service", + monitorServiceAPIURL: "https://services.openaire.eu/uoa-monitor-service/", adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/", contextsAPI: "https://services.openaire.eu/openaire/context", communityAPI: "https://services.openaire.eu/openaire/community/", From 9826e5d3581095c8ab4f06e3ff85e68d93b23dd6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 6 Sep 2024 18:04:05 +0300 Subject: [PATCH 15/16] [develop | FIXED]: Fix a bug with help text placement doesn't be shown in add help text. --- dashboard/helpTexts/page-help-content-form.component.html | 2 +- dashboard/helpTexts/page-help-content-form.component.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard/helpTexts/page-help-content-form.component.html b/dashboard/helpTexts/page-help-content-form.component.html index 030e7434..401ebf60 100644 --- a/dashboard/helpTexts/page-help-content-form.component.html +++ b/dashboard/helpTexts/page-help-content-form.component.html @@ -34,7 +34,7 @@
    -
    diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index 0dd656fa..3ff04faf 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -149,6 +149,9 @@ export class PageContentFormComponent implements OnInit { if (page.left) { this.placementsOptions.push({label: "left", value: "left"}); } + if (page.right) { + this.placementsOptions.push({label: "right", value: "right"}); + } this.orderOptions = []; for (let i = 1; i < countContents + 1; i++) { this.orderOptions.push({label: "" + i, value: i}); From 4727fb7a10f2b7842fd0edeee55707e6a4147881 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 9 Sep 2024 10:57:39 +0300 Subject: [PATCH 16/16] [develop | DONE | FIX ] delete portal, pass the portal type of the first one --- dashboard/portal/portals.component.ts | 8 ++++++-- services/help-content.service.ts | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index b3b205b1..6519bc59 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -131,7 +131,7 @@ export class PortalsComponent implements OnInit { public confirmedDeletePortals(data: any) { this.showLoading = true; - this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.properties.adminToolsAPIURL).subscribe( + this.subscriptions.push(this._helpContentService.deleteCommunities(this.selectedPortals, this.properties.adminToolsAPIURL, this.getPortalType()).subscribe( _ => { this.deletePortalsFromArray(this.selectedPortals); NotificationHandler.rise('Portals have been successfully deleted'); @@ -141,7 +141,11 @@ export class PortalsComponent implements OnInit { error => this.handleUpdateError('System error deleting the selected communities', error) )); } - + getPortalType():string { + let portalId = this.selectedPortals[0]; + let index = this.portals.findIndex(value => value._id === portalId); + return this.portals[index].type; + } public editPortal(i: number) { const portal: Portal = this.checkboxes[i].portal; this.index = this.portals.findIndex(value => value._id === portal._id); diff --git a/services/help-content.service.ts b/services/help-content.service.ts index 701ff4be..1c24841b 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -406,11 +406,10 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - deleteCommunities(ids : string[], helpContentUrl:string) { + deleteCommunities(ids : string[], helpContentUrl:string, portalType:string) { // let headers = new Headers({'Content-Type': 'application/json'}); // let options = new RequestOptions({headers: headers}); - - return this.http.post(helpContentUrl + properties.adminToolsPortalType + '/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) + return this.http.post(helpContentUrl + '/' + portalType + '/delete',JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); }