[Library|Trunk]
Claims: change type of openaire results to "Entity type" add link to the landing page of Openaire results remove cursor-pointer in Basket Title of Sources in the 1st step Autocomplete / entity search service remove unused method (used in old linking UI) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@57384 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
299a2bbb61
commit
351f5ebaa2
|
@ -34,6 +34,7 @@ export class ClaimProject {
|
||||||
public code: string;
|
public code: string;
|
||||||
public jurisdiction: string;
|
public jurisdiction: string;
|
||||||
public fundingLevel0: string;
|
public fundingLevel0: string;
|
||||||
|
public url: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ClaimContext {
|
export class ClaimContext {
|
||||||
|
|
|
@ -78,7 +78,7 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
if(data != null) {
|
if(data != null) {
|
||||||
this.openaireResultsPage=page;
|
this.openaireResultsPage=page;
|
||||||
this.openaireResultsNum = data[0];
|
this.openaireResultsNum = data[0];
|
||||||
this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1]);
|
this.openaireResults =ClaimProjectsSearchFormComponent.openaire2ClaimEntity(data[1], this.properties);
|
||||||
if(data[2] && data[2].length > 0){
|
if(data[2] && data[2].length > 0){
|
||||||
this.filters = this.checkSelectedFilters( data[2], this.prevFilters);
|
this.filters = this.checkSelectedFilters( data[2], this.prevFilters);
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
} while (clickedComponent);
|
} while (clickedComponent);
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
static openaire2ClaimEntity(items){
|
static openaire2ClaimEntity(items, properties:EnvProperties){
|
||||||
const projects: ClaimEntity[] = [];
|
const projects: ClaimEntity[] = [];
|
||||||
for(const item of items){
|
for(const item of items){
|
||||||
const entity: ClaimEntity = new ClaimEntity();
|
const entity: ClaimEntity = new ClaimEntity();
|
||||||
|
@ -176,6 +176,7 @@ export class ClaimProjectsSearchFormComponent {
|
||||||
entity.project.funderId = item.funderId;
|
entity.project.funderId = item.funderId;
|
||||||
entity.project.funderName = item.funderShortname;
|
entity.project.funderName = item.funderShortname;
|
||||||
entity.id = item.id;
|
entity.id = item.id;
|
||||||
|
entity.project.url = properties.searchLinkToProject + entity.id;
|
||||||
entity.title = item.title.name;
|
entity.title = item.title.name;
|
||||||
entity.project.acronym = item.acronym;
|
entity.project.acronym = item.acronym;
|
||||||
entity.project.startDate = item.startYear;
|
entity.project.startDate = item.startYear;
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
<!-- Type filter-->
|
<!-- Type filter-->
|
||||||
<ul class="uk-list">
|
<ul class="uk-list">
|
||||||
<li class="uk-open">
|
<li class="uk-open">
|
||||||
<h5 class="uk-margin-bottom-remove searchFilterTitle">Type (4)
|
<h5 class="uk-margin-bottom-remove searchFilterTitle">Entity Type (4)
|
||||||
</h5>
|
</h5>
|
||||||
<div aria-expanded="false">
|
<div aria-expanded="false">
|
||||||
<div class="searchFilterBoxValues ">
|
<div class="searchFilterBoxValues ">
|
||||||
|
|
|
@ -303,7 +303,7 @@ export class ClaimResultSearchFormComponent {
|
||||||
if(data[2] && data[2].length > 0){
|
if(data[2] && data[2].length > 0){
|
||||||
this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters)
|
this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters)
|
||||||
}
|
}
|
||||||
this.openaireResults = ClaimResultSearchFormComponent.openaire2ClaimResults(data[1], type);
|
this.openaireResults = ClaimResultSearchFormComponent.openaire2ClaimResults(data[1], type, this.properties);
|
||||||
this.openaireResultsStatus = this.errorCodes.DONE;
|
this.openaireResultsStatus = this.errorCodes.DONE;
|
||||||
if (this.openaireResultsNum == 0) {
|
if (this.openaireResultsNum == 0) {
|
||||||
this.openaireResultsStatus = this.errorCodes.NONE;
|
this.openaireResultsStatus = this.errorCodes.NONE;
|
||||||
|
@ -596,7 +596,7 @@ export class ClaimResultSearchFormComponent {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static openaire2ClaimResults(data, type): ClaimEntity[] {
|
public static openaire2ClaimResults(data, type, properties): ClaimEntity[] {
|
||||||
const claimResults = [];
|
const claimResults = [];
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
let item = data[i];
|
let item = data[i];
|
||||||
|
@ -607,7 +607,17 @@ export class ClaimResultSearchFormComponent {
|
||||||
entity.result.DOI = null;
|
entity.result.DOI = null;
|
||||||
entity.id = item.id;
|
entity.id = item.id;
|
||||||
entity.title = item.title.name;
|
entity.title = item.title.name;
|
||||||
entity.result.url = item.title.url;
|
let prefixUrl = "";
|
||||||
|
if(type == "publication"){
|
||||||
|
prefixUrl = properties.searchLinkToPublication;
|
||||||
|
}else if(type == "dataset"){
|
||||||
|
prefixUrl = properties.searchLinkToDataset;
|
||||||
|
}else if(type == "software"){
|
||||||
|
prefixUrl = properties.searchLinkToSoftwareLanding;
|
||||||
|
}else if(type == "other"){
|
||||||
|
prefixUrl = properties.searchLinkToOrp;
|
||||||
|
}
|
||||||
|
entity.result.url = prefixUrl + entity.id;
|
||||||
entity.result.source = String("openaire");
|
entity.result.source = String("openaire");
|
||||||
entity.result.date = (item.year && item.year != "") ? item.year : null;
|
entity.result.date = (item.year && item.year != "") ? item.year : null;
|
||||||
entity.result.accessRights = String(item.title.accessMode);
|
entity.result.accessRights = String(item.title.accessMode);
|
||||||
|
|
|
@ -164,7 +164,7 @@ export class DirectLinkingComponent {
|
||||||
entity.project.startDate = project.startDate;
|
entity.project.startDate = project.startDate;
|
||||||
this.inlineEntity = entity;
|
this.inlineEntity = entity;
|
||||||
}else{
|
}else{
|
||||||
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, type);
|
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, type, this.properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.length > 0) {
|
if (results.length > 0) {
|
||||||
|
|
|
@ -81,7 +81,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="linksbasket uk-inline uk-width-1-1" style="">
|
<div class="linksbasket uk-inline uk-width-1-1" style="">
|
||||||
<div *ngIf="inlineEntity == null">
|
<div *ngIf="inlineEntity == null">
|
||||||
<div class="linksbaskettitles uk-padding-small uk-animation-toggle" (click)="showOptions.showBasketSources()">
|
<div class="linksbaskettitles uk-padding-small uk-animation-toggle"
|
||||||
|
(click)="showOptions.showBasketSources()"
|
||||||
|
[style.cursor]="(showOptions.show!='source'?'pointer':'default')">
|
||||||
<div class="uk-h6 uk-margin-remove portal-color" >
|
<div class="uk-h6 uk-margin-remove portal-color" >
|
||||||
SOURCES ({{(sources.length) | number}})
|
SOURCES ({{(sources.length) | number}})
|
||||||
<span *ngIf="showOptions.show!='source' && !showOptions.basketShowSources"
|
<span *ngIf="showOptions.show!='source' && !showOptions.basketShowSources"
|
||||||
|
|
|
@ -12,12 +12,25 @@ import {StringUtils} from "../../../utils/string-utils.class";
|
||||||
<span
|
<span
|
||||||
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
|
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
|
||||||
<span *ngIf="entity.type=='project' && entity.project">
|
<span *ngIf="entity.type=='project' && entity.project">
|
||||||
|
<a *ngIf="entity.project && entity.project.url" target="_blank" [href]="entity.project.url"
|
||||||
|
class="uk-link">
|
||||||
<span *ngIf="!shortVersion">
|
<span *ngIf="!shortVersion">
|
||||||
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
|
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="shortVersion">
|
<span *ngIf="shortVersion">
|
||||||
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
|
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
|
||||||
</span>
|
</span>
|
||||||
|
</a>
|
||||||
|
<span
|
||||||
|
*ngIf="(entity.project && !entity.project.url)">
|
||||||
|
<span *ngIf="!shortVersion">
|
||||||
|
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
|
||||||
|
</span>
|
||||||
|
<span *ngIf="shortVersion">
|
||||||
|
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="entity.type=='community' && entity.context">
|
<span *ngIf="entity.type=='community' && entity.context">
|
||||||
|
|
|
@ -100,7 +100,7 @@ export class EntitiesAutocompleteComponent {
|
||||||
private initialize(){
|
private initialize(){
|
||||||
|
|
||||||
this.showInput = true;
|
this.showInput = true;
|
||||||
if(this.entityType == "project" && this.funderId ){
|
/* if(this.entityType == "project" && this.funderId ){
|
||||||
this.filtered = this.searchTermStream.pipe(
|
this.filtered = this.searchTermStream.pipe(
|
||||||
debounceTime(300),distinctUntilChanged(),
|
debounceTime(300),distinctUntilChanged(),
|
||||||
switchMap((term: string) => {
|
switchMap((term: string) => {
|
||||||
|
@ -110,7 +110,9 @@ export class EntitiesAutocompleteComponent {
|
||||||
this.results = results.length;
|
this.results = results.length;
|
||||||
return results;
|
return results;
|
||||||
}),);
|
}),);
|
||||||
}else if(this.entityType == "organization" && this.depositType ){
|
}else */
|
||||||
|
|
||||||
|
if(this.entityType == "organization" && this.depositType ){
|
||||||
this.filtered = this.searchTermStream.pipe(
|
this.filtered = this.searchTermStream.pipe(
|
||||||
debounceTime(300),distinctUntilChanged(),
|
debounceTime(300),distinctUntilChanged(),
|
||||||
switchMap((term: string) => {
|
switchMap((term: string) => {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export class EntitiesSearchService {
|
||||||
public ready:boolean = false;
|
public ready:boolean = false;
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
|
||||||
searchProjectsByFunder(keyword:string, funderId:string, properties:EnvProperties ):any {
|
/*searchProjectsByFunder(keyword:string, funderId:string, properties:EnvProperties ):any {
|
||||||
this.ready = false;
|
this.ready = false;
|
||||||
let url = properties.searchResourcesAPIURL;
|
let url = properties.searchResourcesAPIURL;
|
||||||
//console.log("Funder is " + funderId);
|
//console.log("Funder is " + funderId);
|
||||||
|
@ -40,7 +40,7 @@ export class EntitiesSearchService {
|
||||||
console.error('An error occured', ex);
|
console.error('An error occured', ex);
|
||||||
return [{id:'-2',label:'Error'}];;
|
return [{id:'-2',label:'Error'}];;
|
||||||
});
|
});
|
||||||
}
|
}*/
|
||||||
searchByDepositType(keyword:string, DepositType:string, properties:EnvProperties ):any {
|
searchByDepositType(keyword:string, DepositType:string, properties:EnvProperties ):any {
|
||||||
this.ready = false;
|
this.ready = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue