[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:
argiro.kokogiannaki 2019-10-16 10:18:32 +00:00
parent 299a2bbb61
commit 351f5ebaa2
9 changed files with 41 additions and 12 deletions

View File

@ -34,6 +34,7 @@ export class ClaimProject {
public code: string;
public jurisdiction: string;
public fundingLevel0: string;
public url: string;
}
export class ClaimContext {

View File

@ -78,7 +78,7 @@ export class ClaimProjectsSearchFormComponent {
if(data != null) {
this.openaireResultsPage=page;
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){
this.filters = this.checkSelectedFilters( data[2], this.prevFilters);
}
@ -168,7 +168,7 @@ export class ClaimProjectsSearchFormComponent {
} while (clickedComponent);
}*/
static openaire2ClaimEntity(items){
static openaire2ClaimEntity(items, properties:EnvProperties){
const projects: ClaimEntity[] = [];
for(const item of items){
const entity: ClaimEntity = new ClaimEntity();
@ -176,6 +176,7 @@ export class ClaimProjectsSearchFormComponent {
entity.project.funderId = item.funderId;
entity.project.funderName = item.funderShortname;
entity.id = item.id;
entity.project.url = properties.searchLinkToProject + entity.id;
entity.title = item.title.name;
entity.project.acronym = item.acronym;
entity.project.startDate = item.startYear;

View File

@ -107,7 +107,7 @@
<!-- Type filter-->
<ul class="uk-list">
<li class="uk-open">
<h5 class="uk-margin-bottom-remove searchFilterTitle">Type (4)
<h5 class="uk-margin-bottom-remove searchFilterTitle">Entity Type (4)
</h5>
<div aria-expanded="false">
<div class="searchFilterBoxValues ">

View File

@ -303,7 +303,7 @@ export class ClaimResultSearchFormComponent {
if(data[2] && data[2].length > 0){
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;
if (this.openaireResultsNum == 0) {
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 = [];
for (let i = 0; i < data.length; i++) {
let item = data[i];
@ -607,7 +607,17 @@ export class ClaimResultSearchFormComponent {
entity.result.DOI = null;
entity.id = item.id;
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.date = (item.year && item.year != "") ? item.year : null;
entity.result.accessRights = String(item.title.accessMode);

View File

@ -164,7 +164,7 @@ export class DirectLinkingComponent {
entity.project.startDate = project.startDate;
this.inlineEntity = entity;
}else{
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, type);
results = ClaimResultSearchFormComponent.openaire2ClaimResults(data, type, this.properties);
}
if (results.length > 0) {

View File

@ -81,7 +81,9 @@
</div>
<div class="linksbasket uk-inline uk-width-1-1" style="">
<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" >
SOURCES ({{(sources.length) | number}})
<span *ngIf="showOptions.show!='source' && !showOptions.basketShowSources"

View File

@ -12,12 +12,25 @@ import {StringUtils} from "../../../utils/string-utils.class";
<span
*ngIf="(entity.result && !entity.result.url)">{{entity.title ? sliceString(entity.title) : '[No title available]'}}</span>
<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">
{{(entity.project.acronym ? '[' + entity.project.acronym + '] ' : '') + entity.title}}
</span>
<span *ngIf="shortVersion">
{{(entity.project.acronym ? sliceString(entity.project.acronym):sliceString(entity.title))}}
</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 *ngIf="entity.type=='community' && entity.context">

View File

@ -100,7 +100,7 @@ export class EntitiesAutocompleteComponent {
private initialize(){
this.showInput = true;
if(this.entityType == "project" && this.funderId ){
/* if(this.entityType == "project" && this.funderId ){
this.filtered = this.searchTermStream.pipe(
debounceTime(300),distinctUntilChanged(),
switchMap((term: string) => {
@ -110,7 +110,9 @@ export class EntitiesAutocompleteComponent {
this.results = results.length;
return results;
}),);
}else if(this.entityType == "organization" && this.depositType ){
}else */
if(this.entityType == "organization" && this.depositType ){
this.filtered = this.searchTermStream.pipe(
debounceTime(300),distinctUntilChanged(),
switchMap((term: string) => {

View File

@ -15,7 +15,7 @@ export class EntitiesSearchService {
public ready:boolean = false;
constructor(private http: HttpClient ) {}
searchProjectsByFunder(keyword:string, funderId:string, properties:EnvProperties ):any {
/*searchProjectsByFunder(keyword:string, funderId:string, properties:EnvProperties ):any {
this.ready = false;
let url = properties.searchResourcesAPIURL;
//console.log("Funder is " + funderId);
@ -40,7 +40,7 @@ export class EntitiesSearchService {
console.error('An error occured', ex);
return [{id:'-2',label:'Error'}];;
});
}
}*/
searchByDepositType(keyword:string, DepositType:string, properties:EnvProperties ):any {
this.ready = false;