[Trunk | Library]:
1. newSearchPage.component.ts: a. For filter with type "identifier", build params by calling createKeywordQuery() method (currently useless - authorid filter will be changed to type "identifier" on following commits). b. [Bug fix] EncodeURI the identifier.id of identifiers. 2. searchResult.component.ts: [Bug fix] Add check if result.identifiers.get("doi"). 3. showIdentifiers.component.ts: [Bug fix] Add comma "," and "..." when needed. 4. showPublisher.component.ts: [Bug fix] Add class "uk-display-inline-block" for not breaking "Sherpa/ RoMEO" icon from text. 5. resultLanding.service.ts: [Bug fix] Set resultLandingInfo.title to title with classid=="main title" (requested in ticket #6342). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60397 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
f57e7d4d60
commit
66645f70f2
|
@ -1,6 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||
import {properties} from "../../../../environments/environment";
|
||||
|
||||
@Component({
|
||||
selector: 'showIdentifiers',
|
||||
|
@ -25,7 +26,11 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
{{item}} <span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="j !== (identifiers.get(key).length - 1)">, </span>
|
||||
<!-- <span *ngIf="j !== (identifiers.get(key).length - 1)">, </span>-->
|
||||
|
||||
<span *ngIf="(j !== (identifiers.get(key).length - 1)) && (showAll || ((sizeOfPreviousIdentifiers+j+1) < pageSize))">, </span>
|
||||
<span *ngIf="!showAll && (sizeOfPreviousIdentifiers+j+1) == pageSize && sizeOfIdentifiers > pageSize"> ... </span>
|
||||
|
||||
</span>
|
||||
</ng-container>
|
||||
</span>
|
||||
|
@ -37,14 +42,14 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
</a>
|
||||
</div>
|
||||
<div *ngIf="showAll && countIdentifiers() > pageSize" class="uk-text-right">
|
||||
<a (click)="showAll = !showAll; scroll()">View less identifiers</a>
|
||||
<a (click)="showAll = !showAll;">View less identifiers</a>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class ShowIdentifiersComponent {
|
||||
@Input() identifiers: Map<string, string[]>;
|
||||
@Input() properties: EnvProperties;
|
||||
@Input() properties: EnvProperties = properties;
|
||||
public showAll: boolean = false;
|
||||
public sizeOfIdentifiers: number = -1;
|
||||
public sizeOfPreviousIdentifiers: number = -1;
|
||||
|
@ -71,12 +76,21 @@ export class ShowIdentifiersComponent {
|
|||
let num: number = 0;
|
||||
let i: number = 0;
|
||||
if (this.identifiers != undefined) {
|
||||
this.identifiers.forEach(function (value, key, map) {
|
||||
let self = this;
|
||||
this.getKeys(this.identifiers).forEach(function(key: string) {
|
||||
// console.debug("value:", self.identifiers.get(key));
|
||||
if (i < index) {
|
||||
num += value.length;
|
||||
num += self.identifiers.get(key).length;
|
||||
}
|
||||
i++;
|
||||
});
|
||||
})
|
||||
// this.identifiers.forEach(function (value, key, map) {
|
||||
// console.debug("value:", value);
|
||||
// if (i < index) {
|
||||
// num += value.length;
|
||||
// }
|
||||
// i++;
|
||||
// });
|
||||
}
|
||||
this.sizeOfPreviousIdentifiers = num;
|
||||
return num;
|
||||
|
|
|
@ -58,7 +58,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
<span>, </span>
|
||||
</span>
|
||||
<span *ngIf="journal && (journal['issn'] ||journal['lissn'] || journal['eissn'] )">
|
||||
<a target="_blank"
|
||||
<a target="_blank" class="uk-display-inline-block"
|
||||
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))+properties.sherpaURLSuffix"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
|
|
|
@ -151,7 +151,15 @@ export class ResultLandingService {
|
|||
// res['result']['metadata']['oaf:entity']['oaf:result']['title']
|
||||
if(data[1] != null) {
|
||||
if(Array.isArray(data[1])) {
|
||||
this.resultLandingInfo.title = (data[1][0] && data[1][0].content) ? String(data[1][0].content) : "";
|
||||
for(let i=0; i<data[1].length; i++) {
|
||||
if(data[1][i] && data[1][i].content) {
|
||||
this.resultLandingInfo.title = data[1][i].content;
|
||||
if(data[1][i].classid == "main title") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// this.resultLandingInfo.title = (data[1][0] && data[1][0].content) ? String(data[1][0].content) : "";
|
||||
if(data[1][1].classid === 'subtitle') {
|
||||
this.resultLandingInfo.subtitle = (data[1][1] && data[1][1].content) ? String(data[1][1].content) : "";
|
||||
}
|
||||
|
|
|
@ -881,6 +881,8 @@ export class NewSearchPageComponent {
|
|||
}
|
||||
}
|
||||
|
||||
} else if(this.selectedFields[i].type == "identifier") {
|
||||
params += NewSearchPageComponent.createKeywordQuery(this.entityType,this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams);
|
||||
} else if (countParams == 0 && this.selectedFields[i].operatorId == "not" && this.fieldIdsMap[this.selectedFields[i].id].equalityOperator != "=") {
|
||||
params += " " + this.selectedFields[i].id + " <> " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " ";
|
||||
} else if(this.fieldIdsMap[this.selectedFields[i].id].equalityOperator == "=") {
|
||||
|
@ -908,9 +910,11 @@ export class NewSearchPageComponent {
|
|||
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"
|
||||
//and (authorid exact \"0000-0001-7291-3210 \" )"
|
||||
if(identifier.class == "ORCID"){
|
||||
doisParams += (doisParams.length > 0 ? " or " : "") +'(authorid="' + identifier.id + '")';
|
||||
doisParams += (doisParams.length > 0 ? " or " : "") +'(authorid="' + StringUtils.URIEncode(identifier.id) + '")';
|
||||
// doisParams += (doisParams.length > 0 ? " or " : "") +'(authorid="' + StringUtils.URIEncode(identifier.id) + '" and (authoridtype exact "orcid"))';
|
||||
}else{
|
||||
doisParams += (doisParams.length > 0 ? " or " : "") +'(pidclassid exact "' + identifier.class + '" and pid="' + identifier.id + '")';
|
||||
doisParams += (doisParams.length > 0 ? " or " : "") +'(pidclassid exact "' + identifier.class + '" and pid="' + StringUtils.URIEncode(identifier.id) + '")';
|
||||
// doisParams += (doisParams.length > 0 ? " or " : "") +'(pidclassid exact "' + identifier.class + '" and pid="' + identifier.id + '")';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ export class SearchResultComponent implements OnInit, OnChanges {
|
|||
impact[result.doi]=result;
|
||||
});
|
||||
this.previewResults.forEach(function (result) {
|
||||
if(result.identifiers) {
|
||||
if(result.identifiers && result.identifiers.get("doi")) {
|
||||
result.identifiers.get("doi").forEach(function (doi) {
|
||||
if (impact[doi]) {
|
||||
result.DOI = doi;
|
||||
|
|
Loading…
Reference in New Issue