[Eosc Explore]: Updated some styles | Replaced "datasourcetypeuiname" field with "eoscdatasourcetype" | Do not add hardcoded compatibility label "Not yet registered" | Bug fix in Access filter
1. styles.less: Renamed from styles.css and added imports of less files and portal-custom.css (to be updated). 2. angular.json: In styles configuration added styles.less. 3. index.html & beta/index.html: In beta badge, used background instead of background-color to css rules. 4. portal-custom.css: Added rule for .search-form to inherit color in background. 5. searchFields.ts: a. Replaced "datasourcetypeuiname" field with "eoscdatasourcetype" for datasources refine filter "Type". b. In method "getResultAdvancedFields()" return always RESULT_ADVANCED_FIELDS without excluding "eoscifguidelines". 6. datasourcesHelper.class.ts: Replaced "datasourcetypeuiname" field with "eoscdatasourcetype" for datasources queries and used updated type names "Research Entity Registry" (old "Registry") and "Journal Archive" (old "Journal archive"). 7. cache-interceptor.service.ts: Updated cachingRequests array, using new "eoscdatasourcetype" and its values. 8. dataProvider.component.html && result-preview.component.html: Do not add hardcoded compatibility label "Not yet registered" and updated checks. 9. resultLanding.service.ts & parsingFunctions.class.ts: Parse resultLandingInfo.eoscSubjects only by "eoscifguidelines" field not "subjects". 10. searchFilter.component.ts: [Bug fix] In Access filter, fixed bug in view all, when clearing the preselected value. * Do not forget to add in package.json in devDependencies, "@types/express-serve-static-core": "4.17.28"
This commit is contained in:
parent
a72f962b3d
commit
a246608368
|
@ -23,12 +23,12 @@ export class CacheInterceptorService implements HttpInterceptor {
|
|||
"/resources2/?format=json&refine=true&fields=resultbestaccessright&fields=instancetypename&fields=fos&fields=relfunder&fields=sdg&fields=country&fields=resultlanguagename&fields=resulthostingdatasource&fields=community&&fq=resultbestaccessright%20exact%20%22Open%20Access%22&type=results&page=0&size=0",
|
||||
"/resources2/?format=json&refine=true&fields=resultbestaccessright&fields=instancetypename&fields=fos&fields=relfunder&fields=sdg&fields=country&fields=resultlanguagename&fields=resulthostingdatasource&fields=community&&fq=resultbestaccessright exact \"Open Access\"&type=results&page=0&size=0",
|
||||
"/resources2/?format=json&refine=true&fields=funder&fields=projectstartyear&fields=projectendyear&fields=projectoamandatepublications&&type=projects&page=0&size=0",
|
||||
"/resources2/?format=json&refine=true&fields=datasourcetypeuiname&fields=datasourceodlanguages&fields=datasourceodcontenttypes&fields=datasourcecompatibilityname&fields=country&fields=collectedfromname&fields=datasourcethematic&fields=datasourcejurisdiction&&type=datasources&page=0&size=0",
|
||||
"/resources2/?format=json&refine=true&fields=eoscdatasourcetype&fields=datasourceodlanguages&fields=datasourceodcontenttypes&fields=datasourcecompatibilityname&fields=country&fields=collectedfromname&fields=datasourcethematic&fields=datasourcejurisdiction&&type=datasources&page=0&size=0",
|
||||
"/resources2/?format=json&query= ( (reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or reldatasourcecompatibilityid exact openaire-cris_1.1 or reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*) ) &refine=true&fields=country&&type=organizations&page=0&size=0",
|
||||
|
||||
"/projects/?format=json&refine=true&page=1&size=0&fields=funder",
|
||||
|
||||
"/resources/?format=json&query=( oaftype exact datasource and (datasourcetypeuiname exact \"Journal archive\" or datasourcetypeuiname exact \"Repository\"))&refine=true&fields=datasourcetypename&fields=country&fields=datasourceodsubjects&fields=datasourceodcontenttypes&fields=datasourcecompatibilityname&fields=datasourcethematic&fields=datasourcejurisdiction&&type=datasources&page=0&size=0",
|
||||
"/resources/?format=json&query=( oaftype exact datasource and (eoscdatasourcetype exact \"Journal Archive\" or eoscdatasourcetype exact \"Repository\"))&refine=true&fields=datasourcetypename&fields=country&fields=datasourceodsubjects&fields=datasourceodcontenttypes&fields=datasourcecompatibilityname&fields=datasourcethematic&fields=datasourcejurisdiction&&type=datasources&page=0&size=0",
|
||||
|
||||
"/search/v2/api/datasources/count?format=json", "/search/v2/api/publications/count?format=json", "/search/v2/api/datasets/count?format=json", "/search/v2/api/software/count?format=json", "/search/v2/api/other/count?format=json",
|
||||
"relresulttype%3Dpublication"
|
||||
|
|
|
@ -114,9 +114,9 @@
|
|||
<ng-container *ngIf="dataProviderInfo.compatibility.name">{{dataProviderInfo.compatibility.name}}</ng-container>
|
||||
</a>
|
||||
<span *ngIf="!dataProviderInfo.compatibility.id">
|
||||
<ng-container *ngIf="dataProviderInfo.compatibility.info != 'not available'">{{dataProviderInfo.compatibility.info}}</ng-container>
|
||||
<ng-container *ngIf="dataProviderInfo.compatibility.info == 'not available'">
|
||||
Not yet registered <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
|
||||
<ng-container *ngIf="dataProviderInfo.compatibility.info.toLowerCase() != 'not yet registered'">{{dataProviderInfo.compatibility.info}}</ng-container>
|
||||
<ng-container *ngIf="dataProviderInfo.compatibility.info.toLowerCase() == 'not yet registered'">
|
||||
{{dataProviderInfo.compatibility.info}} <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
|
||||
</ng-container>
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
|
||||
|
|
|
@ -518,8 +518,8 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
// publication & dataset landing : for subjects and otherSubjects and classifiedSubjects
|
||||
parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map<string, string[]>, Map<string, string[]>, string[], string[], any[]] {
|
||||
let eoscSubjectsFound = [];
|
||||
parseAllSubjects(_subjects: any, vocabulary: any): [string[], Map<string, string[]>, Map<string, string[]>, string[], string[], ] {
|
||||
// let eoscSubjectsFound = [];
|
||||
let subjects: string[];
|
||||
let otherSubjects: Map<string, string[]>;
|
||||
let classifiedSubjects: Map<string, string[]>;
|
||||
|
@ -530,25 +530,25 @@ export class ParsingFunctions {
|
|||
|
||||
let subject;
|
||||
let length = Array.isArray(_subjects) ? _subjects.length : 1;
|
||||
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
|
||||
if (subject.classid != "") {
|
||||
if (subject.classid == "keyword") {
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
}
|
||||
subjects.push(content);
|
||||
// let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
// let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
// if(found) {
|
||||
// setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
// eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
// } else {
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
}
|
||||
subjects.push(content);
|
||||
// }
|
||||
} else if (!vocabulary || vocabulary[subject.classid] || subject.classid === "SDG" || subject.classid === "FOS") {
|
||||
// if (subject.inferred && subject.inferred == true) {
|
||||
// if (subject.inferred && subject.inferred == true) {
|
||||
if(subject.classid === "SDG") {
|
||||
if (sdg == undefined) {
|
||||
sdg = new Array<string>();
|
||||
|
@ -564,37 +564,37 @@ export class ParsingFunctions {
|
|||
classifiedSubjects = new Map<string, string[]>();
|
||||
}
|
||||
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
if (!classifiedSubjects.has(subject.classname)) {
|
||||
classifiedSubjects.set(subject.classname, new Array<string>());
|
||||
}
|
||||
classifiedSubjects.get(subject.classname).push(content);
|
||||
}
|
||||
let content: string = subject.content+"";
|
||||
// let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
// let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
// if(found) {
|
||||
// setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
// eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
// } else {
|
||||
if (!classifiedSubjects.has(subject.classname)) {
|
||||
classifiedSubjects.set(subject.classname, new Array<string>());
|
||||
}
|
||||
classifiedSubjects.get(subject.classname).push(content);
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
let classname: string = subject.classname + "";
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
}
|
||||
subjects.push(content);
|
||||
// let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, eoscSubjectsFound, subject, content);
|
||||
// let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
// if(found) {
|
||||
// setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
// eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
// } else {
|
||||
let classname: string = subject.classname + "";
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
}
|
||||
subjects.push(content);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
return [subjects, otherSubjects, classifiedSubjects, fos, sdg, eoscSubjectsFound];
|
||||
return [subjects, otherSubjects, classifiedSubjects, fos, sdg];
|
||||
}
|
||||
|
||||
checkAndAddEoscSubject(setOfEoscSubjects: Set<string>, eoscSubjectsFound, subject, content) {
|
||||
|
|
|
@ -336,7 +336,7 @@ export class ResultLandingService {
|
|||
|
||||
// res['result']['metadata']['oaf:entity']['oaf:result']['subject']
|
||||
if(data[8] != null) {
|
||||
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>, string[], string[], any[]] = this.parsingFunctions.parseAllSubjects(data[8], subjectsVocabulary);
|
||||
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>, string[], string[]] = this.parsingFunctions.parseAllSubjects(data[8], subjectsVocabulary);
|
||||
this.resultLandingInfo.subjects = subjectResults[0];
|
||||
this.resultLandingInfo.otherSubjects = subjectResults[1];
|
||||
this.resultLandingInfo.classifiedSubjects = subjectResults[2];
|
||||
|
@ -351,9 +351,9 @@ export class ResultLandingService {
|
|||
})
|
||||
}
|
||||
|
||||
if(!this.resultLandingInfo.eoscSubjects) {
|
||||
this.resultLandingInfo.eoscSubjects = subjectResults[5];
|
||||
}
|
||||
// if(!this.resultLandingInfo.eoscSubjects) {
|
||||
// this.resultLandingInfo.eoscSubjects = subjectResults[5];
|
||||
// }
|
||||
}
|
||||
|
||||
this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
|
||||
|
|
|
@ -22,7 +22,7 @@ export class DatasourcesHelperClass {
|
|||
|
||||
public static getTitle(type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services") {
|
||||
if (type == "registries") {
|
||||
return "Entity Registries"
|
||||
return "Research Entity Registries"
|
||||
} else if (type == "journals") {
|
||||
return "Journals"
|
||||
} else if (type == "compatible") {
|
||||
|
@ -48,15 +48,15 @@ export class DatasourcesHelperClass {
|
|||
}
|
||||
public static getQueryPrefix(type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services"): string {
|
||||
if (type == "registries") {
|
||||
return 'datasourcetypeuiname exact "Registry"';
|
||||
return 'eoscdatasourcetype exact "Research Entity Registry"';
|
||||
} else if (type == "journals") {
|
||||
// return ' not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = notCompatible) and (datasourcetypeuiid exact "pubsrepository::journal" or datasourcetypeuiid exact "aggregator::pubsrepository::journals" ) ';
|
||||
return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and datasourcetypeuiname exact "Journal archive" ';
|
||||
return 'oaftype exact datasource not datasourcecompatibilityid = notCompatible and eoscdatasourcetype exact "Journal Archive" ';
|
||||
|
||||
} else if (type == "compatible") {
|
||||
return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and datasourcetypeuiname exact "Repository" ';
|
||||
return ' oaftype exact datasource and datasourcecompatibilityid <> notCompatible and eoscdatasourcetype exact "Repository" ';
|
||||
}else if (type == "deposit") {
|
||||
return ' oaftype exact datasource and (datasourcetypeuiname exact "Journal archive" or datasourcetypeuiname exact "Repository")';
|
||||
return ' oaftype exact datasource and (eoscdatasourcetype exact "Journal Archive" or eoscdatasourcetype exact "Repository")';
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -62,16 +62,16 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
this.queryParams = Object.assign({}, params);
|
||||
this.paramPosition = SearchFields.getParameterOrder(this.filter.filterId, this.getEntries(params));
|
||||
});
|
||||
this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
this.sort();
|
||||
if (this.filter.filterType == "radio") {
|
||||
this.filter.radioValue = "";
|
||||
this.filter.values.forEach(value => {
|
||||
if (value.selected) {
|
||||
this.filter.radioValue = value.id
|
||||
}
|
||||
});
|
||||
}
|
||||
// this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
// this.sort();
|
||||
// if (this.filter.filterType == "radio") {
|
||||
// this.filter.radioValue = "";
|
||||
// this.filter.values.forEach(value => {
|
||||
// if (value.selected) {
|
||||
// this.filter.radioValue = value.id
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@ -85,6 +85,7 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
}
|
||||
});
|
||||
}
|
||||
this.sort();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ export class SearchFields {
|
|||
|
||||
//DATAPROVIDERS
|
||||
// add Collected From Filter "collectedfromname"
|
||||
public DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypeuiname", "datasourceodlanguages", "datasourceodcontenttypes",
|
||||
public DATASOURCE_REFINE_FIELDS: string[] = ["eoscdatasourcetype", "datasourceodlanguages", "datasourceodcontenttypes",
|
||||
"datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic",
|
||||
"datasourcejurisdiction"];
|
||||
public DATASOURCE_ADVANCED_FIELDS: string[] = ["q", "datasourceofficialname",
|
||||
|
@ -471,6 +471,14 @@ export class SearchFields {
|
|||
equalityOperator: " exact ",
|
||||
filterType: "radio"
|
||||
},
|
||||
["eoscdatasourcetype"]: {
|
||||
name: "Type",
|
||||
type: "refine",
|
||||
param: "type",
|
||||
operator: "tp",
|
||||
equalityOperator: " exact ",
|
||||
filterType: "radio"
|
||||
},
|
||||
["datasourcetypename"]: {
|
||||
name: "Type",
|
||||
type: "vocabulary",
|
||||
|
@ -567,7 +575,7 @@ export class SearchFields {
|
|||
{"name": "relorganizationshortname", "equalityOperator": "="},
|
||||
{"name": "datasourceofficialname", "equalityOperator": "="},
|
||||
{"name": "datasourceenglishname", "equalityOperator": "="},
|
||||
{"name": "datasourcetypeuiname", "equalityOperator": " exact "},
|
||||
{"name": "eoscdatasourcetype", "equalityOperator": " exact "},
|
||||
{"name": "country", "equalityOperator": " exact "},
|
||||
{"name": "datasourcesubject", "equalityOperator": " all "}
|
||||
];
|
||||
|
@ -582,6 +590,14 @@ export class SearchFields {
|
|||
equalityOperator: " exact ",
|
||||
filterType: "radio"
|
||||
},
|
||||
["eoscdatasourcetype"]: {
|
||||
name: "Repository type",
|
||||
type: "refine",
|
||||
param: "type",
|
||||
operator: "tp",
|
||||
equalityOperator: " exact ",
|
||||
filterType: "radio"
|
||||
},
|
||||
["country"]: {
|
||||
name: "Countries",
|
||||
type: "vocabulary",
|
||||
|
@ -701,11 +717,11 @@ export class SearchFields {
|
|||
}
|
||||
|
||||
getResultAdvancedFields() {
|
||||
if(properties.environment == "production") {
|
||||
this.RESULT_ADVANCED_FIELDS = this.RESULT_ADVANCED_FIELDS.filter((value, index, array) => {
|
||||
return value != "eoscifguidelines";
|
||||
})
|
||||
}
|
||||
// if(properties.environment == "production") {
|
||||
// this.RESULT_ADVANCED_FIELDS = this.RESULT_ADVANCED_FIELDS.filter((value, index, array) => {
|
||||
// return value != "eoscifguidelines";
|
||||
// })
|
||||
// }
|
||||
return this.RESULT_ADVANCED_FIELDS;
|
||||
}
|
||||
|
||||
|
@ -806,7 +822,7 @@ export class SearchFields {
|
|||
if (fieldId == "relfunder" || fieldId == "relfundinglevel0_id" || fieldId == "relfundinglevel1_id" || fieldId == "relfundinglevel2_id"
|
||||
|| fieldId == "relproject" || fieldId == "community" || fieldId == "projectendyear-range-projectstartyear") {
|
||||
return "and";
|
||||
} else if (fieldId == "instancetypename" || fieldId == "datasourcetypeuiname"
|
||||
} else if (fieldId == "instancetypename" || fieldId == "eoscdatasourcetype"
|
||||
|| fieldId == "resultlanguagename" || fieldId == "datasourceodlanguages"
|
||||
|| fieldId == "datasourcecompatibilityname" || fieldId == "country" || fieldId == "datasourceodcontenttypes"
|
||||
|| fieldId == "resulthostingdatasource" || fieldId == "collectedfrom") {
|
||||
|
|
|
@ -129,15 +129,15 @@
|
|||
<!-- Special Clause 39-->
|
||||
<!-- </span>{{' '}}-->
|
||||
<span
|
||||
*ngIf="result.compatibility && result.compatibility != '' && result.compatibility != 'not available'"
|
||||
*ngIf="result.compatibility && result.compatibility != '' && result.compatibility.toLowerCase() != 'not yet registered'"
|
||||
class="uk-label" title="Compatibility">
|
||||
{{result.compatibility}}
|
||||
</span>{{' '}}
|
||||
<span
|
||||
*ngIf="result.compatibility != undefined && result.compatibility != '' && result.compatibility == 'not available'
|
||||
*ngIf="result.compatibility != undefined && result.compatibility != '' && result.compatibility.toLowerCase() == 'not yet registered'
|
||||
&& result.resultType != 'service'"
|
||||
class="uk-label" [class.uk-label-danger]="deposit" title="OpenAIRE Compatibility">
|
||||
Not yet registered <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
|
||||
{{result.compatibility}} <span *ngIf="properties.adminToolsPortalType == 'eosc'">in OpenAIRE</span>
|
||||
</span>{{' '}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue