Merge branch 'angular-16-irish-monitor' of code-repo.d4science.org:MaDgIK/openaire-library into angular-16-irish-monitor

This commit is contained in:
Konstantinos Triantafyllou 2024-01-08 16:59:39 +02:00
commit d61a70cc5a
5 changed files with 21 additions and 8 deletions

View File

@ -113,7 +113,7 @@
<div *ngFor="let subChild of child.children" style="margin-bottom: 5px;">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subChild)"
class="uk-link-text">
{{subChild.label}}
{{searchFieldsHelper.getFosParameter() == 'foslabel' ? subChild.label : subChild.id}}
</a>
</div>
</div>
@ -139,7 +139,7 @@
</h3>
<div *ngFor="let subSubItem of subItem.children" style="margin-bottom: 5px;">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(subSubItem)"
class="uk-link-text" [innerHTML]="highlightKeyword(subSubItem.label)">
class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)">
</a>
</div>
</div>

View File

@ -15,6 +15,7 @@ import {PiwikService} from "../utils/piwik/piwik.service";
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
import Timeout = NodeJS.Timeout;
import {ISVocabulariesService} from "../utils/staticAutoComplete/ISVocabularies.service";
import {SearchFields} from "../utils/properties/searchFields";
declare var UIkit;
@ -46,6 +47,7 @@ export class FosComponent implements OnInit, OnDestroy {
private timeout: Timeout;
@ViewChild('tabs') tabs: ElementRef;
public sliderInit: boolean = false;
private searchFieldsHelper: SearchFields = new SearchFields();
constructor(
private vocabulariesService: ISVocabulariesService,
@ -217,6 +219,6 @@ export class FosComponent implements OnInit, OnDestroy {
public buildFosQueryParam(fos) {
// return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)};
return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)}));
return (this.searchFieldsHelper.getFosParameter() == 'foslabel' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)}));
}
}

View File

@ -2,6 +2,7 @@ import {Component, EventEmitter, Input, Output} from "@angular/core";
import {RouterHelper} from "../../utils/routerHelper.class";
import {properties} from "../../../../environments/environment";
import {StringUtils} from "../../utils/string-utils.class";
import {SearchFields} from "../../utils/properties/searchFields";
@Component({
selector: 'fos',
@ -96,6 +97,7 @@ export class FosComponent {
public routerHelper: RouterHelper = new RouterHelper();
public properties = properties;
public title: string = "Fields of Science";
private searchFieldsHelper: SearchFields = new SearchFields();
public viewAllClick() {
// if(this.subjects.length <= this.threshold*2) {
@ -122,11 +124,11 @@ export class FosComponent {
public buildFosQueryParam(fos) {
// return {'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)};
return (properties.environment !== 'production' ? ({'foslabel': this.urlEncodeAndQuote(fos.id+"||"+fos.label)}) : ({'fos': this.urlEncodeAndQuote(fos.id)}));
return (this.searchFieldsHelper.getFosParameter() == 'foslabel' ? ({'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 (properties.environment !== 'production' ? ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)) : ('fos='+this.urlEncodeAndQuote(fos.id)));
return (this.searchFieldsHelper.getFosParameter() == 'foslabel' ? ('foslabel='+this.urlEncodeAndQuote(fos.id+"||"+fos.label)) : ('fos='+this.urlEncodeAndQuote(fos.id)));
}
}

View File

@ -9,6 +9,7 @@ import {HostedByCollectedFrom, Organization} from "../../utils/result-preview/re
import {Dates, Identifier, StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {SearchFields} from "../../utils/properties/searchFields";
@Injectable()
export class ResultLandingService {
@ -325,9 +326,13 @@ export class ResultLandingService {
this.resultLandingInfo.subjects = subjectResults[0];
this.resultLandingInfo.otherSubjects = subjectResults[1];
this.resultLandingInfo.classifiedSubjects = subjectResults[2];
if (subjectResults[3]) {
let searchFieldsHelper: SearchFields = new SearchFields();
subjectResults[3].forEach(element => {
this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()});
this.resultLandingInfo.fos.push(
{id: element, label: searchFieldsHelper.getFosParameter() == "foslabel" ? element.replace(/^\d+/, '').trim() : element}
);
});
}
if (this.resultLandingInfo.fos) {

View File

@ -16,7 +16,7 @@ export class SearchFieldsBase {
// Remove Collected From Filter "collectedfrom","collectedfrom"
public RESULT_REFINE_FIELDS = [
"instancetypename", properties.environment!='production'?"foslabel":'fos', "relfunder",
"instancetypename", "foslabel", "relfunder",
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
"relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"];
@ -25,7 +25,7 @@ export class SearchFieldsBase {
{type: "refine", title: "", values: ["instancetypename"]},
{type: "range", title: "", values: ["resultacceptanceyear", "resultacceptanceyear"]},
{type: "refine", title: "", values: [
properties.environment!='production'?"foslabel":'fos', "relfunder",
"foslabel", "relfunder",
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
"relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"
]}
@ -954,6 +954,10 @@ export class SearchFieldsBase {
}
return "or";
}
getFosParameter() {
return this.RESULT_REFINE_FIELDS.includes("foslabel") ? "foslabel" : "fos";
}
}
export class FieldDetails {