From 0d0c077a4c553193a79b17c78754406de2ca6808 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Fri, 26 Jul 2024 11:38:57 +0300 Subject: [PATCH 1/2] [develop | DONE | FIXED] indicator-utils: add 'return null' on 2 methods (triggered error on validator project) --- monitor-admin/utils/indicator-utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 767d23fa..613bc1c2 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -734,6 +734,7 @@ export class IndicatorUtils { } else if ((obj[this.getDescriptionObjectName(obj)]).hasOwnProperty("queries")) { return "queries"; } + return null; } private getDescriptionObjectName(obj) { @@ -746,6 +747,7 @@ export class IndicatorUtils { } else if (obj.hasOwnProperty("series")) { return "series"; } + return null; } private extractType(obj, indicatorPath: IndicatorPath): IndicatorPathType { -- 2.17.1 From 8d6c45abe39953e70764bca0fb0e5446055d6325 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 1 Aug 2024 14:06:12 +0300 Subject: [PATCH 2/2] [develop | DONE | CHANGED]: fos/fos.component.html & fos/fos.component.ts & landing-utils/fos.component.ts & ISVocabularies.service.ts & resultLanding.service.ts: hide L3 & L4 FoS. --- fos/fos.component.html | 110 +++++++++--------- fos/fos.component.ts | 36 +++--- landingPages/landing-utils/fos.component.ts | 7 +- landingPages/result/resultLanding.service.ts | 19 ++- .../ISVocabularies.service.ts | 3 +- 5 files changed, 101 insertions(+), 74 deletions(-) diff --git a/fos/fos.component.html b/fos/fos.component.html index d5d67d7f..eaec9981 100644 --- a/fos/fos.component.html +++ b/fos/fos.component.html @@ -157,51 +157,54 @@ {{child.id}} + + - + @@ -223,19 +226,22 @@ class="uk-link-text" [innerHTML]="highlightKeyword(subItem.id)"> -
- - + + +
+ + - -
- - -
-
-
+ +
+ + +
+
+
+ diff --git a/fos/fos.component.ts b/fos/fos.component.ts index e86317ea..88177849 100644 --- a/fos/fos.component.ts +++ b/fos/fos.component.ts @@ -184,7 +184,8 @@ export class FosComponent implements OnInit, OnDestroy { if(fos.children) { fos.children.forEach(l2 => { this.fosOptions.push(l2.id); - if(l2.children) { + // hide L3 & L4 FoS + if(l2.children && properties.environment == "development") { l2.children.forEach(l3 => { this.fosOptions.push(l3.id); if(l3.children) { @@ -212,20 +213,25 @@ export class FosComponent implements OnInit, OnDestroy { if(item.children?.length && !matchLevel1) { item.children = item.children.filter(subItem => { matchLevel2 = !!subItem.id.includes(value?.toLowerCase()); - // 3rd level search - if(subItem.children?.length && !matchLevel2) { - subItem.children = subItem.children.filter(subSubItem => { - matchLevel3 = subSubItem.id.includes(value?.toLowerCase()); - // 4th level search - if(subSubItem.children?.length && !matchLevel3) { - subSubItem.children = subSubItem.children.filter(level4Item => { - return level4Item.id.toLowerCase().includes(value?.toLowerCase()) - }); - } - return subSubItem.children?.length > 0 || matchLevel3; - }); - } - return subItem.children?.length > 0; + // hide L3 & L4 FoS + if(properties.environment == "development") { + // 3rd level search + if(subItem.children?.length && !matchLevel2) { + subItem.children = subItem.children.filter(subSubItem => { + matchLevel3 = subSubItem.id.includes(value?.toLowerCase()); + // 4th level search + if (subSubItem.children?.length && !matchLevel3) { + subSubItem.children = subSubItem.children.filter(level4Item => { + return level4Item.id.toLowerCase().includes(value?.toLowerCase()) + }); + } + return subSubItem.children?.length > 0 || matchLevel3; + }); + } + return subItem.children?.length > 0; + } else { + return matchLevel2; + } }); } return item.children?.length > 0; diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index e489cbd9..d91c8f97 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -22,12 +22,13 @@ import {SearchFields} from "../../utils/properties/searchFields"; (click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate"> View all - + + - View all & suggest + View all & suggest - Suggest
diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 24913d76..10bef9c3 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -344,9 +344,22 @@ export class ResultLandingService { if (subjectResults[3]) { let searchFieldsHelper: SearchFields = new SearchFields(); subjectResults[3].forEach(element => { - this.resultLandingInfo.fos.push( - {id: element, label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element} - ); + // hide L3 & L4 FoS + let add = true; + if(element) { + let id = element.split(" ")[0]; + if(id.length > 4 && properties.environment != "development") { + add = false; + } + } + if(add) { + this.resultLandingInfo.fos.push( + { + id: element, + label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element + } + ); + } }); } if (this.resultLandingInfo.fos) { diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts index 7a880f44..a015d7f0 100644 --- a/utils/staticAutoComplete/ISVocabularies.service.ts +++ b/utils/staticAutoComplete/ISVocabularies.service.ts @@ -150,7 +150,8 @@ export class ISVocabulariesService { value.id = fos.id;//data[i].code; value.label = fos.label; array.push(value); - if(fos.children && fos.children.length > 0) { + // hide L3 & L4 FoS + if(fos.children && fos.children.length > 0 && (fos.level == 1)) { for (let i=fos.children.length-1; i>=0; i--) { children.push(fos.children[i]); } -- 2.17.1