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}} + + -
- - - {{searchFieldsHelper.getFosParameter() == 'foslabel' ? subChild.label : subChild.id}} - - - - - - +
+ + + {{searchFieldsHelper.getFosParameter() == 'foslabel' ? subChild.label : subChild.id}} + + + + + + - - - more - - + + + more + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - -
+ + + + + + +
+
@@ -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]); }