[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.
This commit is contained in:
parent
0d0c077a4c
commit
8d6c45abe3
|
@ -157,51 +157,54 @@
|
||||||
{{child.id}}
|
{{child.id}}
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<!-- hide L3 & L4 FoS-->
|
||||||
|
<ng-container *ngIf="properties.environment == 'development'">
|
||||||
<!-- class="parent uk-transition-toggle" tabindex="0"-->
|
<!-- class="parent uk-transition-toggle" tabindex="0"-->
|
||||||
<div *ngFor="let subChild of child.children; let i=index" style="margin-bottom: 7px;"
|
<div *ngFor="let subChild of child.children; let i=index" style="margin-bottom: 7px;"
|
||||||
class="uk-flex uk-flex-middle uk-flex-between uk-transition-toggle" tabindex="0">
|
class="uk-flex uk-flex-middle uk-flex-between uk-transition-toggle" tabindex="0">
|
||||||
<!-- <span class="uk-flex uk-flex-between">-->
|
<!-- <span class="uk-flex uk-flex-between">-->
|
||||||
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subChild)"
|
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subChild)"
|
||||||
class="uk-link-text uk-width-expand">
|
class="uk-link-text uk-width-expand">
|
||||||
{{searchFieldsHelper.getFosParameter() == 'foslabel' ? subChild.label : subChild.id}}
|
{{searchFieldsHelper.getFosParameter() == 'foslabel' ? subChild.label : subChild.id}}
|
||||||
</a>
|
</a>
|
||||||
<span *ngIf="properties.environment == 'development' && subChild.children?.length > 0" (click)="moreClicked(item, child, subChild)"
|
<span *ngIf="properties.environment == 'development' && subChild.children?.length > 0" (click)="moreClicked(item, child, subChild)"
|
||||||
class="uk-transition-fade uk-width-auto uk-flex uk-flex-middle uk-margin-left label4 uk-text-small uk-text-meta">
|
class="uk-transition-fade uk-width-auto uk-flex uk-flex-middle uk-margin-left label4 uk-text-small uk-text-meta">
|
||||||
<!-- <a class="view-more-less-link uk-link-text uk-text-lowercase">-->
|
<!-- <a class="view-more-less-link uk-link-text uk-text-lowercase">-->
|
||||||
<!-- +{{subChild.children.length}} more-->
|
<!-- +{{subChild.children.length}} more-->
|
||||||
<!--<!– <icon [flex]="true" ratio="1" name="chevron_right"></icon>–>-->
|
<!--<!– <icon [flex]="true" ratio="1" name="chevron_right"></icon>–>-->
|
||||||
<!-- </a>-->
|
<!-- </a>-->
|
||||||
|
|
||||||
<icon [flex]="true" ratio="0.7" name="subdirectory_arrow_right"></icon>
|
<icon [flex]="true" ratio="0.7" name="subdirectory_arrow_right"></icon>
|
||||||
<a class="uk-link-text uk-text-lowercase">
|
<a class="uk-link-text uk-text-lowercase">
|
||||||
more
|
more
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- <div *ngIf="subChild.children?.length > 0" (click)="selectedParentLevels=[item, child, subChild]"-->
|
<!-- <div *ngIf="subChild.children?.length > 0" (click)="selectedParentLevels=[item, child, subChild]"-->
|
||||||
<!-- class="uk-flex uk-flex-middle uk-margin-left label4 uk-text-small uk-text-meta">-->
|
<!-- class="uk-flex uk-flex-middle uk-margin-left label4 uk-text-small uk-text-meta">-->
|
||||||
<!-- <a class="uk-link-text">{{subChild.children.length}} Subcategories</a>-->
|
<!-- <a class="uk-link-text">{{subChild.children.length}} Subcategories</a>-->
|
||||||
<!-- <icon [flex]="true" ratio="1" name="chevron_right"></icon>-->
|
<!-- <icon [flex]="true" ratio="1" name="chevron_right"></icon>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
|
||||||
<!-- <span *ngIf="subChild?.children?.length > 0" (click)="fosAccordions.set(subChild.id, !fosAccordions.get(subChild.id))" class="uk-accordion-title uk-padding-remove"></span>-->
|
<!-- <span *ngIf="subChild?.children?.length > 0" (click)="fosAccordions.set(subChild.id, !fosAccordions.get(subChild.id))" class="uk-accordion-title uk-padding-remove"></span>-->
|
||||||
<!-- </span>-->
|
<!-- </span>-->
|
||||||
<!-- <div *ngIf="fosAccordions.get(subChild.id)" class="uk-margin-left">-->
|
<!-- <div *ngIf="fosAccordions.get(subChild.id)" class="uk-margin-left">-->
|
||||||
<!-- <div *ngFor="let level4 of subChild.children" style="margin-bottom: 7px;">-->
|
<!-- <div *ngFor="let level4 of subChild.children" style="margin-bottom: 7px;">-->
|
||||||
<!-- <a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"-->
|
<!-- <a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"-->
|
||||||
<!-- class="label4 uk-text-small uk-text-meta">-->
|
<!-- class="label4 uk-text-small uk-text-meta">-->
|
||||||
<!-- {{searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id}}-->
|
<!-- {{searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id}}-->
|
||||||
<!-- </a>-->
|
<!-- </a>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
|
||||||
<!-- uk-transition-slide-top-->
|
<!-- uk-transition-slide-top-->
|
||||||
<!-- <div *ngIf="subChild.children?.length > 0" class="uk-transition-slide-top">-->
|
<!-- <div *ngIf="subChild.children?.length > 0" class="uk-transition-slide-top">-->
|
||||||
<!-- <div class="child">-->
|
<!-- <div class="child">-->
|
||||||
<!-- <a class="uk-link uk-margin-left">{{subChild.children.length}} Subcategories ></a>-->
|
<!-- <a class="uk-link uk-margin-left">{{subChild.children.length}} Subcategories ></a>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -223,19 +226,22 @@
|
||||||
class="uk-link-text" [innerHTML]="highlightKeyword(subItem.id)">
|
class="uk-link-text" [innerHTML]="highlightKeyword(subItem.id)">
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
<div *ngFor="let subSubItem of subItem.children" style="margin-bottom: 7px;">
|
<!-- hide L3 & L4 FoS-->
|
||||||
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subSubItem)"
|
<ng-container *ngIf="properties.environment == 'development'">
|
||||||
class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)">
|
<div *ngFor="let subSubItem of subItem.children" style="margin-bottom: 7px;">
|
||||||
</a>
|
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subSubItem)"
|
||||||
|
class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)">
|
||||||
|
</a>
|
||||||
|
|
||||||
<ng-container *ngIf="properties.environment == 'development'">
|
<ng-container *ngIf="properties.environment == 'development'">
|
||||||
<div *ngFor="let level4 of subSubItem?.children" class="uk-margin-left">
|
<div *ngFor="let level4 of subSubItem?.children" class="uk-margin-left">
|
||||||
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"
|
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"
|
||||||
class="uk-text-small uk-text-meta uk-margin-xsmall-bottom" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id)">
|
class="uk-text-small uk-text-meta uk-margin-xsmall-bottom" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id)">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -184,7 +184,8 @@ export class FosComponent implements OnInit, OnDestroy {
|
||||||
if(fos.children) {
|
if(fos.children) {
|
||||||
fos.children.forEach(l2 => {
|
fos.children.forEach(l2 => {
|
||||||
this.fosOptions.push(l2.id);
|
this.fosOptions.push(l2.id);
|
||||||
if(l2.children) {
|
// hide L3 & L4 FoS
|
||||||
|
if(l2.children && properties.environment == "development") {
|
||||||
l2.children.forEach(l3 => {
|
l2.children.forEach(l3 => {
|
||||||
this.fosOptions.push(l3.id);
|
this.fosOptions.push(l3.id);
|
||||||
if(l3.children) {
|
if(l3.children) {
|
||||||
|
@ -212,20 +213,25 @@ export class FosComponent implements OnInit, OnDestroy {
|
||||||
if(item.children?.length && !matchLevel1) {
|
if(item.children?.length && !matchLevel1) {
|
||||||
item.children = item.children.filter(subItem => {
|
item.children = item.children.filter(subItem => {
|
||||||
matchLevel2 = !!subItem.id.includes(value?.toLowerCase());
|
matchLevel2 = !!subItem.id.includes(value?.toLowerCase());
|
||||||
// 3rd level search
|
// hide L3 & L4 FoS
|
||||||
if(subItem.children?.length && !matchLevel2) {
|
if(properties.environment == "development") {
|
||||||
subItem.children = subItem.children.filter(subSubItem => {
|
// 3rd level search
|
||||||
matchLevel3 = subSubItem.id.includes(value?.toLowerCase());
|
if(subItem.children?.length && !matchLevel2) {
|
||||||
// 4th level search
|
subItem.children = subItem.children.filter(subSubItem => {
|
||||||
if(subSubItem.children?.length && !matchLevel3) {
|
matchLevel3 = subSubItem.id.includes(value?.toLowerCase());
|
||||||
subSubItem.children = subSubItem.children.filter(level4Item => {
|
// 4th level search
|
||||||
return level4Item.id.toLowerCase().includes(value?.toLowerCase())
|
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 subSubItem.children?.length > 0 || matchLevel3;
|
||||||
return subItem.children?.length > 0;
|
});
|
||||||
|
}
|
||||||
|
return subItem.children?.length > 0;
|
||||||
|
} else {
|
||||||
|
return matchLevel2;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return item.children?.length > 0;
|
return item.children?.length > 0;
|
||||||
|
|
|
@ -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">
|
(click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate">
|
||||||
View all
|
View all
|
||||||
</a>
|
</a>
|
||||||
<!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a> -->
|
<!-- hide L3 & L4 FoS-->
|
||||||
|
<!-- <a *ngIf="viewAll && lessBtn" (click)="viewAll = !viewAll; lessBtn=false;">View less</a> -->
|
||||||
<a *ngIf="properties.adminToolsPortalType != 'eosc' && subjects && subjects.length > threshold && !viewAll"
|
<a *ngIf="properties.adminToolsPortalType != 'eosc' && subjects && subjects.length > threshold && !viewAll"
|
||||||
(click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate">
|
(click)="viewAllClick();" class="view-more-less-link uk-link uk-link-text uk-text-truncate">
|
||||||
View all & suggest
|
View all<ng-container *ngIf="properties.environment == 'development'"> & suggest</ng-container>
|
||||||
</a>
|
</a>
|
||||||
<a *ngIf="properties.adminToolsPortalType != 'eosc' && (subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-link-text uk-text-truncate"
|
<a *ngIf="properties.environment == 'development' && properties.adminToolsPortalType != 'eosc' && (subjects && subjects.length <= threshold || viewAll)" class="uk-link uk-link-text uk-text-truncate"
|
||||||
(click)="suggestClick();">Suggest</a>
|
(click)="suggestClick();">Suggest</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-small-top">
|
<div class="uk-margin-small-top">
|
||||||
|
|
|
@ -344,9 +344,22 @@ export class ResultLandingService {
|
||||||
if (subjectResults[3]) {
|
if (subjectResults[3]) {
|
||||||
let searchFieldsHelper: SearchFields = new SearchFields();
|
let searchFieldsHelper: SearchFields = new SearchFields();
|
||||||
subjectResults[3].forEach(element => {
|
subjectResults[3].forEach(element => {
|
||||||
this.resultLandingInfo.fos.push(
|
// hide L3 & L4 FoS
|
||||||
{id: element, label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element}
|
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) {
|
if (this.resultLandingInfo.fos) {
|
||||||
|
|
|
@ -150,7 +150,8 @@ export class ISVocabulariesService {
|
||||||
value.id = fos.id;//data[i].code;
|
value.id = fos.id;//data[i].code;
|
||||||
value.label = fos.label;
|
value.label = fos.label;
|
||||||
array.push(value);
|
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--) {
|
for (let i=fos.children.length-1; i>=0; i--) {
|
||||||
children.push(fos.children[i]);
|
children.push(fos.children[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue