From 304276f3bc7bed74e41344bf5a90290f592613f1 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 16 Feb 2022 11:40:05 +0200 Subject: [PATCH] [Library]: Fixes in ORCID put-codes query & query dynamic menu only in development environment. 1. dataProvider.component.ts: Comment log for dataProviderInfo.fundedContent. 2. searchResult.component.ts: In initialize() method, before calling orcidService.getPutCodes, added more checks for type (result, publication, dataset, software, other). 3. navigationBar.component.ts: Call _helpContentService.getMenuItems only in development environment. --- landingPages/dataProvider/dataProvider.component.ts | 2 +- searchPages/searchUtils/searchResult.component.ts | 4 +++- sharedComponents/navigationBar.component.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index 13c42d22..4a7c9112 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -290,7 +290,7 @@ export class DataProviderComponent { this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe( fundedContent => { this.dataProviderInfo.fundedContent = fundedContent; - console.log(this.dataProviderInfo.fundedContent); + // console.log(this.dataProviderInfo.fundedContent); }, err => { this.handleError("Error getting results with funding information for datasource id: " + this.datasourceId, err); diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 93f03d20..9bbb2ad5 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -42,7 +42,9 @@ export class SearchResultComponent implements OnInit, OnChanges { } if((properties.adminToolsPortalType == "explore" || properties.adminToolsPortalType == "community") - && Session.isLoggedIn() && this.results && this.results.length > 0) { + && Session.isLoggedIn() && this.results && this.results.length > 0 + && (this.type == "result" || this.type == "publication" || this.type == "dataset" || this.type == "software" || this.type == "other") + ) { this.orcidService.getPutCodes(this.previewResults.map( previewResult => { if(previewResult.identifiers) { diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index ee9fad61..c98af504 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -103,7 +103,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy { this.handleError('Error getting community information (e.g. pages,entities) for community with id: ' + this.communityId, error); })); } - if(this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') { + if(this.properties.environment == "development" && this.portal != 'connect' && this.portal != 'connect-admin' && this.properties.adminToolsPortalType == 'community') { this.subs.push( this._helpContentService.getMenuItems(this.portal).subscribe( data => {