From 8f646a883fb9d2f36163a6f1e8040df98b0c9347 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Thu, 19 Sep 2024 10:49:03 +0300 Subject: [PATCH 1/4] [develop | DONE | ADDED] help-content.service.ts: add a function used in connect-admin, remove unused parameter from other functions --- services/help-content.service.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/services/help-content.service.ts b/services/help-content.service.ts index f79bf1c9..53acd273 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -239,6 +239,12 @@ export class HelpContentService { // .pipe(catchError(this.handleError)); // } + getCommunityPagesByRoute(pid: string, route: string) { + return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages' + + (route ? '?page_route='+route : '')) + .pipe(map(pages => (pages.length>0?pages[0]:null)), catchError(this.handleError)); + } + // Replacing getCommunityPages getCommunityPagesByType(pid: string, type: string) { return this.http.get>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages' @@ -305,7 +311,7 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - togglePages(selectedPortalPid: string, ids : string[], status : boolean) { + togglePages(selectedPortalPid: string, ids : string[], status: boolean) { return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + selectedPortalPid + '/page/toggle?status='+ status.toString(), JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody()) @@ -432,22 +438,21 @@ export class HelpContentService { .pipe(map(res => res['statistics'])); } - getCommunityAdminStatisticsChoices(apiUrl: string, portalId: string): Observable { - const url = `${apiUrl}statistics/${portalId}`; + getCommunityAdminStatisticsChoices(portalId: string): Observable { + const url = `${properties.adminToolsAPIURL}statistics/${portalId}`; //console.log(`getting admin choices for statistics from: ${url}`); return this.http.get(url) //.map(stats => stats.json()) .pipe(catchError(this.handleError)); } - postCommunityAdminStatisticsChoices(apiUrl: string, - portalId: string, + postCommunityAdminStatisticsChoices(portalId: string, entity: string, chartsOrNumbers: string, title: string, status: boolean, monitor: boolean): Observable { - const url = `${apiUrl}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`; + const url = `${properties.adminToolsAPIURL}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`; //console.log(`getting admin choices for statistics from: ${url}`); return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody()) @@ -455,8 +460,8 @@ export class HelpContentService { .pipe(catchError(this.handleError)); } - statisticsIsActiveToggle(apiURL: string, id: string): Observable { - const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle'; + statisticsIsActiveToggle(id: string): Observable { + const url = properties.adminToolsAPIURL + 'statistics/' + encodeURIComponent(id) + '/toggle'; return this.http.post(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError)); } } From 3ea0ee3d1e8432559767958be81bfe6cafd76663 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 19 Sep 2024 11:12:24 +0300 Subject: [PATCH 2/4] [develop | DONE | FIXED] resultLanding.service.ts: Parse services for relatedServices only when the portal is eosc, otherwise datasources only | resultLanding.component.html: For relatedServices, change label of tab and type of results depending on if the portal is eosc (service) or not (datasource). --- landingPages/result/resultLanding.component.html | 12 ++++++------ landingPages/result/resultLanding.service.ts | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index f3a0de11..f11ea7ce 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -154,7 +154,7 @@ [tabNumber]="resultLandingInfo.relatedResults.length">
- +
@@ -467,8 +467,8 @@
- {{openaireEntities.DATASOURCES}} + (click)="openFsModal(servicesFsModal, properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')"> + {{properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES}}

@@ -662,7 +662,7 @@
- +
@@ -800,7 +800,7 @@ (valueChange)="relatedClassChanged(type)">
diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 10bef9c3..c6fab328 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -210,7 +210,8 @@ export class ResultLandingService { this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); } else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") { this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation); - } else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") { + } else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations" && + (relation['datasourcetype']?.classname!== "service" || properties.adminToolsPortalType == "eosc")) { let relationName: string = relation.to.class; if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) { this.resultLandingInfo.relatedServicesClassFilters.add(relationName); From 9c8ac92c91fb1341e36420d9e9771bf27e021064 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 19 Sep 2024 14:26:58 +0300 Subject: [PATCH 3/4] [develop | DONE | FIXED] bulk upload dois - fetch from crossref: introduce a delay to avoid 429 response from API --- claims/linking/bulkClaim/bulkClaim.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/claims/linking/bulkClaim/bulkClaim.component.ts b/claims/linking/bulkClaim/bulkClaim.component.ts index 0e296e87..e8b4f482 100644 --- a/claims/linking/bulkClaim/bulkClaim.component.ts +++ b/claims/linking/bulkClaim/bulkClaim.component.ts @@ -150,7 +150,7 @@ export class BulkClaimComponent { } this.loading.open(); - this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then((result) => { + this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then(async (result) => { const rows = (result as any).split('\n'); // I have used space, you can use any thing. this.exceedsLimit = false; let invalid_rows = 0; @@ -179,6 +179,7 @@ export class BulkClaimComponent { this.allIds.push(id); if (currentLength < this.basketLimit){ currentLength++; + await new Promise((resolve) => setTimeout(resolve, 100)); this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1); }else{ this.exceedsLimit = true; From e1bf3a63ccbd698ea6bc697d89f8e35570494ecf Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 19 Sep 2024 15:54:03 +0300 Subject: [PATCH 4/4] [develop | DONE | FIXED]: orcidWork.ts: Added check to add openaire id as external-id in orcid claims, unless there is at least 1 identifier. --- orcid/orcidWork.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orcid/orcidWork.ts b/orcid/orcidWork.ts index e92fbcb2..70b80ab2 100644 --- a/orcid/orcidWork.ts +++ b/orcid/orcidWork.ts @@ -141,7 +141,7 @@ export class WorkV3_0 { } } - if(resultLandingInfo.identifiers) { + if(resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0) { work['external-ids'] = { 'external-id': [] }; resultLandingInfo.identifiers.forEach(((values, key) => { values.forEach(value => {