From 5195306ee6dfd664b207c3536234f43adc39ad33 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 13 Feb 2024 11:57:46 +0200 Subject: [PATCH 01/93] [develop]: Add userInfoUrl variable in user management service. --- services/user-management.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/user-management.service.ts b/services/user-management.service.ts index 5a19d43b..08f4c0ff 100644 --- a/services/user-management.service.ts +++ b/services/user-management.service.ts @@ -35,7 +35,11 @@ export class UserManagementService { this.routerSubscription.unsubscribe(); } } - + + public static userInfoUrl(index = 0): string { + return (isArray(properties.loginServiceURL)?properties.loginServiceURL[index]:properties.loginServiceURL) + UserManagementService.USERINFO; + } + public get user(): User { return this.getUserInfoSubject.getValue(); } @@ -45,8 +49,7 @@ export class UserManagementService { } public getUserInfoAt(index = 0): Observable { - return this.http.get((isArray(properties.loginServiceURL)?properties.loginServiceURL[index]:properties.loginServiceURL) + - UserManagementService.USERINFO, CustomOptions.registryOptions()).pipe(map(userInfo => { + return this.http.get(UserManagementService.userInfoUrl(index), CustomOptions.registryOptions()).pipe(map(userInfo => { return new User(userInfo); })) } -- 2.17.1 From 7562210daafd452d3e81df3abebea58b3290fe4d Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 13 Feb 2024 14:38:04 +0200 Subject: [PATCH 02/93] [develop]: Fix getURlwithFilters that double encoding the variables. --- monitor-admin/utils/indicator-utils.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index b0a50241..7397b837 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -457,17 +457,6 @@ export class IndicatorUtils { if((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)){ filterSubtitleText.push( "Field of Science: " + foslvl1.join(', ') + ( foslvl1.length > 0 && foslvl2.length > 0? ', ': '') + foslvl2.join(", ") ) ; } - - //For numbers - if (replacedUrl.indexOf(ChartHelper.prefix + 'index_id' + ChartHelper.suffix) != -1) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_id)); - } - if (replacedUrl.indexOf(ChartHelper.prefix + 'index_name' + ChartHelper.suffix) != -1) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_name)); - } - if (replacedUrl.indexOf(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix) != -1) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_shortName)); - } if (indicatorPath.parameters) { Object.keys(indicatorPath.parameters).forEach(key => { let replacedValue = indicatorPath.parameters[key]; @@ -496,6 +485,16 @@ export class IndicatorUtils { replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) }); } + //For numbers + if (replacedUrl.indexOf(ChartHelper.prefix + 'index_id' + ChartHelper.suffix) != -1) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_id)); + } + if (replacedUrl.indexOf(ChartHelper.prefix + 'index_name' + ChartHelper.suffix) != -1) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_name)); + } + if (replacedUrl.indexOf(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix) != -1) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(encodeURIComponent(stakeholder.index_shortName)); + } return (indicatorPath.chartObject ? indicatorPath.url + encodeURIComponent(replacedUrl) : replacedUrl); } -- 2.17.1 From cdddec692524d4852e9cae79887bc70ac692e6af Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 13 Feb 2024 16:07:43 +0200 Subject: [PATCH 03/93] [develop | DONE | FIXED] Search page: extra fixes for custom filter --- searchPages/searchUtils/newSearchPage.component.html | 5 +++-- searchPages/searchUtils/newSearchPage.component.ts | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index e52de3b5..51dc82fa 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -228,7 +228,8 @@ -
diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 01bb1acf..5f62d7d6 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -73,7 +73,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { @Input() set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) { if(!Array.isArray(customFilter)) { - this.customFilters = [customFilter]; + this.customFilters = customFilter?[customFilter]:null; }else{ this.customFilters = customFilter; } @@ -234,14 +234,14 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { } private getPageContents() { - this.subscriptions.push(this.helper.getPageHelpContents(this.properties, (this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => { + this.subscriptions.push(this.helper.getPageHelpContents(this.properties, (this.customFilters && this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => { this.pageContents = contents; })); } private getDivContents() { - this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => { + this.subscriptions.push(this.helper.getDivHelpContents(this.properties, (this.customFilters && this.customFilters[0] && this.customFilters[0].queryFieldName == "communityId") ? this.customFilters[0].valueId : this.properties.adminToolsCommunity, this.router.url).subscribe(contents => { this.divContents = contents; })); } -- 2.17.1 From 6c9c477c24c76ffd6d90bc690b4a6e8df5bb460d Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 13 Feb 2024 16:15:59 +0200 Subject: [PATCH 04/93] [develop | DONE | FIXED] PortalSearchResultComponent: Communities proper check, after updating the status values --- searchPages/searchUtils/portal-search-result.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searchPages/searchUtils/portal-search-result.component.ts b/searchPages/searchUtils/portal-search-result.component.ts index cbf85974..7b44fbe7 100644 --- a/searchPages/searchUtils/portal-search-result.component.ts +++ b/searchPages/searchUtils/portal-search-result.component.ts @@ -60,7 +60,7 @@ export class PortalSearchResultComponent implements OnInit{ hasPermission(result: CommunityInfo & StakeholderInfo) { if(this.type === "community") { - return result.status === "all" || (result.status === "manager" && result.isManager); + return result.isPublic() || (result.isRestricted() && result.isManager); } else if(this.type === "stakeholder") { return result.visibility === "PUBLIC" || (result.visibility === "RESTRICTED" && (result.isManager || result.isMember)) || (result.visibility === "PRIVATE" && result.isManager); -- 2.17.1 From 56faf6f6a4744b59775e3b4f510ffe33c957968a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 13 Feb 2024 17:33:26 +0200 Subject: [PATCH 05/93] [develop | DONE | FIXED]: orcid-work.component.ts: [Bug fix] Show tooltip when button is disabled & When in beta environment, do not call query to get put codes, always disable buttons and show tooltip about not available feature on beta. --- orcid/orcid-work.component.ts | 188 +++++++++++++--------------------- 1 file changed, 72 insertions(+), 116 deletions(-) diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 4d653b7f..6153d146 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -22,88 +22,54 @@ declare var UIkit: any; template: ` - - - - Claim - -
+ [ngClass]="isMobile && pageType == 'landing' ? ' uk-width-1-1' : ''" + [attr.uk-tooltip]="isMobile? 'cls: uk-invisible' : 'pos: bottom; cls: uk-active uk-text-small uk-padding-small'" + [title]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipAdd"> + + + + + Claim + +
+
- - - - - Remove - -
+ [title]="(noPids || !isLoggedIn) ? ((noPids) ? tooltipNoPid : tooltipNoLoggedInUser) : tooltipDelete"> + + + + + Remove + +
+
- - -
{{requestGrantMessage}}
- - - - - - - - - - - - - - - - - -
@@ -292,18 +258,6 @@ declare var UIkit: any; instead. - - - - - - - - - - - - @@ -369,9 +323,6 @@ export class OrcidWorkComponent { public hasConsent: boolean = false; public currentAction: string = ""; - public hoverAdd: boolean = false; - public hoverDelete: boolean = false; - public properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; @@ -391,24 +342,26 @@ export class OrcidWorkComponent { } ngOnInit() { - this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { - if (user) { - this.isLoggedIn = true; - if (!this.givenPutCode) { - this.getPutCode(); + if(this.properties.environment != 'beta') { + this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { + if (user) { + this.isLoggedIn = true; + if (!this.givenPutCode) { + this.getPutCode(); + } + } else { + this.isLoggedIn = false; } - } else { + }, error => { this.isLoggedIn = false; + })); + if (properties.dashboard == 'irish') { + this.subscriptions.push(this._userProfileService.getUserProfile().subscribe(userProfile => { + this.hasConsent = userProfile.consent; + }, error => { + this.hasConsent = false; + })); } - }, error => { - this.isLoggedIn = false; - })); - if(properties.dashboard == 'irish'){ - this.subscriptions.push(this._userProfileService.getUserProfile().subscribe(userProfile => { - this.hasConsent = userProfile.consent; - }, error =>{ - this.hasConsent = false; - })); } } @@ -894,13 +847,18 @@ export class OrcidWorkComponent { } this.showLoading = false; } - + + get tooltipBETA() { + // return "Login to the production environment to add works to your ORCID record"; + return "Add or delete a work from your ORCID record. This feature is not available on BETA."; + } + get tooltipAdd() { - return "Add this work to your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); + return (properties.environment == "beta") ? this.tooltipBETA : ("Add this work to your ORCID record" + ((properties.environment == "test") ? ". The action will affect your real ORCID iD." : "")); } get tooltipDelete() { - return "Delete this work from your ORCID record" + ((properties.environment == "beta") ? ". The action will affect your real ORCID iD." : ""); + return "Delete this work from your ORCID record" + ((properties.environment == "test") ? ". The action will affect your real ORCID iD." : ""); } get tooltipNoPid() { @@ -908,16 +866,14 @@ export class OrcidWorkComponent { } get tooltipNoLoggedInUser() { - return "Add or delete a work from your ORCID record. Please log in first." + return (properties.environment == "beta") ? this.tooltipBETA : "Add or delete a work from your ORCID record. Please log in first." } - - hoverEvent($event, action: string = "add") { - if (action == "add") { - this.hoverAdd = $event.type == "mouseover"; - this.hoverDelete = false; - } else if (action == "delete") { - this.hoverDelete = $event.type == "mouseover"; - this.hoverAdd = false; - } + + get isDisabled() { + return (this.properties.environment == 'beta' || this.showLoading || !this.isLoggedIn || (!this.pids && (!this.identifiers || this.identifiers.size == 0))); + } + + get noPids() { + return (!this.pids && (!this.identifiers || this.identifiers.size == 0)); } } -- 2.17.1 From 9c8a67e612d4d0f7d692362e965e400815465d8e Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 14 Feb 2024 10:28:54 +0200 Subject: [PATCH 06/93] [develop | DONE | FIXED] Search pages: extra fixes for custom filter --- searchPages/searchDataProviders.component.ts | 2 +- searchPages/searchOrganizations.component.ts | 2 +- searchPages/searchProjects.component.ts | 2 +- searchPages/searchResearchResults.component.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 0f260db2..c5483431 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -57,7 +57,7 @@ export class SearchDataProvidersComponent { @Input() set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) { if(!Array.isArray(customFilter)) { - this.customFilters = [customFilter]; + this.customFilters = customFilter?[customFilter]:null; }else{ this.customFilters = customFilter; } diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index 6ea539d4..50deb4a2 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -66,7 +66,7 @@ export class SearchOrganizationsComponent { @Input() set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) { if(!Array.isArray(customFilter)) { - this.customFilters = [customFilter]; + this.customFilters = customFilter?[customFilter]:null; }else{ this.customFilters = customFilter; } diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 0b394601..5e4e36c5 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -50,7 +50,7 @@ export class SearchProjectsComponent { @Input() set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) { if(!Array.isArray(customFilter)) { - this.customFilters = [customFilter]; + this.customFilters = customFilter?[customFilter]:null; }else{ this.customFilters = customFilter; } diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 7b4e5f28..176ae26c 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -87,7 +87,7 @@ export class SearchResearchResultsComponent { @Input() set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) { if(!Array.isArray(customFilter)) { - this.customFilters = [customFilter]; + this.customFilters = customFilter?[customFilter]:null; }else{ this.customFilters = customFilter; } -- 2.17.1 From cf0ebe0fb00af632e7577478908f4a3399f4eab1 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 14 Feb 2024 10:46:15 +0200 Subject: [PATCH 07/93] [develop | DONE | FIXED ] community status checks --- claims/claim-utils/service/contexts.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claims/claim-utils/service/contexts.service.ts b/claims/claim-utils/service/contexts.service.ts index 45f40de1..7fe126d9 100644 --- a/claims/claim-utils/service/contexts.service.ts +++ b/claims/claim-utils/service/contexts.service.ts @@ -62,7 +62,7 @@ export class ContextsService { if(getAll) { return this.communitiesSubject.getValue(); } else { - return this.communitiesSubject.getValue().filter(community => community.status != 'hidden'); + return this.communitiesSubject.getValue().filter(community => !community.isPrivate()); } } -- 2.17.1 From 9b9f817e623391618b9f33e87eba32e4dfaa0e12 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 14 Feb 2024 12:14:32 +0200 Subject: [PATCH 08/93] [develop | DONE | FIXED] ContextsService: revert last change for coomunity hidden status --- claims/claim-utils/service/contexts.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claims/claim-utils/service/contexts.service.ts b/claims/claim-utils/service/contexts.service.ts index 7fe126d9..45f40de1 100644 --- a/claims/claim-utils/service/contexts.service.ts +++ b/claims/claim-utils/service/contexts.service.ts @@ -62,7 +62,7 @@ export class ContextsService { if(getAll) { return this.communitiesSubject.getValue(); } else { - return this.communitiesSubject.getValue().filter(community => !community.isPrivate()); + return this.communitiesSubject.getValue().filter(community => community.status != 'hidden'); } } -- 2.17.1 From 3204ba18ff266b1b62febe848fb09c0d306067b9 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 14 Feb 2024 15:43:27 +0200 Subject: [PATCH 09/93] [develop]: Fix showAuthors in modal. --- .../deletedByInference.component.ts | 2 +- utils/authors/showAuthors.component.ts | 180 +++++++++--------- .../mobile-dropdown.component.ts | 5 +- .../result-preview.component.html | 2 +- 4 files changed, 100 insertions(+), 89 deletions(-) diff --git a/landingPages/result/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts index 69a47dab..30ebb017 100644 --- a/landingPages/result/deletedByInference/deletedByInference.component.ts +++ b/landingPages/result/deletedByInference/deletedByInference.component.ts @@ -27,7 +27,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
diff --git a/utils/authors/showAuthors.component.ts b/utils/authors/showAuthors.component.ts index 837bbbbf..5b2c3710 100644 --- a/utils/authors/showAuthors.component.ts +++ b/utils/authors/showAuthors.component.ts @@ -1,4 +1,13 @@ -import {Component, Inject, Input, PLATFORM_ID, ViewChild} from '@angular/core'; +import { + AfterContentInit, + AfterViewInit, + ChangeDetectorRef, + Component, + Inject, + Input, + PLATFORM_ID, + ViewChild +} from '@angular/core'; import {ActivatedRoute} from "@angular/router"; import {RouterHelper} from "../routerHelper.class"; import {EnvProperties} from '../properties/env-properties'; @@ -11,89 +20,89 @@ import {properties} from "../../../../environments/environment"; selector: 'showAuthors', template: ` - - {{author.fullName + ";"}} - - - - orcid - orcid bw - - {{author.fullName + ";"}} - - -
- -
- -
- -
-
- -
-
{{author.fullName}}
-
-
ORCID
- -
- {{" "}} - {{" "}} - - Harvested from ORCID Public Data File - Derived by OpenAIRE algorithms or harvested - from 3d party repositories -
-
-
- - -
- -
-
- -
-
- {{author.fullName}} in OpenAIRE -
- -
-
-
- + + {{author.fullName + ";"}} + + + + orcid + orcid bw + + {{author.fullName + ";"}} + + +
+ +
+ +
+ +
+
+ +
+
{{author.fullName}}
+
+
ORCID
+ +
+ {{" "}} + {{" "}} + + Harvested from ORCID Public Data File + Derived by OpenAIRE algorithms or harvested + from 3d party repositories +
+
+
+ + +
+ +
+
+ +
+
+ {{author.fullName}} in OpenAIRE +
+ +
+
+
{ if(event instanceof NavigationStart) { this.element.nativeElement.remove(); @@ -63,6 +63,7 @@ export class MobileDropdownComponent implements OnInit{ close() { if(this.opened) { this.opened = false; + this.cdr.detectChanges(); this.onClose.emit(); document.getElementsByTagName('body')[0].setAttribute('style', ''); } diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 96832b0a..8854bebc 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -125,7 +125,7 @@
-
-- 2.17.1 From 35323bd7441d7d21ce785aade0002ee02fdc402a Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 20 Feb 2024 10:58:47 +0200 Subject: [PATCH 10/93] [develop | FIXED | CHANGED]: Move formalize methods of stakehodlers in stakeholder.ts. Fix empty chart and number section in monitorbase component. --- monitor/entities/stakeholder.ts | 13 ++++- ...or-indicator-stakeholder-base.component.ts | 2 + monitor/services/stakeholder.service.ts | 57 +++++++------------ 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 474456c4..49c8e755 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -1,6 +1,6 @@ import {SafeResourceUrl} from "@angular/platform-browser"; -import {properties} from "../../../../environments/environment"; import {Session, User} from "../../login/utils/helper.class"; +import {StringUtils} from "../../utils/string-utils.class"; export const ChartHelper = { prefix: "((__", @@ -52,6 +52,17 @@ export class Stakeholder { this.description = description; this.topics = []; } + + static checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] { + if (Array.isArray(response)) { + response.forEach(value => { + value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl); + }); + } else { + response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl); + } + return response; + } } export class StakeholderInfo extends Stakeholder { diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index 9a7a3648..ee7bb511 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -208,6 +208,8 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator } protected setIndicators() { + this.activeSubCategory.numbers = this.activeSubCategory.numbers.filter(section => section.indicators.length > 0); + this.activeSubCategory.charts = this.activeSubCategory.charts.filter(section => section.indicators.length > 0); 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 diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 37fd7a3c..3f0f3a11 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -6,7 +6,6 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {map} from "rxjs/operators"; import {properties} from "../../../../environments/environment"; import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; -import {StringUtils} from "../../utils/string-utils.class"; export interface Reorder { action: 'moved' | 'added' | 'removed', @@ -41,7 +40,7 @@ export class StakeholderService { 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 => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { this.stakeholderSubject.next(stakeholder); resolve(); @@ -53,23 +52,24 @@ export class StakeholderService { } return from(this.getStakeholderAsync()); } - getResearcherStakeholder( orcid, name, results, shouldUpdate: boolean = false): Observable { + + 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 => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })).subscribe(stakeholder => { stakeholder.index_id = orcid; stakeholder.index_name = name; stakeholder.name = name; stakeholder.alias = orcid; - if(results <7 && stakeholder.topics[0]?.categories[0]?.subCategories[0]){ - stakeholder.topics[0].categories[0].subCategories[0].charts=[]; // keep only numbers - charts wont show much anyway + if (results < 7 && stakeholder.topics[0]?.categories[0]?.subCategories[0]) { + stakeholder.topics[0].categories[0].subCategories[0].charts = []; // keep only numbers - charts wont show much anyway } this.stakeholderSubject.next(stakeholder); resolve(); }, error => { - let stakeholder = new Stakeholder(null,"researcher", orcid,name,name,orcid,"PUBLIC", null, null,""); + let stakeholder = new Stakeholder(null, "researcher", orcid, name, name, orcid, "PUBLIC", null, null, ""); this.stakeholderSubject.next(stakeholder); resolve(); }); @@ -89,25 +89,25 @@ export class StakeholderService { getAlias(url: string): Observable { return this.http.get(url + '/stakeholder/alias', CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(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) : '') + ((!type && defaultId) ? ('?defaultId=' + defaultId) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { return this.http.get(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } getDefaultStakeholders(url: string, type: string = null): Observable { return this.http.get(url + '/stakeholder/default' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { - return this.formalize(this.checkIsUpload(stakeholders)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholders)); })); } @@ -116,7 +116,7 @@ export class StakeholderService { stakeholder.alias = stakeholder.alias.slice(1); } return this.http.post(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { - return this.formalize(this.checkIsUpload(stakeholder)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })); } @@ -130,11 +130,11 @@ export class StakeholderService { } path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save', element, CustomOptions.registryOptions()).pipe(map(element => { + '/save', element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { - return this.formalize(this.checkIsUpload(element)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { - return this.formalize(element); + return HelperFunctions.copy(element); } })); } @@ -142,11 +142,11 @@ export class StakeholderService { saveBulkElements(url: string, indicators, path: string[] = []): Observable { path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { + '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { - return this.formalize(this.checkIsUpload(element)); + return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { - return this.formalize(element); + return HelperFunctions.copy(element); } })); } @@ -154,8 +154,8 @@ export class StakeholderService { saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
{ path = HelperFunctions.encodeArray(path); return this.http.post
(url + ((path.length > 0) ? '/' : '') + path.join('/') + - '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { - return this.formalize(element); + '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { + return HelperFunctions.copy(element); })); } @@ -176,7 +176,7 @@ export class StakeholderService { reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable { path = HelperFunctions.encodeArray(path); return this.http.post(url + '/' + path.join('/') + '/' + type + '/reorder', reorder, CustomOptions.registryOptions()).pipe(map(indicators => { - return this.formalize(indicators); + return HelperFunctions.copy(indicators); })); } @@ -187,19 +187,4 @@ export class StakeholderService { setStakeholder(stakeholder: Stakeholder) { this.stakeholderSubject.next(stakeholder); } - - private checkIsUpload(response: Stakeholder | Stakeholder[]): any | any[] { - if (Array.isArray(response)) { - response.forEach(value => { - value.isUpload = value.logoUrl && !StringUtils.isValidUrl(value.logoUrl); - }); - } else { - response.isUpload = response.logoUrl && !StringUtils.isValidUrl(response.logoUrl); - } - return response; - } - - private formalize(element: any) { - return HelperFunctions.copy(element); - } } -- 2.17.1 From af6174c5de7d16e6a5c1222d4ae8d9a18e35667b Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 20 Feb 2024 13:38:31 +0200 Subject: [PATCH 11/93] [develop | DONE | CHANGED] change footer text --- sharedComponents/bottom.component.html | 6 +++--- utils/properties/environments/environment.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sharedComponents/bottom.component.html b/sharedComponents/bottom.component.html index c978bf51..45389b2d 100644 --- a/sharedComponents/bottom.component.html +++ b/sharedComponents/bottom.component.html @@ -1,5 +1,5 @@ -
+
flag black white low
@@ -64,7 +64,7 @@ height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
-
+
@@ -208,7 +208,7 @@ height="50px" class="el-image" alt="OpenAIRE" loading="lazy">
-
+
diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index f462caeb..d601e40a 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -77,7 +77,7 @@ export let common: EnvProperties = { b2noteAPIURL: 'https://b2note.eudat.eu/', myOrcidLinksPage: "/my-orcid-links", - footerGrantText: "OpenAIRE has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreements No. 777541 and 101017452", + footerGrantText: "OpenAIRE has received funding from a series of EU funded projects.", //connect enermapsURL: "https://lab.idiap.ch/enermaps", -- 2.17.1 From 50244801d6195dfc7034310ec8f8fb2a331f8b8f Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 21 Feb 2024 13:54:53 +0200 Subject: [PATCH 12/93] [develop | DONE | CHANGED]: availableOn.component.ts: Removed environment check from fulltext links (display them also in production). --- landingPages/landing-utils/availableOn.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 4a6d28f6..1ea5740d 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -22,7 +22,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - -
+
Full-Text: -- 2.17.1 From 51dba6da3a37e2f32fa2942727fd2ac3d49913a2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 21 Feb 2024 14:22:44 +0200 Subject: [PATCH 13/93] [develop | DONE | CHANGED]: quick-contact.component: Added field "quickContactClicked" initially set to false and when help button is clicked, it is set to true and card is displayed (--> recaptcha is loaded only if the users clicks on the button). --- sharedComponents/quick-contact/quick-contact.component.html | 4 ++-- sharedComponents/quick-contact/quick-contact.component.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sharedComponents/quick-contact/quick-contact.component.html b/sharedComponents/quick-contact/quick-contact.component.html index 116060f7..d43d55d4 100644 --- a/sharedComponents/quick-contact/quick-contact.component.html +++ b/sharedComponents/quick-contact/quick-contact.component.html @@ -1,12 +1,12 @@
-
-
+
Send a message diff --git a/sharedComponents/quick-contact/quick-contact.component.ts b/sharedComponents/quick-contact/quick-contact.component.ts index bf8f75e9..ccf17492 100644 --- a/sharedComponents/quick-contact/quick-contact.component.ts +++ b/sharedComponents/quick-contact/quick-contact.component.ts @@ -11,6 +11,7 @@ declare var UIkit; styleUrls: ['quick-contact.component.less'] }) export class QuickContactComponent implements OnInit, OnDestroy { + public quickContactClicked: boolean = false; public showDrop: boolean = false; @Input() public contactForm: FormGroup; -- 2.17.1 From 45a9737d84e70c9aeac32651058911d797eb66bb Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 21 Feb 2024 14:32:14 +0200 Subject: [PATCH 14/93] [develop]: Add statsProfile in indicatorPath. --- monitor-admin/utils/indicator-utils.ts | 10 +++++++--- monitor/entities/stakeholder.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 7397b837..25de908b 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -317,7 +317,9 @@ export class IndicatorUtils { public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string { let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if (stakeholder.statsProfile) { + if(indicatorPath.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.statsProfile) + } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } if (indicatorPath.parameters) { @@ -396,8 +398,10 @@ export class IndicatorUtils { let filterSubtitleText = []; indicatorPath.filtersApplied = 0; let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if (stakeholder.statsProfile) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile); + if(indicatorPath.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.statsProfile) + } else if (stakeholder.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } if (fundingL0) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 49c8e755..faa7bac8 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -210,6 +210,7 @@ export class IndicatorPath { parameters: any; filters: any; filtersApplied: number = 0; + statsProfile: string; format: Format; constructor(type: IndicatorPathType, source: SourceType, url: string, chartObject: string, jsonPath: string[], format: Format = 'NUMBER') { -- 2.17.1 From a45122565a997bb25cb319a0ba72ea59f549fff6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 22 Feb 2024 09:41:57 +0200 Subject: [PATCH 15/93] [develop | ADDED]: Add statsProfile in indicatorPath parameters and in form in order to override stakeholder's one. --- monitor-admin/topic/indicators.component.html | 22 ++++ monitor-admin/topic/indicators.component.ts | 85 ++++++++++---- monitor-admin/utils/indicator-utils.ts | 107 ++++++++++-------- monitor/entities/stakeholder.ts | 1 - sharedComponents/input/input.component.ts | 7 +- 5 files changed, 146 insertions(+), 76 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index e5723eb8..05144592 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -271,6 +271,12 @@ [options]="indicatorUtils.formats" type="select">
+
+
+
+
@@ -400,6 +420,8 @@ placeholder="Year (From)">
+
{ + this.statsProfiles = [null].concat(statsProfiles); + }, error => { + this.statsProfiles = []; + })); + } else { + this.statsProfiles = []; + } } ngOnDestroy(): void { @@ -400,7 +412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.getJsonPath(index).disable(); } indicatorPath.get('result').setErrors({validating: true}); - this.subscriptions.push(this.statisticsService.getNumbers(null, indicatorPath.get('url').value).subscribe(response => { + this.subscriptions.push(this.statisticsService.getNumbers(indicatorPath.get('source').value, this.indicatorUtils.getFullUrl(this.stakeholder, this.indicator.indicatorPaths[index])).subscribe(response => { let result = JSON.parse(JSON.stringify(response)); this.getJsonPath(index).controls.forEach(jsonPath => { if (result) { @@ -448,12 +460,16 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.section.indicators[this.index].indicatorPaths[index].jsonPath; } - public getParameters(index: number): UntypedFormArray { - return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + public getParameters(index: number, type: IndicatorType = 'chart'): UntypedFormArray { + if(type === 'chart') { + return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + } else { + return this.numberIndicatorPaths.at(index).get('parameters') as UntypedFormArray; + } } - public getParameter(index: number, key: string): UntypedFormControl { - return this.getParameters(index).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; + public getParameter(index: number, key: string, type: IndicatorType = 'chart'): UntypedFormControl { + return this.getParameters(index, type).controls.filter(control => control.value.key === key)[0] as UntypedFormControl; } private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) { @@ -474,6 +490,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple jsonPath: jsonPath, result: this.fb.control(0, Validators.required), source: this.fb.control(source, Validators.required), + parameters: parameters, format: this.fb.control(format, Validators.required) } )); @@ -506,6 +523,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple if (indicatorPath.source) { this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source); } + (this.numberIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) { let paths = indicatorPath.jsonPath; for (let i = 0; i < paths.length; i++) { @@ -568,8 +586,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type); - let parameters = this.getParametersAsFormArray(indicatorPath); - (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', parameters); + (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); if (!this.indicator.indicatorPaths[index]) { this.indicator.indicatorPaths[index] = indicatorPath; this.indicator.indicatorPaths[index].safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); @@ -642,7 +659,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple defaultId: this.fb.control(this.indicator.defaultId) }); this.indicator.indicatorPaths.forEach(indicatorPath => { - this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), indicatorPath.parameters, indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format); + this.addNumberIndicatorPath(this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), this.getParametersAsFormArray(indicatorPath), indicatorPath.source, this.getJsonPathAsFormArray(indicatorPath), indicatorPath.format); }); } else { this.indicator = new Indicator('', '', '', 'number', 'small', 'small', "PUBLIC", []); @@ -754,11 +771,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.editing = true; if (this.indicator.type === 'chart') { this.chartIndicatorFb.get('description').enable(); - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, true); + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type); this.section = this.charts.find(section => section._id === this.section._id); } else { this.numberIndicatorFb.get('description').enable(); - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type, false); + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, this.indicator.type); this.section = this.numbers.find(section => section._id === this.section._id); } let path = [ @@ -917,16 +934,27 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - hasDifference(index: number): boolean { + hasDifference(index: number, type: IndicatorType = 'chart'): boolean { let hasDifference = false; - this.chartIndicatorPaths.at(index).value.parameters.forEach((parameter) => { - if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { - hasDifference = true; - return; - } - }); - return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== - this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); + if(type === 'chart') { + this.chartIndicatorPaths.at(index).value.parameters.forEach(parameter => { + if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { + hasDifference = true; + return; + } + }); + return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== + 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]) { + hasDifference = true; + return; + } + }); + } + return hasDifference; } public get isAdministrator(): boolean { @@ -937,11 +965,18 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.isAdministrator || Session.isCurator(this.stakeholder.type, this.user); } - refreshIndicator() { - this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart', true); - this.indicator.indicatorPaths.forEach(indicatorPath => { - indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); - }); + refreshIndicator(type: IndicatorType = 'chart') { + if(type === 'chart') { + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart'); + this.indicator.indicatorPaths.forEach(indicatorPath => { + indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); + }); + } else if(type === 'number') { + this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, 'number'); + this.indicator.indicatorPaths.forEach((indicatorPath, index) => { + this.validateJsonPath(index); + }); + } } deleteIndicatorOpen(section: Section, indicatorId: string, type: string, childrenAction: string = null) { diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 25de908b..a8493563 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -85,7 +85,7 @@ export class StakeholderUtils { visibilityIcon: Map = new Map(this.visibilities.map(option => [option.value, option.icon])); defaultValue(options: Option[]) { - return options.length === 1?options[0].value:null; + return options.length === 1 ? options[0].value : null; } showField(options: Option[]) { @@ -94,7 +94,7 @@ export class StakeholderUtils { getLabel(options: Option[], value) { let option = options.find(option => option.value === value); - return option?option.label:null; + return option ? option.label : null; } getTypesByUserRoles(user, id: string = null): Option[] { @@ -317,8 +317,9 @@ export class IndicatorUtils { public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string { let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if(indicatorPath.statsProfile) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.statsProfile) + if (indicatorPath.parameters.statsProfile) { + console.log(indicatorPath.parameters.statsProfile) + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile) } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } @@ -394,12 +395,12 @@ export class IndicatorUtils { return (indicatorPath.chartObject ? indicatorPath.url + encodeURIComponent(replacedUrl) : replacedUrl); } - public getFullUrlWithFilters(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null, coFunded: boolean = false, foslvl1:string[]=[], foslvl2:string[]=[], publiclyFunded: "all"| "true"| "false"= "all" ): string { + public getFullUrlWithFilters(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null, coFunded: boolean = false, foslvl1: string[] = [], foslvl2: string[] = [], publiclyFunded: "all" | "true" | "false" = "all"): string { let filterSubtitleText = []; indicatorPath.filtersApplied = 0; let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; - if(indicatorPath.statsProfile) { - replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.statsProfile) + if (indicatorPath.parameters.statsProfile) { + replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile) } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } @@ -408,7 +409,7 @@ export class IndicatorUtils { let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Funding level 0: " ) ; + filterSubtitleText.push("Funding level 0: "); } } if (startYear) { @@ -425,7 +426,7 @@ export class IndicatorUtils { indicatorPath.filtersApplied += filterResults.filtersApplied; } } - if(startYear || endYear) { + if (startYear || endYear) { filterSubtitleText.push(startYear && endYear ? (startYear + ' - ' + endYear) : (endYear ? ('until ' + endYear) : '')); } if (coFunded) { @@ -433,33 +434,33 @@ export class IndicatorUtils { let filterResults = this.addFilter(replacedUrl, 'co-funded', coFunded); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Co-funded: " + (coFunded?'yes':'no') ) ; + filterSubtitleText.push("Co-funded: " + (coFunded ? 'yes' : 'no')); } } - if (publiclyFunded && publiclyFunded !="all") { + if (publiclyFunded && publiclyFunded != "all") { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { let filterResults = this.addFilter(replacedUrl, 'publicly-funded', publiclyFunded); replacedUrl = filterResults.url; indicatorPath.filtersApplied += filterResults.filtersApplied; - filterSubtitleText.push( "Publicly funded: " + (publiclyFunded?'yes':'no') ) ; + filterSubtitleText.push("Publicly funded: " + (publiclyFunded ? 'yes' : 'no')); } } if (foslvl1) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { - let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1); - replacedUrl = filterResults.url; - indicatorPath.filtersApplied +=filterResults.filtersApplied?foslvl1.length:0; + let filterResults = this.addFilter(replacedUrl, 'foslvl1', foslvl1); + replacedUrl = filterResults.url; + indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl1.length : 0; } } if (foslvl2) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { - let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2); - replacedUrl = filterResults.url; - indicatorPath.filtersApplied += filterResults.filtersApplied?foslvl2.length:0; + let filterResults = this.addFilter(replacedUrl, 'foslvl2', foslvl2); + replacedUrl = filterResults.url; + indicatorPath.filtersApplied += filterResults.filtersApplied ? foslvl2.length : 0; } } - if((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)){ - filterSubtitleText.push( "Field of Science: " + foslvl1.join(', ') + ( foslvl1.length > 0 && foslvl2.length > 0? ', ': '') + foslvl2.join(", ") ) ; + if ((foslvl1 && foslvl1.length > 0) || (foslvl2 && foslvl2.length > 0)) { + filterSubtitleText.push("Field of Science: " + foslvl1.join(', ') + (foslvl1.length > 0 && foslvl2.length > 0 ? ', ' : '') + foslvl2.join(", ")); } if (indicatorPath.parameters) { Object.keys(indicatorPath.parameters).forEach(key => { @@ -484,7 +485,7 @@ export class IndicatorUtils { replacedValue = stakeholder.index_shortName.toLowerCase(); } if (key == "subtitle" && filterSubtitleText.length > 0) { - replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ':'') + ' Active filters: ('+filterSubtitleText.join(", ") + ')'; + replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')'; } replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) }); @@ -577,7 +578,7 @@ export class IndicatorUtils { /*Chart with proper json object*/ //apply the filter in any select fields for (let select of queries["query"]["select"]) { - let filterString = IndicatorFilterUtils.getFilter(select["field"], filterType,filterValue); + let filterString = IndicatorFilterUtils.getFilter(select["field"], filterType, filterValue); if (filterString) { let filter = JSON.parse(filterString); //check if filter already exists @@ -639,21 +640,19 @@ export class IndicatorUtils { return values.length > 1; } - generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType, addParameters: boolean = true): Indicator { + generateIndicatorByForm(form: any, indicatorPaths: IndicatorPath[], type: IndicatorType): Indicator { let indicator: Indicator = new Indicator(form.name, form.description, form.additionalDescription, type, form.width, form.height, form.visibility, indicatorPaths, form.defaultId); indicator._id = form._id; form.indicatorPaths.forEach((indicatorPath, index) => { indicator.indicatorPaths[index].type = indicatorPath.type; indicator.indicatorPaths[index].format = indicatorPath.format; - if (addParameters) { - indicatorPath.parameters.forEach(parameter => { - indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value; - if (parameter.key === 'type') { - indicator.indicatorPaths[index].type = parameter.value; - } - }); - } + indicatorPath.parameters.forEach(parameter => { + indicator.indicatorPaths[index].parameters[parameter.key] = parameter.value; + if (parameter.key === 'type') { + indicator.indicatorPaths[index].type = parameter.value; + } + }); }); return indicator; } @@ -667,6 +666,7 @@ export class IndicatorUtils { let chart = JSON.parse(indicatorPath.chartObject); this.parameterizeDefaultQuery(chart, indicatorPath, stakeholder); this.extractStakeHolders(chart, indicatorPath, stakeholder); + this.addProfile(indicatorPath); indicatorPath.chartObject = JSON.stringify(chart); if (!jsonPath || jsonPath.length == 0 || (jsonPath.length == 1 && jsonPath[0] == "")) { indicatorPath.jsonPath = ["data", "0", "0", "0"]; @@ -726,6 +726,7 @@ export class IndicatorUtils { this.extractStakeHolders(chart, indicatorPath, stakeholder); this.extractStartYear(chart, indicatorPath); this.extractEndYear(chart, indicatorPath); + this.addProfile(indicatorPath); indicatorPath.chartObject = JSON.stringify(chart); } } else if (source === 'old') { @@ -806,10 +807,10 @@ export class IndicatorUtils { for (let gfilter of filter["groupFilters"]) { //ignore field No Of Funders let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1 ) || - (gfilter["field"].indexOf(".funder") != -1) || - (gfilter["field"].indexOf(".funder.id") != -1)) { + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) || + (gfilter["field"].indexOf(".funder") != -1) || + (gfilter["field"].indexOf(".funder.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -832,9 +833,9 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches + if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".context.name") != -1) - || (gfilter["field"].indexOf(".context.id") != -1)) { + || (gfilter["field"].indexOf(".context.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -859,9 +860,9 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".organization.name") != -1)|| - (gfilter["field"].indexOf(".organization.id") != -1)) { + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".organization.name") != -1) || + (gfilter["field"].indexOf(".organization.id") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -869,6 +870,7 @@ export class IndicatorUtils { } } } + private extractDatasource(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { // works for .datasource.name and .HostedBy datasource // and .datasource.id @@ -885,9 +887,9 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1)|| - (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) || + (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -895,6 +897,7 @@ export class IndicatorUtils { } } } + private extractResearcher(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { // works for .orcid if (stakeholder.type != "researcher") { @@ -910,8 +913,8 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); - if(replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".orcid") != -1 )) { + if (replacedValue) { // don't proceed in replacement if no replaced value matches + if ((gfilter["field"].indexOf(".orcid") != -1)) { gfilter["values"][0] = replacedValue; } } @@ -919,19 +922,21 @@ export class IndicatorUtils { } } } - private replaceIndexValues(currentValue, stakeholder, parameters ){ - if(currentValue == stakeholder.index_name){ + + private replaceIndexValues(currentValue, stakeholder, parameters) { + if (currentValue == stakeholder.index_name) { parameters["index_name"] = stakeholder.index_name; return ChartHelper.prefix + "index_name" + ChartHelper.suffix; - }else if(currentValue == stakeholder.index_id){ + } else if (currentValue == stakeholder.index_id) { parameters["index_id"] = stakeholder.index_id; return ChartHelper.prefix + "index_id" + ChartHelper.suffix; - }else if(currentValue == stakeholder.index_shortName) { + } else if (currentValue == stakeholder.index_shortName) { parameters["index_shortName"] = stakeholder.index_shortName; return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; } } + private extractStartYear(obj, indicatorPath: IndicatorPath) { let start_year; for (let query of obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)]) { @@ -968,6 +973,10 @@ export class IndicatorUtils { } } + private addProfile(indicatorPath: IndicatorPath) { + indicatorPath.parameters['statsProfile'] = null; + } + private parameterizeDefaultQuery(obj, indicatorPath: IndicatorPath, stakeholder: Stakeholder) { let name = ""; for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index faa7bac8..49c8e755 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -210,7 +210,6 @@ export class IndicatorPath { parameters: any; filters: any; filtersApplied: number = 0; - statsProfile: string; format: Format; constructor(type: IndicatorPathType, source: SourceType, url: string, chartObject: string, jsonPath: string[], format: Format = 'NUMBER') { diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 35a0f12d..83f7114a 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -336,7 +336,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() set options(options: (Option | string | number) []) { this.optionsArray = options.map(option => { - if (typeof option === 'string' || typeof option === 'number') { + if(option === null) { + return { + label: this.noValueSelected, + value: '' + }; + } else if (typeof option === 'string' || typeof option === 'number') { return { label: option.toString(), value: option -- 2.17.1 From 590bdaf2e3dc7985db8d3c5f9bc892689b8ba767 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 22 Feb 2024 13:57:27 +0200 Subject: [PATCH 16/93] [develop | DONE | FIXED]: [BUG FIX] bulkClaim.component.ts: In method "fetchResult()", if call to Crossref returns 404, query Datacite | environment.ts: Update url of "searchDataciteAPIURL" property to call endpoint "/dois" instead of "/works" (/works is the version 1 - old - while the current is version 2). --- claims/linking/bulkClaim/bulkClaim.component.ts | 13 +++++++++---- utils/properties/environments/environment.ts | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/claims/linking/bulkClaim/bulkClaim.component.ts b/claims/linking/bulkClaim/bulkClaim.component.ts index fac882b3..79654726 100644 --- a/claims/linking/bulkClaim/bulkClaim.component.ts +++ b/claims/linking/bulkClaim/bulkClaim.component.ts @@ -269,11 +269,16 @@ export class BulkClaimComponent { } }, err => { - //console.log(err); + // console.log(err); BulkClaimComponent.handleError("Error getting crossref by DOIs: " + id, err); - this.notFoundIds.push(id); - this.notFoundIdsRow.push(row); - this.endOfFetching(); + + if(err.status == 404) { + this.searchInDatacite(id, accessMode, date, row); + } else { + this.notFoundIds.push(id); + this.notFoundIdsRow.push(row); + this.endOfFetching(); + } } )); } diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index d601e40a..86c362e7 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -6,7 +6,7 @@ export let common: EnvProperties = { useNewStatistisTool: true, openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", searchCrossrefAPIURL: "https://api.crossref.org/works", - searchDataciteAPIURL: "https://api.datacite.org/works", + searchDataciteAPIURL: "https://api.datacite.org/dois", searchOrcidURL: "https://pub.orcid.org/v2.1/", orcidURL: "https://orcid.org/", orcidAPIURL: "https://services.openaire.eu/uoa-orcid-service/", -- 2.17.1 From ba87ad69d354eb7d3c754b314485fa2fdecc5b04 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 22 Feb 2024 15:12:33 +0200 Subject: [PATCH 17/93] [develop]: Manage stakeholders: Add select type in all monitor dashboards --- .../manageStakeholders/manageStakeholders.component.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.html b/monitor-admin/manageStakeholders/manageStakeholders.component.html index cf96dbc3..de1567cd 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.html +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.html @@ -12,9 +12,8 @@
-
-
+
+
-- 2.17.1 From f5ca757771316ed4497dabc2f10f481da337f249 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 23 Feb 2024 10:11:00 +0200 Subject: [PATCH 18/93] [develop | DONE | CHANGED] Range filters set placeholder/ validator based on min/max year from input --- utils/rangeFilter/rangeFilter.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/rangeFilter/rangeFilter.component.ts b/utils/rangeFilter/rangeFilter.component.ts index dcf0d9a3..3c7e5e48 100644 --- a/utils/rangeFilter/rangeFilter.component.ts +++ b/utils/rangeFilter/rangeFilter.component.ts @@ -21,7 +21,7 @@ export class RangeFilterComponent { @Input() yearMax: number = Dates.yearMax; @Input() mandatoryRange:boolean = false; public currentYear: number = Dates.currentYear; - public yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + public yearValidators; public formValidators = [StringUtils.fromYearAfterToYearValidator]; public rangeForm: UntypedFormGroup; public yearRange: YearRange = { @@ -41,6 +41,11 @@ export class RangeFilterComponent { constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {} ngOnInit() { + this.yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; + this.yearRange = { + from: {control: 'yearFrom', placeholder: this.yearMin.toString()}, + to: {control: 'yearTo', placeholder: this.yearMax.toString()} + } if(this.mandatoryRange) { this.formValidators.push(StringUtils.rangeRequired(this.mandatoryRange)); } -- 2.17.1 From 7c3c082fc0636faee3d68e11c86051a9089be3fd Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 23 Feb 2024 10:12:32 +0200 Subject: [PATCH 19/93] [develop | DONE | CHANGED] add min/max year variables with default values max: current and min: current -20 --- .../monitor-indicator-stakeholder-base.component.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index ee7bb511..8c95c6d6 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -50,7 +50,8 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator selectedFromAndToValues: "" }; rangeFilter: RangeFilterComponent; - + minYear = Dates.currentYear - 20 + maxYear = Dates.currentYear public numberResults: Map = new Map(); public chartsActiveType: Map = new Map(); public currentYear = new Date().getFullYear(); @@ -179,12 +180,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator protected 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 + ""; + if (this.periodFilter.selectedToValue && (this.periodFilter.selectedToValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedToValue, this.minYear, this.maxYear))) { + this.periodFilter.selectedToValue = this.maxYear + ""; 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 + ""; + if (this.periodFilter.selectedFromValue && (this.periodFilter.selectedFromValue.length == 0 || !Dates.isValidYear(this.periodFilter.selectedFromValue, this.minYear, this.maxYear))) { + this.periodFilter.selectedFromValue = this.minYear + ""; 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)) { -- 2.17.1 From abbe118035e086075b6d86fa46bdf996569b8701 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 23 Feb 2024 14:20:19 +0200 Subject: [PATCH 20/93] [ develop | DONE | REMOVED] TimeoutInterceptor: remove properties.searchAPIURLLAst from timeout whitelist --- timeout-interceptor.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timeout-interceptor.service.ts b/timeout-interceptor.service.ts index 224e585e..3b5c2fff 100644 --- a/timeout-interceptor.service.ts +++ b/timeout-interceptor.service.ts @@ -13,7 +13,7 @@ export class TimeoutInterceptor implements HttpInterceptor { private static TIMEOUT_WHITELIST = [ properties.csvAPIURL, properties.registryUrl, properties.claimsAPIURL, properties.searchCrossrefAPIURL, properties.searchDataciteAPIURL, - properties.statisticsAPIURL, properties.searchAPIURLLAst, properties.monitorStatsFrameUrl]; + properties.statisticsAPIURL, properties.monitorStatsFrameUrl]; constructor(@Inject(DEFAULT_TIMEOUT) protected defaultTimeout: number, @Inject(PLATFORM_ID) private platformId: any) { } -- 2.17.1 From 79d39db833a8207513bcf350c02262baf56da4da Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 26 Feb 2024 09:46:52 +0200 Subject: [PATCH 21/93] [develop]: Remove currentYear from monitor base component --- monitor/monitor-indicator-stakeholder-base.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index 8c95c6d6..4573dee4 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -50,11 +50,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator selectedFromAndToValues: "" }; rangeFilter: RangeFilterComponent; - minYear = Dates.currentYear - 20 - maxYear = Dates.currentYear + minYear = Dates.currentYear - 20; + maxYear = Dates.currentYear; public numberResults: Map = new Map(); public chartsActiveType: Map = new Map(); - public currentYear = new Date().getFullYear(); public clipboard; /** Services */ -- 2.17.1 From 110c2ab4b392c79f7e31b199be261a81284c587e Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 26 Feb 2024 15:54:50 +0200 Subject: [PATCH 22/93] [develop | FIXED | DONE]: 1. Fixed prefix of roles. 2. Disable filtering in manage stakeholders while loading. --- dashboard/users/subscribers/subscribers.component.ts | 4 ++-- login/utils/helper.class.ts | 2 +- .../manageStakeholders/manageStakeholders.component.html | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dashboard/users/subscribers/subscribers.component.ts b/dashboard/users/subscribers/subscribers.component.ts index 5b7976e7..fcc49978 100644 --- a/dashboard/users/subscribers/subscribers.component.ts +++ b/dashboard/users/subscribers/subscribers.component.ts @@ -141,8 +141,8 @@ export class SubscribersComponent implements OnInit, OnDestroy, OnChanges { this.createRoleModal.okButtonLeft = false; this.createRoleModal.okButtonText = 'create'; this.roleFb = this.fb.group({ - name: this.fb.control(Role.mapType(this.type) + '.' + this.id, Validators.required), - description: this.fb.control(Role.mapType(this.type) + ' ' + this.id, Validators.required) + name: this.fb.control(Role.roleName(this.type, this.id), Validators.required), + description: this.fb.control(Role.roleName(this.type, this.id), Validators.required) }); setTimeout(() => { this.roleFb.get('name').disable(); diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index 92c2a62e..6f2a2951 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -239,7 +239,7 @@ export class Role { } else if (type == "organization") { type = "institution"; } - return Role.GROUP + type; + return type; } /** diff --git a/monitor-admin/manageStakeholders/manageStakeholders.component.html b/monitor-admin/manageStakeholders/manageStakeholders.component.html index de1567cd..a876d32a 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.component.html +++ b/monitor-admin/manageStakeholders/manageStakeholders.component.html @@ -14,11 +14,11 @@
-
-
-- 2.17.1 From 43b1882956d37e01fd8aa99a396bfedf0493d8e2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 27 Feb 2024 01:42:15 +0200 Subject: [PATCH 23/93] [develop | DONE | FIXED]: [BUG FIX] searchDataProviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts: In method "filterRequestedAll()" (when clicking on view all of a search filter) get filters from the 3rd position of response, not the 2nd. --- searchPages/searchDataProviders.component.ts | 2 +- searchPages/searchOrganizations.component.ts | 2 +- searchPages/searchProjects.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index c5483431..876f7dc2 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -370,7 +370,7 @@ export class SearchDataProvidersComponent { this.searchFiltersSub = this._searchDataProvidersService.advancedSearchDataproviders(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, this.entityType, this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index 50deb4a2..415ee722 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -329,7 +329,7 @@ export class SearchOrganizationsComponent { this.searchFiltersSub = this._searchOrganizationsService.advancedSearchOrganizations(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "organization", this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 5e4e36c5..bb76455c 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -358,7 +358,7 @@ export class SearchProjectsComponent { this.searchFiltersSub = this._searchProjectsService.advancedSearchProjects(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), 1, 0, properties, fieldsStr, [oldFilter.filterId], this.refineQuery).subscribe( // this.searchFiltersSub = this._refineFieldsResultsService.getAllRefineFieldResultsByFieldName(oldFilter.filterId, "project", this.properties, this.refineQuery).subscribe( res => { - let filter: Filter = res[1][0]; + let filter: Filter = res[2][0]; if(filter.values.length == 0) { filter = oldFilter; filter.countAllValues = 0; -- 2.17.1 From f6654f7b932f725859073c609110e89f30c95427 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 27 Feb 2024 10:41:15 +0200 Subject: [PATCH 24/93] [develop | DONE | CHANGED]: result-preview.component.html: Open Access Routes, Impact-based indicators (bip) and Usage counts drops on click, not hover. --- utils/result-preview/result-preview.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 8854bebc..b920a1ea 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -224,7 +224,7 @@ Access Routes -
+
@@ -263,7 +263,7 @@ {{formatNumber(result.measure.bip[0].value)}}{{result.measure.bip[0].value}} -
+
@@ -289,7 +289,7 @@ [name]="result.measure.counts[0].icon">{{formatNumber(result.measure.counts[0].value)}} -
+
-- 2.17.1 From f43025b21cd19450137363a5ca8931dd87d62d33 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 27 Feb 2024 11:21:33 +0200 Subject: [PATCH 25/93] [develop | ADDED | FIXED]: Add missing searchLinkToStakeholders property in library common properties --- utils/properties/environments/environment.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 86c362e7..b48fe5c4 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -86,6 +86,9 @@ export let common: EnvProperties = { afterLoginRedirectLink: '/myCommunities', searchLinkToCommunities: '/search/find/communities', openOrgsUrl:"https://beta.orgs.openaire.eu", + + // monitor + searchLinkToStakeholders: "/browse" } export let commonDev: EnvProperties = { -- 2.17.1 From 49cd8a6232b74302649773a5b0d4647c478b85c9 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 27 Feb 2024 19:15:39 +0200 Subject: [PATCH 26/93] [develop | DONE | FIXED]: [BUG FIX] searchAll.component.ts: Tabs did not change if changed entity via menu & queryparams changes emit before params change - used combineLatest and debounceTime(0) as a workaround. --- searchPages/find/searchAll.component.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index 27af8480..f70ac38b 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -23,7 +23,8 @@ import {EnvProperties} from '../../utils/properties/env-properties'; import {SEOService} from '../../sharedComponents/SEO/SEO.service'; import {StringUtils} from '../../utils/string-utils.class'; import {SearchCustomFilter} from "../searchUtils/searchUtils.class"; -import {Subscription} from "rxjs"; +import {combineLatest, Subscription} from "rxjs"; +import {debounceTime, map} from "rxjs/operators"; import {AdvancedField, Filter} from "../searchUtils/searchHelperClasses.class"; import {SearchResearchResultsComponent} from "../searchResearchResults.component"; import {SearchProjectsComponent} from "../searchProjects.component"; @@ -219,9 +220,14 @@ export class SearchAllComponent { loadAll() { this.reloadTabs(); + // https://github.com/angular/angular/issues/26764 + this.subs.push(combineLatest([this.route.params, this.route.queryParams]) + .pipe(debounceTime(0)) + .pipe(map(results => ({params: results[0], query: results[1]}))) + .subscribe(results => { + let params = results['params']; + let queryParams = results['query']; - this.subs.push(this.route.params.subscribe(params => { - this.subs.push(this.route.queryParams.subscribe(queryParams => { this.parameters = Object.assign({}, queryParams); this.keyword = (queryParams['keyword']) ? queryParams['keyword'] : (queryParams["q"] ? queryParams["q"] : (queryParams["f0"] && queryParams["f0"] == "q" && queryParams["fv0"]?queryParams["fv0"]:"")); this.selectedFields[0].value = StringUtils.URIDecode(this.keyword); @@ -237,9 +243,8 @@ export class SearchAllComponent { active = ((["result","projects","organizations","datasources","services"]).indexOf(queryParams["active"])!= -1)?queryParams["active"]:null; delete this.parameters['active']; } - - if(this.activeEntity == null) { - if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0)) { + // if(this.activeEntity == null) { + if (this.activeEntity == null && (!params["entity"] || params["entity"].length == 0) && (!active || this.activeEntity != active)) { if (active) { this.activeEntity = active; if ((typeof document !== 'undefined')) { @@ -261,7 +266,7 @@ export class SearchAllComponent { } this.activeEntity = ((["result", "projects", "organizations", "datasources", "services"]).indexOf(entity) != -1) ? entity : this.getDefaultEntityToShow(); } - } + // } if (this.activeEntity == "result") { this.searchResults(); } else if (this.activeEntity == "projects") { @@ -274,7 +279,7 @@ export class SearchAllComponent { this.searchOrganizations(); } this.count(); - })); + // })); })); } -- 2.17.1 From 17e237c179b407b05e811c57effaf54189be9d6b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 28 Feb 2024 14:33:44 +0200 Subject: [PATCH 27/93] [develop | DONE | CHANGED]: Added routing modules (in library files) in Landing pages and in ORCID pages - imported the routing.module.ts in module.ts. --- .../dataProvider-routing.module.ts | 12 ++++++++++++ .../dataProvider/dataProvider.module.ts | 2 ++ .../organization-routing.module.ts | 12 ++++++++++++ .../organization/organization.module.ts | 2 ++ landingPages/project/project-routing.module.ts | 12 ++++++++++++ landingPages/project/project.module.ts | 2 ++ .../result/resultLanding-routing.module.ts | 12 ++++++++++++ landingPages/result/resultLanding.module.ts | 2 ++ .../myOrcidLinks-routing.module.ts | 17 +++++++++++++++++ orcid/my-orcid-links/myOrcidLinks.module.ts | 2 ++ orcid/orcid-routing.module.ts | 16 ++++++++++++++++ orcid/orcid.module.ts | 3 ++- ...ecommendedResultsForOrcid-routing.module.ts | 18 ++++++++++++++++++ .../searchRecommendedResultsForOrcid.module.ts | 2 ++ 14 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 landingPages/dataProvider/dataProvider-routing.module.ts create mode 100644 landingPages/organization/organization-routing.module.ts create mode 100644 landingPages/project/project-routing.module.ts create mode 100644 landingPages/result/resultLanding-routing.module.ts create mode 100644 orcid/my-orcid-links/myOrcidLinks-routing.module.ts create mode 100644 orcid/orcid-routing.module.ts create mode 100644 orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts diff --git a/landingPages/dataProvider/dataProvider-routing.module.ts b/landingPages/dataProvider/dataProvider-routing.module.ts new file mode 100644 index 00000000..fb878479 --- /dev/null +++ b/landingPages/dataProvider/dataProvider-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { DataProviderComponent } from "./dataProvider.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: DataProviderComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class DataProviderRoutingModule { } diff --git a/landingPages/dataProvider/dataProvider.module.ts b/landingPages/dataProvider/dataProvider.module.ts index 6cbdf9b4..c6716f47 100644 --- a/landingPages/dataProvider/dataProvider.module.ts +++ b/landingPages/dataProvider/dataProvider.module.ts @@ -36,10 +36,12 @@ import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.modu import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-screen-modal.module'; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {DataProviderRoutingModule} from "./dataProvider-routing.module"; @NgModule({ imports: [CommonModule, FormsModule, RouterModule, + DataProviderRoutingModule, IFrameModule, ErrorMessagesModule, LandingModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule, diff --git a/landingPages/organization/organization-routing.module.ts b/landingPages/organization/organization-routing.module.ts new file mode 100644 index 00000000..4e48b2b8 --- /dev/null +++ b/landingPages/organization/organization-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { OrganizationComponent } from "./organization.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: OrganizationComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class OrganizationRoutingModule { } diff --git a/landingPages/organization/organization.module.ts b/landingPages/organization/organization.module.ts index 9a4a2737..0c29500c 100644 --- a/landingPages/organization/organization.module.ts +++ b/landingPages/organization/organization.module.ts @@ -33,11 +33,13 @@ import {graph, versions} from "../../utils/icons/icons"; import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {OrganizationRoutingModule} from "./organization-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, + OrganizationRoutingModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule, LandingModule, DataProvidersServiceModule, diff --git a/landingPages/project/project-routing.module.ts b/landingPages/project/project-routing.module.ts new file mode 100644 index 00000000..3cec4ec2 --- /dev/null +++ b/landingPages/project/project-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { ProjectComponent } from "./project.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: ProjectComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class ProjectRoutingModule { } diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index 713c9f1f..30a3a8e9 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -32,10 +32,12 @@ import {FullScreenModalModule} from '../../utils/modal/full-screen-modal/full-sc import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {ProjectRoutingModule} from "./project-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, LandingModule, + ProjectRoutingModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule, IFrameModule, ReportsServiceModule, SearchResearchResultsServiceModule, ProjectServiceModule, diff --git a/landingPages/result/resultLanding-routing.module.ts b/landingPages/result/resultLanding-routing.module.ts new file mode 100644 index 00000000..51aac48d --- /dev/null +++ b/landingPages/result/resultLanding-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import { PreviousRouteRecorder } from "../../utils/piwik/previousRouteRecorder.guard"; +import { ResultLandingComponent } from "./resultLanding.component"; + + +@NgModule({ + imports: [ + RouterModule.forChild([{ path: '', component: ResultLandingComponent, canDeactivate: [PreviousRouteRecorder] }]) + ] +}) +export class ResultLandingRoutingModule { } diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 247c8a99..8554f354 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -37,10 +37,12 @@ import {SdgFosSuggestModule} from '../landing-utils/sdg-fos-suggest/sdg-fos-sugg import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-screen-modal.module"; import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; +import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, LandingModule, SharedModule, RouterModule, + ResultLandingRoutingModule, CiteThisModule, PagingModule, IFrameModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule, DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, diff --git a/orcid/my-orcid-links/myOrcidLinks-routing.module.ts b/orcid/my-orcid-links/myOrcidLinks-routing.module.ts new file mode 100644 index 00000000..58cc1201 --- /dev/null +++ b/orcid/my-orcid-links/myOrcidLinks-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; +import {MyOrcidLinksComponent} from "./myOrcidLinks.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: MyOrcidLinksComponent, + canActivate: [LoginGuard], canDeactivate: [PreviousRouteRecorder] + } + + ]) + ] +}) +export class MyOrcidLinksRoutingModule { } diff --git a/orcid/my-orcid-links/myOrcidLinks.module.ts b/orcid/my-orcid-links/myOrcidLinks.module.ts index 82bfb099..fad5db04 100644 --- a/orcid/my-orcid-links/myOrcidLinks.module.ts +++ b/orcid/my-orcid-links/myOrcidLinks.module.ts @@ -10,10 +10,12 @@ import {SearchResearchResultsServiceModule} from "../../services/searchResearchR import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; +import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module"; @NgModule({ imports: [ CommonModule, FormsModule, + MyOrcidLinksRoutingModule, RouterModule, ErrorMessagesModule, ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule, AlertModalModule, PiwikServiceModule diff --git a/orcid/orcid-routing.module.ts b/orcid/orcid-routing.module.ts new file mode 100644 index 00000000..1d786595 --- /dev/null +++ b/orcid/orcid-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; +import {OrcidComponent} from './orcid.component'; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OrcidComponent, + canActivate: [LoginGuard], + canDeactivate: [PreviousRouteRecorder] } + ]) + ] +}) +export class OrcidRoutingModule { } diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index 097be324..b323ea70 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -17,10 +17,11 @@ import {IconsService} from "../utils/icons/icons.service"; import {orcid_add, orcid_bin} from "../utils/icons/icons"; import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; import {LogServiceModule} from "../utils/log/LogService.module"; +import {OrcidRoutingModule} from "./orcid-routing.module"; @NgModule({ imports: [ - CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, + CommonModule, RouterModule, OrcidRoutingModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, IconsModule, FullScreenModalModule, LogServiceModule ], declarations: [ diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts new file mode 100644 index 00000000..970f5c9a --- /dev/null +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid-routing.module.ts @@ -0,0 +1,18 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; +import {LoginGuard} from "../../login/loginGuard.guard"; +import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; +import {SearchRecommendedResultsForOrcidComponent} from "./searchRecommendedResultsForOrcid.component"; + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: SearchRecommendedResultsForOrcidComponent, + canActivate: [LoginGuard], + canDeactivate: [PreviousRouteRecorder] + } + + ]) + ] +}) +export class SearchRecommendedResultsForOrcidRoutingModule { } diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts index d23ade61..82172b21 100644 --- a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts @@ -11,12 +11,14 @@ import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module"; import {OrcidService} from "../orcid.service"; +import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommendedResultsForOrcid-routing.module"; // import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, + SearchRecommendedResultsForOrcidRoutingModule, SearchFormModule, SearchResearchResultsModule, // , BreadcrumbsModule ], -- 2.17.1 From 9ef3f71ea656dca035238bb4f715666348a29616 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 28 Feb 2024 15:10:27 +0200 Subject: [PATCH 28/93] [develop]: Delete console log from stats profile of an indicator --- monitor-admin/utils/indicator-utils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index a8493563..161b2309 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -318,7 +318,6 @@ export class IndicatorUtils { public getFullUrl(stakeholder: Stakeholder, indicatorPath: IndicatorPath, fundingL0: string = null, startYear: string = null, endYear: string = null): string { let replacedUrl = indicatorPath.chartObject ? indicatorPath.chartObject : indicatorPath.url; if (indicatorPath.parameters.statsProfile) { - console.log(indicatorPath.parameters.statsProfile) replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(indicatorPath.parameters.statsProfile) } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) -- 2.17.1 From efa0f72cc36ebd10420f77afc2c452ec92172990 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 28 Feb 2024 16:45:23 +0200 Subject: [PATCH 29/93] [develop | DONE | CHANGED]: isRouteEnabled.guard.ts, freeGuard.guard.ts: Added @Injectable({providedIn: 'root'}) | Removed from providers PreviousRouteRecorderm, isRouteEnabled, LoginGuard AdminLoginGuard, PiwikService & removed from imports PiwikServiceModule. --- .../displayClaims/displayClaims.module.ts | 3 +-- claims/claimsAdmin/claimsAdmin.module.ts | 5 +---- claims/directLinking/directLinking.module.ts | 5 +---- claims/linking/linkingGeneric.module.ts | 7 +------ claims/myClaims/myClaims.module.ts | 5 +---- deposit/depositFirstPage.module.ts | 2 -- deposit/searchDataprovidersToDeposit.module.ts | 3 +-- error/isRouteEnabled.guard.ts | 4 +++- fos/fos.module.ts | 6 +----- landingPages/landing-utils/landing.module.ts | 8 ++------ login/freeGuard.guard.ts | 2 +- login/user.module.ts | 5 +---- monitor-admin/general/general.module.ts | 5 +---- .../manageStakeholders/manageStakeholders.module.ts | 5 +---- monitor-admin/topic/topic.module.ts | 12 ++---------- orcid/my-orcid-links/myOrcidLinks.module.ts | 3 +-- orcid/orcid.module.ts | 3 --- .../searchRecommendedResultsForOrcid.module.ts | 3 +-- reload/reload.module.ts | 6 +----- sdg/sdg.module.ts | 7 +------ searchPages/find/searchAll.module.ts | 8 ++------ searchPages/searchOrganizations.module.ts | 1 - searchPages/searchUtils/newSearchPage.module.ts | 8 ++------ utils/piwik/previousRouteRecorder.guard.ts | 2 +- 24 files changed, 27 insertions(+), 91 deletions(-) diff --git a/claims/claim-utils/displayClaims/displayClaims.module.ts b/claims/claim-utils/displayClaims/displayClaims.module.ts index 6ecda833..99134994 100644 --- a/claims/claim-utils/displayClaims/displayClaims.module.ts +++ b/claims/claim-utils/displayClaims/displayClaims.module.ts @@ -17,7 +17,6 @@ import {HelperModule} from '../../../utils/helper/helper.module'; import {Schema2jsonldModule} from '../../../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../../../sharedComponents/SEO/SEOService.module'; import {IndexInfoServiceModule} from "../../../utils/indexInfoService.module"; -import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module"; import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module'; import {InputModule} from '../../../sharedComponents/input/input.module'; import {LoadingModule} from '../../../utils/loading/loading.module'; @@ -30,7 +29,7 @@ import {link} from "../../../utils/icons/icons"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule, - ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule, + ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging, IconsModule, DropdownFilterModule ], diff --git a/claims/claimsAdmin/claimsAdmin.module.ts b/claims/claimsAdmin/claimsAdmin.module.ts index ace19292..89caa0d6 100644 --- a/claims/claimsAdmin/claimsAdmin.module.ts +++ b/claims/claimsAdmin/claimsAdmin.module.ts @@ -3,9 +3,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { ClaimsAdminComponent } from './claimsAdmin.component'; import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; -import { AdminLoginGuard} from'../../login/adminLoginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; @NgModule({ imports: [ @@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; DisplayClaimsModule ], - providers:[AdminLoginGuard, PreviousRouteRecorder,IsRouteEnabled], + providers:[], declarations: [ ClaimsAdminComponent ], diff --git a/claims/directLinking/directLinking.module.ts b/claims/directLinking/directLinking.module.ts index a9bea79c..9505f79d 100644 --- a/claims/directLinking/directLinking.module.ts +++ b/claims/directLinking/directLinking.module.ts @@ -5,9 +5,6 @@ import { DirectLinkingComponent } from './directLinking.component'; import {EntitySearchServiceModule} from '../../utils/entitiesAutoComplete/entitySearchService.module'; import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module'; -import {LoginGuard} from'../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {LinkingGenericModule} from '../linking/linkingGeneric.module'; @@ -18,7 +15,7 @@ import {LinkingGenericModule} from '../linking/linkingGeneric.module'; EntitySearchServiceModule, SearchResearchResultsServiceModule, Schema2jsonldModule, SEOServiceModule, LinkingGenericModule ], - providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers:[], declarations: [ DirectLinkingComponent ], exports:[DirectLinkingComponent] diff --git a/claims/linking/linkingGeneric.module.ts b/claims/linking/linkingGeneric.module.ts index 5d49a3b5..0ec6eafe 100644 --- a/claims/linking/linkingGeneric.module.ts +++ b/claims/linking/linkingGeneric.module.ts @@ -7,20 +7,16 @@ import {SelectedContextsModule} from './selected/selectedContexts.module'; import {SelectedPublicationsModule} from './selected/selectedResults.module'; import {LinkingGenericComponent} from './linkingGeneric.component'; import {StartOverModule} from '../claim-utils/startOver.module'; -import {LoginGuard} from '../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {ClaimContextSearchFormModule} from '../claim-utils/claimContextSearchForm.module'; import {ClaimProjectsSearchFormModule} from '../claim-utils/claimProjectSearchForm.module'; import {BulkClaimModule} from './bulkClaim/bulkClaim.module'; import {ClaimResultSearchFormModule} from '../claim-utils/claimResultSearchForm.module'; import {HelperModule} from '../../utils/helper/helper.module'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; import {MetadataPreviewModule} from './selected/metadataPreview.module'; import {ClaimEntitiesMetadataModule} from "./selected/ClaimEntitiesMetadata.module"; import {AlertModalModule} from '../../utils/modal/alertModal.module'; -import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {StepperModule} from "../../sharedComponents/stepper/stepper.module"; import {IconsModule} from "../../utils/icons/icons.module"; @@ -34,10 +30,9 @@ import {link} from "../../utils/icons/icons"; StartOverModule, ClaimContextSearchFormModule, ClaimProjectsSearchFormModule, BulkClaimModule, ClaimResultSearchFormModule, HelperModule, Schema2jsonldModule, SEOServiceModule, MetadataPreviewModule, ClaimEntitiesMetadataModule, AlertModalModule, - PiwikServiceModule, MatSelectModule, BreadcrumbsModule, StepperModule, IconsModule ], - providers: [LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers: [], declarations: [ LinkingGenericComponent ], exports: [ diff --git a/claims/myClaims/myClaims.module.ts b/claims/myClaims/myClaims.module.ts index 20d97331..bb87055d 100644 --- a/claims/myClaims/myClaims.module.ts +++ b/claims/myClaims/myClaims.module.ts @@ -3,9 +3,6 @@ import { NgModule } from '@angular/core'; import { SharedModule } from '../../../openaireLibrary/shared/shared.module'; import { MyClaimsComponent } from './myClaims.component'; import {DisplayClaimsModule} from '../claim-utils/displayClaims/displayClaims.module'; -import {LoginGuard} from'../../login/loginGuard.guard'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; @NgModule({ imports: [ @@ -13,7 +10,7 @@ import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; DisplayClaimsModule ], - providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + providers:[], declarations: [ MyClaimsComponent ], exports: [MyClaimsComponent] diff --git a/deposit/depositFirstPage.module.ts b/deposit/depositFirstPage.module.ts index c91e19b0..197b0ff3 100644 --- a/deposit/depositFirstPage.module.ts +++ b/deposit/depositFirstPage.module.ts @@ -5,7 +5,6 @@ import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; -import {PiwikServiceModule} from '../utils/piwik/piwikService.module'; import {HelperModule} from '../utils/helper/helper.module'; import {Schema2jsonldModule} from '../sharedComponents/schema2jsonld/schema2jsonld.module'; import { SEOServiceModule } from '../sharedComponents/SEO/SEOService.module'; @@ -18,7 +17,6 @@ import {FullScreenModalModule} from '../utils/modal/full-screen-modal/full-scree imports: [ CommonModule, FormsModule, RouterModule, - PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, SearchInputModule, FullScreenModalModule diff --git a/deposit/searchDataprovidersToDeposit.module.ts b/deposit/searchDataprovidersToDeposit.module.ts index c6fb9f0a..d7959e48 100644 --- a/deposit/searchDataprovidersToDeposit.module.ts +++ b/deposit/searchDataprovidersToDeposit.module.ts @@ -9,7 +9,6 @@ import {SearchResultsModule } from '../searchPages/searchUtils/searchResults.mod import {DataProvidersServiceModule} from '../services/dataProvidersService.module'; import {SearchFormModule} from '../searchPages/searchUtils/searchForm.module'; -import {IsRouteEnabled} from '../error/isRouteEnabled.guard'; import {SearchDataProvidersModule} from "../searchPages/searchDataProviders.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; @@ -25,7 +24,7 @@ import {SearchInputModule} from "../sharedComponents/search-input/search-input.m declarations: [ SearchDataprovidersToDepositComponent ], - providers:[ IsRouteEnabled], + providers:[], exports: [ SearchDataprovidersToDepositComponent ] diff --git a/error/isRouteEnabled.guard.ts b/error/isRouteEnabled.guard.ts index 2dca90fb..a49e53d0 100644 --- a/error/isRouteEnabled.guard.ts +++ b/error/isRouteEnabled.guard.ts @@ -6,7 +6,9 @@ import {ConfigurationService} from '../utils/configuration/configuration.service import {ConnectHelper} from '../connect/connectHelper'; import {properties} from "../../../environments/environment"; -@Injectable() +@Injectable({ + providedIn: 'root' +}) export class IsRouteEnabled { constructor(private router: Router, diff --git a/fos/fos.module.ts b/fos/fos.module.ts index d0f1f833..9264a6e9 100644 --- a/fos/fos.module.ts +++ b/fos/fos.module.ts @@ -2,13 +2,11 @@ import {CommonModule} from "@angular/common"; import {NgModule} from "@angular/core"; import {FormsModule} from "@angular/forms"; import {RouterModule} from "@angular/router"; -import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; import {IconsModule} from "../utils/icons/icons.module"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {SearchInputModule} from "../sharedComponents/search-input/search-input.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; -import {PiwikService} from "../utils/piwik/piwik.service"; import {FosRoutingModule} from './fos-routing.module'; import {FosComponent} from './fos.component'; @@ -22,9 +20,7 @@ import {FosComponent} from './fos.component'; declarations: [ FosComponent ], - providers: [ - PreviousRouteRecorder, PiwikService - ], + providers: [], exports: [ FosComponent ] diff --git a/landingPages/landing-utils/landing.module.ts b/landingPages/landing-utils/landing.module.ts index a7ae76f1..3eedae91 100644 --- a/landingPages/landing-utils/landing.module.ts +++ b/landingPages/landing-utils/landing.module.ts @@ -8,19 +8,15 @@ import { RouterModule } from '@angular/router'; import {TabPagingComponent} from './tabPaging.component'; import {ShowTitleComponent} from './showTitle.component'; import {AddThisComponent} from './addThis.component'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; -import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard'; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, PiwikServiceModule + CommonModule, FormsModule, RouterModule ], declarations: [ TabPagingComponent, ShowTitleComponent, AddThisComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ TabPagingComponent, ShowTitleComponent, AddThisComponent ] diff --git a/login/freeGuard.guard.ts b/login/freeGuard.guard.ts index 13d5941e..9d2b2b0c 100644 --- a/login/freeGuard.guard.ts +++ b/login/freeGuard.guard.ts @@ -3,7 +3,7 @@ import { Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@a import {Observable} from 'rxjs'; import {LoginErrorCodes} from './utils/guardHelper.class'; -@Injectable() +@Injectable({providedIn: 'root'}) export class FreeGuard { constructor(private router: Router) { diff --git a/login/user.module.ts b/login/user.module.ts index f592e6b8..13e493d6 100644 --- a/login/user.module.ts +++ b/login/user.module.ts @@ -7,16 +7,13 @@ import {UserRoutingModule} from './user-routing.module'; import {UserComponent} from './user.component'; -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {LoadingModule} from "../utils/loading/loading.module"; @NgModule({ imports: [ CommonModule, FormsModule, UserRoutingModule, RouterModule, LoadingModule ], - providers: [ - PreviousRouteRecorder - ], + providers: [], declarations: [ UserComponent ], diff --git a/monitor-admin/general/general.module.ts b/monitor-admin/general/general.module.ts index 7f4e7064..8f4aef96 100644 --- a/monitor-admin/general/general.module.ts +++ b/monitor-admin/general/general.module.ts @@ -1,7 +1,6 @@ import {NgModule} from "@angular/core"; import {GeneralComponent} from "./general.component"; import {GeneralRoutingModule} from "./general-routing.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {InputModule} from "../../sharedComponents/input/input.module"; @@ -30,9 +29,7 @@ import { LogoUrlPipeModule, SidebarMobileToggleModule ], - providers: [ - PreviousRouteRecorder, - ], + providers: [], exports: [GeneralComponent] }) export class GeneralModule { diff --git a/monitor-admin/manageStakeholders/manageStakeholders.module.ts b/monitor-admin/manageStakeholders/manageStakeholders.module.ts index 5ea2b818..2d2bd224 100644 --- a/monitor-admin/manageStakeholders/manageStakeholders.module.ts +++ b/monitor-admin/manageStakeholders/manageStakeholders.module.ts @@ -1,7 +1,6 @@ import {NgModule} from "@angular/core"; import {ManageStakeholdersComponent} from "./manageStakeholders.component"; import {ManageStakeholdersRoutingModule} from "./manageStakeholders-routing.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {CommonModule} from "@angular/common"; import {RouterModule} from "@angular/router"; import {InputModule} from "../../sharedComponents/input/input.module"; @@ -40,9 +39,7 @@ import {PagingModule} from "../../utils/paging.module"; SliderTabsModule, PagingModule ], - providers: [ - PreviousRouteRecorder, - ], + providers: [], exports: [ManageStakeholdersComponent] }) export class ManageStakeholdersModule { diff --git a/monitor-admin/topic/topic.module.ts b/monitor-admin/topic/topic.module.ts index 748b6572..71e9b9d9 100644 --- a/monitor-admin/topic/topic.module.ts +++ b/monitor-admin/topic/topic.module.ts @@ -1,9 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; - -import {PiwikService} from '../../utils/piwik/piwik.service'; import {TopicComponent} from "./topic.component"; import {TopicRoutingModule} from "./topic-routing.module"; import {RouterModule} from "@angular/router"; @@ -22,9 +19,7 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module"; import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module"; -import { - SidebarMobileToggleModule -} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module"; +import {SidebarMobileToggleModule} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module"; @NgModule({ imports: [ @@ -34,10 +29,7 @@ import { declarations: [ TopicComponent, IndicatorsComponent ], - providers: [ - PreviousRouteRecorder, - PiwikService - ], + providers: [], exports: [ TopicComponent ] diff --git a/orcid/my-orcid-links/myOrcidLinks.module.ts b/orcid/my-orcid-links/myOrcidLinks.module.ts index fad5db04..10cd7552 100644 --- a/orcid/my-orcid-links/myOrcidLinks.module.ts +++ b/orcid/my-orcid-links/myOrcidLinks.module.ts @@ -9,7 +9,6 @@ import {MyOrcidLinksComponent} from "./myOrcidLinks.component"; import {SearchResearchResultsServiceModule} from "../../services/searchResearchResultsService.module"; import {SearchMyOrcidResultsModule} from "./searchMyOrcidResults.module"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; -import {PiwikServiceModule} from "../../utils/piwik/piwikService.module"; import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module"; @NgModule({ @@ -18,7 +17,7 @@ import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module"; MyOrcidLinksRoutingModule, RouterModule, ErrorMessagesModule, ResultPreviewModule, SearchResearchResultsServiceModule, SearchMyOrcidResultsModule, - AlertModalModule, PiwikServiceModule + AlertModalModule ], declarations: [ MyOrcidLinksComponent diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index b323ea70..54bae78b 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -5,8 +5,6 @@ import {RouterModule} from '@angular/router'; import {OrcidComponent} from './orcid.component'; import {OrcidService} from './orcid.service'; -import {FreeGuard} from '../login/freeGuard.guard'; -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {OrcidWorkComponent} from './orcid-work.component'; import {AlertModalModule} from '../utils/modal/alertModal.module'; import {ResultLandingService} from '../landingPages/result/resultLanding.service'; @@ -29,7 +27,6 @@ import {OrcidRoutingModule} from "./orcid-routing.module"; OrcidWorkComponent ], providers:[ - FreeGuard, PreviousRouteRecorder, OrcidService, ResultLandingService ], exports: [ diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts index 82172b21..b4eaa38a 100644 --- a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module.ts @@ -8,7 +8,6 @@ import {SearchRecommendedResultsForOrcidComponent} from './searchRecommendedResu import {SearchResultsModule } from '../../searchPages/searchUtils/searchResults.module'; import {SearchFormModule} from '../../searchPages/searchUtils/searchForm.module'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; import {SearchResearchResultsModule} from "../../searchPages/searchResearchResults.module"; import {OrcidService} from "../orcid.service"; import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommendedResultsForOrcid-routing.module"; @@ -25,7 +24,7 @@ import {SearchRecommendedResultsForOrcidRoutingModule} from "./searchRecommended declarations: [ SearchRecommendedResultsForOrcidComponent ], - providers:[ IsRouteEnabled, OrcidService], + providers:[OrcidService], exports: [ SearchRecommendedResultsForOrcidComponent ] diff --git a/reload/reload.module.ts b/reload/reload.module.ts index 788e3b5e..7574440d 100644 --- a/reload/reload.module.ts +++ b/reload/reload.module.ts @@ -6,8 +6,6 @@ import { RouterModule } from '@angular/router'; import{ReloadRoutingModule } from './reload-routing.module'; import{ReloadComponent} from './reload.component'; - -import {PreviousRouteRecorder} from '../utils/piwik/previousRouteRecorder.guard'; import {LoadingModule} from "../utils/loading/loading.module"; @NgModule({ @@ -19,9 +17,7 @@ import {LoadingModule} from "../utils/loading/loading.module"; declarations: [ ReloadComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ ReloadComponent ] diff --git a/sdg/sdg.module.ts b/sdg/sdg.module.ts index 258d0e01..1888b381 100644 --- a/sdg/sdg.module.ts +++ b/sdg/sdg.module.ts @@ -2,14 +2,11 @@ import {CommonModule} from "@angular/common"; import {NgModule} from "@angular/core"; import {FormsModule} from "@angular/forms"; import {RouterModule} from "@angular/router"; -import {PreviousRouteRecorder} from "../utils/piwik/previousRouteRecorder.guard"; import {BreadcrumbsModule} from "../utils/breadcrumbs/breadcrumbs.module"; import {RefineFieldResultsServiceModule} from "../services/refineFieldResultsService.module"; import {LoadingModule} from "../utils/loading/loading.module"; import {Schema2jsonldModule} from "../sharedComponents/schema2jsonld/schema2jsonld.module"; import {SEOServiceModule} from "../sharedComponents/SEO/SEOService.module"; -import {PiwikService} from "../utils/piwik/piwik.service"; - import {SdgRoutingModule} from './sdg-routing.module'; import {SdgComponent} from './sdg.component'; @@ -22,9 +19,7 @@ import {SdgComponent} from './sdg.component'; declarations: [ SdgComponent ], - providers: [ - PreviousRouteRecorder, PiwikService - ], + providers: [], exports: [ SdgComponent ] diff --git a/searchPages/find/searchAll.module.ts b/searchPages/find/searchAll.module.ts index e35f830f..ffa0832f 100644 --- a/searchPages/find/searchAll.module.ts +++ b/searchPages/find/searchAll.module.ts @@ -12,7 +12,6 @@ import {SearchResearchResultsServiceModule} from '../../services/searchResearchR import {OrganizationsServiceModule} from '../../services/organizationsService.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module'; import {SearchAllComponent} from "./searchAll.component"; import {AdvancedSearchFormModule} from "../searchUtils/advancedSearchForm.module"; @@ -20,7 +19,6 @@ import {SearchResearchResultsModule} from "../searchResearchResults.module"; import {SearchProjectsModule} from "../searchProjects.module"; import {SearchOrganizationsModule} from "../searchOrganizations.module"; import {SearchDataProvidersModule} from "../searchDataProviders.module"; -import {PreviousRouteRecorder} from "../../utils/piwik/previousRouteRecorder.guard"; import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module"; import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module"; import {NumberRoundModule} from "../../utils/pipes/number-round.module"; @@ -31,15 +29,13 @@ import {GroupedRequestsServiceModule} from "../../services/groupedRequestsServic CommonModule, FormsModule, RouterModule, DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule, OrganizationsServiceModule, - SearchResultsModule, PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule, + SearchResultsModule, Schema2jsonldModule, SEOServiceModule, AdvancedSearchFormModule, SearchResearchResultsModule, SearchProjectsModule, SearchOrganizationsModule, SearchDataProvidersModule, BreadcrumbsModule, SliderTabsModule, NumberRoundModule, GroupedRequestsServiceModule ], declarations: [ SearchAllComponent ], - providers:[ - PreviousRouteRecorder - ], + providers:[], exports: [ SearchAllComponent ] diff --git a/searchPages/searchOrganizations.module.ts b/searchPages/searchOrganizations.module.ts index 664c3ab7..2e6b0056 100644 --- a/searchPages/searchOrganizations.module.ts +++ b/searchPages/searchOrganizations.module.ts @@ -1,7 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; -import {IsRouteEnabled} from '../error/isRouteEnabled.guard'; import {NewSearchPageModule} from "./searchUtils/newSearchPage.module"; import {OrganizationsServiceModule} from "../services/organizationsService.module"; import {SearchOrganizationsComponent} from "./searchOrganizations.component"; diff --git a/searchPages/searchUtils/newSearchPage.module.ts b/searchPages/searchUtils/newSearchPage.module.ts index 9be5ebd5..2ec3c8b5 100644 --- a/searchPages/searchUtils/newSearchPage.module.ts +++ b/searchPages/searchUtils/newSearchPage.module.ts @@ -13,8 +13,6 @@ import {SearchPagingModule} from './searchPaging.module'; import {SearchSortingModule} from './searchSorting.module'; import {SearchDownloadModule} from './searchDownload.module'; import {ModalModule} from '../../utils/modal/modal.module'; -import {PiwikServiceModule} from '../../utils/piwik/piwikService.module'; -import {PreviousRouteRecorder} from '../../utils/piwik/previousRouteRecorder.guard'; import {HelperModule} from '../../utils/helper/helper.module'; import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module'; import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module'; @@ -39,7 +37,7 @@ import {graph} from "../../utils/icons/icons"; LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchFilterModule, RangeFilterModule, - PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, + HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule, SearchResultsInDepositModule, SearchResultsForOrcidModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule, AlertModalModule, ClickModule, IconsModule, LoadingModule, InputModule @@ -47,9 +45,7 @@ import {graph} from "../../utils/icons/icons"; declarations: [ NewSearchPageComponent ], - providers: [ - PreviousRouteRecorder - ], + providers: [], exports: [ NewSearchPageComponent ] diff --git a/utils/piwik/previousRouteRecorder.guard.ts b/utils/piwik/previousRouteRecorder.guard.ts index 4d050618..31959034 100644 --- a/utils/piwik/previousRouteRecorder.guard.ts +++ b/utils/piwik/previousRouteRecorder.guard.ts @@ -6,7 +6,7 @@ import {properties} from "../../../../environments/environment"; @Injectable({ providedIn: 'root' -}) // do not forget to register this class as a provider +}) export class PreviousRouteRecorder { constructor(private router: Router) { } -- 2.17.1 From edf49c40190a9740a1d0e822009b56ba0cad02e6 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 28 Feb 2024 17:42:58 +0200 Subject: [PATCH 30/93] [develop | DONE | CHANGED]: sdg-fos-suggest.component.ts: Added field "isOpen: boolean = false;" and check if isOpen to show modal content | resultLanding.component: Removed old unused code and old comments, updated and added more checks e.g. not load content of modals if they are not open. --- .../sdg-fos-suggest.component.ts | 53 ++--- .../result/resultLanding.component.html | 193 ++---------------- .../result/resultLanding.component.ts | 5 + 3 files changed, 48 insertions(+), 203 deletions(-) diff --git a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts index 6c0d059a..3a547a27 100644 --- a/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts +++ b/landingPages/landing-utils/sdg-fos-suggest/sdg-fos-suggest.component.ts @@ -15,34 +15,36 @@ import {StringUtils} from "../../../utils/string-utils.class"; template: ` - - -
-
- -
Thank you for your feedback.
-
Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
-
- (Optional) + + + +
+
+ +
Thank you for your feedback.
+
Before sending us your options, would you like to leave us your e-mail to notify you about the reporting status?
+
+ (Optional) +
+
+ + +
+
+ +

Your feedback is successfully received and it will soon be reviewed by our graph experts!

+ +
+ -
- - -
- - -

Your feedback is successfully received and it will soon be reviewed by our graph experts!

- -
-
-
+
` }) @@ -62,6 +64,7 @@ export class SdgFosSuggestComponent { public sent: boolean = false; public error: boolean = false; subscriptions: Subscription[] = []; + isOpen: boolean = false; constructor(private emailService: EmailService, private fb: FormBuilder, private cdr: ChangeDetectorRef) {} diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 1d64f1f3..3a2de7e2 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -4,8 +4,8 @@ [searchActionRoute]="properties.searchLinkToResults"> -
-
+
+
- - - -
@@ -166,54 +102,6 @@
- - -
- - - - - - - -
- - -
-
- -
-
@@ -232,48 +120,15 @@ [publiclyFunded]="resultLandingInfo.publiclyFunded" [projects]="resultLandingInfo.fundedByProjects"> - - -
- - -
- -
+ +
-
- - - - - -
-
- -
- -
-
-
-
-
+
- -
@@ -886,16 +719,18 @@ - + - + + + -
+
@@ -1327,6 +1162,7 @@
+ - + + \ No newline at end of file diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index f51645f3..d1eb7126 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -74,6 +74,8 @@ export class ResultLandingComponent { public linkToSearchPage: string = null; public citeThisClicked: boolean; + public addThisClicked: boolean; + public descriptionClicked: boolean; // Metrics tab variables public metricsClicked: boolean; @@ -864,6 +866,7 @@ export class ResultLandingComponent { } public openAddThisModal() { + this.addThisClicked = true; this.addThisModal.cancelButton = false; this.addThisModal.okButton = false; this.addThisModal.alertTitle = "Share this " + this.getTypeName() + " in your social networks"; @@ -1076,6 +1079,7 @@ export class ResultLandingComponent { this.sdgFosSuggest.subjectType="fos"; } this.cdr.detectChanges(); + this.sdgFosSuggest.isOpen = true; this.sdgFosSuggest.openSelectionModal(); } @@ -1090,6 +1094,7 @@ export class ResultLandingComponent { } public openDescriptionModal() { + this.descriptionClicked = true; this.descriptionModal.alertFooter = false; this.descriptionModal.alertTitle = "Abstract"; this.descriptionModal.open(); -- 2.17.1 From 69d6feb6651398c743fb651363a628cd04c72f82 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 29 Feb 2024 09:25:26 +0200 Subject: [PATCH 31/93] [develop | DONE | CHANGED] search page: remove top paging, remove results per page, remove total number of results, put selected filter, sorting and download on the same row, change to smaller labels for selected filters --- .../searchUtils/newSearchPage.component.html | 279 ++++++++---------- .../searchUtils/searchDownload.component.ts | 11 +- .../searchUtils/searchSorting.component.ts | 2 +- 3 files changed, 130 insertions(+), 162 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 51dc82fa..17c81793 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -1,101 +1,93 @@ -

-
-
-
-
    - - -
  • - - {{customFilter.valueName}} - -
  • +

    +
    +
      + + +
    • + + {{customFilter.valueName}} + +
    • +
      +
      + + + +
    • + + {{type.name}} + + +
    • +
      +
      + + + +
    • + + {{filter.selectedFromAndToValues}} + + +
    • - - - -
    • - - {{type.name}} - - -
    • -
      -
      +
      +
      + + + +
    • + + + + {{filter.title}}: + {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} + + + + {{value.name}} + + + +
    • - - - -
    • - - {{filter.selectedFromAndToValues}} - - -
    • -
      -
      +
      +
      + + + +
    • + + + + {{filter.title}}: + {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} + + + + {{value.name}} + + + +
    • - - - -
    • - - - - - {{filter.title}}: - {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} - - - - - {{value.name}} - - - -
    • -
      -
      -
      - - - -
    • - - - - {{filter.title}}: - {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} - - - - {{value.name}} - - - -
    • -
      -
      -
      -
    -
    - - -

+ + +

@@ -170,10 +162,6 @@
  • - - - -
  • @@ -190,31 +178,7 @@
    - -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    -
    +
    @@ -294,9 +258,6 @@
    -
    - -
    @@ -315,7 +276,7 @@
    -
    +
    OpenAIRE - Explore.
    -
    - -
    - - {{searchUtils.totalResults|number}} - {{type}} - - for - {{searchTerm}} - - - ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied) - - - - {{oldTotalResults|number}} - {{type}}, page - {{searchUtils.page | number}} - of {{(totalPages(oldTotalResults)|number)}} - -
    +
    + class="uk-margin-small-bottom uk-flex uk-flex-center">
    -
    -
    - -
    -
    - + +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + + + + + Data dump + + +
    +
    diff --git a/searchPages/searchUtils/searchDownload.component.ts b/searchPages/searchUtils/searchDownload.component.ts index 39448aec..2a506fb1 100644 --- a/searchPages/searchUtils/searchDownload.component.ts +++ b/searchPages/searchUtils/searchDownload.component.ts @@ -15,12 +15,11 @@ import {properties} from "../../../../environments/environment"; selector: 'search-download', template: ` diff --git a/searchPages/searchUtils/searchSorting.component.ts b/searchPages/searchUtils/searchSorting.component.ts index 88afac19..92a50b1d 100644 --- a/searchPages/searchUtils/searchSorting.component.ts +++ b/searchPages/searchUtils/searchSorting.component.ts @@ -7,7 +7,7 @@ import {properties} from "../../../../environments/environment"; template: `
    -- 2.17.1 From 3e8ed4f50429dad8a3426512709ae5b586b7ef02 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 29 Feb 2024 11:33:17 +0200 Subject: [PATCH 32/93] [develop | DONE | CHANGED] remove tooltips from search page, add labels for entity metadata --- .../landing-utils/availableOn.component.ts | 2 +- .../entity-metadata.component.ts | 29 ++++++++++--------- .../landing-utils/showPublisher.component.ts | 6 ++-- .../entity-actions.component.ts | 13 ++++----- .../result-preview.component.html | 6 ++-- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 1ea5740d..85fef1ea 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -40,7 +40,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - {{sliceString(availableOn[0].downloadNames.join("; "), 20)}} diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index d9e0cf98..0378f127 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -118,8 +118,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - - + + Compatibility: + @@ -137,10 +138,11 @@ import {RouterHelper} from "../../utils/routerHelper.class"; {{compatibility.name}} - - - {{compatibilityString}} - + + + Compatibility: + {{compatibilityString}} + OpenAIRE Text Mining @@ -152,9 +154,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; Publicly funded - - {{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} + + Funded by: + {{showInline ? projectNames.join(', ') : projectNames.slice(0, projectsLimit).join(', ')}} +{{projects.length - projectsLimit | number}} projects @@ -166,9 +168,9 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - - {{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} + + Partners: + {{showInline ? organizationNames.join(', ') : organizationNames.slice(0, organizationsLimit).join(', ')}} +{{organizations.length - organizationsLimit | number}} partners @@ -180,9 +182,10 @@ import {RouterHelper} from "../../utils/routerHelper.class"; - + {{subjects.slice(0, 3).join(', ')}} + {{provenanceAction}} diff --git a/landingPages/landing-utils/showPublisher.component.ts b/landingPages/landing-utils/showPublisher.component.ts index 37c0838b..bbb8c177 100644 --- a/landingPages/landing-utils/showPublisher.component.ts +++ b/landingPages/landing-utils/showPublisher.component.ts @@ -5,7 +5,8 @@ import {EnvProperties} from "../../utils/properties/env-properties"; selector: 'showPublisher, [showPublisher]', template: ` - {{publisher}} + Publisher: + {{publisher}} @@ -14,7 +15,8 @@ import {EnvProperties} from "../../utils/properties/env-properties"; || journal['volume'] || journal['eissn'] || journal['issue'])"> - + + Journal: {{journal['journal']}} , diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index f2e07c77..bf2c628a 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -14,8 +14,7 @@ import {EnvProperties} from "../properties/env-properties";
    Embed @@ -99,6 +95,7 @@ export class EntityActionsComponent implements OnInit { @Input() embed: boolean = false; @Input() url: string; @Input() isMobile: boolean = false; + @Input() showTooltip: boolean = true; public citeThisClicked: boolean; public routerHelper: RouterHelper = new RouterHelper(); @ViewChild('citeModal') citeModal; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index b920a1ea..7e1c1d56 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -187,7 +187,8 @@ [deposit]="deposit" [embed]="embed" [type]="result.resultType" [result]="result" [id]="result.objId?result.objId:result.id" - [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"> + [url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id" + [showTooltip]="false"> + [isMobile]="isMobile" + [showTooltip]="false"> Date: Mon, 4 Mar 2024 10:39:01 +0200 Subject: [PATCH 33/93] [develop | DONE | FIXED] search page: add a limit of 35 characters and atooltip for displayed selected filters --- .../searchUtils/newSearchPage.component.html | 40 ++++++++++++------- .../searchUtils/newSearchPage.component.ts | 1 + 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 17c81793..f9143437 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -5,7 +5,7 @@
  • - + {{customFilter.valueName}}
  • @@ -15,7 +15,7 @@
  • - + {{type.name}} @@ -66,19 +72,23 @@ -
  • - - +
  • + + {{filter.title}}: {{(value.name=='true'||value.name=='Yes')?'Yes':'No'}} - - {{value.name}} - + + + {{value.name | slice:0:filterPillCharactersLimit}}... + + + {{value.name}} + + + diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index 5f62d7d6..cf9f105a 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -131,6 +131,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { public parameterNames: string[] = []; public parameterValues: string[] = []; + filterPillCharactersLimit: number = 35; public csvLimit: number = 0; public pagingLimit: number = 0; public resultsPerPage: number = 0; -- 2.17.1 From da4a5f3321e78bf98df286855d82522a4b9fe42a Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 4 Mar 2024 11:15:40 +0200 Subject: [PATCH 34/93] [develop | DONE | FIXED]: [BUG FIX] fundedBy.component.ts: Provenance should always get the label from the respective vocabulary - calculate everything in ngOnInit. --- .../landing-utils/fundedBy.component.ts | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index c03a5ea1..b7852a4a 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -20,14 +20,16 @@ import {RouterHelper} from "../../utils/routerHelper.class";
  • - +
    - + + +
    , @@ -35,13 +37,13 @@ import {RouterHelper} from "../../utils/routerHelper.class";
    - + -
    - +
    +
    @@ -54,7 +56,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; | {{ item['acronym'] ? item['acronym'] : item['title']}} - +
    Project
    @@ -84,7 +86,7 @@ import {RouterHelper} from "../../utils/routerHelper.class"; Funding stream: {{item.funding}} -
    +
    Validated by funder | {{item.provenanceAction}} @@ -105,8 +107,15 @@ export class FundedByComponent { public url = properties.searchLinkToProject.split('?')[0]; public title: string = "Funded by"; @Input() provenanceActionVocabulary = null; - public provenancesCalculated: boolean[] = []; + // public provenancesCalculated: boolean[] = []; public routerHelper:RouterHelper = new RouterHelper(); + public dropClicked: boolean = false; + + public ngOnInit() { + this.fundedByProjects.forEach((project, index) => { + this.getVocabularyLabel(project, this.provenanceActionVocabulary, index); + }) + } public viewAllClick() { if(this.fundedByProjects.length <= this.threshold*2) { @@ -124,11 +133,11 @@ export class FundedByComponent { } public getVocabularyLabel(item: any, vocabulary: any, index: number) { - if(!this.provenancesCalculated[index]) { - this.provenancesCalculated[index] = true; + // if(!this.provenancesCalculated[index]) { + // this.provenancesCalculated[index] = true; item.provenanceAction = HelperFunctions.getVocabularyLabel(item.provenanceAction, vocabulary, false); - } - return item.provenanceAction; + // } + // return item.provenanceAction; } public addEoscPrevInParams(obj) { -- 2.17.1 From 00a5150042526cfda77f6aeff62814bcff5219e4 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 4 Mar 2024 11:17:50 +0200 Subject: [PATCH 35/93] [develop | DONE | FIXED]: [BUG FIX] resultLanding.component.ts: Get type of entity from route.snapshot.data.type. --- landingPages/result/resultLanding.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index d1eb7126..769f1975 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -199,6 +199,9 @@ export class ResultLandingComponent { private userManagementService: UserManagementService, private layoutService: LayoutService, private _contextService: ContextsService) { + if(route.snapshot.data && route.snapshot.data['type']) { + this.type = route.snapshot.data['type']; + } } ngOnInit() { -- 2.17.1 From 6a41954109ef54f3ded00fcf3468a1d0f271a2a0 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 4 Mar 2024 13:14:09 +0200 Subject: [PATCH 36/93] [develop | DONE | CHANGED & ADDED]: env-properties.ts & environment.ts: Added properties "rorURL", "isniURL", "wikiDataURL", "fundRefURL" | organizationInfo.ts: Added identifiers | searchOrganizations.service.ts & organization.service.ts: Parse identifiers (pid) [BETA ONLY] | organization.module.ts: Import ResultLandingUtilsModule (to call | organization.component: Removed old unused code & Added & In mobile added country and website url | parsingFunctions.class.ts: Added parsing for organization pids | showIdentifiers.component.ts: Added cases for organization pids & check if pid value is a url, do not add prefix. --- .../landing-utils/parsingFunctions.class.ts | 8 +- .../showIdentifiers.component.ts | 18 ++- .../organization/organization.component.html | 128 ++++++------------ .../organization/organization.component.ts | 8 -- .../organization/organization.module.ts | 3 +- services/organization.service.ts | 6 + services/searchOrganizations.service.ts | 8 +- utils/entities/organizationInfo.ts | 1 + utils/properties/env-properties.ts | 4 + utils/properties/environments/environment.ts | 4 + 10 files changed, 89 insertions(+), 99 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 105c54cf..d5d614a3 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -42,7 +42,7 @@ export class ParsingFunctions { "funderShortname": "", "funderName": "", "funding": "", "code": "", "provenanceAction": "", "validated": false }; - + if (relation.title != 'unidentified') { fundedByProject['id'] = relation['to'].content; fundedByProject['acronym'] = relation.acronym; @@ -538,7 +538,8 @@ export class ParsingFunctions { if (pid.hasOwnProperty("classid") && pid['classid'] != "") { if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data" - || pid.classid == "swhid") { + || pid.classid == "swhid" + || pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef") { if (!identifiers.has(pid.classid)) { identifiers.set(pid.classid, new Array()); } @@ -547,7 +548,8 @@ export class ParsingFunctions { } else { for (let i = 0; i < pid.length; i++) { if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data" - || pid[i].classid == "swhid") { + || pid[i].classid == "swhid" + || pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef") { if (!identifiers.has(pid[i].classid)) { identifiers.set(pid[i].classid, new Array()); } diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 8a0b4680..11a15f14 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -26,8 +26,9 @@ import {properties} from "../../../../environments/environment"; {{key}}: - + {{item}} , @@ -113,7 +114,10 @@ export class ShowIdentifiersComponent implements AfterViewInit { }); } - public getUrl(key: string): string { + public getUrl(key: string, value: string): string { + if(value.includes("http://") || value.includes("https://")) { + return ""; + } if(key == "doi") { return properties.doiURL; } else if(key == "pmc") { @@ -126,6 +130,14 @@ export class ShowIdentifiersComponent implements AfterViewInit { return properties.r3DataURL; } else if(key == "swhid") { return properties.swhURL; + } else if(key == "ROR") { + return properties.rorURL; + } else if(key == "ISNI") { + return properties.isniURL; + } else if(key == "Wikidata") { + return properties.wikiDataURL; + } else if(key == "FundRef") { + return properties.fundRefURL; } } diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index 04f4235a..09f004f2 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -19,57 +19,28 @@
    - - -
    -
    -
    - - - Powered by OpenAIRE graph - - - Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} - +
    +
    + + + Powered by OpenAIRE graph + + + Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}} + - -
    - Found an issue? - Give us feedback -
    -
    -
    + +
    + Found an issue? + Give us feedback +
    +
    +
    - -
    - - -
    - - + Country: {{organizationInfo.country}}
    + +
    + +
    @@ -257,9 +207,7 @@
    -
    - -
    + @@ -270,12 +218,12 @@
    + + +
    - - -
    @@ -287,6 +235,23 @@ && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null" [entityType]="'organization'" [prevPath]="prevPath"> +
    + + + +
    + Country: {{organizationInfo.country}} +
    + +
    + +
    +

    @@ -406,10 +371,7 @@ [type]="'organizations'" [prevPath]="prevPath"> - - - - +
    diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 814d7bb9..f313a196 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -77,7 +77,6 @@ export class OrganizationComponent { @ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent; // @ViewChild('downloadReportModal') downloadReportModal; // @ViewChild('downloadFunderReportModal') downloadFunderReportModal; - @ViewChild('addThisModal') addThisModal; @ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent; @ViewChild(ModalLoading) loading: ModalLoading; @@ -717,13 +716,6 @@ export class OrganizationComponent { this.downloadReportsModal.cancel(); } - public openAddThisModal() { - this.addThisModal.cancelButton = false; - this.addThisModal.okButton = false; - this.addThisModal.alertTitle = "Share this "+OpenaireEntities.ORGANIZATION+" in your social networks"; - this.addThisModal.open(); - } - public getParamsForSearchLink(type: string = "") { if(type) { return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']); diff --git a/landingPages/organization/organization.module.ts b/landingPages/organization/organization.module.ts index 0c29500c..c7b2d24c 100644 --- a/landingPages/organization/organization.module.ts +++ b/landingPages/organization/organization.module.ts @@ -34,6 +34,7 @@ import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-sc import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module"; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {OrganizationRoutingModule} from "./organization-routing.module"; +import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module"; @NgModule({ @@ -51,7 +52,7 @@ import {OrganizationRoutingModule} from "./organization-routing.module"; ProjectsServiceModule, Schema2jsonldModule, SEOServiceModule, HelperModule, OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, - TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EntityActionsModule, ResultLandingUtilsModule ], declarations: [ OrganizationComponent, diff --git a/services/organization.service.ts b/services/organization.service.ts index 722d1338..b74bd92f 100644 --- a/services/organization.service.ts +++ b/services/organization.service.ts @@ -8,9 +8,11 @@ import {OrganizationInfo} from '../utils/entities/organizationInfo'; import{EnvProperties} from '../utils/properties/env-properties'; import {map} from "rxjs/operators"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; +import {properties} from "../../../environments/environment"; @Injectable() export class OrganizationService { + public parsingFunctions: ParsingFunctions = new ParsingFunctions(); constructor(private http: HttpClient ) {} @@ -92,6 +94,10 @@ export class OrganizationService { } } } + + if(organization['pid'] && properties.environment != "production") { + this.organizationInfo.identifiers = this.parsingFunctions.parseIdentifiers(organization['pid']); + } } //Comment Parsing Projects info diff --git a/services/searchOrganizations.service.ts b/services/searchOrganizations.service.ts index 488b0e87..019b8146 100644 --- a/services/searchOrganizations.service.ts +++ b/services/searchOrganizations.service.ts @@ -9,9 +9,11 @@ import{EnvProperties} from '../utils/properties/env-properties'; import {StringUtils} from '../utils/string-utils.class'; import {map} from "rxjs/operators"; import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class"; +import {properties} from "../../../environments/environment"; @Injectable() export class SearchOrganizationsService { + public parsingFunctions: ParsingFunctions = new ParsingFunctions(); constructor(private http: HttpClient ) {} @@ -173,7 +175,11 @@ export class SearchOrganizationsService { result.country = resData.country.classname; } - results.push(result); + if(resData['pid'] && properties.environment != "production") { + result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']); + } + + results.push(result); } return results; diff --git a/utils/entities/organizationInfo.ts b/utils/entities/organizationInfo.ts index 6bd9b68f..5194f076 100644 --- a/utils/entities/organizationInfo.ts +++ b/utils/entities/organizationInfo.ts @@ -26,4 +26,5 @@ export class OrganizationInfo { // organizations: {name: string; url: string}[]}[]; deletedByInferenceIds: string[]; + identifiers: Map; //key is the classname } diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index b6e3b370..f740381d 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -45,6 +45,10 @@ export interface EnvProperties { openDoarURL?: string; r3DataURL?: string; swhURL?: string; + rorURL?: string; + isniURL?: string; + wikiDataURL?: string; + fundRefURL?: string; fairSharingURL?: string, eoscMarketplaceURL?: string, sherpaURL?: string; diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index b48fe5c4..fb86e5d4 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -20,6 +20,10 @@ export let common: EnvProperties = { openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", r3DataURL: "http://service.re3data.org/repository/", swhURL: "https://archive.softwareheritage.org/", + rorURL: "https://ror.org/", + isniURL: "https://isni.org/isni/", + wikiDataURL: "https://www.wikidata.org/wiki/", + fundRefURL: "https://api.crossref.org/funders/", fairSharingURL: "https://fairsharing.org/", eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/", -- 2.17.1 From c630b29247700c52e3209766769707d8de79f316 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 4 Mar 2024 15:47:57 +0200 Subject: [PATCH 37/93] [develop]: Remove index variables from parameters of indicator path. --- monitor-admin/utils/indicator-utils.ts | 43 +++++++------------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 161b2309..9360c228 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -322,6 +322,9 @@ export class IndicatorUtils { } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name); if (indicatorPath.parameters) { Object.keys(indicatorPath.parameters).forEach(key => { let replacedValue = indicatorPath.parameters[key]; @@ -331,16 +334,6 @@ export class IndicatorUtils { if (endYear && key == "end_year" && indicatorPath.filters["end_year"]) { replacedValue = (replacedValue > endYear) ? endYear : replacedValue; } - if (key == "index_id") { - replacedValue = stakeholder.index_id; - } - if (key == "index_name") { - replacedValue = stakeholder.index_name; - } - if (key == "index_shortName") { - replacedValue = stakeholder.index_shortName.toLowerCase(); - } - replacedUrl = replacedUrl.split(ChartHelper.prefix + key + ChartHelper.suffix).join(replacedValue) }); } @@ -403,6 +396,9 @@ export class IndicatorUtils { } else if (stakeholder.statsProfile) { replacedUrl = replacedUrl.split(ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix).join(stakeholder.statsProfile) } + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_id' + ChartHelper.suffix).join(stakeholder.index_id); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_shortName' + ChartHelper.suffix).join(stakeholder.index_shortName); + replacedUrl = replacedUrl.split(ChartHelper.prefix + 'index_name' + ChartHelper.suffix).join(stakeholder.index_name); if (fundingL0) { if (indicatorPath.source == "stats-tool" && indicatorPath.chartObject) { let filterResults = this.addFilter(replacedUrl, 'fundingL0', fundingL0); @@ -474,15 +470,6 @@ export class IndicatorUtils { //if there is a parameter that is filtered and the value of the parameter changes, count the filter as applied indicatorPath.filtersApplied++; } - if (key == "index_id") { - replacedValue = stakeholder.index_id; - } - if (key == "index_name") { - replacedValue = stakeholder.index_name; - } - if (key == "index_shortName") { - replacedValue = stakeholder.index_shortName.toLowerCase(); - } if (key == "subtitle" && filterSubtitleText.length > 0) { replacedValue = replacedValue + (replacedValue.length > 0 ? ' - ' : '') + ' Active filters: (' + filterSubtitleText.join(", ") + ')'; } @@ -805,7 +792,7 @@ export class IndicatorUtils { for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { //ignore field No Of Funders - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) || (gfilter["field"].indexOf(".funder") != -1) || @@ -831,7 +818,7 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".context.name") != -1) || (gfilter["field"].indexOf(".context.id") != -1)) { @@ -858,7 +845,7 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".organization.name") != -1) || (gfilter["field"].indexOf(".organization.id") != -1)) { @@ -885,7 +872,7 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) || (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { @@ -911,7 +898,7 @@ export class IndicatorUtils { } for (let filter of query["query"]["filters"]) { for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder, indicatorPath.parameters); + let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches if ((gfilter["field"].indexOf(".orcid") != -1)) { gfilter["values"][0] = replacedValue; @@ -922,15 +909,12 @@ export class IndicatorUtils { } } - private replaceIndexValues(currentValue, stakeholder, parameters) { + private replaceIndexValues(currentValue, stakeholder) { if (currentValue == stakeholder.index_name) { - parameters["index_name"] = stakeholder.index_name; return ChartHelper.prefix + "index_name" + ChartHelper.suffix; } else if (currentValue == stakeholder.index_id) { - parameters["index_id"] = stakeholder.index_id; return ChartHelper.prefix + "index_id" + ChartHelper.suffix; } else if (currentValue == stakeholder.index_shortName) { - parameters["index_shortName"] = stakeholder.index_shortName; return ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; } @@ -1002,13 +986,10 @@ export class IndicatorUtils { for (let i of index) { if (name.split('.').length > 3 && name.split('.')[3] == "id") { parameters[i] = ChartHelper.prefix + "index_id" + ChartHelper.suffix; - indicatorPath.parameters["index_id"] = stakeholder.index_id; } else if (name.split('.').length > 3 && name.split('.')[3] == "shortname") { parameters[i] = ChartHelper.prefix + "index_shortName" + ChartHelper.suffix; - indicatorPath.parameters["index_shortName"] = stakeholder.index_shortName.toLowerCase(); } else if (name.split('.').length > 3 && name.split('.')[3] == "name") { parameters[i] = ChartHelper.prefix + "index_name" + ChartHelper.suffix; - indicatorPath.parameters["index_name"] = stakeholder.index_name; } } } -- 2.17.1 From da3c2fccf29dbdaf1b37fa06bd543e7ffa721690 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 4 Mar 2024 17:02:33 +0200 Subject: [PATCH 38/93] [develop | DONE | FIXED]: Moved RoutingModule as first imported module with possible routing (advanced search projects & organizations were loading orcid routing instead of their own). --- dashboard/divId/divIds.module.ts | 3 ++- dashboard/divhelpcontent/class-help-content-form.module.ts | 3 ++- dashboard/divhelpcontent/class-help-contents.module.ts | 3 ++- dashboard/entity/entities.module.ts | 3 ++- dashboard/helpTexts/page-help-content-form.module.ts | 3 ++- dashboard/helpTexts/page-help-contents.module.ts | 3 ++- dashboard/menu/menu.module.ts | 3 ++- dashboard/page/pages.module.ts | 3 ++- dashboard/portal/portals.module.ts | 3 ++- landingPages/project/project.module.ts | 2 +- 10 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dashboard/divId/divIds.module.ts b/dashboard/divId/divIds.module.ts index eca996e6..dbdcb477 100644 --- a/dashboard/divId/divIds.module.ts +++ b/dashboard/divId/divIds.module.ts @@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module"; @NgModule({ imports: [ + ClassesRoutingModule, CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, - AdminTabsModule, PageContentModule, ClassesRoutingModule, SearchInputModule, IconsModule, LoadingModule + AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule ], declarations: [DivIdsComponent], exports: [DivIdsComponent] diff --git a/dashboard/divhelpcontent/class-help-content-form.module.ts b/dashboard/divhelpcontent/class-help-content-form.module.ts index 5f0bec5c..9e0b061a 100644 --- a/dashboard/divhelpcontent/class-help-content-form.module.ts +++ b/dashboard/divhelpcontent/class-help-content-form.module.ts @@ -16,9 +16,10 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m @NgModule({ imports: [ + ClassHelpContentFormRoutingModule, CommonModule, FormsModule, RouterModule, SafeHtmlPipeModule, CKEditorModule, - AlertModalModule, ReactiveFormsModule, ClassHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule + AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatSlideToggleModule, IconsModule, LoadingModule, PageContentModule ], declarations: [ ClassContentFormComponent diff --git a/dashboard/divhelpcontent/class-help-contents.module.ts b/dashboard/divhelpcontent/class-help-contents.module.ts index 8e350d1d..ecd80574 100644 --- a/dashboard/divhelpcontent/class-help-contents.module.ts +++ b/dashboard/divhelpcontent/class-help-contents.module.ts @@ -19,8 +19,9 @@ import {PageContentModule} from '../sharedComponents/page-content/page-content.m @NgModule({ imports: [ + ClassHelpContentsRoutingModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, ClassHelpContentsRoutingModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule, PageContentModule ], declarations: [ diff --git a/dashboard/entity/entities.module.ts b/dashboard/entity/entities.module.ts index 52843fb9..a112018c 100644 --- a/dashboard/entity/entities.module.ts +++ b/dashboard/entity/entities.module.ts @@ -17,8 +17,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; @NgModule({ imports: [ + EntitiesRoutingModule, CommonModule, RouterModule, FormsModule, AdminToolServiceModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, EntitiesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule ], declarations: [EntitiesComponent], exports: [EntitiesComponent] diff --git a/dashboard/helpTexts/page-help-content-form.module.ts b/dashboard/helpTexts/page-help-content-form.module.ts index 27e34ae4..714ee256 100644 --- a/dashboard/helpTexts/page-help-content-form.module.ts +++ b/dashboard/helpTexts/page-help-content-form.module.ts @@ -16,9 +16,10 @@ import {MatSlideToggleModule} from "@angular/material/slide-toggle"; @NgModule({ imports: [ + PageHelpContentFormRoutingModule, CommonModule, FormsModule, RouterModule, SafeHtmlPipeModule, CKEditorModule, - AlertModalModule, ReactiveFormsModule, PageHelpContentFormRoutingModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule + AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, IconsModule, PageContentModule, LoadingModule, MatSlideToggleModule ], declarations: [PageContentFormComponent], exports: [PageContentFormComponent] diff --git a/dashboard/helpTexts/page-help-contents.module.ts b/dashboard/helpTexts/page-help-contents.module.ts index 10bc383f..8a2876df 100644 --- a/dashboard/helpTexts/page-help-contents.module.ts +++ b/dashboard/helpTexts/page-help-contents.module.ts @@ -17,8 +17,9 @@ import {HTMLToStringPipeModule} from '../../utils/pipes/HTMLToStringPipe.module' @NgModule({ imports: [ + PageHelpContentsRoutingModule, CommonModule, RouterModule, FormsModule, SafeHtmlPipeModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageHelpContentsRoutingModule, PageContentModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule, HTMLToStringPipeModule ], declarations: [ diff --git a/dashboard/menu/menu.module.ts b/dashboard/menu/menu.module.ts index db77cef3..53e90331 100644 --- a/dashboard/menu/menu.module.ts +++ b/dashboard/menu/menu.module.ts @@ -18,8 +18,9 @@ import {LogoUrlPipeModule} from '../../utils/pipes/logoUrlPipe.module'; @NgModule({ imports: [ + MenuRoutingModule, CommonModule, RouterModule, FormsModule, AdminToolServiceModule, - AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, MenuRoutingModule, SearchInputModule, IconsModule, LoadingModule, + AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, InputModule, PageContentModule, AdminTabsModule, SearchInputModule, IconsModule, LoadingModule, TransitionGroupModule, LogoUrlPipeModule ], declarations: [MenuComponent], diff --git a/dashboard/page/pages.module.ts b/dashboard/page/pages.module.ts index 111f1af4..369723fb 100644 --- a/dashboard/page/pages.module.ts +++ b/dashboard/page/pages.module.ts @@ -20,8 +20,9 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; @NgModule({ imports: [ + PagesRoutingModule, CommonModule, RouterModule, FormsModule, AlertModalModule, ReactiveFormsModule, MatSlideToggleModule, AdminToolServiceModule, InputModule, - MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, PagesRoutingModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule + MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AdminTabsModule, PageContentModule, SearchInputModule, IconsModule, LoadingModule, LogoUrlPipeModule ], declarations: [PagesComponent], exports: [PagesComponent] diff --git a/dashboard/portal/portals.module.ts b/dashboard/portal/portals.module.ts index 3c6ff447..50aaf92b 100644 --- a/dashboard/portal/portals.module.ts +++ b/dashboard/portal/portals.module.ts @@ -15,9 +15,10 @@ import {LoadingModule} from "../../utils/loading/loading.module"; @NgModule({ imports: [ + PortalsRoutingModule, CommonModule, FormsModule, AlertModalModule, ReactiveFormsModule, - RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, PortalsRoutingModule, IconsModule, SearchInputModule, LoadingModule + RouterModule, AdminToolServiceModule, InputModule, AdminTabsModule, PageContentModule, IconsModule, SearchInputModule, LoadingModule ], declarations: [PortalsComponent], exports: [PortalsComponent] diff --git a/landingPages/project/project.module.ts b/landingPages/project/project.module.ts index 30a3a8e9..b2d6d649 100644 --- a/landingPages/project/project.module.ts +++ b/landingPages/project/project.module.ts @@ -36,8 +36,8 @@ import {ProjectRoutingModule} from "./project-routing.module"; @NgModule({ imports: [ - CommonModule, FormsModule, RouterModule, LandingModule, ProjectRoutingModule, + CommonModule, FormsModule, RouterModule, LandingModule, LoadingModalModule, AlertModalModule, ErrorMessagesModule, IFrameModule, ReportsServiceModule, SearchResearchResultsServiceModule, ProjectServiceModule, -- 2.17.1 From c33af181bb46f6c054cc1e115f721cd204a619e1 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 7 Mar 2024 10:27:30 +0200 Subject: [PATCH 39/93] [develop]: Role-verification: Add relatve to route parameter. --- role-verification/role-verification.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 416c2624..1b54fe75 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -93,6 +93,8 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit, public userInfoLinkPrefix = ''; @Input() public userInfoLink = null; + @Input() + public relativeTo: ActivatedRoute = this._route; public user: User; public verification: any; public code: UntypedFormControl; @@ -150,7 +152,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit, 'errorCode': LoginErrorCodes.NOT_LOGIN, 'redirectUrl': this._router.url }, - relativeTo: this._route + relativeTo: this.relativeTo }); } } else if(this.isMember) { -- 2.17.1 From b0c69be6ef3e55089d7032f0d1457c874652974f Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Fri, 8 Mar 2024 12:50:55 +0200 Subject: [PATCH 40/93] [develop | DONE | ADDED] irish-monitor: add new BehaviorSubject for enabling/disabling help-pop-up component on admin and non-admin pages --- dashboard/sharedComponents/sidebar/layout.service.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dashboard/sharedComponents/sidebar/layout.service.ts b/dashboard/sharedComponents/sidebar/layout.service.ts index 17657431..dc515f81 100644 --- a/dashboard/sharedComponents/sidebar/layout.service.ts +++ b/dashboard/sharedComponents/sidebar/layout.service.ts @@ -88,6 +88,10 @@ export class LayoutService { * Handle it manually in the component, it doesn't use data * */ private rootClassSubject: BehaviorSubject = new BehaviorSubject(null); + /** + * Display help pop-up on non-admin pages. (default true for the rest of the pages) + * */ + private hasHelpPopUpSubject: BehaviorSubject = new BehaviorSubject(true); private subscriptions: any[] = []; ngOnDestroy() { @@ -343,4 +347,12 @@ export class LayoutService { this.rootClassSubject.next(value); } } + + get hasHelpPopUp(): Observable { + return this.hasHelpPopUpSubject.asObservable(); + } + + setHasHelpPopUp(value: boolean) { + this.hasHelpPopUpSubject.next(value); + } } -- 2.17.1 From 622459c26c5db0c832e9b159d0558b15b86800c8 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 12 Mar 2024 19:24:50 +0200 Subject: [PATCH 41/93] [develop]: Helper class: Remove group from mapType. --- login/utils/helper.class.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index 6f2a2951..152cda48 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -234,6 +234,7 @@ export class Role { } public static mapType(type: string, communityMap: boolean = true): string { + type = type.replace(this.GROUP, ''); if (type == "ri" && communityMap) { type = "community"; } else if (type == "organization") { -- 2.17.1 From 6b907fe97d765773e2865c748a6edf9fe4c2b866 Mon Sep 17 00:00:00 2001 From: argirok Date: Wed, 13 Mar 2024 12:04:23 +0200 Subject: [PATCH 42/93] [develop | DONE | ADDED] add method for grouped count queries that goes through the cache --- services/searchResearchResults.service.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 3e49a7cc..aadcd730 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -133,7 +133,14 @@ export class SearchResearchResultsService { return this.http.get((properties.useLongCache && size == 0 && !params && (!refineQuery || !refineQuery.includes("fq="))) ? (properties.cacheUrl + encodeURIComponent(url)) : url) .pipe(map(res => [res['meta'].total, this.parseResults(resultType, res['results'], properties), RefineResultsUtils.parse(res['refineResults'], refineFields, "publication")])); } + countResults(field:string,value:string): any { + let url = properties.utilsService + "/portals/countResults"; + if (field && value) { + url += "?field=" + encodeURIComponent(field) + "&value="+encodeURIComponent(value); + } + return this.http.get((properties.useLongCache ) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + } searchResultForEntity(resultType: string, params: string, page: number, size: number, properties: EnvProperties): any { let link = properties.searchAPIURLLAst; //let url = link+params+"/"+this.getEntityQueryName(resultType,true)+ "?format=json"; -- 2.17.1 From c64df204052a07c4e061d97492283b775dcc8bb3 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 14 Mar 2024 09:28:33 +0200 Subject: [PATCH 43/93] [develop | DONE | ADDED] add orcid-core module, without the routing - use it in other components instead of orcid module --- landingPages/result/resultLanding.module.ts | 4 +- .../searchMyOrcidResults.module.ts | 4 +- orcid/orcid-core.module.ts | 43 +++++++++++++++++++ orcid/orcid.module.ts | 36 ++-------------- utils/result-preview/result-preview.module.ts | 4 +- 5 files changed, 53 insertions(+), 38 deletions(-) create mode 100644 orcid/orcid-core.module.ts diff --git a/landingPages/result/resultLanding.module.ts b/landingPages/result/resultLanding.module.ts index 8554f354..2d7dfc11 100644 --- a/landingPages/result/resultLanding.module.ts +++ b/landingPages/result/resultLanding.module.ts @@ -26,7 +26,6 @@ import {ResultPreviewModule} from "../../utils/result-preview/result-preview.mod import {FeedbackModule} from "../feedback/feedback.module"; import {TabsModule} from "../../utils/tabs/tabs.module"; import {LoadingModule} from "../../utils/loading/loading.module"; -import {OrcidModule} from "../../orcid/orcid.module"; import {IconsModule} from "../../utils/icons/icons.module"; import {IconsService} from "../../utils/icons/icons.service"; import {cite, fire, graph, landmark, link, link_to, quotes, rocket, versions} from "../../utils/icons/icons"; @@ -38,6 +37,7 @@ import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-sc import {SafeHtmlPipeModule} from '../../utils/pipes/safeHTMLPipe.module'; import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module"; import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; +import {OrcidCoreModule} from "../../orcid/orcid-core.module"; @NgModule({ imports: [ @@ -47,7 +47,7 @@ import {ResultLandingRoutingModule} from "./resultLanding-routing.module"; AltMetricsModule, Schema2jsonldModule, SEOServiceModule, DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule, TabsModule, LoadingModule, - OrcidModule, IconsModule, InputModule, EGIDataTransferModule, RecaptchaModule, + OrcidCoreModule, IconsModule, InputModule, EGIDataTransferModule, RecaptchaModule, SdgFosSuggestModule, FullScreenModalModule, SafeHtmlPipeModule, EntityActionsModule ], declarations: [ diff --git a/orcid/my-orcid-links/searchMyOrcidResults.module.ts b/orcid/my-orcid-links/searchMyOrcidResults.module.ts index 87ce11d0..66cf5358 100644 --- a/orcid/my-orcid-links/searchMyOrcidResults.module.ts +++ b/orcid/my-orcid-links/searchMyOrcidResults.module.ts @@ -6,15 +6,15 @@ import {RouterModule} from '@angular/router'; import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module"; import {ErrorMessagesModule} from "../../utils/errorMessages.module"; import {searcMyOrcidResultsComponent} from "./searchMyOrcidResults.component"; -import {OrcidModule} from "../orcid.module"; import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module"; import {PagingModule} from "../../utils/paging.module"; +import {OrcidCoreModule} from "../orcid-core.module"; @NgModule({ imports: [ CommonModule, FormsModule, RouterModule, ErrorMessagesModule, - ResultPreviewModule, OrcidModule, NoLoadPaging, PagingModule + ResultPreviewModule, OrcidCoreModule, NoLoadPaging, PagingModule ], declarations: [ searcMyOrcidResultsComponent diff --git a/orcid/orcid-core.module.ts b/orcid/orcid-core.module.ts new file mode 100644 index 00000000..eda20ab1 --- /dev/null +++ b/orcid/orcid-core.module.ts @@ -0,0 +1,43 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; + +import {RouterModule} from '@angular/router'; + +import {OrcidComponent} from './orcid.component'; +import {OrcidService} from './orcid.service'; +import {OrcidWorkComponent} from './orcid-work.component'; +import {AlertModalModule} from '../utils/modal/alertModal.module'; +import {ResultLandingService} from '../landingPages/result/resultLanding.service'; +import {LoadingModule} from '../utils/loading/loading.module'; +import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module'; +import {IconsModule} from '../utils/icons/icons.module'; +import {IconsService} from "../utils/icons/icons.service"; +import {orcid_add, orcid_bin} from "../utils/icons/icons"; +import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; +import {LogServiceModule} from "../utils/log/LogService.module"; +import {OrcidRoutingModule} from "./orcid-routing.module"; + +@NgModule({ + imports: [ + CommonModule, RouterModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, + IconsModule, FullScreenModalModule, LogServiceModule + ], + declarations: [ + OrcidComponent, + OrcidWorkComponent + ], + providers:[ + OrcidService, ResultLandingService + ], + exports: [ + OrcidComponent, + OrcidWorkComponent + ] +}) + + +export class OrcidCoreModule{ + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([orcid_add, orcid_bin]) + } +} diff --git a/orcid/orcid.module.ts b/orcid/orcid.module.ts index 54bae78b..5743c46a 100644 --- a/orcid/orcid.module.ts +++ b/orcid/orcid.module.ts @@ -1,43 +1,15 @@ import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; - -import {RouterModule} from '@angular/router'; - -import {OrcidComponent} from './orcid.component'; -import {OrcidService} from './orcid.service'; -import {OrcidWorkComponent} from './orcid-work.component'; -import {AlertModalModule} from '../utils/modal/alertModal.module'; -import {ResultLandingService} from '../landingPages/result/resultLanding.service'; -import {LoadingModule} from '../utils/loading/loading.module'; -import {ResultLandingUtilsModule} from '../landingPages/landing-utils/resultLandingUtils.module'; -import {IconsModule} from '../utils/icons/icons.module'; import {IconsService} from "../utils/icons/icons.service"; import {orcid_add, orcid_bin} from "../utils/icons/icons"; -import {FullScreenModalModule} from "../utils/modal/full-screen-modal/full-screen-modal.module"; -import {LogServiceModule} from "../utils/log/LogService.module"; import {OrcidRoutingModule} from "./orcid-routing.module"; +import {OrcidCoreModule} from "./orcid-core.module"; +import {OrcidComponent} from "./orcid.component"; @NgModule({ - imports: [ - CommonModule, RouterModule, OrcidRoutingModule, AlertModalModule, LoadingModule, ResultLandingUtilsModule, - IconsModule, FullScreenModalModule, LogServiceModule - ], - declarations: [ - OrcidComponent, - OrcidWorkComponent - ], - providers:[ - OrcidService, ResultLandingService - ], - exports: [ - OrcidComponent, - OrcidWorkComponent - ] + imports: [OrcidCoreModule, OrcidRoutingModule], + exports: [OrcidComponent] }) export class OrcidModule{ - constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([orcid_add, orcid_bin]) - } } diff --git a/utils/result-preview/result-preview.module.ts b/utils/result-preview/result-preview.module.ts index 5ad90baf..12726cc6 100644 --- a/utils/result-preview/result-preview.module.ts +++ b/utils/result-preview/result-preview.module.ts @@ -4,15 +4,15 @@ import {ResultPreviewComponent} from "./result-preview.component"; import {RouterModule} from "@angular/router"; import {ShowAuthorsModule} from "../authors/showAuthors.module"; import {ResultLandingUtilsModule} from "../../landingPages/landing-utils/resultLandingUtils.module"; -import {OrcidModule} from "../../orcid/orcid.module"; import {IconsModule} from "../icons/icons.module"; import {IconsService} from "../icons/icons.service"; import {cite, fire, landmark, link, link_to, quotes, rocket} from "../icons/icons"; import {EntityActionsModule} from "../entity-actions/entity-actions.module"; import {EntityMetadataModule} from "../../landingPages/landing-utils/entity-metadata.module"; +import {OrcidCoreModule} from "../../orcid/orcid-core.module"; @NgModule({ - imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidModule, IconsModule, EntityActionsModule, EntityMetadataModule], + imports: [CommonModule, RouterModule, ShowAuthorsModule, ResultLandingUtilsModule, OrcidCoreModule, IconsModule, EntityActionsModule, EntityMetadataModule], declarations: [ResultPreviewComponent], exports: [ResultPreviewComponent] }) -- 2.17.1 From ca8b732a640cd222bc6a3a2792a98214dcd8e305 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 15 Mar 2024 15:43:58 +0200 Subject: [PATCH 44/93] [develop | DONE | ADDED]: menu.ts: In MenuItem class added field "badge?: string", which is used only in FAIRCORE4EOSC | navigationBar.component.html: Added in menu item (only in no-link parent), to show a badge in FAIRCORE4EOSC. --- sharedComponents/menu.ts | 4 +++- sharedComponents/navigationBar.component.html | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index e3b38e60..b4328834 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -23,10 +23,11 @@ export class MenuItem { isFeatured: boolean; isActive: boolean; target: string = "_blank"; + badge?: string = ""; // used only for RDGraph portal (FAIRCORE4EOSC) constructor(id: string, title: string, url: string, route: string, needsAuthorization: boolean, entitiesRequired: string[], routeRequired: string[], params, icon: Icon = null, fragment = null, customClass = null, routeActive = null, - target: string = "_blank", type: string = "internal", isFeatured: boolean = false, items: MenuItem[] = []) { + target: string = "_blank", type: string = "internal", isFeatured: boolean = false, items: MenuItem[] = [], badge: string = "") { this._id = id; this.title = title; this.url = url; @@ -43,6 +44,7 @@ export class MenuItem { this.target = target; this.type = type; this.isFeatured = isFeatured; + this.badge = badge; } public static isTheActiveMenu(menu: MenuItem, currentRoute: any, activeMenuItem: string = ""): boolean { diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 7f502eab..a0147369 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -41,7 +41,9 @@ {{menu.title}} + [fragment]="menu.fragment"> + {{menu.badge}} + {{menu.title}} {{menu.title}} - {{menu.title}} + + {{menu.badge}} + {{menu.title}}
    -- 2.17.1 From 6c4a4d9721030ad43ca7e4112a9bc8c548557123 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 19 Mar 2024 12:55:39 +0200 Subject: [PATCH 45/93] [develop | DONE | ADDED] add new custom classes fo slider-tabs container --- sharedComponents/tabs/slider-tabs.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts index d4246f23..84cfbd1c 100644 --- a/sharedComponents/tabs/slider-tabs.component.ts +++ b/sharedComponents/tabs/slider-tabs.component.ts @@ -20,7 +20,7 @@ declare var UIkit; template: `
    -
    +
      Date: Thu, 21 Mar 2024 09:46:11 +0200 Subject: [PATCH 46/93] [develop | DONE | FIXED] linking update parsing of the datacite API --- .../service/searchDatacite.service.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/claims/claim-utils/service/searchDatacite.service.ts b/claims/claim-utils/service/searchDatacite.service.ts index 4361462f..a6d9cc8b 100644 --- a/claims/claim-utils/service/searchDatacite.service.ts +++ b/claims/claim-utils/service/searchDatacite.service.ts @@ -58,22 +58,20 @@ export class SearchDataciteService { entity.result.journal = null; entity.result.DOI = item.attributes.doi; entity.id = item.attributes.doi; - entity.title = item.attributes.title; + entity.title = Array.isArray(item.attributes.titles) && item.attributes.titles[0].title?item.attributes.titles[0].title:null; entity.result.url = properties.doiURL + item.attributes.doi; entity.result.source = 'datacite'; entity.type = 'dataset'; - entity.result.date = item.attributes.published; + entity.result.date = item.attributes.publicationYear; entity.result.accessRights = "OPEN"; - entity.result.publisher = item.attributes['container-title']; + entity.result.publisher = item.attributes['publisher']; entity.result.journal = null; entity.result.record = item; - if (item.attributes.author) { + if (item.attributes.creators) { entity.result.authors = []; - for (let j = 0; j < item.attributes.author.length; j++) { - const author = item.attributes.author[j]; - if(author.family || author.literal) { - entity.result.authors.push((author.family) ? author.family + (author.given ? ', ' + author.given : '') : author.literal); - } + for (let j = 0; j < item.attributes.creators.length; j++) { + const author = item.attributes.creators[j].name; + entity.result.authors.push(author); } } results.push(entity); -- 2.17.1 From d6b924bcaaf54b6a11908fa8d0cfbab065d6bd41 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 21 Mar 2024 09:47:02 +0200 Subject: [PATCH 47/93] [develop | DONE | FIXED] linking update check to decide if claim is pending and show the link to landing --- claims/claim-utils/displayClaims/displayClaims.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 9e5ccf97..d4204ceb 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -351,7 +351,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { if (claimDateStr < lastUpdateDateStr) { return true; } else { - return claim.target.collectedFrom != "infrastruct_::openaire" && claim.indexed; + return claim.target.collectedFrom != "infrastruct_::openaire"; } } -- 2.17.1 From b6cda48e2fa1db6a2361a862c1fd959077fde58c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 27 Mar 2024 16:30:38 +0200 Subject: [PATCH 48/93] [develop | DONE | ADDED]: searchFields.base.ts: Added static "triplet" refine (facet) field "haslicense". --- utils/properties/searchFields.base.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/utils/properties/searchFields.base.ts b/utils/properties/searchFields.base.ts index 79ece5b3..98c6a020 100644 --- a/utils/properties/searchFields.base.ts +++ b/utils/properties/searchFields.base.ts @@ -333,6 +333,14 @@ export class SearchFieldsBase { operator: "pf", equalityOperator: " = ", filterType: "triplet" + }, + ["haslicense"]: { + name: "License", + type: "triplet", + param: "haslicense", + operator: "hl", + equalityOperator: " = ", + filterType: "triplet" } }; @@ -369,6 +377,11 @@ export class SearchFieldsBase { { name: "All", id: "", count: "0" }, { name: "Yes", id: "true", count: "0" }, { name: "No", id: "false", count: "0" } + ], + ["haslicense"]: [ + { name: "All", id: "", count: "0" }, + { name: "Yes", id: "true", count: "0" }, + { name: "No", id: "false", count: "0" } ] }; -- 2.17.1 From cafe0e4926f0d9762cd59a71ce1779743db34771 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 28 Mar 2024 13:07:11 +0200 Subject: [PATCH 49/93] [develop | DONE | ADDED] displayClaims: add bulk delete functionality for claims, change the claims cards to a more compact claims list --- .../displayClaims.component.html | 109 ++++++++++-------- .../displayClaims.component.less | 10 -- .../displayClaims/displayClaims.component.ts | 68 +++++++++-- .../claimEntityFormatter.component.ts | 17 +-- .../projectTitleFormatter.component.ts | 2 +- 5 files changed, 133 insertions(+), 73 deletions(-) diff --git a/claims/claim-utils/displayClaims/displayClaims.component.html b/claims/claim-utils/displayClaims/displayClaims.component.html index bdcc74b3..94034a2e 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.html +++ b/claims/claim-utils/displayClaims/displayClaims.component.html @@ -56,57 +56,76 @@
      No links found
      -
        -
      • -
        -
        -
        -
        - -
        -
        - available - - pending - -
        -
        -
        - Claimed by: - {{claim.userMail}} + + +
        +
        + +
        + +
        + +
          +
        • +
          + +
          +
          +
          +
          +
          +
          -
          - Claimed date: - {{claim.date}} +
          + available + + pending + +
          +
          +
          + Claimed by: + {{claim.userMail}} +
          +
          + Claimed date: + {{claim.date}} +
          -
          -
          -
          - +
          +
          + +
          +
          +
          +
          -
          -
          -
          -
          - -
        • -
        -
        - -
        +
        + +
        +
      • +
      +
      + +
      +
    diff --git a/claims/claim-utils/displayClaims/displayClaims.component.less b/claims/claim-utils/displayClaims/displayClaims.component.less index 0eadec18..e322586c 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.less +++ b/claims/claim-utils/displayClaims/displayClaims.component.less @@ -4,14 +4,4 @@ position: relative; padding: 0 20px; height: 100%; - - &::before { - content: ''; - position: absolute; - top: 0; - left: 50%; - right: 0; - bottom: 0; - border-left: @global-border-width solid @global-border; - } } diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 9e5ccf97..8f24cf4d 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -52,6 +52,7 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { lastIndexDate = null; public filterForm: FormGroup; public entities: string[] = []; + selected = []; allOptions: Option[] = [ {label: OpenaireEntities.PUBLICATIONS, value: "publication"}, @@ -310,23 +311,34 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { } isSelected(value: string) { - return this.filterForm && this.filterForm.get('entities').value.find(entity => entity === value) + return this.filterForm && this.filterForm.get('entities').value.find(entity => entity === value); } - deleteOpen(index: number) { + deleteOpen(index: number = null) { this.index = index; this.deleteModal.alertTitle = 'Delete Confirmation'; - this.deleteModal.message = 'Are you sure you want to delete this link?'; + this.deleteModal.message = 'Are you sure you want to delete ' + (this.index != null ? '1' : this.selected.length) + ' link(s)?'; this.deleteModal.okButtonText = 'Yes'; this.deleteModal.open(); } delete() { - this.subscriptions.push(this._claimService.deleteBulk([this.claims[this.index].id], this.properties.claimsAPIURL).subscribe( + let claimsToBeDeleted = ((this.index != null) ? [this.claims[this.index].id] : this.selected.map(claim => claim.id)); + console.log(claimsToBeDeleted); + this.subscriptions.push(this._claimService.deleteBulk(claimsToBeDeleted, this.properties.claimsAPIURL).subscribe( res => { - this.claims.splice(this.index, 1); - this.resultsNum = this.resultsNum - 1; - NotificationHandler.rise('Link has been deleted successfully'); + if (this.index != null) { + this.claims.splice(this.index, 1); + this.resultsNum = this.resultsNum - 1; + NotificationHandler.rise('Link has been deleted successfully'); + } else { + claimsToBeDeleted.forEach(claimId => { + this.claims.splice(this.claims.findIndex((id) => id == claimId), 1); + }); + this.resultsNum = this.resultsNum - claimsToBeDeleted.length; + NotificationHandler.rise(claimsToBeDeleted.length + ' links have been deleted successfully'); + } + this.selected = []; let goToPage = this.page; if (this.totalPages(this.resultsNum) < this.page && this.page > 0) { goToPage = this.page - 1; @@ -334,7 +346,8 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { this.goTo(goToPage); }, err => { this.handleErrors(err, "Error deleting claim with id: " + this.claims[this.index].id); - })); + } + )); } pageChange($event) { @@ -362,7 +375,44 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { } return totalPages; } - + + selectClaim(item: any, event) { + let value = event.currentTarget.checked; + if (value) { + this.selected.push(item); + } else { + for (var _i = 0; _i < this.selected.length; _i++) { + let claim = this.selected[_i]; + if (claim['id'] == item.id) { + this.selected.splice(_i, 1); + } + } + } + } + + selectAll(event) { + let value = event.currentTarget.checked; + if (value) { + this.selected = []; + for (let _i = 0; _i < this.claims.length; _i++) { + let claim = this.claims[_i]; + this.selected.push(claim); + } + } else { + this.selected = []; + } + } + + isSelectedClaim(id: string) { + for (let _i = 0; _i < this.selected.length; _i++) { + let claim = this.selected[_i]; + if (claim['id'] == id) { + return true; + } + } + return false; + } + private updateDescription(description: string) { this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "property='og:description'"); diff --git a/claims/claim-utils/entityFormatter/claimEntityFormatter.component.ts b/claims/claim-utils/entityFormatter/claimEntityFormatter.component.ts index 6102d684..547e4c16 100644 --- a/claims/claim-utils/entityFormatter/claimEntityFormatter.component.ts +++ b/claims/claim-utils/entityFormatter/claimEntityFormatter.component.ts @@ -15,21 +15,22 @@ import {StringUtils} from "../../../utils/string-utils.class";
    {{getEntityName(type)}}
    -
    - Link to: +
    + Link to:
    -
    - Link to: +
    + Link to:
    -
    - Link to: - {{entity.title}} +
    + Link to: +
    + {{entity.title}} +
    ` }) diff --git a/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts b/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts index 92557d9a..14ee0e60 100644 --- a/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts +++ b/claims/claim-utils/entityFormatter/projectTitleFormatter.component.ts @@ -20,7 +20,7 @@ import {properties} from "../../../../../environments/environment"; - Funder: {{project['funderName']}} + Funder: {{project['funderName']}} ` }) -- 2.17.1 From 894667955c788cc72db30ce68fa284b4fd02bd45 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 28 Mar 2024 13:22:21 +0200 Subject: [PATCH 50/93] [develop | DONE | ADDED] slider-tabs component: add condition to disable slider-arrows if isServer is true --- sharedComponents/tabs/slider-tabs.component.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts index 84cfbd1c..666f90a2 100644 --- a/sharedComponents/tabs/slider-tabs.component.ts +++ b/sharedComponents/tabs/slider-tabs.component.ts @@ -6,11 +6,14 @@ import { ElementRef, EventEmitter, Input, OnDestroy, Output, QueryList, - ViewChild + ViewChild, + Inject, + PLATFORM_ID } from "@angular/core"; import {SliderTabComponent} from "./slider-tab.component"; import {ActivatedRoute, Router} from "@angular/router"; import {Subscription} from "rxjs"; +import {isPlatformServer} from "@angular/common"; import Timeout = NodeJS.Timeout; declare var UIkit; @@ -78,8 +81,10 @@ declare var UIkit;
    - - + + + +
    `, }) @@ -143,10 +148,13 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy { private subscriptions: any[] = []; private observer: IntersectionObserver; private timeout: Timeout; + isServer: boolean; constructor(private route: ActivatedRoute, private router: Router, - private cdr: ChangeDetectorRef) { + private cdr: ChangeDetectorRef, + @Inject(PLATFORM_ID) private platform: any) { + this.isServer = isPlatformServer(this.platform); } ngAfterViewInit() { -- 2.17.1 From 0c7539462183f2716718afdc79f5db12ed581ba2 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 1 Apr 2024 01:16:31 +0300 Subject: [PATCH 51/93] [develop | FIXED | CHANGED]: Add stakeholder in export indicators file and import base on this stakeholder. --- monitor-admin/topic/indicators.component.html | 49 -------- monitor-admin/topic/indicators.component.ts | 105 +++++------------- 2 files changed, 30 insertions(+), 124 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 05144592..e4e84099 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -14,16 +14,6 @@ (click)="deleteSectionOpen(number, i, 'number', 'delete')"> - - - - - - - - - -
    @@ -113,16 +103,6 @@ (click)="deleteSectionOpen(chart, i, 'chart', 'delete')"> - - - - - - - - - -
    -
    @@ -440,8 +419,6 @@ - -
    @@ -462,25 +439,10 @@
    Indicators of all profiles based on this default indicator, will be deleted as well.
    - - - Are you sure you want to proceed?
    -
    @@ -490,20 +452,9 @@
    Sections of all profiles based on this default section and their contents, will be deleted as well.
    - - - Are you sure you want to proceed?
    -
    diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 30343944..1abcfa4d 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -504,16 +504,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.numberIndicatorPaths.at(index).get('result').setValue(null); if (this.numberIndicatorPaths.at(index).get('url').valid) { let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value))); - if (!this.isStakeholderParametersValid(indicatorPath)) { - // default profile - if (this.stakeholder.defaultId == null) { - this.urlParameterizedMessage = "This indicator couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly." - } else { - this.urlParameterizedMessage = "This indicator couldn't be generated properly. Please make sure chart data is for the current stakeholder." - } - } else { - this.urlParameterizedMessage = null; - } this.checkForSchemaEnhancements(this.numberIndicatorPaths.at(index).get('url').value); if (this.indicator.indicatorPaths[index]) { this.indicator.indicatorPaths[index] = indicatorPath; @@ -574,16 +564,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => { if (this.chartIndicatorPaths.at(index).get('url').valid) { let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder); - if (!this.isStakeholderParametersValid(indicatorPath)) { - // default profile - if (this.stakeholder.defaultId == null) { - this.urlParameterizedMessage = "This chart couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly." - } else { - this.urlParameterizedMessage = "This chart couldn't be generated properly. Please make sure chart data is for the current stakeholder." - } - } else { - this.urlParameterizedMessage = null; - } this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); @@ -601,12 +581,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } } - private isStakeholderParametersValid(indicatorPath: IndicatorPath) { - return !((indicatorPath.chartObject && Object.keys(indicatorPath.parameters).indexOf("index_id") == -1 && Object.keys(indicatorPath.parameters).indexOf("index_name") == -1 && Object.keys(indicatorPath.parameters).indexOf("index_shortName") == -1) - || (!indicatorPath.chartObject && indicatorPath.url.indexOf("index_id") == -1 && indicatorPath.url.indexOf("index_name") == -1 && (indicatorPath.url).indexOf("index_shortName") == -1)); - - } - private getJsonPathAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray { let jsonPath = this.fb.array([]); if (indicatorPath.jsonPath) { @@ -1159,24 +1133,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - // deleteNumberSectionOpen(section: Section, index: number) { - // this.section = section; - // this.index = index; - // this.deleteNumberSectionModal.alertTitle = 'Delete Section'; - // this.deleteNumberSectionModal.cancelButtonText = 'No'; - // this.deleteNumberSectionModal.okButtonText = 'Yes'; - // this.deleteNumberSectionModal.open(); - // } - // - // deleteChartSectionOpen(section: Section, index: number) { - // this.section = section; - // this.index = index; - // this.deleteChartSectionModal.alertTitle = 'Delete Section'; - // this.deleteChartSectionModal.cancelButtonText = 'No'; - // this.deleteChartSectionModal.okButtonText = 'Yes'; - // this.deleteChartSectionModal.open(); - // } - deleteSectionOpen(section: Section, index: number, type: IndicatorType, childrenAction: string = null) { if (!this.editing && !section.defaultId) { this.sectionTypeToDelete = type; @@ -1256,11 +1212,20 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return charts; } - importIndicatorsAndSave(charts: any[]) { + importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) { let sectionsToSave: Section[] = []; let countIndicators = 0; + if(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, + pos: 'bottom-right' + }); + this.editing = false; + this.importLoading = false; + return; + } // name description additionalDescription, height, width, visibility - let noValidParams = 0; let duplicates = 0; charts = this.migrateFromOldImportJsonFile(charts); for (let chart of charts) { @@ -1296,7 +1261,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } if (chart.type == "chart") { - indicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(chart.url), chart.url, chart.type, this.stakeholder); + indicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(chart.url), chart.url, chart.type, stakeholder); for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts) { for (let chart of section.indicators) { if (JSON.stringify(chart.indicatorPaths[0].chartObject) == JSON.stringify(indicatorPath.chartObject)) { @@ -1304,10 +1269,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple exists = true; } } - } } else if (chart.type == "number") { - indicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(chart.url), chart.url, this.stakeholder, + indicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(chart.url), chart.url, stakeholder, chart.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(chart.url))); for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers) { for (let chart of section.indicators) { @@ -1316,20 +1280,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple exists = true; } } - } } - if (!this.isStakeholderParametersValid(indicatorPath)) { - noValidParams++; - } if (!exists) { 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), [indicatorPath]); sectionsToSave[chart['sectionIndex']].indicators.push(i); countIndicators++; } - } - if (duplicates > 0) { UIkit.notification(duplicates + " urls already exist and will not be imported!", { status: 'warning', @@ -1337,19 +1295,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple pos: 'bottom-right' }); } - if (noValidParams > 0 && !(this.stakeholder.type == 'country')) { - let noValidMessage = "Some indicators couldn't be generated properly. Please make sure chart data is for the current stakeholder."; - if (this.stakeholder.defaultId == null) { - noValidMessage = "Some indicators couldn't be generated properly. Stakeholders based on this profile may not inherit the data correctly."; - } - UIkit.notification(noValidMessage, { - status: 'danger', - timeout: 6000, - pos: 'bottom-right' - }); - this.editing = false; - this.importLoading = false; - } else if (sectionsToSave.length > 0 && countIndicators > 0) { + if (sectionsToSave.length > 0 && countIndicators > 0) { this.saveIndicators(sectionsToSave.filter(section => !!section)); } if (sectionsToSave.length == 0 || countIndicators == 0) { @@ -1408,8 +1354,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple let topic = this.stakeholder ? this.stakeholder.topics[this.topicIndex] : null; let category = topic ? topic.categories[this.categoryIndex] : null; let subCategory = category ? category.subCategories[subcategoryIndex] : null; - - var jsonFileUrl = window.URL.createObjectURL(new Blob([JSON.stringify(indicators)], {type: 'application/json'})); + let json = { + stakeholder: this.stakeholder, + indicators: indicators + } + var jsonFileUrl = window.URL.createObjectURL(new Blob([JSON.stringify(json)], {type: 'application/json'})); var a = window.document.createElement('a'); window.document.body.appendChild(a); a.setAttribute('style', 'display: none'); @@ -1456,11 +1405,17 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } this.makeFileRequest(this.properties.utilsService + '/upload?type=json', [], this.filesToUpload).then(async (result: string) => { - - let json_result = JSON.parse(result); - + let json = JSON.parse(result); // validate file - if (!json_result || json_result.length == 0) { + if(json && Array.isArray(json)) { + UIkit.notification("This file is not supported any more. Please export indicators and try again!", { + status: 'danger', + timeout: 6000, + pos: 'bottom-right' + }); + this.editing = false; + this.importLoading = false; + } else if (!json || json?.indicators.length == 0) { UIkit.notification("Importing file is empty", { status: 'danger', timeout: 6000, @@ -1469,7 +1424,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.editing = false; this.importLoading = false; } else { - this.importIndicatorsAndSave(json_result); + this.importIndicatorsAndSave(json.stakeholder, json.indicators); } }, (error) => { console.error("Error importing files", error); -- 2.17.1 From b34f42326ca8069b6ade0e1934c7e7cd021112cb Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 1 Apr 2024 18:16:21 +0300 Subject: [PATCH 52/93] [develop | ADDED]: Add loading in import indicators in order to avoid any actions during this process --- monitor-admin/topic/indicators.component.html | 9 ++-- monitor-admin/topic/indicators.component.ts | 45 ++++++++----------- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index e4e84099..b9bce2df 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -198,13 +198,16 @@
    +
    + +
    -
    - -
    +
    + +
    diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 1abcfa4d..ab491a54 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -86,8 +86,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public safeUrls: Map = new Map([]); public numberResponses: Map = new Map(); public numberResults: Map = new Map(); - /** Import / Export Indicators */ - importLoading: boolean = false; + public loading: boolean = false; @ViewChild('editChartModal', {static: true}) editChartModal: AlertModal; @ViewChild('editNumberModal', {static: true}) editNumberModal: AlertModal; @ViewChild('deleteModal', {static: true}) deleteModal: AlertModal; @@ -354,7 +353,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.stakeholder && this.stakeholder.topics[this.topicIndex] && this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]; + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] && !this.loading; } public get numberIndicatorPaths(): UntypedFormArray { @@ -874,19 +873,22 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); } } - this.editing = false; - this.importLoading = false; + this.finish(); NotificationHandler.rise('Indicators have been imported successfully!'); }, error => { this.chartIndicatorFb = null; NotificationHandler.rise('An error has occurred. Please try again later', 'danger'); - this.editing = false; - this.importLoading = false; + this.finish(); })); } + finish() { + this.editing = false; + this.loading = false; + } + reorderIndicators(sectionId: string, type: IndicatorType, reorder: Reorder) { this.editing = true; let path = [ @@ -1221,8 +1223,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); return; } // name description additionalDescription, height, width, visibility @@ -1255,8 +1256,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); break; } @@ -1304,8 +1304,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); } } @@ -1367,14 +1366,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple a.click(); window.URL.revokeObjectURL(jsonFileUrl); a.remove(); // remove the element - - this.editing = false; + this.finish(); } fileChangeEvent(fileInput: any, index) { this.index = index; this.editing = true; - this.importLoading = true; + this.loading = true; this.filesToUpload = >fileInput.target.files; this.upload(); } @@ -1387,8 +1385,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); return; } else { if (this.filesToUpload[0].name.indexOf(".json") == -1 || (this.filesToUpload[0].type != "application/json")) { @@ -1398,8 +1395,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); return; } } @@ -1413,16 +1409,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); } else if (!json || json?.indicators.length == 0) { UIkit.notification("Importing file is empty", { status: 'danger', timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); } else { this.importIndicatorsAndSave(json.stakeholder, json.indicators); } @@ -1433,8 +1427,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple timeout: 6000, pos: 'bottom-right' }); - this.editing = false; - this.importLoading = false; + this.finish(); }); } -- 2.17.1 From 828dfc0671dc58977ef30a641cbd7fe7f94c0eb5 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 1 Apr 2024 18:56:26 +0300 Subject: [PATCH 53/93] [develop]: Remove topics from exported file in export indicators. --- monitor-admin/topic/indicators.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index ab491a54..46119354 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -1354,9 +1354,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple let category = topic ? topic.categories[this.categoryIndex] : null; let subCategory = category ? category.subCategories[subcategoryIndex] : null; let json = { - stakeholder: this.stakeholder, + stakeholder: HelperFunctions.copy(this.stakeholder), indicators: indicators } + delete json.stakeholder.topics; var jsonFileUrl = window.URL.createObjectURL(new Blob([JSON.stringify(json)], {type: 'application/json'})); var a = window.document.createElement('a'); window.document.body.appendChild(a); -- 2.17.1 From 78d262dd3b67ceb022cf9a3e5135bcf8466c7f1c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Apr 2024 10:59:33 +0300 Subject: [PATCH 54/93] [develop | DONE | ADDED]: Added search organizations by PID (ror, isni, wikidata, fundRef). 1. string-utils.class.ts: Added methods "isValidRor()", "isValidIsni()", "isValidWikidata()", "isValidFundRef()" and cases for these new identifiers. 2. newSearchPage.component.ts: In method "createKeywordQuery()", check for PIDs also for organizations entity. 3. environment.ts: Updated property "fundRefURL" to "https://data.crossref.org/fundingdata/funder/" (old: https://api.crossref.org/funders/). --- .../searchUtils/newSearchPage.component.ts | 2 +- utils/properties/environments/environment.ts | 2 +- utils/string-utils.class.ts | 37 +++++++++++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index cf9f105a..e8447acb 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -1085,7 +1085,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges { let params = ""; let doisParams = ""; var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value); - if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "dataprovider" || entityType == "service")) { + if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "dataprovider" || entityType == "service" || entityType == "organization")) { for (let identifier of DOIs) { // console.log(identifier) // pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\" diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index fb86e5d4..283a1295 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -23,7 +23,7 @@ export let common: EnvProperties = { rorURL: "https://ror.org/", isniURL: "https://isni.org/isni/", wikiDataURL: "https://www.wikidata.org/wiki/", - fundRefURL: "https://api.crossref.org/funders/", + fundRefURL: "https://data.crossref.org/fundingdata/funder/", fairSharingURL: "https://fairsharing.org/", eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/", diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index cbce9848..3ccf6e6b 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -150,7 +150,7 @@ export class DOI { } export class Identifier { - class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" = null; + class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" | "ror" | "wikidata" | "fundref" | "isni" = null; id: string; public static getDOIsFromString(str: string): string[] { @@ -205,14 +205,22 @@ export class Identifier { return {"class": "re3data", "id": pid}; } else if (Identifier.isValidSwhId(pid)) { return {"class": "swhid", "id": pid}; + } else if (Identifier.isValidRor(pid)) { + return {"class": "ror", "id": pid}; + } else if (Identifier.isValidFundRef(pid)) { + return {"class": "fundref", "id": pid}; + } else if (Identifier.isValidWikidata(pid)) { + return {"class": "wikidata", "id": pid}; + } else if (Identifier.isValidIsni(pid)) { + return {"class": "isni", "id": pid}; } //set it as a doi, to catch the case that doi has not valid format return (strict?null:{"class": "doi", "id": pid}); } public static getPIDFromIdentifiers(identifiers: Map): Identifier { - let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid"]; - if(identifiers) { + let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid", "ror", "wikidata", "fundref", "isni"]; + if(identifiers && identifiers.size > 0) { for (let cl of classes) { if (identifiers.get(cl)) { for (let pid of identifiers.get(cl)) { @@ -258,6 +266,7 @@ export class Identifier { } public static isValidHANDLE(str: string): boolean { + // let exp = /\b[0-9a-zA-Z-]*\/[0-9a-zA-Z-]*$/g; // resolve with url - need to add method for raw value let exp = /^[0-9a-zA-Z-]*\/[0-9a-zA-Z-]*$/g; return str.match(exp) != null; } @@ -272,6 +281,28 @@ export class Identifier { let exp = /swh:1:snp:[0-9a-f]{40}/g; return str.match(exp) != null; } + + public static isValidRor(str: string): boolean { + let exp = /0[a-z|0-9]{6}[0-9]{2}\b/g; + return str.match(exp) != null; + } + + public static isValidIsni(str: string): boolean { + let exp = /^[0]{7}[0-9]{8}[0-9X]$/g; + return str.match(exp) != null; + } + + public static isValidWikidata(str: string): boolean { + let exp = /^Q\d+$/g; + return str.match(exp) != null; + } + + public static isValidFundRef(str: string): boolean { + // let exp = /aaa/g; + let exp = /^[1-9]\d+$/g; + return str.match(exp) != null; + } + } export class StringUtils { -- 2.17.1 From 18791ec9d22d3f30dd895e2e090d154b9e7b75fb Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Apr 2024 13:33:23 +0300 Subject: [PATCH 55/93] [develop | DONE | ADDED]: searchFields.base.ts: Added "pid" field in ORGANIZATION_ADVANCED_FIELDS. --- utils/properties/searchFields.base.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/properties/searchFields.base.ts b/utils/properties/searchFields.base.ts index 98c6a020..1813b1a2 100644 --- a/utils/properties/searchFields.base.ts +++ b/utils/properties/searchFields.base.ts @@ -798,7 +798,7 @@ export class SearchFieldsBase { //ORGANIZATION public ORGANIZATION_REFINE_FIELDS: string[] = ["country"] - public ORGANIZATION_ADVANCED_FIELDS: string[] = ["q", "organizationlegalname", "organizationlegalshortname", "country"]; + public ORGANIZATION_ADVANCED_FIELDS: string[] = ["q", "organizationlegalname", "organizationlegalshortname", "country", "pid"]; public ORGANIZATION_FIELDS: { [key: string]: FieldDetails } = { ["q"]: {name: "Any field", type: "keyword", param: "q", operator: "op", equalityOperator: "=", filterType: null}, @@ -826,6 +826,7 @@ export class SearchFieldsBase { equalityOperator: " exact ", filterType: "checkbox" }, + ["pid"]: {name: "PID", type: "keyword", param: "pid", operator: "pd", equalityOperator: " exact ", filterType: null} }; // public ORGANIZATION_INDEX:string[] = ["organizationcountryname"]//,"organizationeclegalbody"]; // public ADVANCED_SEARCH_ORGANIZATION_PARAM:string[] = ["q","contenttype","compatibility","country","type"]; -- 2.17.1 From 07569f24e16f1818742c41aacd86a6a76ac920af Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 3 Apr 2024 16:16:09 +0300 Subject: [PATCH 56/93] [develop | DONE | FIXED]: resultLanding.component.html & searchResult.component.ts: Added checks for ORCID also for properties.dashboard == "irish". --- landingPages/result/resultLanding.component.html | 6 ++++-- searchPages/searchUtils/searchResult.component.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 3a2de7e2..d99ba7b3 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -79,7 +79,8 @@ [type]="resultLandingInfo.resultType" [result]="resultLandingInfo" [id]="resultLandingInfo.objIdentifier"> -
    @@ -544,7 +545,8 @@

    - +
    0 && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other") ) { -- 2.17.1 From dcfc6b0b6a288d5f944efb63f51d8e6d11e5df76 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 4 Apr 2024 16:10:08 +0300 Subject: [PATCH 57/93] [develop | DONE | CHANGED]: searchFields.base.ts: Replace in ORGANIZATION_REFINE_FIELDS and ORGANIZATION_ADVANCED_FIELDS field "country" with "countrynojurisdiction". --- utils/properties/searchFields.base.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/properties/searchFields.base.ts b/utils/properties/searchFields.base.ts index 1813b1a2..a029a42e 100644 --- a/utils/properties/searchFields.base.ts +++ b/utils/properties/searchFields.base.ts @@ -797,8 +797,8 @@ export class SearchFieldsBase { //ORGANIZATION - public ORGANIZATION_REFINE_FIELDS: string[] = ["country"] - public ORGANIZATION_ADVANCED_FIELDS: string[] = ["q", "organizationlegalname", "organizationlegalshortname", "country", "pid"]; + public ORGANIZATION_REFINE_FIELDS: string[] = ["countrynojurisdiction"] + public ORGANIZATION_ADVANCED_FIELDS: string[] = ["q", "organizationlegalname", "organizationlegalshortname", "countrynojurisdiction", "pid"]; public ORGANIZATION_FIELDS: { [key: string]: FieldDetails } = { ["q"]: {name: "Any field", type: "keyword", param: "q", operator: "op", equalityOperator: "=", filterType: null}, @@ -818,7 +818,7 @@ export class SearchFieldsBase { equalityOperator: "=", filterType: null }, - ["country"]: { + ["countrynojurisdiction"]: { name: "Country", type: "vocabulary", param: "country", @@ -962,7 +962,7 @@ export class SearchFieldsBase { return "and"; } else if (fieldId == "instancetypename" || fieldId == "eoscdatasourcetype" || fieldId == "resultlanguagename" || fieldId == "datasourceodlanguages" - || fieldId == "datasourcecompatibilityname" || fieldId == "country" || fieldId == "datasourceodcontenttypes" + || fieldId == "datasourcecompatibilityname" || fieldId == "country" || fieldId == "countrynojurisdiction" || fieldId == "datasourceodcontenttypes" || fieldId == "resulthostingdatasource" || fieldId == "collectedfrom") { return "or"; } -- 2.17.1 From c351349f8ee3a130c56dc72b17159f07460c108e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 4 Apr 2024 17:13:56 +0300 Subject: [PATCH 58/93] [develop | DONE | FIXED] newSearchPage.component.html: Added checks, not to show "Filters" column in the search pages, when there are no filters. --- searchPages/searchUtils/newSearchPage.component.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index f9143437..ab005f85 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -288,7 +288,9 @@
    -
    0) || (staticFilters && staticFilters.length > 0) + || (rangeFilters && rangeFilters.length > 0) || (filters && filters.length > 0))) + && (results.length > 0 || (searchUtils.refineStatus == errorCodes.LOADING && searchUtils.status != errorCodes.LOADING) || (!hideFilters && (existingFiltersWithValues > 0 || (selectedRangeFilters + selectedFilters + selectedTypesNum) > 0))) " class="uk-width-1-4@m search-filters"> -- 2.17.1 From d63092cd9e48b10d130eb52fccfad945e9d785ba Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 5 Apr 2024 10:57:39 +0300 Subject: [PATCH 59/93] [new-order | DONE]: Add new move indicator method when an indicator moved to another section --- monitor-admin/topic/indicators.component.html | 14 ---- monitor-admin/topic/indicators.component.ts | 67 +++++++++++-------- monitor/services/stakeholder.service.ts | 31 +++++---- 3 files changed, 57 insertions(+), 55 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index b9bce2df..1f68e246 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -236,13 +236,6 @@
    -
    -
    - There are schema enhancements that can be applied in this query.Apply - now -
    -
    @@ -373,13 +366,6 @@
    -
    -
    - There are schema enhancements that can be applied in this query. Apply - now -
    -
    = new BehaviorSubject(null); /** Caches */ public safeUrls: Map = new Map([]); public numberResponses: Map = new Map(); @@ -94,8 +96,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public sectionTypeToDelete: string; public sectionChildrenActionOnDelete: string; public indicatorChildrenActionOnDelete: string; - urlParameterizedMessage = null; - showCheckForSchemaEnhancements: boolean = false; + public urlParameterizedMessage = null; private notification: Notification; @ViewChild('editNumberNotify', {static: true}) editNumberNotify: NotifyFormComponent; @ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent; @@ -124,7 +125,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple private notificationService: NotificationService, private fb: UntypedFormBuilder, protected _router: Router, - private cdr: ChangeDetectorRef, private sanitizer: DomSanitizer) { super() this.filesToUpload = []; @@ -186,7 +186,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } }); if (document !== undefined) { - let callback = (list, type: IndicatorType, action: 'moved' | 'added' | 'removed'): void => { + let callback = (list): string[] => { let items: HTMLCollection = list.current.children; let reordered = []; for (let i = 0; i < items.length; i++) { @@ -194,12 +194,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple reordered.push(items.item(i).id); } } - let reorder: Reorder = { - action: action, - target: list.detail[1].id, - ids: reordered - } - this.reorderIndicators(list.current.id.toString().split('-')[1], type, reorder); + return reordered; }; this.numbers.forEach((section) => { this.subscriptions.push(UIkit.util.on(document, 'start', '#number-' + section._id, (): void => { @@ -209,24 +204,32 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.dragging = false; })); this.subscriptions.push(UIkit.util.on(document, 'moved', '#number-' + section._id, (list): void => { - callback(list, "number", 'moved'); + this.reorderIndicators(section._id, 'number', callback(list)); })); this.subscriptions.push(UIkit.util.on(document, 'added', '#number-' + section._id, (list): void => { - callback(list, "number", 'added'); + this.to.next({id: section._id, indicators: callback(list)}); })); this.subscriptions.push(UIkit.util.on(document, 'removed', '#number-' + section._id, (list): void => { - callback(list, "number", 'removed'); + let sub = this.to.asObservable().subscribe(to => { + if(to) { + let from: SectionInfo = {id: section._id, indicators: callback(list)}; + this.moveIndicator({target: list.detail[1].id, from: from, to: to}); + setTimeout(() => { + sub.unsubscribe(); + }) + } + }) })); }); this.charts.forEach((section) => { this.subscriptions.push(UIkit.util.on(document, 'moved', '#chart-' + section._id, (list): void => { - callback(list, "chart", 'moved'); + this.reorderIndicators(section._id, 'chart', callback(list)); })); this.subscriptions.push(UIkit.util.on(document, 'added', '#chart-' + section._id, (list): void => { - callback(list, "chart", 'added'); + //callback(list, "chart", 'added'); })); this.subscriptions.push(UIkit.util.on(document, 'removed', '#chart-' + section._id, (list): void => { - callback(list, "chart", 'removed'); + // callback(list, "chart", 'removed'); })); }); } @@ -496,14 +499,12 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple let index = this.numberIndicatorPaths.length - 1; if (this.numberIndicatorPaths.at(index).get('url').valid) { this.validateJsonPath(index); - this.checkForSchemaEnhancements(this.numberIndicatorPaths.at(index).get('url').value); } if (this.indicator.defaultId === null) { this.subscriptions.push(this.numberIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => { this.numberIndicatorPaths.at(index).get('result').setValue(null); if (this.numberIndicatorPaths.at(index).get('url').valid) { let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value))); - this.checkForSchemaEnhancements(this.numberIndicatorPaths.at(index).get('url').value); if (this.indicator.indicatorPaths[index]) { this.indicator.indicatorPaths[index] = indicatorPath; } else { @@ -559,11 +560,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple if (disableUrl) { this.chartIndicatorPaths.at(index).get('url').disable(); } else { - this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value); this.urlSubscriptions.push(this.chartIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => { if (this.chartIndicatorPaths.at(index).get('url').valid) { let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(value), value, this.chartIndicatorPaths.at(index).get('type').value, this.stakeholder); - this.checkForSchemaEnhancements(this.chartIndicatorPaths.at(index).get('url').value); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).get('type').setValue(indicatorPath.type); (this.chartIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); if (!this.indicator.indicatorPaths[index]) { @@ -889,7 +888,23 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.loading = false; } - reorderIndicators(sectionId: string, type: IndicatorType, reorder: Reorder) { + moveIndicator(moveIndicator: MoveIndicator) { + this.editing = true; + let path = [ + this.stakeholder._id, + this.stakeholder.topics[this.topicIndex]._id, + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex]._id, + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id + ]; + this.subscriptions.push(this.stakeholderService.moveIndicator(this.properties.monitorServiceAPIURL, path, moveIndicator).subscribe(subCategory => { + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] = subCategory; + this.setCharts(); + this.setNumbers(); + this.editing = false; + })); + } + + reorderIndicators(sectionId: string, type: IndicatorType, indicators: string[]) { this.editing = true; let path = [ this.stakeholder._id, @@ -898,7 +913,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]._id, sectionId ]; - this.subscriptions.push(this.stakeholderService.reorderIndicators(this.properties.monitorServiceAPIURL, path, reorder, type).subscribe(indicators => { + this.subscriptions.push(this.stakeholderService.reorderIndicators(this.properties.monitorServiceAPIURL, path, indicators).subscribe(indicators => { if (type === 'chart') { this.charts.find(section => section._id === sectionId).indicators = indicators; this.setCharts(); @@ -1191,10 +1206,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple })); } - private checkForSchemaEnhancements(url: string) { - this.showCheckForSchemaEnhancements = this.isAdministrator && url && !this.properties.useOldStatisticsSchema && this.indicatorUtils.checkForSchemaEnhancements(url) && this.properties.dashboard != 'irish'; - } - migrateFromOldImportJsonFile(charts) { // first section contains numbers // second contains charts diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index 3f0f3a11..d8b8bf30 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -1,16 +1,21 @@ import {Injectable} from "@angular/core"; import {HttpClient} from "@angular/common/http"; import {BehaviorSubject, from, Observable, Subscriber} from "rxjs"; -import {Indicator, Section, Stakeholder, StakeholderInfo, Visibility} from "../entities/stakeholder"; +import {Indicator, Section, Stakeholder, StakeholderInfo, SubCategory, Visibility} from "../entities/stakeholder"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {map} from "rxjs/operators"; import {properties} from "../../../../environments/environment"; import {CustomOptions} from "../../services/servicesUtils/customOptions.class"; -export interface Reorder { - action: 'moved' | 'added' | 'removed', - target: string, - ids: string[]; +export interface SectionInfo { + id: string; + indicators: string[]; +} + +export interface MoveIndicator { + target: string; + from: SectionInfo; + to: SectionInfo; } @Injectable({ @@ -128,7 +133,6 @@ export class StakeholderService { if (element.alias && element.alias.startsWith('/')) { element.alias = element.alias.slice(1); } - path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + '/save', element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { @@ -140,7 +144,6 @@ export class StakeholderService { } saveBulkElements(url: string, indicators, path: string[] = []): Observable { - path = HelperFunctions.encodeArray(path); return this.http.post(url + ((path.length > 0) ? '/' : '') + path.join('/') + '/save-bulk', indicators, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { @@ -152,7 +155,6 @@ export class StakeholderService { } saveSection(url: string, element: any, path: string[] = [], index: number = -1): Observable
    { - path = HelperFunctions.encodeArray(path); return this.http.post
    (url + ((path.length > 0) ? '/' : '') + path.join('/') + '/save/' + index, element, CustomOptions.registryOptions()).pipe(map(element => { return HelperFunctions.copy(element); @@ -160,7 +162,6 @@ export class StakeholderService { } deleteElement(url: string, path: string[], childrenAction: string = null): Observable { - path = HelperFunctions.encodeArray(path); let params: string = ""; if (childrenAction) { params = "?children=" + childrenAction; @@ -169,17 +170,21 @@ export class StakeholderService { } reorderElements(url: string, path: string[], ids: string[]): Observable { - path = HelperFunctions.encodeArray(path); return this.http.post(url + '/' + path.join('/') + '/reorder', ids, CustomOptions.registryOptions()); } - reorderIndicators(url: string, path: string[], reorder: Reorder, type: string = 'chart'): Observable { - path = HelperFunctions.encodeArray(path); - return this.http.post(url + '/' + path.join('/') + '/' + type + '/reorder', reorder, CustomOptions.registryOptions()).pipe(map(indicators => { + reorderIndicators(url: string, path: string[], indicators: string[]): Observable { + 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 HelperFunctions.copy(subCategory); + })); + } + getStakeholderAsObservable(): Observable { return this.stakeholderSubject.asObservable(); } -- 2.17.1 From dc1679c56534a505836bc505c75adc3c7ac77fda Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 5 Apr 2024 11:09:16 +0300 Subject: [PATCH 60/93] [develop | DONE | CHANGED]: newSearchPage.component.html: Restored number of results and keyword display & added uk-text-capitalize on selected filter labels. --- .../searchUtils/newSearchPage.component.html | 75 ++++++++++++------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index ab005f85..d59cb0b1 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -1,11 +1,11 @@

    -
    +
    • - + {{customFilter.valueName}}
    • @@ -15,7 +15,7 @@
    • - + {{type.name}}
    - + +
    + +
    + + {{searchUtils.totalResults|number}} + {{type}} + + for + {{searchTerm}} + + + ({{advancedSearchTerms}} rule{{advancedSearchTerms == 1 ? '' : 's'}} applied) + + + + {{oldTotalResults|number}} + {{type}}, page + {{searchUtils.page | number}} + of {{(totalPages(oldTotalResults)|number)}} + +
    -
    +
    + *ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'" + [isDisabled]="disabled" + [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"> - Data dump + Zenodo dumpData dump
    - -
    - -
    - -
    -
    + +
    + class="uk-grid uk-flex-middle uk-child-width-1-1 uk-child-width-1-2@m" uk-grid>
    + class="uk-margin-small-left uk-flex uk-flex-middle" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile"> + *ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'" + [isDisabled]="disabled" + [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"> - Data dump + Zenodo dumpData dump
    + +
    + +
    + +
    +

    For more results please try a new, more specific query

    -- 2.17.1 From b71bdfa559a84623bde09f987edc9054a167e588 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 5 Apr 2024 20:13:05 +0300 Subject: [PATCH 61/93] [new-reorder]: Add multi charts in admin indicators (works now only for charts in UI). Deprecated transition-group disable/enable method. --- dashboard/menu/menu.component.ts | 2 - monitor-admin/topic/indicators.component.html | 1025 ++++++++++------- monitor-admin/topic/indicators.component.ts | 130 ++- monitor-admin/topic/topic.component.ts | 30 +- monitor-admin/topic/topic.module.ts | 3 +- monitor-admin/utils/indicator-utils.ts | 10 + monitor/entities/stakeholder.ts | 1 + ...or-indicator-stakeholder-base.component.ts | 28 +- .../transition-group.component.ts | 16 +- 9 files changed, 758 insertions(+), 487 deletions(-) diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index d756a77f..9f89224b 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -372,10 +372,8 @@ export class MenuComponent implements OnInit { } public valueChange() { - this.elements.disable(); this.cdr.detectChanges(); this.elements.init(); - this.elements.enable(); } public get displayMenuItems() { diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 1f68e246..2b0a57c3 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -1,456 +1,657 @@
    -
    -
    Number Indicators
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - - - - -
    - +
    + +
    + -
    -
    {{indicator.name}}
    -
    - - -- -
    -
    - -
    - +
    + +
    -
    -
    - -
    -
    -
    -
    Chart Indicators
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - - - - -
    - +
    +
    -
    -
    -
    - {{indicator.name}} +
    +
    +
    +
    +
    + Create a custom indicator +
    +
    + Use our advance tool to create a custom Indicator that suit the needs of your + funding + KPI's. +
    +
    + +
    +
    +
    +
    - -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - Create a custom indicator -
    -
    - Use our advance tool to create a custom Indicator that suit the needs of your funding - KPI's. -
    -
    - -
    -
    -
    -
    +
    + +
    -
    -
    - -
    -
    + [large]="true" classTitle="uk-background-primary uk-light" + (alertOutput)="saveIndicator()" + [okDisabled]="numberIndicatorFb && (numberIndicatorFb.invalid || numberIndicatorFb.pristine)">
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    {{urlParameterizedMessage}}
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    -
    -
    - JSON Path -
    -
    -
    - This JSON path is not valid or the result has not been calculated yet. - Please press calculate on box below to see the result. -
    -
    -
    -
    -
    - - - - - - -
    -
    - -
    -
    +
    -
    - +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    {{ urlParameterizedMessage }}
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + JSON Path +
    +
    +
    + This JSON path is not valid or the result has not been calculated yet. + Please press calculate on box below to see the result. +
    +
    +
    +
    +
    + + + + + + +
    +
    + +
    +
    +
    + +
    +
    -
    -
    +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    {{urlParameterizedMessage}}
    + [okDisabled]="chartIndicatorFb && (chartIndicatorFb.invalid || chartIndicatorFb.pristine)"> +
    + +
    +
    +
    +
    +
    -
    - +
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    -
    - +
    -
    -
    - -
    -
    - + +
    +
    + +
    + You are about to delete + "{{ indicator.name ? indicator.name : (indicator.indicatorPaths[0]?.parameters?.title ? indicator.indicatorPaths[0].parameters.title : '') }} + " indicator permanently. +
    + Indicators of all profiles based on this default indicator, will be deleted as well. +
    + Are you sure you want to proceed? +
    - You are about to delete - "{{indicator.name ? indicator.name : (indicator.indicatorPaths[0]?.parameters?.title?indicator.indicatorPaths[0].parameters.title:'')}}" indicator permanently. -
    - Indicators of all profiles based on this default indicator, will be deleted as well. -
    - Are you sure you want to proceed? -
    -
    - -
    -
    - + +
    +
    + +
    + You are about to delete this section and its indicators permanently. +
    + Sections of all profiles based on this default section and their contents, will be deleted as well. +
    + Are you sure you want to proceed?
    - You are about to delete this section and its indicators permanently. -
    - Sections of all profiles based on this default section and their contents, will be deleted as well. -
    - Are you sure you want to proceed? -
    -
    -
    - +
    +
    + +
    -
    diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 62883ae6..42e85ddc 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -20,7 +20,7 @@ import { Visibility } from "../../monitor/entities/stakeholder"; import { - AbstractControl, + AbstractControl, FormArray, FormGroup, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, @@ -45,6 +45,7 @@ import {NotificationHandler} from "../../utils/notification-handler"; import {IndicatorStakeholderBaseComponent} from "../utils/stakeholder-base.component"; import {properties} from "../../../../environments/environment"; import {StatsProfilesService} from "../utils/services/stats-profiles.service"; +import {TransitionGroupComponent} from "../../utils/transition-group/transition-group.component"; declare var UIkit; declare var copy; @@ -101,6 +102,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple @ViewChild('editNumberNotify', {static: true}) editNumberNotify: NotifyFormComponent; @ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent; @ViewChild('deleteNotify', {static: true}) deleteNotify: NotifyFormComponent; + /* Transition Groups */ + @ViewChild('transitionGroup') transitionGroup: TransitionGroupComponent; public isFullscreen: boolean = false; @@ -266,7 +269,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple setNumbers() { this.numberSections = this.fb.array([]); this.numberResults.clear(); - let urls: Map = new Map(); + let urls: Map = new Map(); this.numbers.forEach((section, i) => { this.numberSections.push(this.fb.group({ _id: this.fb.control(section._id), @@ -278,11 +281,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple indicators: this.fb.control(section.indicators) })); section.indicators.forEach((number, j) => { - let url = this.indicatorUtils.getFullUrl(this.stakeholder, number.indicatorPaths[0]); - 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); + number.indicatorPaths.forEach((indicatorPath, k) => { + let url = this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath); + const pair = JSON.stringify([indicatorPath.source, url]); + const indexes = urls.get(pair) ? urls.get(pair) : []; + indexes.push([i, j, k]); + urls.set(pair, indexes); + }); }); }); this.numberSubscription.forEach(value => { @@ -304,10 +309,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); } - private calculateResults(response: any, indexes: [number, number][]) { - indexes.forEach(([i, j]) => { + private calculateResults(response: any, indexes: [number, number, number][]) { + indexes.forEach(([i, j, k]) => { let result = JSON.parse(JSON.stringify(response)); - this.numbers[i].indicators[j].indicatorPaths[0].jsonPath.forEach(jsonPath => { + this.numbers[i].indicators[j].indicatorPaths[k].jsonPath.forEach(jsonPath => { if (result) { result = result[jsonPath]; } @@ -320,7 +325,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } else { result = 0; } - this.numberResults.set(i + '-' + j, result); + this.numberResults.set(i + '-' + j + '-' + k, result); }); } @@ -367,6 +372,14 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple return this.chartIndicatorFb.get('indicatorPaths') as UntypedFormArray; } + public getActiveIndicatorPath(indicator: Indicator) { + if(indicator.activePath) { + return indicator.indicatorPaths[indicator.activePath]; + } else { + return indicator.indicatorPaths[0]; + } + } + public getNumberClassBySize(size: IndicatorSize) { if (size === 'small') { return 'uk-width-medium@m uk-width-1-1'; @@ -579,6 +592,65 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } } + public removeNumberIndicatorPath(index: number) { + this.numberIndicatorPaths.removeAt(index); + this.indicator.indicatorPaths.splice(index, 1); + this.transitionGroup.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.transitionGroup.init(); + if(this.indicator.activePath === index) { + this.activeChartIndicatorPath(Math.max(0, index - 1)); + } else if(this.indicator.activePath > index) { + this.activeChartIndicatorPath(this.indicator.activePath - 1); + } + this.chartIndicatorFb.markAsDirty(); + } + + public moveIndicatorPath(form: FormGroup, + indicatorPaths: FormArray, index: number, + newIndex: number = index - 1) { + this.transitionGroup.init(); + let a = indicatorPaths.at(index); + let b = indicatorPaths.at(newIndex); + indicatorPaths.setControl(index , b); + indicatorPaths.setControl(newIndex , a); + HelperFunctions.swap(this.indicator.indicatorPaths, index , newIndex); + if(this.indicator.activePath === index) { + this.indicator.activePath = newIndex; + } else if(this.indicator.activePath === newIndex) { + this.indicator.activePath = index; + } + form.markAsDirty(); + } + + public activeNumberIndicatorPath(index: number) { + let paths = this.numberIndicatorPaths; + if(index == paths.length) { + this.addNumberIndicatorPath(); + this.transitionGroup.init(); + } + this.indicator.activePath = index; + } + + public activeChartIndicatorPath(index: number) { + let paths = this.chartIndicatorPaths; + if(index == paths.length) { + this.addChartIndicatorPath(); + this.transitionGroup.init(); + } + this.indicator.activePath = index; + } + private getJsonPathAsFormArray(indicatorPath: IndicatorPath): UntypedFormArray { let jsonPath = this.fb.array([]); if (indicatorPath.jsonPath) { @@ -1273,25 +1345,29 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple if (chart.type == "chart") { indicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(chart.url), chart.url, chart.type, stakeholder); - for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts) { - for (let chart of section.indicators) { - if (JSON.stringify(chart.indicatorPaths[0].chartObject) == JSON.stringify(indicatorPath.chartObject)) { - duplicates++; - exists = true; - } - } - } + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => { + section.indicators.forEach(indicator => { + indicator.indicatorPaths.forEach(path => { + if (JSON.stringify(path.chartObject) == JSON.stringify(indicatorPath.chartObject)) { + duplicates++; + exists = true; + } + }); + }); + }); } else if (chart.type == "number") { indicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(chart.url), chart.url, stakeholder, chart.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(chart.url))); - for (let section of this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers) { - for (let chart of section.indicators) { - if (JSON.stringify(chart.indicatorPaths[0].chartObject) == JSON.stringify(indicatorPath.chartObject)) { - duplicates++; - exists = true; - } - } - } + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers.forEach((section: Section) => { + section.indicators.forEach(indicator => { + indicator.indicatorPaths.forEach(path => { + if (JSON.stringify(path.chartObject) == JSON.stringify(indicatorPath.chartObject)) { + duplicates++; + exists = true; + } + }); + }); + }); } if (!exists) { 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), [indicatorPath]); diff --git a/monitor-admin/topic/topic.component.ts b/monitor-admin/topic/topic.component.ts index b178eb46..40d128d8 100644 --- a/monitor-admin/topic/topic.component.ts +++ b/monitor-admin/topic/topic.component.ts @@ -242,30 +242,18 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } topicChanged(callback: Function, save: boolean = false) { - if(this.topics && save) { - this.topics.disable(); - } - if(this.categories) { - this.categories.disable(); - } - if(this.subCategories) { - this.subCategories.disable(); - } if(callback) { callback(); } this.cdr.detectChanges(); if(this.topics && save) { this.topics.init(); - this.topics.enable(); } if(this.categories) { this.categories.init(); - this.categories.enable(); } if(this.subCategories) { this.subCategories.init(); - this.subCategories.enable(); } } @@ -359,6 +347,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, this.stakeholder.topics.splice(this.index, 1); if(this.topicIndex === this.index) { this.chooseTopic(Math.max(0, this.index - 1)); + } else if(this.topicIndex > this.index) { + this.chooseTopic(this.topicIndex - 1); } }, true); }; @@ -388,23 +378,15 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } categoryChanged(callback: Function, save: boolean = false) { - if(this.categories && save) { - this.categories.disable(); - } - if(this.subCategories) { - this.subCategories.disable(); - } if(callback) { callback(); } this.cdr.detectChanges(); if(this.categories && save) { this.categories.init(); - this.categories.enable(); } if(this.subCategories) { this.subCategories.init(); - this.subCategories.enable(); } } @@ -500,6 +482,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, this.stakeholder.topics[this.topicIndex].categories.splice(this.index, 1); if(this.categoryIndex === this.index) { this.chooseCategory(Math.max(0, this.index - 1)); + } else if(this.categoryIndex > this.index) { + this.chooseCategory(this.categoryIndex - 1); } }, true); }; @@ -528,16 +512,12 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, } subCategoryChanged(callback: Function, save: boolean = false) { - if(this.subCategories && save) { - this.subCategories.disable(); - } if(callback) { callback(); } this.cdr.detectChanges(); if(this.subCategories && save) { this.subCategories.init(); - this.subCategories.enable(); } } @@ -640,6 +620,8 @@ export class TopicComponent extends StakeholderBaseComponent implements OnInit, this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories.splice(this.index, 1); if(this.subCategoryIndex === this.index) { this.chooseSubcategory(Math.max(0, this.index - 1)); + } else if(this.subCategoryIndex > this.index) { + this.chooseSubcategory(this.subCategoryIndex - 1); } }, true); }; diff --git a/monitor-admin/topic/topic.module.ts b/monitor-admin/topic/topic.module.ts index 71e9b9d9..4c887228 100644 --- a/monitor-admin/topic/topic.module.ts +++ b/monitor-admin/topic/topic.module.ts @@ -20,11 +20,12 @@ import {TransitionGroupModule} from "../../utils/transition-group/transition-gro import {NumberRoundModule} from "../../utils/pipes/number-round.module"; import {SideBarModule} from "../../dashboard/sharedComponents/sidebar/sideBar.module"; import {SidebarMobileToggleModule} from "../../dashboard/sharedComponents/sidebar/sidebar-mobile-toggle/sidebar-mobile-toggle.module"; +import {SliderTabsModule} from "../../sharedComponents/tabs/slider-tabs.module"; @NgModule({ imports: [ CommonModule, TopicRoutingModule, ClickModule, RouterModule, FormsModule, AlertModalModule, - ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule, LogoUrlPipeModule, TransitionGroupModule, NumberRoundModule, SideBarModule, SidebarMobileToggleModule + ReactiveFormsModule, InputModule, IconsModule, PageContentModule, LoadingModule, NotifyFormModule, LogoUrlPipeModule, TransitionGroupModule, NumberRoundModule, SideBarModule, SidebarMobileToggleModule, SliderTabsModule ], declarations: [ TopicComponent, IndicatorsComponent diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 9360c228..832b4894 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -55,6 +55,8 @@ 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; } export class StakeholderUtils { @@ -82,6 +84,14 @@ export class StakeholderUtils { return StakeholderConfiguration.CACHE_INDICATORS; } + get hasMultiNumberIndicatorPaths() { + return StakeholderConfiguration.NUMBER_MULTI_INDICATOR_PATHS; + } + + get hasMultiChartIndicatorPaths() { + return StakeholderConfiguration.CHART_MULTI_INDICATOR_PATHS; + } + visibilityIcon: Map = new Map(this.visibilities.map(option => [option.value, option.icon])); defaultValue(options: Option[]) { diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 49c8e755..a33506ac 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -183,6 +183,7 @@ export class Indicator { visibility: Visibility; defaultId: string; indicatorPaths: IndicatorPath[]; + activePath: number = 0; overlay: Overlay = false; constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) { diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index 4573dee4..8838d202 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -214,15 +214,17 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator (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(); + let urls: Map = new Map(); this.activeSubCategory.numbers.forEach((section, i) => { section.indicators.forEach((number, j) => { if (this.hasPermission(number.visibility)) { - let url = this.getFullUrl(number.indicatorPaths[0]); - 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); + number.indicatorPaths.forEach((indicatorPath, k) => { + let url = this.getFullUrl(indicatorPath); + const pair = JSON.stringify([indicatorPath.source, url]); + const indexes = urls.get(pair) ? urls.get(pair) : []; + indexes.push([i, j, k]); + urls.set(pair, indexes); + }) } }); }); @@ -231,10 +233,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator 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]) => { + indexes.forEach(([i, j, k]) => { 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 => { + this.activeSubCategory.numbers[i].indicators[j].indicatorPaths[k].jsonPath.forEach(jsonPath => { if (result) { result = result[jsonPath]; } @@ -247,7 +249,7 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator } else { result = 0; } - this.numberResults.set(i + '-' + j, result); + this.numberResults.set(i + '-' + j + '-' + k, result); } }); } @@ -255,10 +257,10 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator }); 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]); - } + indicator.indicatorPaths.forEach((indicatorPath, k) => { + indicator.indicatorPaths[k].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[k]); + this.chartsActiveType.set(i + '-' + j + '-' + k, indicator.indicatorPaths[k]); + }); }); }); if (this.cdr && !(this.cdr as ViewRef).destroyed) { diff --git a/utils/transition-group/transition-group.component.ts b/utils/transition-group/transition-group.component.ts index 53530868..8cea910d 100644 --- a/utils/transition-group/transition-group.component.ts +++ b/utils/transition-group/transition-group.component.ts @@ -1,6 +1,6 @@ import {TransitionGroupItemDirective} from "./transition-group-item.directive"; import { - AfterViewInit, + AfterViewInit, ChangeDetectorRef, Component, ContentChildren, ElementRef, Input, @@ -29,15 +29,14 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy { @ContentChildren(TransitionGroupItemDirective) items: QueryList; @Input() public id: string; - private disabled: boolean = false; + public size: number; private subscription: Subscription; constructor(public element: ElementRef) {} ngAfterViewInit() { - this.init(); this.subscription = this.items.changes.subscribe(items => { - if(!this.disabled) { + if(items.length === this.size) { items.forEach(item => item.prevPos = item.newPos || item.prevPos); items.forEach(this.runCallback); this.refreshPosition('newPos'); @@ -80,6 +79,7 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy { init() { this.refreshPosition('prevPos'); this.refreshPosition('newPos'); + this.size = this.items.length; } runCallback(item: TransitionGroupItemDirective) { @@ -126,17 +126,17 @@ export class TransitionGroupComponent implements AfterViewInit, OnDestroy { /** * Enable transition - * + * @deprecated * */ enable() { - this.disabled = false; + console.debug('Deprecated') } /** * Disable transition - * + * @deprecated * */ disable() { - this.disabled = true; + console.debug('Deprecated') } } -- 2.17.1 From e91830f2f8c1182c6e728f87a03af3a2932d816e Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 5 Apr 2024 20:31:29 +0300 Subject: [PATCH 62/93] [develop]: Monitor base component delete chartsActiveType --- .../monitor-indicator-stakeholder-base.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monitor/monitor-indicator-stakeholder-base.component.ts b/monitor/monitor-indicator-stakeholder-base.component.ts index 8838d202..c6d388e3 100644 --- a/monitor/monitor-indicator-stakeholder-base.component.ts +++ b/monitor/monitor-indicator-stakeholder-base.component.ts @@ -53,7 +53,6 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator minYear = Dates.currentYear - 20; maxYear = Dates.currentYear; public numberResults: Map = new Map(); - public chartsActiveType: Map = new Map(); public clipboard; /** Services */ @@ -259,7 +258,6 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator section.indicators.forEach((indicator, j) => { indicator.indicatorPaths.forEach((indicatorPath, k) => { indicator.indicatorPaths[k].safeResourceUrl = this.getUrlByStakeHolder(indicator.indicatorPaths[k]); - this.chartsActiveType.set(i + '-' + j + '-' + k, indicator.indicatorPaths[k]); }); }); }); @@ -273,10 +271,12 @@ export abstract class MonitorIndicatorStakeholderBaseComponent extends Indicator this.indicatorUtils.getChartUrl(indicatorPath.source, this.getFullUrl(indicatorPath))); } - 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); + public getActiveIndicatorPath(indicator: Indicator) { + if(indicator.activePath) { + return indicator.indicatorPaths[indicator.activePath]; + } else { + return indicator.indicatorPaths[0]; + } } public filter() { -- 2.17.1 From 4f10c5c5f4a42629ac4eb13f3a1e3977ab353b86 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Sat, 6 Apr 2024 03:10:51 +0300 Subject: [PATCH 63/93] [develop]: Align import/export indicators with multi indicator paths. --- monitor-admin/topic/indicators.component.html | 2 - monitor-admin/topic/indicators.component.ts | 306 +++++++++--------- 2 files changed, 158 insertions(+), 150 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 2b0a57c3..69abb1dd 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -339,7 +339,6 @@
    -
    {{ urlParameterizedMessage }}
    diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index 42e85ddc..9be745ae 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -97,7 +97,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public sectionTypeToDelete: string; public sectionChildrenActionOnDelete: string; public indicatorChildrenActionOnDelete: string; - public urlParameterizedMessage = null; private notification: Notification; @ViewChild('editNumberNotify', {static: true}) editNumberNotify: NotifyFormComponent; @ViewChild('editChartNotify', {static: true}) editChartNotify: NotifyFormComponent; @@ -210,11 +209,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.reorderIndicators(section._id, 'number', callback(list)); })); this.subscriptions.push(UIkit.util.on(document, 'added', '#number-' + section._id, (list): void => { - this.to.next({id: section._id, indicators: callback(list)}); + this.to.next({id: section._id, indicators: callback(list)}); })); this.subscriptions.push(UIkit.util.on(document, 'removed', '#number-' + section._id, (list): void => { let sub = this.to.asObservable().subscribe(to => { - if(to) { + if (to) { let from: SectionInfo = {id: section._id, indicators: callback(list)}; this.moveIndicator({target: list.detail[1].id, from: from, to: to}); setTimeout(() => { @@ -232,7 +231,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple //callback(list, "chart", 'added'); })); this.subscriptions.push(UIkit.util.on(document, 'removed', '#chart-' + section._id, (list): void => { - // callback(list, "chart", 'removed'); + // callback(list, "chart", 'removed'); })); }); } @@ -331,8 +330,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple get charts(): Section[] { if (this.stakeholder.topics[this.topicIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]) { + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]) { return this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex].charts; } else { return []; @@ -341,8 +340,8 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple get numbers(): Section[] { if (this.stakeholder.topics[this.topicIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]) { + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex]) { return this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex].numbers; } else { return []; @@ -359,9 +358,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple get canEdit() { return this.stakeholder && - this.stakeholder.topics[this.topicIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && - this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] && !this.loading; + this.stakeholder.topics[this.topicIndex] && + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex] && + this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.subcategoryIndex] && !this.loading; } public get numberIndicatorPaths(): UntypedFormArray { @@ -373,7 +372,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } public getActiveIndicatorPath(indicator: Indicator) { - if(indicator.activePath) { + if (indicator.activePath) { return indicator.indicatorPaths[indicator.activePath]; } else { return indicator.indicatorPaths[0]; @@ -476,7 +475,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } public getParameters(index: number, type: IndicatorType = 'chart'): UntypedFormArray { - if(type === 'chart') { + if (type === 'chart') { return this.chartIndicatorPaths.at(index).get('parameters') as UntypedFormArray; } else { return this.numberIndicatorPaths.at(index).get('parameters') as UntypedFormArray; @@ -489,7 +488,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple private getSecureUrlByStakeHolder(indicatorPath: IndicatorPath) { return this.sanitizer.bypassSecurityTrustResourceUrl( - this.indicatorUtils.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath))); + this.indicatorUtils.getChartUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath))); } private getUrlByStakeHolder(indicatorPath: IndicatorPath) { @@ -501,13 +500,13 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple jsonPath.push(this.fb.control('', Validators.required)); } this.numberIndicatorPaths.push(this.fb.group({ - url: this.fb.control(url, [Validators.required, StringUtils.urlValidator()]), - jsonPath: jsonPath, - result: this.fb.control(0, Validators.required), - source: this.fb.control(source, Validators.required), - parameters: parameters, - format: this.fb.control(format, Validators.required) - } + url: this.fb.control(url, [Validators.required, StringUtils.urlValidator()]), + jsonPath: jsonPath, + result: this.fb.control(0, Validators.required), + source: this.fb.control(source, Validators.required), + parameters: parameters, + format: this.fb.control(format, Validators.required) + } )); let index = this.numberIndicatorPaths.length - 1; if (this.numberIndicatorPaths.at(index).get('url').valid) { @@ -515,45 +514,43 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } if (this.indicator.defaultId === null) { this.subscriptions.push(this.numberIndicatorPaths.at(index).get('url').valueChanges.subscribe(value => { - this.numberIndicatorPaths.at(index).get('result').setValue(null); - if (this.numberIndicatorPaths.at(index).get('url').valid) { - let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value))); - if (this.indicator.indicatorPaths[index]) { - this.indicator.indicatorPaths[index] = indicatorPath; - } else { - this.indicator.indicatorPaths.push(indicatorPath); - } - if (indicatorPath.source) { - this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source); - } - (this.numberIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); - if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) { - let paths = indicatorPath.jsonPath; - for (let i = 0; i < paths.length; i++) { - if (i == this.getJsonPath(index).length) { - this.getJsonPath(index).push(this.fb.control('', Validators.required)); - } + this.numberIndicatorPaths.at(index).get('result').setValue(null); + if (this.numberIndicatorPaths.at(index).get('url').valid) { + let indicatorPath: IndicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(value), value, this.stakeholder, this.numberIndicatorPaths.at(index).get('jsonPath').value, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(value))); + if (this.indicator.indicatorPaths[index]) { + this.indicator.indicatorPaths[index] = indicatorPath; + } else { + this.indicator.indicatorPaths.push(indicatorPath); + } + if (indicatorPath.source) { + this.numberIndicatorPaths.at(index).get('source').setValue(indicatorPath.source); + } + (this.numberIndicatorPaths.at(index) as UntypedFormGroup).setControl('parameters', this.getParametersAsFormArray(indicatorPath)); + if (indicatorPath.jsonPath.length > 1 && this.getJsonPath(index).length == 1) { + let paths = indicatorPath.jsonPath; + for (let i = 0; i < paths.length; i++) { + if (i == this.getJsonPath(index).length) { + this.getJsonPath(index).push(this.fb.control('', Validators.required)); + } + } + this.getJsonPath(index).setValue(paths) } - this.getJsonPath(index).setValue(paths) } - } else { - this.urlParameterizedMessage = null; - } - }) + }) ); this.subscriptions.push(this.numberIndicatorPaths.at(index).get('jsonPath').valueChanges.subscribe(value => { - if (this.indicator.indicatorPaths[index]) { - this.indicator.indicatorPaths[index].jsonPath = value; - } - this.numberIndicatorPaths.at(index).get('result').setValue(null); - }) + if (this.indicator.indicatorPaths[index]) { + this.indicator.indicatorPaths[index].jsonPath = value; + } + this.numberIndicatorPaths.at(index).get('result').setValue(null); + }) ); this.subscriptions.push(this.numberIndicatorPaths.at(index).get('source').valueChanges.subscribe(value => { - if (this.indicator.indicatorPaths[index]) { - this.indicator.indicatorPaths[index].source = value; - } - }) + if (this.indicator.indicatorPaths[index]) { + this.indicator.indicatorPaths[index].source = value; + } + }) ); } else { this.numberIndicatorPaths.at(index).get('url').disable(); @@ -564,10 +561,10 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public addChartIndicatorPath(value: string = '', parameters: UntypedFormArray = new UntypedFormArray([]), disableUrl: boolean = false, type: string = null) { this.chartIndicatorPaths.push(this.fb.group({ - url: this.fb.control(value, [Validators.required, StringUtils.urlValidator()]), - parameters: parameters, - type: this.fb.control(type) - } + url: this.fb.control(value, [Validators.required, StringUtils.urlValidator()]), + parameters: parameters, + type: this.fb.control(type) + } )); let index = this.chartIndicatorPaths.length - 1; if (disableUrl) { @@ -585,8 +582,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple indicatorPath.safeResourceUrl = this.indicator.indicatorPaths[index].safeResourceUrl; this.indicator.indicatorPaths[index] = indicatorPath; } - } else { - this.urlParameterizedMessage = null; } })); } @@ -596,9 +591,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.numberIndicatorPaths.removeAt(index); this.indicator.indicatorPaths.splice(index, 1); this.transitionGroup.init(); - if(this.indicator.activePath === index) { + if (this.indicator.activePath === index) { this.activeNumberIndicatorPath(Math.max(0, index - 1)); - } else if(this.indicator.activePath > index) { + } else if (this.indicator.activePath > index) { this.activeNumberIndicatorPath(this.indicator.activePath - 1); } this.numberIndicatorFb.markAsDirty(); @@ -608,9 +603,9 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.chartIndicatorPaths.removeAt(index); this.indicator.indicatorPaths.splice(index, 1); this.transitionGroup.init(); - if(this.indicator.activePath === index) { + if (this.indicator.activePath === index) { this.activeChartIndicatorPath(Math.max(0, index - 1)); - } else if(this.indicator.activePath > index) { + } else if (this.indicator.activePath > index) { this.activeChartIndicatorPath(this.indicator.activePath - 1); } this.chartIndicatorFb.markAsDirty(); @@ -622,12 +617,12 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.transitionGroup.init(); let a = indicatorPaths.at(index); let b = indicatorPaths.at(newIndex); - indicatorPaths.setControl(index , b); - indicatorPaths.setControl(newIndex , a); - HelperFunctions.swap(this.indicator.indicatorPaths, index , newIndex); - if(this.indicator.activePath === index) { + indicatorPaths.setControl(index, b); + indicatorPaths.setControl(newIndex, a); + HelperFunctions.swap(this.indicator.indicatorPaths, index, newIndex); + if (this.indicator.activePath === index) { this.indicator.activePath = newIndex; - } else if(this.indicator.activePath === newIndex) { + } else if (this.indicator.activePath === newIndex) { this.indicator.activePath = index; } form.markAsDirty(); @@ -635,7 +630,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public activeNumberIndicatorPath(index: number) { let paths = this.numberIndicatorPaths; - if(index == paths.length) { + if (index == paths.length) { this.addNumberIndicatorPath(); this.transitionGroup.init(); } @@ -644,7 +639,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple public activeChartIndicatorPath(index: number) { let paths = this.chartIndicatorPaths; - if(index == paths.length) { + if (index == paths.length) { this.addChartIndicatorPath(); this.transitionGroup.init(); } @@ -684,7 +679,21 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } public editNumberIndicatorOpen(section: Section, id = null) { - this.urlParameterizedMessage = null; + this.editNumberModal.cancelButtonText = 'Cancel'; + this.editNumberModal.okButtonLeft = false; + this.editNumberModal.alertMessage = false; + if (this.index === -1) { + this.editNumberModal.alertTitle = 'Create a new number indicator'; + this.editNumberModal.okButtonText = 'Save'; + this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); + this.editNumberNotify.reset(this.notification.message); + } else { + this.editNumberModal.alertTitle = 'Edit number indicator\'s information'; + this.editNumberModal.okButtonText = 'Save Changes'; + this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); + this.editNumberNotify.reset(this.notification.message); + } + this.editNumberModal.stayOpen = true; this.section = section; this.index = (id) ? section.indicators.findIndex(value => value._id === id) : -1; if (this.index !== -1) { @@ -726,26 +735,26 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.numberIndicatorFb.get('description').disable(); }, 0); } - this.editNumberModal.cancelButtonText = 'Cancel'; - this.editNumberModal.okButtonLeft = false; - this.editNumberModal.alertMessage = false; - if (this.index === -1) { - this.editNumberModal.alertTitle = 'Create a new number indicator'; - this.editNumberModal.okButtonText = 'Save'; - this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); - this.editNumberNotify.reset(this.notification.message); - } else { - this.editNumberModal.alertTitle = 'Edit number indicator\'s information'; - this.editNumberModal.okButtonText = 'Save Changes'; - this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); - this.editNumberNotify.reset(this.notification.message); - } - this.editNumberModal.stayOpen = true; this.editNumberModal.open(); } public editChartIndicatorOpen(section: Section, id = null) { - this.urlParameterizedMessage = null; + this.editChartModal.cancelButtonText = 'Cancel'; + this.editChartModal.okButtonLeft = false; + this.editChartModal.alertMessage = false; + if (this.index === -1) { + this.editChartModal.alertTitle = 'Create a new chart indicator'; + this.editChartModal.okButtonText = 'Save'; + this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); + this.editChartNotify.reset(this.notification.message); + } else { + this.editChartModal.alertTitle = 'Edit chart indicator\'s information'; + this.editChartModal.okButtonText = 'Save Changes'; + this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); + ; + this.editChartNotify.reset(this.notification.message); + } + this.editChartModal.stayOpen = true; this.urlSubscriptions.forEach(value => { if (value instanceof Subscriber) { value.unsubscribe(); @@ -769,7 +778,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); this.indicator.indicatorPaths.forEach(indicatorPath => { this.addChartIndicatorPath(this.getUrlByStakeHolder(indicatorPath), - this.getParametersAsFormArray(indicatorPath), this.indicator.defaultId !== null, indicatorPath.type); + this.getParametersAsFormArray(indicatorPath), this.indicator.defaultId !== null, indicatorPath.type); indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); }); } else { @@ -792,22 +801,6 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.chartIndicatorFb.get('description').disable(); }, 0); } - this.editChartModal.cancelButtonText = 'Cancel'; - this.editChartModal.okButtonLeft = false; - this.editChartModal.alertMessage = false; - if (this.index === -1) { - this.editChartModal.alertTitle = 'Create a new chart indicator'; - this.editChartModal.okButtonText = 'Save'; - this.notification = NotificationUtils.createIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); - this.editChartNotify.reset(this.notification.message); - } else { - this.editChartModal.alertTitle = 'Edit chart indicator\'s information'; - this.editChartModal.okButtonText = 'Save Changes'; - this.notification = NotificationUtils.editIndicator(this.user.firstname + ' ' + this.user.lastname, this.stakeholder.name); - ; - this.editChartNotify.reset(this.notification.message); - } - this.editChartModal.stayOpen = true; this.editChartModal.open(); } @@ -907,7 +900,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.setCharts(); this.setNumbers(); this.initReorder(); - if(properties.notificationsAPIURL) { + if (properties.notificationsAPIURL) { this.notification = NotificationUtils.importIndicators(this.user.fullname, this.stakeholder.alias); this.notification.entity = this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index]._id; this.notification.name = this.user.firstname; @@ -999,7 +992,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple hasDifference(index: number, type: IndicatorType = 'chart'): boolean { let hasDifference = false; - if(type === 'chart') { + if (type === 'chart') { this.chartIndicatorPaths.at(index).value.parameters.forEach(parameter => { if (parameter.value !== this.indicator.indicatorPaths[index].parameters[parameter.key]) { hasDifference = true; @@ -1008,7 +1001,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple }); return hasDifference || this.indicator.indicatorPaths[index].safeResourceUrl.toString() !== this.getSecureUrlByStakeHolder(this.indicator.indicatorPaths[index]).toString(); - } else if(type === 'number') { + } 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]) { @@ -1029,12 +1022,12 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } refreshIndicator(type: IndicatorType = 'chart') { - if(type === 'chart') { + if (type === 'chart') { this.indicator = this.indicatorUtils.generateIndicatorByForm(this.chartIndicatorFb.value, this.indicator.indicatorPaths, 'chart'); this.indicator.indicatorPaths.forEach(indicatorPath => { indicatorPath.safeResourceUrl = this.getSecureUrlByStakeHolder(indicatorPath); }); - } else if(type === 'number') { + } else if (type === 'number') { this.indicator = this.indicatorUtils.generateIndicatorByForm(this.numberIndicatorFb.value, this.indicator.indicatorPaths, 'number'); this.indicator.indicatorPaths.forEach((indicatorPath, index) => { this.validateJsonPath(index); @@ -1293,6 +1286,11 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple 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; } @@ -1300,7 +1298,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple importIndicatorsAndSave(stakeholder: Stakeholder, charts: any[]) { let sectionsToSave: Section[] = []; let countIndicators = 0; - if(stakeholder.type !== this.stakeholder.type) { + if (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, @@ -1313,23 +1311,25 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple let duplicates = 0; charts = this.migrateFromOldImportJsonFile(charts); for (let chart of charts) { - chart.visibility = this.showVisibility?chart.visibility:this.stakeholderUtils.defaultValue(this.stakeholderUtils.visibilities); + 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']); sectionToSave.indicators = []; sectionsToSave[chart['sectionIndex']] = sectionToSave; } let exists = false; - let indicatorPath; + let indicatorPaths: IndicatorPath[] = []; // validate indicators' schema from file let invalid_file_message; if (!chart.type) { invalid_file_message = "No indicator type is specified. Type should be chart or number."; } else if (chart.type != "chart" && chart.type != "number") { invalid_file_message = "Invalid indicator type. Type should be chart or number."; - } else if (chart.type == "number" && !chart.jsonPath) { + } else if (chart.indicatorPaths.length === 0) { + invalid_file_message = "No indicator paths are specified." + } else if (chart.type == "number" && chart.indicatorPaths.filter(path => !path.jsonPath).length > 0) { invalid_file_message = "No jsonPath is specified for number indicator." - } else if (!chart.url) { + } else if (chart.indicatorPaths.filter(path => !path.url).length > 0) { invalid_file_message = "No indicator url is specified."; } @@ -1344,33 +1344,38 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } if (chart.type == "chart") { - indicatorPath = this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(chart.url), chart.url, chart.type, stakeholder); + indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder)); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => { section.indicators.forEach(indicator => { indicator.indicatorPaths.forEach(path => { - if (JSON.stringify(path.chartObject) == JSON.stringify(indicatorPath.chartObject)) { - duplicates++; + let size = indicatorPaths.length; + indicatorPaths = indicatorPaths.filter(indicatorPath => JSON.stringify(path.chartObject) !== JSON.stringify(indicatorPath.chartObject)) + if (indicatorPaths.length < size) { + duplicates = duplicates + (size - indicatorPaths.length); exists = true; } }); }); }); } else if (chart.type == "number") { - indicatorPath = this.indicatorUtils.generateIndicatorByNumberUrl(this.indicatorUtils.getNumberSource(chart.url), chart.url, stakeholder, - chart.jsonPath, this.indicatorUtils.numberSources.get(this.indicatorUtils.getNumberSource(chart.url))); + indicatorPaths = chart.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)))); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].numbers.forEach((section: Section) => { section.indicators.forEach(indicator => { indicator.indicatorPaths.forEach(path => { - if (JSON.stringify(path.chartObject) == JSON.stringify(indicatorPath.chartObject)) { - duplicates++; + let size = indicatorPaths.length; + indicatorPaths = indicatorPaths.filter(indicatorPath => JSON.stringify(path.chartObject) !== JSON.stringify(indicatorPath.chartObject)) + if (indicatorPaths.length < size) { + duplicates = duplicates + (size - indicatorPaths.length); exists = true; } }); }); }); } - if (!exists) { - 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), [indicatorPath]); + 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); countIndicators++; } @@ -1402,36 +1407,41 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple let indexIndicator: number = 0; this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].numbers.forEach(section => { section.indicators.forEach(indicator => { - indicator.indicatorPaths.forEach(indicatorPath => { - indicators[indexIndicator] = { - "type": indicator.type, "name": indicator.name, "jsonPath": indicatorPath.jsonPath, - "description": indicator.description, "additionalDescription": indicator.additionalDescription, - "visibility": indicator.visibility, "width": indicator.width, "height": indicator.height, - "url": this.indicatorUtils.getNumberUrl(indicatorPath.source, this.indicatorUtils.getFullUrl(this.stakeholder, indicatorPath)), - "sectionTitle": section.title, - "sectionType": section.type, - "sectionIndex": index - }; - indexIndicator++; - }); + indicators[indexIndicator] = { + "indicatorPaths": indicator.indicatorPaths.map(path => { + return { + jsonPath: path.jsonPath, + url: this.indicatorUtils.getNumberUrl(path.source, this.indicatorUtils.getFullUrl(this.stakeholder, path)) + } + }), + "type": indicator.type, "name": indicator.name, + "description": indicator.description, "additionalDescription": indicator.additionalDescription, + "visibility": indicator.visibility, "width": indicator.width, "height": indicator.height, + "sectionTitle": section.title, + "sectionType": section.type, + "sectionIndex": index + }; + indexIndicator++; }); index++; }); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[subcategoryIndex].charts.forEach(section => { section.indicators.forEach(indicator => { - indicator.indicatorPaths.forEach(indicatorPath => { - indicators[indexIndicator] = { - "type": indicator.type, "name": indicator.name, - "description": indicator.description, "additionalDescription": indicator.additionalDescription, - "visibility": indicator.visibility, "width": indicator.width, "height": indicator.height, - "url": this.getUrlByStakeHolder(indicatorPath), - "sectionTitle": section.title, - "sectionType": section.type, - "sectionIndex": index - }; - indexIndicator++; - }); + indicators[indexIndicator] = { + "indicatorPaths": indicator.indicatorPaths.map(path => { + return { + url: this.getUrlByStakeHolder(path) + } + }), + "type": indicator.type, "name": indicator.name, + "description": indicator.description, "additionalDescription": indicator.additionalDescription, + "visibility": indicator.visibility, "width": indicator.width, "height": indicator.height, + "sectionTitle": section.title, + "sectionType": section.type, + "sectionIndex": index + }; + indexIndicator++; }); index++; @@ -1491,7 +1501,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple this.makeFileRequest(this.properties.utilsService + '/upload?type=json', [], this.filesToUpload).then(async (result: string) => { let json = JSON.parse(result); // validate file - if(json && Array.isArray(json)) { + if (json && Array.isArray(json)) { UIkit.notification("This file is not supported any more. Please export indicators and try again!", { status: 'danger', timeout: 6000, -- 2.17.1 From 69cdb2cec2001ece062af3b2b629d2ce9cdf4867 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 8 Apr 2024 14:14:09 +0300 Subject: [PATCH 64/93] [develop]: Add roles in stakeholder configuration to handle naming of roles in different services. --- .../role-users/role-users.component.html | 22 +++++++++---------- .../users/role-users/role-users.component.ts | 17 +++++++++----- monitor-admin/utils/indicator-utils.ts | 10 +++++++++ .../role-verification.component.ts | 6 +++-- utils/email/composer.ts | 7 +++--- 5 files changed, 41 insertions(+), 21 deletions(-) diff --git a/dashboard/users/role-users/role-users.component.html b/dashboard/users/role-users/role-users.component.html index 6fb1d94f..88befe57 100644 --- a/dashboard/users/role-users/role-users.component.html +++ b/dashboard/users/role-users/role-users.component.html @@ -8,26 +8,26 @@
    + [searchControl]="filterForm.get('active')" [expandable]="true" [placeholder]="'Search ' + stakeholderUtils.roles[role] + 's'" searchInputClass="outer">
    -

    -
    +

    Profiles

    { - if (key == "index_name") { - indicatorPath.parameters[key] = funder.index_name; - } else if (key == "index_id") { - indicatorPath.parameters[key] = funder.index_id; - } else if (key == "index_shortName") { - indicatorPath.parameters[key] = funder.index_shortName.toLowerCase(); - } - }); - } - } - } - section.indicators = chartsTokeep; - } - for (let section of subCategory.numbers) { - section.defaultId = !isDefault ? section._id : null; - section.stakeholderAlias = funder.alias; - section._id = null; - for (let indicator of section.indicators) { - indicator.defaultId = !isDefault ? indicator._id : null; - indicator._id = null; - } - } - - } - category.subCategories = subTokeep; - } - } - return funder; - } aliasValidatorString(elements: string[]): ValidatorFn { return (control: AbstractControl): { [key: string]: string } | null => { diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index a33506ac..a1670174 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -37,6 +37,7 @@ export class Stakeholder { isUpload: boolean = false; description: string; topics: any[]; + copy: boolean = true; details?: any; constructor(_id: string, type: StakeholderType, index_id: string, index_name: string, index_shortName: string, alias: string, visibility: Visibility, logoUrl: string, defaultId: string = null, description: string = null) { @@ -50,6 +51,7 @@ export class Stakeholder { this.visibility = visibility; this.logoUrl = logoUrl; this.description = description; + this.copy = !!this.defaultId && this.defaultId !== '-1'; this.topics = []; } diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index d8b8bf30..4c597cd2 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -116,11 +116,15 @@ export class StakeholderService { })); } - buildStakeholder(url: string, stakeholder: Stakeholder): Observable { + buildStakeholder(url: string, stakeholder: Stakeholder, copyId: string): Observable { if (stakeholder.alias && stakeholder.alias.startsWith('/')) { stakeholder.alias = stakeholder.alias.slice(1); } - return this.http.post(url + '/build-stakeholder', stakeholder, CustomOptions.registryOptions()).pipe(map(stakeholder => { + let copy = { + stakeholder: stakeholder, + copyId: copyId + } + return this.http.post(url + '/build-stakeholder', copy, CustomOptions.registryOptions()).pipe(map(stakeholder => { return HelperFunctions.copy(Stakeholder.checkIsUpload(stakeholder)); })); } @@ -129,12 +133,12 @@ export class StakeholderService { return this.http.post(url + '/' + path.join('/') + '/change-visibility' + '?visibility=' + visibility + (propagate ? '&propagate=true' : ''), null, CustomOptions.registryOptions()); } - saveElement(url: string, element: any, path: string[] = []): Observable { + 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('/') + - '/save', element, CustomOptions.registryOptions()).pipe(map(element => { + '/save' + (isFull?'/full':''), element, CustomOptions.registryOptions()).pipe(map(element => { if (path.length === 0) { return HelperFunctions.copy(Stakeholder.checkIsUpload(element)); } else { -- 2.17.1 From 438075f8dfca0d78ec9985e08572fd7d2b40ab18 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 12 Apr 2024 11:19:17 +0300 Subject: [PATCH 73/93] [develop | DONE | FIXED]: Fixes on search projects for claims. 1. searchProjects.service.ts: Parse funder name if funder shortname is not available. 2. claimProjectSearchForm.component.ts: a. [BUG FIX] Set filter.countAllValues = filter.values.length; to show filter values without extra "view all" call b. [BUG FIX] Call projectService.advancedSearchProjects instead of projectService.searchProjects to get projects (/resources2 instead of /projects) to get 100 first values by default in facets. --- .../claimProjectSearchForm.component.ts | 98 ++++++++++--------- services/searchProjects.service.ts | 2 +- 2 files changed, 53 insertions(+), 47 deletions(-) diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 01e6d8c0..27ec74d5 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -65,35 +65,36 @@ export class ClaimProjectsSearchFormComponent { } search(page,size) { - if(this.keyword.length == 0){ - this.showResults =false; + if (this.keyword.length == 0) { + this.showResults = false; return; } - this.showResults =true; + this.showResults = true; this.openaireResults = []; this.openaireResultsStatus = this.errorCodes.LOADING; this.prevFilters = this.filters; //searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any { - this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( + this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, (page == 1) ? this.refineFieldsQuery : null, (page == 1) ? this.refineFields : [], this.createOpenaireRefineQuery()).subscribe( + // this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( data => { - if(data != null) { - this.openaireResultsPage=page; - this.openaireResultsNum = data[0]; - this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties); - if(data[2] && data[2].length > 0){ - this.filters = this.checkSelectedFilters( data[2], this.prevFilters); - } - - this.openaireResultsStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireResultsStatus = this.errorCodes.NONE; - this.filters = this.checkSelectedFilters( [], this.prevFilters); - } - }else { - this.openaireResultsStatus = this.errorCodes.ERROR; + if (data != null) { + this.openaireResultsPage = page; + this.openaireResultsNum = data[0]; + this.openaireResults = ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties); + if (data[2] && data[2].length > 0) { + this.filters = this.checkSelectedFilters(data[2], this.prevFilters); } - }, + + this.openaireResultsStatus = this.errorCodes.DONE; + if (this.openaireResultsNum == 0) { + this.openaireResultsStatus = this.errorCodes.NONE; + this.filters = this.checkSelectedFilters([], this.prevFilters); + } + } else { + this.openaireResultsStatus = this.errorCodes.ERROR; + } + }, err => { this.openaireResultsStatus = this.errorCodes.ERROR; //console.log(err.status); @@ -202,12 +203,16 @@ export class ClaimProjectsSearchFormComponent { } - createOpenaireQueryParams():string { + createOpenaireQueryParams(): string { let query = ""; - if(this.keyword.length > 0){ - query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); + if (this.keyword.length > 0) { + // query += "q=" + StringUtils.quote(StringUtils.URIEncode(this.keyword)); + query += StringUtils.quote(StringUtils.URIEncode(this.keyword)); } + return query; + } + createOpenaireRefineQuery(): string { /*if(this.startYear.length > 0 ){ query+='&fq=projectstartyear exact \"'+this.startYear+'\"' } @@ -215,30 +220,30 @@ export class ClaimProjectsSearchFormComponent { query+='&fq=projectendyear exact \"'+this.endYear+'\"' }*/ let allFqs = ""; - for (let filter of this.filters){ - if(filter.countSelectedValues > 0){ - let count_selected=0; + for (let filter of this.filters) { + if (filter.countSelectedValues > 0) { + let count_selected = 0; let fq = ""; - for (let value of filter.values){ - if(value.selected == true){ + for (let value of filter.values) { + if (value.selected == true) { count_selected++; - fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + (StringUtils.quote(value.id)); + fq += (fq.length > 0 ? " " + filter.filterOperator + " " : "") + filter.filterId + " exact " + (StringUtils.quote(value.id)); } } - if(count_selected > 0){ - fq="&fq="+StringUtils.URIEncode(fq); + if (count_selected > 0) { + fq = "&fq=" + StringUtils.URIEncode(fq); allFqs += fq; } } } - for (let i=0; i=" ,"<=", "and" ) + allFqs += NewSearchPageComponent.createRangeFilterQuery(this.rangeFields[i], filter.selectedFromValue, filter.selectedToValue, " within ", ">=", "<=", "and") } - return query+allFqs; - + return allFqs + "&type=projects"; } + public yearChanged() { this.search(this.page, this.size); @@ -273,20 +278,21 @@ export class ClaimProjectsSearchFormComponent { } } - + filter.countAllValues = filter.values.length; } if(filters.length == 0 ){ - for(let j=0; j< prevFilters.length ; j++){ - let filter = Object.assign({}, prevFilters[j]); - filter.values = []; - for(let filterValue of prevFilters[j].values) { - if(filterValue.selected){ - filterValue.number = 0; - filter.values.push(filterValue); - } - } - filters.push(filter) + for(let j=0; j< prevFilters.length ; j++) { + let filter = Object.assign({}, prevFilters[j]); + filter.values = []; + for (let filterValue of prevFilters[j].values) { + if (filterValue.selected) { + filterValue.number = 0; + filter.values.push(filterValue); } + } + filter.countAllValues = filter.values.length; + filters.push(filter) + } } return filters; } diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index e9c48eaa..6d30b06c 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -230,7 +230,7 @@ export class SearchProjectsService { for(let z=0; z Date: Fri, 12 Apr 2024 13:57:56 +0300 Subject: [PATCH 74/93] [develop | DONE | ADDED] topics/indicators: add condition to hide all "edit" actions when stakeholder is NOT a copy --- monitor-admin/topic/indicators.component.html | 52 +++++++++++-------- monitor-admin/topic/indicators.component.ts | 4 ++ monitor-admin/topic/topic.component.html | 32 +++++++----- monitor-admin/topic/topic.component.ts | 4 ++ 4 files changed, 58 insertions(+), 34 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 69abb1dd..9c7f6ca9 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -4,9 +4,9 @@
    -
    +
    - @@ -17,25 +17,29 @@
    -
    +
    {{numberSections.at(i).get('title').value}}
    + [attr.uk-sortable]="isEditable ? 'group: number': null" uk-grid>
    - - + + -
      @@ -79,7 +83,7 @@
    -
    +
    -
    +
    @@ -106,9 +110,9 @@
    -
    +
    - @@ -120,25 +124,29 @@
    -
    +
    {{chartSections.at(i).get('title').value}}
    + [attr.uk-sortable]="isEditable ? 'group: chart': null" uk-grid>
    - - + + -
      @@ -214,7 +222,7 @@
    -
    +
    -
    +
    @@ -288,10 +296,10 @@ class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left" [class.uk-invisible-hover]="indicator.activePath !== i" (click)="$event.stopPropagation();$event.preventDefault()"> - + -
    • @@ -486,10 +494,10 @@ class="uk-flex uk-flex-column uk-flex-center uk-margin-small-left" [class.uk-invisible-hover]="indicator.activePath !== i" (click)="$event.stopPropagation();$event.preventDefault()"> - + -
      diff --git a/landingPages/result/deletedByInference/deletedByInference.service.ts b/landingPages/result/deletedByInference/deletedByInference.service.ts index 5b812e8f..f3b3754c 100644 --- a/landingPages/result/deletedByInference/deletedByInference.service.ts +++ b/landingPages/result/deletedByInference/deletedByInference.service.ts @@ -145,8 +145,7 @@ export class DeletedByInferenceService { if(author.orcid_pending) { author.orcid_pending = author.orcid_pending.toUpperCase(); } - - if(result['authors'][author.rank] && results['authors'][author.rank].fullName == author.content) { + if(result['authors'][author.rank] && result['authors'][author.rank].fullName == author.content) { if(!author.orcid && result['authors'][author.rank].orcid) { author.orcid = result['authors'][author.rank].orcid; } else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) { diff --git a/orcid/orcid-work.component.ts b/orcid/orcid-work.component.ts index 6153d146..8473be66 100644 --- a/orcid/orcid-work.component.ts +++ b/orcid/orcid-work.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, Input, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {Subscriber, Subscription} from "rxjs"; import {OrcidService} from "./orcid.service"; @@ -85,7 +85,7 @@ declare var UIkit: any; ORCID  - + ORCID logo  ACTIONS @@ -330,7 +330,8 @@ export class OrcidWorkComponent { private _router: Router, private orcidService: OrcidService, private resultLandingService: ResultLandingService, - private userManagementService: UserManagementService, private _logService: LogService, private _userProfileService: UserProfileService) { + private userManagementService: UserManagementService, private _logService: LogService, private _userProfileService: UserProfileService, + private cdr: ChangeDetectorRef) { if (typeof document !== 'undefined') { this.tokenUrl = properties.orcidTokenURL + "client_id=" + properties.orcidClientId @@ -444,6 +445,8 @@ export class OrcidWorkComponent { this.subscriptions.push(this.orcidService.getPutCode(this.pids).subscribe( putCodes => { this.putCodes = putCodes; + this.cdr.markForCheck(); + // this.cdr.detectChanges(); }, error => { } @@ -525,7 +528,9 @@ export class OrcidWorkComponent { this.putCodes.push("" + response['put-code']); this.creationDates.push(response['created-date']['value']); this.updateDates.push(response['last-modified-date']['value']); - + this.cdr.markForCheck(); + // this.cdr.detectChanges(); + // this.closeGrantModal(); // this.message = "You have successfully added work with pids: "+this.pids+" in your ORCID record!"; this.message = "You have successfully added work \"" + this.resultTitle + "\" in your ORCID record!"; @@ -701,6 +706,8 @@ export class OrcidWorkComponent { deletedAll = false; } else { this.putCodes.splice(i, 1); + this.cdr.markForCheck(); + // this.cdr.detectChanges(); this.creationDates.splice(i, 1); this.updateDates.splice(i, 1); // this.works.splice(i, 1); diff --git a/sdg/sdg.component.html b/sdg/sdg.component.html index 1acb5d08..c1f431fe 100644 --- a/sdg/sdg.component.html +++ b/sdg/sdg.component.html @@ -34,9 +34,9 @@
    - + SDGs logo
    - + SDGs big logo
    @@ -61,7 +61,7 @@
    - +
    {{sdg.number == null ? '0' : sdg.number | number}} diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 74028ebd..c623abc1 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -311,7 +311,7 @@ target="_blank"> OpenAIRE - Explore.
    -
    +
    @@ -347,7 +347,7 @@
    -
    +
    diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 33ba74c0..881578d8 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -78,6 +78,7 @@ export class SearchResultComponent implements OnInit, OnChanges { // console.debug(i, this.previewResults[i].orcidPutCodes); } } + this.previewResults = JSON.parse(JSON.stringify(this.previewResults, this.replacer), this.reviver); }, error => { } @@ -85,6 +86,26 @@ export class SearchResultComponent implements OnInit, OnChanges { } } + private replacer(key, value) { + if(value instanceof Map) { + return { + dataType: 'Map', + value: Array.from(value.entries()), // or with spread: value: [...value] + }; + } else { + return value; + } + } + + private reviver(key, value) { + if(typeof value === 'object' && value !== null) { + if (value.dataType === 'Map') { + return new Map(value.value); + } + } + return value; + } + public getResultPreview(result: SearchResult): ResultPreview { return ResultPreview.searchResultConvert(result, (result.entityType) ? result.entityType : this.type); } diff --git a/sharedComponents/quick-contact/quick-contact.component.html b/sharedComponents/quick-contact/quick-contact.component.html index d43d55d4..23e3d1ab 100644 --- a/sharedComponents/quick-contact/quick-contact.component.html +++ b/sharedComponents/quick-contact/quick-contact.component.html @@ -12,7 +12,7 @@ Send a message
    - + contact person
    How can we help? diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 046eb7c0..229ab5f9 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -218,7 +218,7 @@
    - + diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index d7a1d0f8..539eccb9 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnChanges, OnInit, SimpleChanges} from "@angular/core"; +import {ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, SimpleChanges} from "@angular/core"; import {ResultPreview} from "./result-preview"; import {EnvProperties} from "../properties/env-properties"; import {RouterHelper} from "../routerHelper.class"; @@ -12,7 +12,8 @@ import {NumberUtils} from '../number-utils.class'; @Component({ selector: 'result-preview', templateUrl: 'result-preview.component.html', - styleUrls: ['result-preview.component.less'] + styleUrls: ['result-preview.component.less'], + changeDetection: ChangeDetectionStrategy.OnPush }) export class ResultPreviewComponent implements OnInit, OnChanges { @Input() prevPath: string = ""; @@ -255,4 +256,8 @@ export class ResultPreviewComponent implements OnInit, OnChanges { } return obj; } + + public get countDots() { + return (this.result.oaRoutes.green ? 1 : 0) + (this.result.oaRoutes.oaColor ? 1 : 0) + (this.result.oaRoutes.isInDiamondJournal ? 1 : 0); + } } -- 2.17.1 From c219c8370b223f4f4df2520f2a4ad89dde493637 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 16 Apr 2024 10:07:31 +0300 Subject: [PATCH 77/93] [develop | DONE | REVERTED]: searchResult.component.ts & result-preview.component.html & result-preview.component.ts: Reverted changes regarding changeDetection: ChangeDetectionStrategy.OnPush - should be first introduced in another branch. --- searchPages/searchUtils/searchResult.component.ts | 2 +- utils/result-preview/result-preview.component.html | 2 +- utils/result-preview/result-preview.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 881578d8..d76c1de6 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -78,7 +78,7 @@ export class SearchResultComponent implements OnInit, OnChanges { // console.debug(i, this.previewResults[i].orcidPutCodes); } } - this.previewResults = JSON.parse(JSON.stringify(this.previewResults, this.replacer), this.reviver); + // this.previewResults = JSON.parse(JSON.stringify(this.previewResults, this.replacer), this.reviver); }, error => { } diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 229ab5f9..046eb7c0 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -218,7 +218,7 @@
    - + diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 539eccb9..ac31bb91 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -13,7 +13,7 @@ import {NumberUtils} from '../number-utils.class'; selector: 'result-preview', templateUrl: 'result-preview.component.html', styleUrls: ['result-preview.component.less'], - changeDetection: ChangeDetectionStrategy.OnPush + // changeDetection: ChangeDetectionStrategy.OnPush }) export class ResultPreviewComponent implements OnInit, OnChanges { @Input() prevPath: string = ""; -- 2.17.1 From 4b3e805d311396db3f4ac505fb6b0c93455c8f50 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 16 Apr 2024 11:36:45 +0300 Subject: [PATCH 78/93] [develop | DONE | REVERTED]: searchProjects.service.ts: Revert parsing funder name if funder shortname is not available. --- services/searchProjects.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index 6d30b06c..e9c48eaa 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -230,7 +230,7 @@ export class SearchProjectsService { for(let z=0; z Date: Tue, 16 Apr 2024 11:47:12 +0300 Subject: [PATCH 79/93] [develop | DONE | CHANGED]: In search projects results, show funder name by default, and if not available, show funder short name. 1. searchResult.ts: Added field funderName: string; in class SearchResult. 2. result-preview.ts: Added field funderName: string; in class ResultPreview & in method "searchResultConvert()" set resultPreview.funderName = result.funderName; 3. searchProjects.service.ts: Added parsing of funderName. 4. result-preview.component.html: Show funderName and if not available, show funderShortname. 5. entity-metadata.component.ts: Added check for funders display. --- landingPages/landing-utils/entity-metadata.component.ts | 2 +- services/searchProjects.service.ts | 1 + utils/entities/searchResult.ts | 1 + utils/result-preview/result-preview.component.html | 8 ++++---- utils/result-preview/result-preview.ts | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/landingPages/landing-utils/entity-metadata.component.ts b/landingPages/landing-utils/entity-metadata.component.ts index 0378f127..4060446c 100644 --- a/landingPages/landing-utils/entity-metadata.component.ts +++ b/landingPages/landing-utils/entity-metadata.component.ts @@ -295,7 +295,7 @@ export class EntityMetadataComponent { return this.projects.map(project => { let value = project.funderShortname ? project.funderShortname : project.funderName; if (project.acronym || project.title) { - value = value + ' | ' + (project.acronym ? project.acronym : + value = (value ? value + ' | ' : '') + (project.acronym ? project.acronym : (project.title.length > 25 ? (project.title.slice(0, 25) + '...'): project.title)); } // if(project.code) { diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index e9c48eaa..e9e704b9 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -231,6 +231,7 @@ export class SearchProjectsService { let fundingData = Array.isArray(resData['fundingtree']) ? resData['fundingtree'][z] : resData['fundingtree']; if(fundingData.hasOwnProperty("funder")) { result['funderShortname'] = fundingData['funder'].shortname; + result['funderName'] = fundingData['funder'].name; result['funderId'] = fundingData['funder'].id; result['jurisdiction'] = (fundingData['funder']['id']['jurisdiction'] )?fundingData['funder']['id']['jurisdiction']:""; diff --git a/utils/entities/searchResult.ts b/utils/entities/searchResult.ts index e59e56f7..ba762833 100644 --- a/utils/entities/searchResult.ts +++ b/utils/entities/searchResult.ts @@ -48,6 +48,7 @@ export class SearchResult { acronym: string; code: string; // callIdentifier?: string; // currently not parsed + funderName: string; funderShortname: string; budget?: string; contribution?: string; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 046eb7c0..70fa4f30 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -95,12 +95,12 @@
    -
    - +
    + Funder: - {{result.funderShortname}} + {{result.funderName ? result.funderName : result.funderShortname}} - + {{openaireEntities.PROJECT}} Code: {{result.code}} diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index 542e34f2..c8a38e1d 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -123,6 +123,7 @@ export class ResultPreview { acronym: string; code: string; // callIdentifier: string; // currently not parsed + funderName: string; funderShortname: string; budget: string; contribution: string; @@ -188,6 +189,7 @@ export class ResultPreview { resultPreview.acronym = result.acronym; resultPreview.code = result.code; // resultPreview.callIdentifier = result.callIdentifier; // currently not parsed + resultPreview.funderName = result.funderName; resultPreview.funderShortname = result.funderShortname; resultPreview.budget = result.budget; resultPreview.contribution = result.contribution; -- 2.17.1 From b7293411993fc37a422483b092d7cb3cf5ce5efd Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 16 Apr 2024 12:21:02 +0300 Subject: [PATCH 80/93] [develop]: Fix visibility condition in Indicaotrs page --- monitor-admin/topic/indicators.component.html | 16 ++++++---------- monitor-admin/topic/topic.component.html | 10 +++++----- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/monitor-admin/topic/indicators.component.html b/monitor-admin/topic/indicators.component.html index 9c7f6ca9..0b5b1aa1 100644 --- a/monitor-admin/topic/indicators.component.html +++ b/monitor-admin/topic/indicators.component.html @@ -33,13 +33,11 @@ - - + + -