[Library | new-theme]: Fixes in parsing of "eoscifguidelines" | Added EOSC Subject ("eoscifguidelines") in RESULT ADVANCED FIELDS (not in production for now).

1. resultLanding.service.ts: [Bug fix] Spelling error in parsing of "eoscifguidelines" field.
2. showSubjects.component.ts: [Bug fix] Do not show "EOSC" label in classified subjects, when no "eoscSubjects" parsed.
3. searchFields.ts: In RESULT_ADVANCED_FIELDS added "eoscifguidelines" | Added method "getResultAdvancedFields()", which does not include "eoscifguidelines" in "RESULT_ADVANCED_FIELDS" when environment == "production".
4. searchAll.component.ts & searchResearchResults.component.ts: Get searchFields.RESULT_ADVANCED_FIELDS from "getResultAdvancedFields()".
This commit is contained in:
Konstantina Galouni 2022-09-09 00:46:44 +03:00
parent 656a3634e2
commit 7ef47ab0ef
5 changed files with 25 additions and 6 deletions

View File

@ -18,7 +18,7 @@ import {properties} from "../../../../environments/environment";
Subjects by Vocabulary
</div>
<ng-container *ngTemplateOutlet="subjects_by_vocabulary_template; context: {customClasses: 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container>
<ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container>
<ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>
<div *ngIf="isClassifiedLarge" class="uk-text-right">
<a (click)="openSubjectsByVocabularyModal()" class="view-more-less-link">View all</a>
</div>
@ -97,7 +97,7 @@ import {properties} from "../../../../environments/environment";
<modal-alert #subjectsByVocabularyModal *ngIf="(classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0)" large="true">
<div class="uk-text-small">
<ng-container *ngTemplateOutlet="subjects_by_vocabulary_template"></ng-container>
<ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container>
<ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>
</div>
</modal-alert>
`

View File

@ -87,7 +87,7 @@ export class ResultLandingService {
res[1]['oaf:result']['pid'], // 4
res[1]['oaf:result']['journal'], // 5
res[1]['oaf:result']['language'], // 6
res[1]['oaf:result']['eoscifgiudelines'], // 7
res[1]['oaf:result']['eoscifguidelines'], // 7
res[1]['oaf:result']['subject'], // 8
res[1]['oaf:result']['context'], // 9
res[1]['oaf:result']['creator'], // 10

View File

@ -103,7 +103,7 @@ export class SearchAllComponent {
resultTypes = {publication: true, dataset: true, software: true, other: true};
//adv Search Form
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
public fieldIds: string[] = this.searchFields.getResultAdvancedFields();
public fieldIdsMap = this.searchFields.RESULT_FIELDS;
public selectedFields: AdvancedField[] = [];

View File

@ -62,7 +62,7 @@ export class SearchResearchResultsComponent {
public searchUtils: SearchUtilsClass = new SearchUtilsClass();
public searchFields: SearchFields = new SearchFields();
public fieldIds: string[] = this.searchFields.RESULT_ADVANCED_FIELDS;
public fieldIds: string[] = this.searchFields.getResultAdvancedFields();
public fieldIdsMap = this.searchFields.RESULT_FIELDS;
public rangeFields: string[][] = this.searchFields.RESULT_RANGE_FIELDS;
public selectedFields: AdvancedField[] = [];

View File

@ -1,4 +1,5 @@
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
import {properties} from "../../../../environments/environment";
export class SearchFields {
@ -17,7 +18,7 @@ export class SearchFields {
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
"relproject", "sdg", "country", "resultlanguagename", "resulthostingdatasource", "community"];
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "resultpublisher",
public RESULT_ADVANCED_FIELDS: string[] = ["q", "resulttitle", "resultauthor", "authorid", "resultdescription", "resultsubject", "eoscifguidelines", "resultpublisher",
"resultbestaccessright", "community", "collectedfromdatasourceid", "resulthostingdatasourceid", "resultdateofacceptance",
"relfunder",
"relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id",
@ -56,6 +57,14 @@ export class SearchFields {
equalityOperator: "=",
filterType: null
},
["eoscifguidelines"]: {
name: "EOSC Subject",
type: "keyword",
param: "eoscSubj",
operator: "es",
equalityOperator: " exact ",
filterType: null
},
["resultdescription"]: {
name: "Abstract",
type: "keyword",
@ -690,6 +699,16 @@ export class SearchFields {
constructor() {
}
getResultAdvancedFields() {
if(properties.environment == "production") {
this.RESULT_ADVANCED_FIELDS = this.RESULT_ADVANCED_FIELDS.filter((value, index, array) => {
return value != "eoscifguidelines";
})
}
return this.RESULT_ADVANCED_FIELDS;
}
getField(fieldId: string, fieldType: string): any {
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
return this.RESULT_FIELDS[fieldId];