From 94857a762a6dd8b1cc6e24b25ce973167d6b3cb2 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 6 Mar 2017 14:07:31 +0000 Subject: [PATCH] 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 --- .../project/project.component.html | 7 +++++-- .../landingPages/project/project.module.ts | 1 - .../landingPages/project/project.service.ts | 6 +++++- .../publication/publication.component.html | 2 +- .../searchUtils/searchResult.component.ts | 4 ++-- .../simple/searchPublications.component.ts | 4 ++-- .../services/searchDataproviders.service.ts | 2 +- .../app/services/searchDatasets.service.ts | 2 +- .../services/searchOrganizations.service.ts | 2 +- .../src/app/services/searchPeople.service.ts | 2 +- .../app/services/searchProjects.service.ts | 19 ++++++++++++++++--- .../services/searchPublications.service.ts | 14 ++++++++------ .../src/app/utils/entities/searchResult.ts | 4 ++-- .../fetchPublications.class.ts | 2 +- portal-2/src/index.html | 9 +++++++++ 15 files changed, 55 insertions(+), 25 deletions(-) diff --git a/portal-2/src/app/landingPages/project/project.component.html b/portal-2/src/app/landingPages/project/project.component.html index 643a4618..8c18a8c6 100644 --- a/portal-2/src/app/landingPages/project/project.component.html +++ b/portal-2/src/app/landingPages/project/project.component.html @@ -6,7 +6,10 @@
-

{{projectName}}

+
+

{{projectName}}

+

{{projectName}}

+
Title:
@@ -163,7 +166,7 @@
  • Share - Bookmark
  • -
  • +
  • View all Project Publications diff --git a/portal-2/src/app/landingPages/project/project.module.ts b/portal-2/src/app/landingPages/project/project.module.ts index dbb9bdec..4539bebf 100644 --- a/portal-2/src/app/landingPages/project/project.module.ts +++ b/portal-2/src/app/landingPages/project/project.module.ts @@ -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'; diff --git a/portal-2/src/app/landingPages/project/project.service.ts b/portal-2/src/app/landingPages/project/project.service.ts index 6c0f1f97..1293f32e 100644 --- a/portal-2/src/app/landingPages/project/project.service.ts +++ b/portal-2/src/app/landingPages/project/project.service.ts @@ -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; diff --git a/portal-2/src/app/landingPages/publication/publication.component.html b/portal-2/src/app/landingPages/publication/publication.component.html index 5731b45f..d3fd5882 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.html +++ b/portal-2/src/app/landingPages/publication/publication.component.html @@ -103,7 +103,7 @@
  • -
      +
      • diff --git a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts index 7e6d208e..dedf7ade 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts @@ -13,7 +13,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
      • -

        +

        @@ -85,7 +85,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
        Organizations: - + {{organization.name}} diff --git a/portal-2/src/app/searchPages/simple/searchPublications.component.ts b/portal-2/src/app/searchPages/simple/searchPublications.component.ts index 72661d67..790f9039 100644 --- a/portal-2/src/app/searchPages/simple/searchPublications.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPublications.component.ts @@ -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; diff --git a/portal-2/src/app/services/searchDataproviders.service.ts b/portal-2/src/app/services/searchDataproviders.service.ts index c8f805f7..024fc470 100644 --- a/portal-2/src/app/services/searchDataproviders.service.ts +++ b/portal-2/src/app/services/searchDataproviders.service.ts @@ -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; diff --git a/portal-2/src/app/services/searchDatasets.service.ts b/portal-2/src/app/services/searchDatasets.service.ts index fd7a8731..3fca63f6 100644 --- a/portal-2/src/app/services/searchDatasets.service.ts +++ b/portal-2/src/app/services/searchDatasets.service.ts @@ -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; diff --git a/portal-2/src/app/services/searchOrganizations.service.ts b/portal-2/src/app/services/searchOrganizations.service.ts index 5f49c1bd..1d016376 100644 --- a/portal-2/src/app/services/searchOrganizations.service.ts +++ b/portal-2/src/app/services/searchOrganizations.service.ts @@ -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 == '') { diff --git a/portal-2/src/app/services/searchPeople.service.ts b/portal-2/src/app/services/searchPeople.service.ts index 7f02bd16..1162a78f 100644 --- a/portal-2/src/app/services/searchPeople.service.ts +++ b/portal-2/src/app/services/searchPeople.service.ts @@ -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; diff --git a/portal-2/src/app/services/searchProjects.service.ts b/portal-2/src/app/services/searchProjects.service.ts index af7baa5d..50227032 100644 --- a/portal-2/src/app/services/searchProjects.service.ts +++ b/portal-2/src/app/services/searchProjects.service.ts @@ -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; // } diff --git a/portal-2/src/app/services/searchPublications.service.ts b/portal-2/src/app/services/searchPublications.service.ts index 49f76678..0c96d81f 100644 --- a/portal-2/src/app/services/searchPublications.service.ts +++ b/portal-2/src/app/services/searchPublications.service.ts @@ -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; diff --git a/portal-2/src/app/utils/entities/searchResult.ts b/portal-2/src/app/utils/entities/searchResult.ts index a0e0e0ca..e209221c 100644 --- a/portal-2/src/app/utils/entities/searchResult.ts +++ b/portal-2/src/app/utils/entities/searchResult.ts @@ -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: @@ -26,5 +26,5 @@ export class SearchResult { compatibility: string; countries: string[]; constructor(){} - + } diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts index 216d72f5..fbea36ac 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts @@ -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; diff --git a/portal-2/src/index.html b/portal-2/src/index.html index e0bc739c..9fef05dc 100644 --- a/portal-2/src/index.html +++ b/portal-2/src/index.html @@ -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; + } +