Fix tabs in publication landing page (bug caused from merge) | special clause 39 icon added in project landing and search results | acronym and project code added in search results

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46142 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-03-06 14:07:31 +00:00
parent 613f602e98
commit 94857a762a
15 changed files with 55 additions and 25 deletions

View File

@ -6,7 +6,10 @@
<div class="uk-width-7-10">
<!--h3 *ngIf="projectInfo.acronym != undefined && projectInfo.acronym != ''">{{projectInfo.acronym}}</h3>
<h3 *ngIf="projectInfo.acronym == undefined || projectInfo.acronym == ''">{{projectInfo.title}}</h3-->
<h2>{{projectName}}</h2>
<div class="projectIcon">
<h2 *ngIf="projectInfo.specialClause39==true" class="sc39">{{projectName}}</h2>
<h2 *ngIf="projectInfo.specialClause39!=true">{{projectName}}</h2>
</div>
<dl class="uk-description-list-horizontal custom-description-list-horizontal">
<dt *ngIf="projectInfo.title != undefined && projectInfo.title != ''">Title: </dt>
@ -163,7 +166,7 @@
<li>
Share - Bookmark
</li>
<li>
<li *ngIf="fetchPublications.searchUtils.totalResults > 10">
<a href="{{linkToSearchPublications}}">
View all Project Publications
</a>

View File

@ -3,7 +3,6 @@ import { NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { RouterModule } from '@angular/router';
import { ProjectServiceModule} from './projectService.module';
// import {HtmlProgressReportService} from './htmlProgressReport.service';

View File

@ -103,7 +103,11 @@ export class ProjectService {
if(data[0] != null) {
this.projectInfo.acronym = data[0].acronym;
this.projectInfo.title = data[0].title;
if(Array.isArray(data[0]['title'])) {
this.projectInfo.title = data[0].title[0];
} else {
this.projectInfo.title = data[0].title;
}
this.projectInfo.callIdentifier = data[0].callidentifier;
this.projectInfo.contractNum = data[0].code;
this.projectInfo.startDate = data[0].startdate;

View File

@ -103,7 +103,7 @@
</li>
</ul>
<ul id="{{'tab-content'+articleId}}" class="uk-switcher uk-margin">
<ul id="tab-content" class="uk-switcher uk-margin">
<li id="citationsTab-content">
<div *ngIf="publicationInfo.references == undefined" class = "uk-alert" >

View File

@ -13,7 +13,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<li *ngFor="let result of results" class="uk-animation-fade">
<h4 [class] = result.title.accessMode [title] = result.title.accessMode >
<h4 class = "{{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
<!--a href="{{result['title'].url}}"-->
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">

View File

@ -242,7 +242,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number
}
);
}
/*
public getAggregatorResults(id:string, page: number, size: number){
this.subResults = this._searchPublicationsService.searchAggregators('&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
data => {
@ -264,7 +264,7 @@ public getAggregatorResults(id:string, page: number, size: number){
this.searchUtils.status = errorCodes.ERROR;
}
);
}
}*/
public queryChanged($event) {
var parameters = $event.value;

View File

@ -247,7 +247,7 @@ export class SearchDataprovidersService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
result['title'].name = resData.officialname;

View File

@ -146,7 +146,7 @@ export class SearchDatasetsService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(Array.isArray(resData['title'])) {
result['title'].name = resData['title'][0].content;

View File

@ -97,7 +97,7 @@ export class SearchOrganizationsService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
result['title'].name = resData.legalshortname;
if(result['title'].name == '') {

View File

@ -75,7 +75,7 @@ export class SearchPeopleService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
result['title'].name = resData.fullname;

View File

@ -128,17 +128,30 @@ export class SearchProjectsService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(resData['acronym'] != undefined && resData['acronym'] != "") {
result['title'].name = resData['acronym'] + " - ";
}
if(Array.isArray(resData['title'])) {
// resData['title'][0].hasOwnProperty("content") {
result['title'].name = resData['title'][0];
result['title'].name += resData['title'][0];
// }
} else {
// resData['title'].hasOwnProperty("content") {
result['title'].name = resData['title'];
result['title'].name += resData['title'];
// }
}
if(result['title'].name != '') {
result['title'].name += " ("+resData['code']+")"
}
if(resData['ecsc39'] == true) {
result['title'].sc39 = "sc39";
}
// if(resData['title'].hasOwnProperty("content")) {
// result['title'].name = resData['title'].content;
// }

View File

@ -57,7 +57,7 @@ export class SearchPublicationsService {
.map(res => this.parseResults(res));
}
searchAggregators (params: string, refineParams:string, page: number, size: number ):any {
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number ):any {
let link = OpenaireProperties.getSearchAPIURLLast()+"publications";
@ -72,7 +72,7 @@ export class SearchPublicationsService {
let key = url;
if (this._cache.has(key)) {
return Observable.of(this._cache.get(key)).map(res => this.parseRefineResults(res['refineResults']));
return Observable.of(this._cache.get(key)).map(res => this.parseRefineResults(id, res['refineResults']));
}
return this.http.get(url)
@ -80,7 +80,7 @@ export class SearchPublicationsService {
.do(res => {
this._cache.set(key, res);
})
.map(res => this.parseRefineResults(res['refineResults']));
.map(res => this.parseRefineResults(id, res['refineResults']));
}
searchPublicationsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any {
@ -209,7 +209,7 @@ export class SearchPublicationsService {
var result: SearchResult = new SearchResult();
result['title'] = {"name": '', "accessMode": ''};
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(Array.isArray(resData['title'])) {
// resData['title'][0].hasOwnProperty("content") {
@ -392,7 +392,7 @@ export class SearchPublicationsService {
return results;
}
parseRefineResults(data: any): any {
parseRefineResults(id: string, data: any): any {
var results:any = [];
if(data.hasOwnProperty("resulthostingdatasource")) {
let length = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'].length : 1;
@ -406,7 +406,9 @@ export class SearchPublicationsService {
//result['url'] = OpenaireProperties.getsearchLinkToDataProvider()+result['id'];
result['count'] = datasource.count;
results.push(result);
if(result['id'] != id && result['name'] != "Unknown Repository") {
results.push(result);
}
}
}
return results;

View File

@ -1,5 +1,5 @@
export class SearchResult {
title: { "name": string, "accessMode": string};
title: { "name": string, "accessMode": string, "sc39": string};
id:string;
DOI:string;
//publications & datasets & organizations:

View File

@ -180,7 +180,7 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
}
public getAggregatorResults(id:string, page: number, size: number){
this.subResults = this._searchPublicationsService.searchAggregators('&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
this.subResults = this._searchPublicationsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
data => {
this.results = data;

View File

@ -118,6 +118,15 @@
padding-right: 18px;
}
.sc39 {
background: rgba(0, 0, 0, 0) url("/assets/sc39.png") no-repeat scroll right center;
padding-right: 24px;
}
.projectIcon {
display: inline-table;
}
</style>
</head>