From edf8ae835c66c52f1c2282bc01eff53dcd945766 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 2 Oct 2023 13:13:22 +0300 Subject: [PATCH] [Library | develop] fos/fos.component.ts & landing-utilts/fos.component.ts & searchFields.ts: Restored checks for environment to use fos or foslabel field - foslabel not yet introduced in current prod index. --- fos/fos.component.ts | 3 ++- landingPages/landing-utils/fos.component.ts | 6 ++++-- utils/properties/searchFields.ts | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fos/fos.component.ts b/fos/fos.component.ts index c02b6bed..043e7bd5 100644 --- a/fos/fos.component.ts +++ b/fos/fos.component.ts @@ -216,6 +216,7 @@ export class FosComponent implements OnInit, OnDestroy { } public buildFosQueryParam(fos) { - return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + // return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)})); } } diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index 4dfc59e6..ba95bdc8 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -121,10 +121,12 @@ export class FosComponent { } public buildFosQueryParam(fos) { - return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + // return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}; + return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)})); } public buildFosHrefParam(fos): string { - return ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)); + // return ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)); + return (properties.environment !== 'production' ? ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)) : ('fos='+this.urlEncodeAndQuote(fos.id))); } } diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index 7ae0fcda..65ca6a4b 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -14,7 +14,7 @@ export class SearchFields { // Remove Collected From Filter "collectedfrom","collectedfrom" public RESULT_REFINE_FIELDS = [ - "resultbestaccessright", "instancetypename", "foslabel", "relfunder", + "resultbestaccessright", "instancetypename", properties.environment!='production'?"foslabel":'fos', "relfunder", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id", "relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"];