Tooltip properly built in Dataset Landing page | Message 'Record in Preview' added in Publication and Dataset Landing Pages when res['result']['header']['dri:status'] == 'under curation' | citeThis.component.ts: added check for server side rendering | showAuthors.component: commas between authors shown properly | claimsByToken.component: fixing sorting is under construction

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@47108 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-05-09 12:08:13 +00:00
parent e629fffebe
commit df3c0221f2
12 changed files with 167 additions and 77 deletions

View File

@ -78,30 +78,30 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</tbody>
</table-->
<table *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped"
[mfData]="pending_claims" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"
[(mfSortBy)]="sortByClaimDate" [(mfSortOrder)]="sortOrder">
<table *ngIf="pending_claims && pending_claims.length > 0" class="uk-table uk-table-striped custom-dataTable-content"
[mfData]="pending_claims" #mf1="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1">
<!--[(mfSortBy)]="sortByClaimDate1" (mfSortOrder)="sortOrder"-->
<thead>
<tr>
<th><mfDefaultSorter [by]="sortByTitle">Research Result</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed By</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate">Claimed Date</mfDefaultSorter></th>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter by="claim1.userMail">Claimed By</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate1">Claimed Date</mfDefaultSorter></th>
<th class="uk-text-center">Approve</th>
</tr>
</thead>
<tbody>
<tr class="uk-table-middle" *ngFor="let claim of mf.data">
<td class="uk-width-2-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
<td class="uk-width-1-6 uk-text-center" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
<td class="uk-width-1-6 uk-text-center">{{claim.date}}</td>
<tr class="uk-table-middle" *ngFor="let claim1 of mf1.data">
<td class="uk-width-2-6" *ngIf="claim1.targetType != 'project'"><claim-entity [entity]="claim1.target" [type]="claim1.targetType" > </claim-entity></td>
<td class="uk-width-1-6 uk-text-center" *ngIf="claim1.sourceType != 'project'"><claim-entity [entity]="claim1.source" [type]="claim1.sourceType" > </claim-entity></td>
<td class="uk-width-1-6 uk-text-center">{{claim1.userMail}}</td>
<td class="uk-width-1-6 uk-text-center">{{claim1.date}}</td>
<td class="uk-width-1-6 uk-text-center">
<label>
Yes <input [id]="claim.id" type="checkbox" (click)="selectApprove(claim.id,$event)" [ngModel]="isSelectedRight(claim.id)"/>
Yes <input [id]="claim1.id" type="checkbox" (click)="selectApprove(claim1.id,$event)" [ngModel]="isSelectedRight(claim1.id)"/>
</label>
<label>
No <input [id]="claim.id" type="checkbox" (click)="selectDisapprove(claim.id,$event)" [ngModel]="isSelectedWrong(claim.id)"/>
No <input [id]="claim1.id" type="checkbox" (click)="selectDisapprove(claim1.id,$event)" [ngModel]="isSelectedWrong(claim1.id)"/>
</label>
</td>
</tr>
@ -109,12 +109,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<tfoot>
<tr>
<td>
<!--mfBootstrapPaginator></mfBootstrapPaginator-->
</td>
<td></td>
<td></td>
<td>
<paging-no-load [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf, $event)"></paging-no-load>
<paging-no-load [currentPage]="1" [totalResults]="pending_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf1, $event)"></paging-no-load>
</td>
</tr>
</tfoot>
@ -162,21 +161,21 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</table-->
<table *ngIf="curated_claims && curated_claims.length > 0" class="uk-table uk-table-striped"
[mfData]="curated_claims" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1"
[(mfSortBy)]="sortByCurationDate" [(mfSortOrder)]="sortOrder">
[mfData]="curated_claims" #mf2="mfDataTable" [mfRowsOnPage]="rowsOnPage" [mfActivePage]="1">
<!--[(mfSortBy)]="sortByCurationDate2" [(mfSortOrder)]="sortOrder"-->
<thead>
<tr>
<th><mfDefaultSorter [by]="sortByTitle">Research Result</mfDefaultSorter></th>
<th><mfDefaultSorter [by]="sortByTitle1">Research Result</mfDefaultSorter></th>
<!--th>Link to</th-->
<th class="uk-text-center"><mfDefaultSorter by="userMail">Claimed by</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate">Claimed Date</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByClaimDate2">Claimed Date</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter by="curatedBy">Curated by</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByCurationDate">Curation Date</mfDefaultSorter></th>
<th class="uk-text-center"><mfDefaultSorter [by]="sortByCurationDate2">Curation Date</mfDefaultSorter></th>
<th class="uk-text-center">Approved</th>
</tr>
</thead>
<tbody>
<tr class="uk-table-middle" *ngFor="let claim of mf.data let i=index">
<tr class="uk-table-middle" *ngFor="let claim of mf2.data let i=index">
<td class="uk-width-1-6" *ngIf="claim.targetType != 'project'"><claim-entity [entity]="claim.target" [type]="claim.targetType" > </claim-entity></td>
<td class="uk-width-1-6" *ngIf="claim.sourceType != 'project'"><claim-entity [entity]="claim.source" [type]="claim.sourceType" > </claim-entity></td>
<td class="uk-width-1-6 uk-text-center">{{claim.userMail}}</td>
@ -208,7 +207,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
<td></td>
<td></td>
<td>
<paging-no-load [currentPage]="1" [totalResults]="curated_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf, $event)"> </paging-no-load>
<paging-no-load [currentPage]="1" [totalResults]="curated_claims.length" [size]="rowsOnPage" (pageChange)="refreshTable(mf2, $event)"> </paging-no-load>
</td>
</tr>
</tfoot>
@ -242,7 +241,7 @@ export class ClaimsByTokenComponent {
public accessStatus: string;// = "empty";
public rowsOnPage = 5;
public sortOrder = "desc";
public sortOrder = "asc";
@ViewChild (ModalSelect) selectModal : ModalSelect;
@ -272,15 +271,15 @@ refreshTable(mf:any, $event:any) {
mf.setPage(mf.mfActivePage, this.rowsOnPage);
}
public sortByClaimDate = (claim: any) => {
public sortByClaimDate1 = (claim: any) => {
return new Date(claim.date);
}
public sortByCurationDate = (claim: any) => {
public sortByCurationDate1 = (claim: any) => {
return new Date(claim.curationDate);
}
public sortByTitle = (claim: any) => {
public sortByTitle1 = (claim: any) => {
if(claim.targetType != 'project') {
return claim.target.title;
} else {
@ -288,6 +287,24 @@ public sortByTitle = (claim: any) => {
}
}
public sortByClaimDate2 = (claim: any) => {
return new Date(claim.date);
}
public sortByCurationDate2 = (claim: any) => {
console.info(new Date(claim.curationDate));
return new Date(claim.curationDate);
}
public sortByTitle2= (claim: any) => {
if(claim.targetType != 'project') {
return claim.target.title;
} else {
return claim.source.title;
}
}
validateJWTandToken() {
var jwtToken=Session.getUserJwt();
if(this.token) {

View File

@ -7,6 +7,14 @@
<div *ngIf="datasetInfo != null" class="uk-grid">
<div class="uk-width-7-10">
<showTitle [title]="datasetInfo.title"></showTitle>
<div *ngIf="datasetInfo.underCurationMessage">
<span data-uk-tooltip="{pos:'right', cls:'tooltip uk-text-center uk-contrast'}"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span>
</div>
<!--/div>
</div>
@ -166,18 +174,7 @@
*ngFor="let item of datasetInfo.fundedByProjects let i=index">
<div *ngIf="i<5 || showAllFundedBy">
<span data-uk-tooltip="{pos:'right', cls:'tooltip uk-text-center uk-contrast'}"
title="
<div>
<h4>{{item['title']}}</h4>
Project Code: {{item['code']}}
<div>
Funder: {{item['funderName']}} ({{item['funderShortname']}})
</div>
<div>
Funding: {{item['funding']}}
</div>
</div>
">
title="{{buildFundingTooltip(item)}}">
<!--a *ngIf="!item['inline']" href="{{item['url']}}"-->
<a *ngIf="!item['inline']"
[queryParams]="{projectId: item.id}" routerLinkActive="router-link-active" routerLink="/search/project">

View File

@ -128,4 +128,48 @@ export class DatasetComponent {
this._meta.setTitle(_title );
this._meta.updateMeta("og:title",_title);
}
public buildCurationTooltip() {
let tooltipContent: string = "";
tooltipContent += "<h4>Record in preview</h4>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
return tooltipContent;
}
public buildFundingTooltip(item: { "id": string, "acronym": string, "title": string,
"funderShortname": string, "funderName": string,
"funding": string, "code": string, inline: boolean}) {
let tooltipContent: string = "";
if(item.title) {
tooltipContent += "<h4>"+item.title+"</h4>";
}
if(item.code) {
tooltipContent += "Project Code: "+item.code;
}
if(item.funderName || item.funderShortname) {
tooltipContent += "<div>Funder: ";
if(item.funderName && item.funderShortname) {
tooltipContent += item.funderName + " ("+ item.funderShortname +")";
} else if(item.funderName) {
tooltipContent += item.funderName;
} else {
tooltipContent += item.funderShortname;
}
tooltipContent += "</div>";
}
if(item.funding) {
tooltipContent += "<div>Funding: "+ item.funding + "</div>";
}
if(tooltipContent) {
tooltipContent = "<div>" + tooltipContent + "</div>";
}
return tooltipContent;
}
}

View File

@ -27,17 +27,18 @@ export class DatasetService {
return this.http.get(url)
.map(res => <any> res.json())
.do(res => console.info(res['result']['metadata']['oaf:entity']))
.map(res => res['result']['metadata']['oaf:entity']['oaf:result'])
.map(res => [res,
res['title'],
res['rels']['rel'],
res['children'],
res['pid'],
res['subject'],
res['bestlicense'],
res['collectedfrom'],
res['context'],
res['resulttype']
.map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result']])
.map(res => [res[1],
res[1]['title'],
res[1]['rels']['rel'],
res[1]['children'],
res[1]['pid'],
res[1]['subject'],
res[1]['bestlicense'],
res[1]['collectedfrom'],
res[1]['context'],
res[1]['resulttype'],
res[0]
]).do(res => {
this._cache.set(key, res);
})
@ -565,6 +566,11 @@ export class DatasetService {
}
}
if(data[10] != null && data[10] == "under curation") {
this.datasetInfo.underCurationMessage = true;
} else {
this.datasetInfo.underCurationMessage = false;
}
//this.printdatasetInfo();
return this.datasetInfo;

View File

@ -39,11 +39,13 @@ export class CiteThisComponent {
ngOnInit() {
// this.Cite
// this.sub = this.route.queryParams.subscribe(data => {
if(typeof window !== 'undefined') {
this.parseData();
var Cite = require('citation-js');
this.cite = new Cite(this.data);
// this.cite.setData(this.data);
this.citationText = this.cite.get(this.citation.getOptionsBy(this.selectedStyle));
}
// });
}
parseData(){

View File

@ -10,6 +10,14 @@
<!--/div-->
<!--/div-->
<div *ngIf="publicationInfo.underCurationMessage">
<span data-uk-tooltip="{pos:'right', cls:'tooltip uk-text-center uk-contrast'}"
title="{{buildCurationTooltip()}}">
<i>Record in preview</i>
<i class="uk-icon-info-circle"></i>
</span>
</div>
<!--div class="uk-grid"-->
<!--div class="uk-width-7-10" *ngIf="publicationInfo != null"-->
@ -403,7 +411,7 @@
*ngFor="let item of publicationInfo.fundedByProjects let i=index">
<div *ngIf="i<5 || showAllFundedBy">
<span data-uk-tooltip="{pos:'right', cls:'tooltip uk-text-center uk-contrast'}"
title="{{buildTooltip(item)}}">
title="{{buildFundingTooltip(item)}}">
<!--a *ngIf="!item['inline']" href="{{item['url']}}"-->
<a *ngIf="!item['inline'] && item.id"

View File

@ -151,7 +151,16 @@ export class PublicationComponent {
this.pageViews = $event.pageViews;
}
public buildTooltip(item: { "id": string, "acronym": string, "title": string,
public buildCurationTooltip() {
let tooltipContent: string = "";
tooltipContent += "<h4>Record in preview</h4>";
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
return tooltipContent;
}
public buildFundingTooltip(item: { "id": string, "acronym": string, "title": string,
"funderShortname": string, "funderName": string,
"funding": string, "code": string, inline: boolean}) {
let tooltipContent: string = "";

View File

@ -23,19 +23,20 @@ export class PublicationService {
}
return this.http.get(url)
.map(res => <any> res.json())
.map(res => res['result']['metadata']['oaf:entity'])
.map(res => [res['oaf:result'],
res['oaf:result']['title'],
res['oaf:result']['rels']['rel'],
res['oaf:result']['children'],
res['oaf:result']['pid'],
res['oaf:result']['journal'],
res['oaf:result']['language'],
res['oaf:result']['subject'],
res['oaf:result']['bestlicense'],
res['oaf:result']['collectedfrom'],
(res['extraInfo']!= undefined && res['extraInfo']['citations']!= undefined)? res['extraInfo']['citations']['citation']:null,
res['oaf:result']['context']
.map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']])
.map(res => [ res[1]['oaf:result'],
res[1]['oaf:result']['title'],
res[1]['oaf:result']['rels']['rel'],
res[1]['oaf:result']['children'],
res[1]['oaf:result']['pid'],
res[1]['oaf:result']['journal'],
res[1]['oaf:result']['language'],
res[1]['oaf:result']['subject'],
res[1]['oaf:result']['bestlicense'],
res[1]['oaf:result']['collectedfrom'],
(res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null,
res[1]['oaf:result']['context'],
res[0]
])
.do(res => {
this._cache.set(key, res);
@ -685,6 +686,12 @@ export class PublicationService {
}
}
if(data[12] != null && data[12] == "under curation") {
this.publicationInfo.underCurationMessage = true;
} else {
this.publicationInfo.underCurationMessage = false;
}
return this.publicationInfo;
}
}

View File

@ -7,19 +7,17 @@ import {Component, Input} from '@angular/core';
<div *ngIf="showAll">
<a class="uk-text-muted" (click)="showAll = !showAll;">View less authors</a>
</div>
<span *ngFor="let item of authors.slice(0,30)">
<span *ngFor="let item of authors.slice(0,30) let i=index">
<!--a href="{{item['url']}}"-->
<a routerLinkActive="router-link-active" routerLink="/search/person" [queryParams]="{personId: item.id}">
{{item['name']}};
</a>
<a *ngIf="item.id" routerLinkActive="router-link-active" routerLink="/search/person" [queryParams]="{personId: item.id}">{{item['name']}}</a><span *ngIf="item.id && i<29 && i<(authors.length-1)">;</span>
<span *ngIf="!item.id">{{item['name']}}</span><span *ngIf="!item.id && i<29 && i<(authors.length-1)">;</span>
</span>
<span *ngIf="!showAll && authors.length > 30"> ... </span>
<span *ngIf="showAll">
<span *ngFor="let item of authors.slice(30)">
<span *ngFor="let item of authors.slice(30) let i=index">
<!--a href="{{item['url']}}"-->
<a routerLinkActive="router-link-active" routerLink="/search/person" [queryParams]="{personId: item.id}">
{{item['name']}};
</a>
<a *ngIf="item.id" routerLinkActive="router-link-active" routerLink="/search/person" [queryParams]="{personId: item.id}">{{item['name']}}</a><span *ngIf="item.id && i<(authors.length-1)">;</span>
<span *ngIf="!item.id">{{item['name']}}</span><span *ngIf="!item.id && i<(authors.length-1)">;</span>
</span>
</span>
<span *ngIf="!showAll && authors.length > 30">

View File

@ -24,7 +24,6 @@ import { Filter, Value} from './searchHelperClasses.class';
<span class="filterName"><div title = "{{value.name}}"> <input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
{{_formatName(value)}} </div></span><span class="filterNumber" *ngIf = "showResultCount === true" > ({{value.number}})</span>
</div>
</div>
</div>
</div>
@ -41,7 +40,6 @@ export class SearchFilterComponent {
public showAll:boolean = false;
public _maxCharacters:number =28;
constructor () {
}

View File

@ -35,9 +35,9 @@ import { Meta} from '../../../angular2-meta';
</div>
<a *ngIf = "advancedSearchLink && advancedSearchLink.length > 0" routerLinkActive="router-link-active" class="uk-float-right" [routerLink]=advancedSearchLink >More search options <i class="uk-icon-angle-double-right"></i></a>
</div>
<div class="uk-grid uk-width-1-1 uk-margin">
<div class="uk-grid uk-width-1-1 uk-margin">
<div class=" search-filters uk-width-large-1-4 uk-width-medium-1-4 uk-width-small-1-1">
<search-filter *ngFor="let filter of filters " [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)"></search-filter>
<search-filter *ngFor="let filter of filters " [filter]="filter" [showResultCount]=showResultCount (change)="filterChanged($event)" (showMoreFilter1) = "showMoreFilter($event)"></search-filter>
</div>
<div class="uk-width-large-3-4 uk-width-medium-3-4 uk-width-small-1-1" >
@ -65,7 +65,6 @@ import { Meta} from '../../../angular2-meta';
</div>
<modal-loading [message]= "'Loading results...'"></modal-loading>
`
})
export class SearchPageComponent {
@ -107,6 +106,7 @@ export class SearchPageComponent {
ngAfterViewChecked(){
}
updateDescription(description:string){
this._meta.updateMeta("description", description);
this._meta.updateMeta("og:description", description);

View File

@ -157,6 +157,10 @@
min-height: 250px;
}
.custom-dataTable-content {
min-height: 1000px;
}
.filterItem span {
display: inline-flex;
}