Basket Limit:
		set to 100
		don't allow to add  more through search forms
		don't allow more in bulk
	Bulk - access mode and date: fix getting info from csv
	Add margins
	Display claims; remove showLatestClaims attribute

Landing   pub - HelpeTexts: remove doule quote and helper




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56750 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-07-24 12:46:29 +00:00
parent 3e5c6bae88
commit 322492af79
20 changed files with 131 additions and 106 deletions

View File

@ -32,8 +32,8 @@
</div> </div>
<div class="uk-margin-right uk-padding"> <div class="uk-margin-right uk-padding">
<span *ngFor="let community of communities"> <span *ngFor="let community of communities" [title]="(this.results.length>=basketLimit)?'Basket reached the size limit':''">
<span [class]="' uk-margin-small-bottom uk-margin-small-right '+getCommunityClass(community)" <span [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-margin-small-bottom uk-margin-small-right '+getCommunityClass(community)"
(click)="select(community)" style="cursor:pointer;"> (click)="select(community)" style="cursor:pointer;">
<a href="#modal-categories" uk-toggle> <a href="#modal-categories" uk-toggle>
{{community.label}} {{community.label}}
@ -74,7 +74,7 @@
No aditional community paths found for this community. No aditional community paths found for this community.
</div> </div>
<ul *ngIf="categories[selectedCommunityId] && categories[selectedCommunityId].length > 0 " <ul *ngIf="categories[selectedCommunityId] && categories[selectedCommunityId].length > 0 "
class=" uk-list uk-margin-top uk-animation-fade"> class=" uk-list uk-margin-top uk-animation-fade uk-overflow-auto uk-height-medium">
<li *ngFor="let category of categories[selectedCommunityId]"> <li *ngFor="let category of categories[selectedCommunityId]">
<span (click)="browseConcepts(category.id)"> <span (click)="browseConcepts(category.id)">
<span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20" <span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20"
@ -89,8 +89,8 @@
{{category.label}} - {{category.id}}</span> {{category.label}} - {{category.id}}</span>
<a *ngIf="!isSelected(category.id)" <a *ngIf="!isSelected(category.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})" (click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})"
class="uk-icon-button icon-button-small"> [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-icon-button icon-button-small'">
<span class="uk-icon"> <span class="uk-icon" [title]="(this.results.length>=basketLimit)?'Basket reached the size limit':''">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus"
ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17"
height="1"></rect></svg> height="1"></rect></svg>
@ -126,7 +126,7 @@
</span> </span>
<a *ngIf="!isSelected(concept1.id)" <a *ngIf="!isSelected(concept1.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept1)" (click)="addNewContext(selectedCommunityLabel,category.label,concept1)"
class="uk-icon-button icon-button-small"><span class="uk-icon"> [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-icon-button icon-button-small'"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg> x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a> </span></a>
@ -154,7 +154,7 @@
{{concept2.label}}</span> {{concept2.label}}</span>
<a *ngIf="!isSelected(concept2.id)" <a *ngIf="!isSelected(concept2.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept2)" (click)="addNewContext(selectedCommunityLabel,category.label,concept2)"
class="uk-icon-button icon-button-small"><span class="uk-icon"> [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-icon-button icon-button-small'"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg> x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a> </span></a>
@ -166,10 +166,10 @@
</span> </span>
<ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] " <ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] "
class="uk-animation-fade"> class="uk-animation-fade">
<li *ngFor="let concept3 of concept2.concepts">{{concept3.label}} <li *ngFor="let concept3 of concept2.concepts">{{concept3.label}} [title]="(this.results.length>=basketLimit)?'Basket reached the size limit':''"
<a *ngIf="!isSelected(concept3.id)" <a *ngIf="!isSelected(concept3.id)"
(click)="addNewContext(selectedCommunityLabel,category.label,concept3)" (click)="addNewContext(selectedCommunityLabel,category.label,concept3)"
class="uk-icon-button icon-button-small"><span class="uk-icon"> [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-icon-button icon-button-small'"><span class="uk-icon">
<svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect <svg width="16" height="16" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" ratio="0.8"><rect
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg> x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
</span></a> </span></a>

View File

@ -19,6 +19,7 @@ export class ClaimContextSearchFormComponent {
@Input() public properties: EnvProperties; @Input() public properties: EnvProperties;
@Input() communityId: string = null; @Input() communityId: string = null;
@Input() public inlineClaim: boolean = false; @Input() public inlineClaim: boolean = false;
@Input() basketLimit;
public selectedCommunityId: string = "0"; public selectedCommunityId: string = "0";
public selectedCategoryId: string = "0"; public selectedCategoryId: string = "0";
@ -85,15 +86,15 @@ export class ClaimContextSearchFormComponent {
} }
addNewContext(community, category, concept, notify = true) { addNewContext(community, category, concept, notify = true) {
if (this.results.length > 50) { // if (this.results.length > 50) {
UIkit.notification({ // UIkit.notification({
message: 'Your basket exceeds the number of allowed concepts (50)', // message: 'Your basket exceeds the number of allowed concepts (50)',
status: 'warning', // status: 'warning',
timeout: 1500, // timeout: 1500,
pos: 'top-center' // pos: 'top-center'
}); // });
return; // return;
} // }
const entity: ClaimEntity = new ClaimEntity() ; const entity: ClaimEntity = new ClaimEntity() ;
entity.type = "community"; entity.type = "community";

View File

@ -106,7 +106,7 @@
<div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1" <div *ngIf="openaireResultsStatus == errorCodes.LOADING" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div> role="alert"><span class="loading-gif uk-align-center"></span></div>
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults <claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
[selectedResults]=selectedProjects></claim-results> [selectedResults]=selectedProjects [basketLimit]="basketLimit"></claim-results>
</div> </div>
</div> </div>
</div> </div>

View File

@ -34,6 +34,7 @@ export class ClaimProjectsSearchFormComponent {
@Input() public properties:EnvProperties; @Input() public properties:EnvProperties;
@Input() public inlineClaim:boolean=false; @Input() public inlineClaim:boolean=false;
@Input() localStoragePrefix:string = ""; @Input() localStoragePrefix:string = "";
@Input() basketLimit;
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
public projects:string[]; public projects:string[];

View File

@ -64,7 +64,7 @@
<div> <div>
<claim-results [localStoragePrefix]=localStoragePrefix [results]=crossrefResults <claim-results [localStoragePrefix]=localStoragePrefix [results]=crossrefResults
[selectedResults]=selectedResults></claim-results> [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
</div> </div>
</div> </div>
</div> </div>
@ -185,7 +185,7 @@
class="uk-animation-fade uk-margin-top uk-width-1-1" class="uk-animation-fade uk-margin-top uk-width-1-1"
role="alert"><span class="loading-gif uk-align-center"></span></div> role="alert"><span class="loading-gif uk-align-center"></span></div>
<claim-results [localStoragePrefix]=localStoragePrefix <claim-results [localStoragePrefix]=localStoragePrefix
[results]=openaireResults [selectedResults]=selectedResults></claim-results> [results]=openaireResults [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
</div> </div>
</div> </div>
</div> </div>
@ -240,7 +240,7 @@
<div> <div>
<claim-results [localStoragePrefix]=localStoragePrefix <claim-results [localStoragePrefix]=localStoragePrefix
*ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " [results]=orcidResultsToShow *ngIf="orcidResultsNum >0 && orcidResultsToShow.length > 0 " [results]=orcidResultsToShow
[selectedResults]=selectedResults></claim-results> [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
<div *ngIf="orcidResultsNum == 0" class="uk-alert uk-alert-primary uk-margin-top"> No results found</div> <div *ngIf="orcidResultsNum == 0" class="uk-alert uk-alert-primary uk-margin-top"> No results found</div>
</div> </div>
</div> </div>
@ -275,7 +275,7 @@
role="alert"><span class="loading-gif uk-align-center"></span></div> role="alert"><span class="loading-gif uk-align-center"></span></div>
<div> <div>
<claim-results [localStoragePrefix]=localStoragePrefix *ngIf="dataciteResults.length > 0 " <claim-results [localStoragePrefix]=localStoragePrefix *ngIf="dataciteResults.length > 0 "
[results]=dataciteResults [selectedResults]=selectedResults></claim-results> [results]=dataciteResults [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
</div> </div>
</div> </div>
</div> </div>

View File

@ -29,6 +29,7 @@ export class ClaimResultSearchFormComponent {
@Input() public selectedResults: ClaimEntity[]; @Input() public selectedResults: ClaimEntity[];
@Input() public properties: EnvProperties; @Input() public properties: EnvProperties;
@Input() localStoragePrefix: string = ""; @Input() localStoragePrefix: string = "";
@Input() basketLimit;
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();

View File

@ -20,8 +20,8 @@ declare var UIkit: any;
<claim-result-metadata [entity]="entity"></claim-result-metadata> <claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata> <claim-project-metadata [entity]="entity"></claim-project-metadata>
</div> </div>
<div class="uk-margin-auto-vertical"> <div class="uk-margin-auto-vertical uk-padding-remove-left uk-margin-small-left" [title]="(this.selectedResults.length>=basketLimit)?'Basket reached the size limit':''">
<a class="uk-icon-button" *ngIf="!isSelected(entity)" <a [class]="(this.selectedResults.length>=basketLimit)?'uk-icon-button uk-disabled':'uk-icon-button'" *ngIf="!isSelected(entity)"
(click)="add(entity)"> (click)="add(entity)">
<span class="uk-icon"> <span class="uk-icon">
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus" <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="plus"
@ -46,7 +46,7 @@ export class ClaimResultsComponent {
@Input() results: ClaimEntity[]; @Input() results: ClaimEntity[];
@Input() selectedResults: ClaimEntity[]; @Input() selectedResults: ClaimEntity[];
@Input() localStoragePrefix: string = ""; @Input() localStoragePrefix: string = "";
@Input() basketLimit;
private isSelected(result: ClaimEntity) { private isSelected(result: ClaimEntity) {
let found: boolean = false; let found: boolean = false;
@ -64,15 +64,15 @@ export class ClaimResultsComponent {
} }
add(item: ClaimEntity) { add(item: ClaimEntity) {
if (this.selectedResults.length > 150) { // if (this.selectedResults.length > this.basketLimit) {
UIkit.notification({ // UIkit.notification({
message: 'Your basket exceeds the number of allowed results (150)', // message: 'Your basket exceeds the number of allowed results (150)',
status: 'warning', // status: 'warning',
timeout: 1500, // timeout: 1500,
pos: 'top-center' // pos: 'top-center'
}); // });
return; // return;
} // }
let found: boolean = this.isSelected(item); let found: boolean = this.isSelected(item);
if (!found) { if (!found) {
this.selectedResults.push(item); this.selectedResults.push(item);

View File

@ -151,19 +151,9 @@
(click)="changeOrderby('date')"> (click)="changeOrderby('date')">
Claim Date Claim Date
</th> </th>
<th *ngIf="showLatestClaims">Status <th >Status
<!-- <span class="uk-icon"--> <span class="uk-icon"
<!-- [attr.uk-tooltip]="'title:<div class=\'uk-margin-small\'>Status declared if the link information is available in the portal and the APIs<br><br> If it is pending, the information will be added in the next content provision workflow</div>'">--> [attr.uk-tooltip]="'title:<div class=\'uk-margin uk-padding-small\'>Status declares if the link information is available in the portal and the APIs<br> If it is pending, the information will be added in the next content provision workflow.</div>'" >
<!-- <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="question"-->
<!-- ratio="1">-->
<!-- <circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle><circle cx="10.44"-->
<!-- cy="14.42"-->
<!-- r="1.05"></circle><path-->
<!-- fill="none" stroke="#000" stroke-width="1.2"-->
<!-- d="M8.17,7.79 C8.17,4.75 12.72,4.73 12.72,7.72 C12.72,8.67 11.81,9.15 11.23,9.75 C10.75,10.24 10.51,10.73 10.45,11.4 C10.44,11.53 10.43,11.64 10.43,11.75"></path></svg>-->
<!-- </span>-->
<span class="uk-icon"
[attr.uk-tooltip]="'title:<div class=\'uk-margin\'>Status declares if the link information is available in the portal and the APIs<br> If it is pending, the information will be added in the next content provision workflow</div>'" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="info" ratio="1"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="info" ratio="1"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>
</span> </span>
</th> </th>

View File

@ -30,7 +30,6 @@ export class DisplayClaimsComponent {
@Input() showUserEmail: boolean = true; @Input() showUserEmail: boolean = true;
@Input() myClaims: boolean = false; @Input() myClaims: boolean = false;
@Input() isAdmin: boolean = false; @Input() isAdmin: boolean = false;
@Input() showLatestClaims: boolean = false;
page: number=1; page: number=1;
size: number=10; size: number=10;
sizes = [10, 20, 30, 50]; sizes = [10, 20, 30, 50];

View File

@ -1,15 +1,12 @@
import {Component, ViewChild, Input} from '@angular/core'; import {Component, Input} from '@angular/core';
import {Location} from '@angular/common';
import {Title, Meta} from '@angular/platform-browser'; import {Title, Meta} from '@angular/platform-browser';
import {Observable} from 'rxjs';
@Component({ @Component({
selector: 'claims-admin', selector: 'claims-admin',
template: ` template: `
<div id="tm-main" [class]="((isConnect)?'':'uk-section') +' uk-margin-small-top tm-middle'" > <div id="tm-main" [class]="((isConnect)?'':'uk-section') +' uk-padding-remove-top tm-middle'" >
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
<div class="uk-container"> <div class="uk-container">

View File

@ -16,8 +16,8 @@ declare var UIkit: any;
<div class="uk-animation uk-text-center" style=" "> <div class="uk-animation uk-text-center" style=" ">
<form class=" "> <form class=" ">
<div class="uk-grid"> <div>
<div class="uk-width-expand"> <div>
<!--div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper></div> <!--div class="uk-text-lead">Upload a DOI csv file <helper div="link-result-bulk" tooltip=true ></helper></div>
<label for="exampleInputFile">Select a file: </label--> <label for="exampleInputFile">Select a file: </label-->
<div class="js-upload" uk-form-custom> <div class="js-upload" uk-form-custom>
@ -31,15 +31,31 @@ declare var UIkit: any;
<div *ngIf="showReport" uk-alert class="uk-alert uk-alert-primary" role="alert"> <div *ngIf="showReport" uk-alert class="uk-alert uk-alert-primary" role="alert">
<a class="uk-alert-close uk-icon uk-close" ><svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" data-svg="close-icon"><line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line></svg></a> <a class="uk-alert-close uk-icon uk-close">
<div>Uploaded file contains {{allIds.length}} {{((allIds.length == 1) ? 'DOI' : 'DOIs')}}. <svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"
data-svg="close-icon">
<line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line>
<line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line>
</svg>
</a>
<div>Uploaded file contains <span
class="uk-text-bold">{{allIds.length}} {{((allIds.length == 1) ? 'DOI' : 'DOIs')}}</span>.
<span <span
*ngIf="allIds.length > 0">{{foundIds.length}} {{((foundIds.length == 1) ? 'result was' : 'results were')}} succefully fetched from CrossRef and Datacite.</span> *ngIf="exceedsLimit">
<div class="uk-text-danger">Basket exceeds the size limit.</div>
<span *ngIf="allIds.length > 0 && foundIds.length > 0">Only </span>
<span *ngIf="allIds.length > 0 && foundIds.length == 0">No results added.</span>
</span>
<span
*ngIf="allIds.length > 0 && foundIds.length > 0">{{foundIds.length}} {{((foundIds.length == 1) ? 'result was' : 'results were')}} succefully fetched from
<span class="uk-text-bold">CrossRef</span>{{ ' and ' }}<span
class="uk-text-bold">Datacite</span>.</span>
</div> </div>
<div <div
*ngIf="duplicateIds.length > 0">{{duplicateIds.length | number}} duplicate DOIs in {{((duplicateIds.length == 1) ? 'line' : 'lines')}} {{duplicateIdsRow}}. *ngIf="duplicateIds.length > 0">{{duplicateIds.length | number}} duplicate DOIs in {{((duplicateIds.length == 1) ? 'line' : 'lines')}} {{duplicateIdsRow}}.
</div> </div>
<div *ngIf="notFoundIds.length > 0">Couldn't be found: <div *ngIf="notFoundIds.length > 0">Couldn't be fetched:
<ul class=""> <ul class="">
<li *ngFor="let id of notFoundIds; let i = index">"{{id}}" in line {{notFoundIdsRow[i]}}</li> <li *ngFor="let id of notFoundIds; let i = index">"{{id}}" in line {{notFoundIdsRow[i]}}</li>
</ul> </ul>
@ -50,12 +66,18 @@ declare var UIkit: any;
</ul> </ul>
</div> </div>
<div <div
*ngIf="allIds.length == 0 || foundIds.length == 0"> Please make sure that the uploaded file, is a csv file with the proper format. *ngIf="allIds.length == 0 || (foundIds.length == 0 && !exceedsLimit)"> Please make sure that the uploaded file, is a csv file with the proper format.
</div> </div>
</div> </div>
<div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert"> <div *ngIf="errorMessage.length > 0 " class="uk-alert uk-alert-danger" role="alert">
<a class="uk-alert-close uk-icon uk-close" ><svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg" data-svg="close-icon"><line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line><line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line></svg></a> <a class="uk-alert-close uk-icon uk-close">
<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"
data-svg="close-icon">
<line fill="none" stroke="#000" stroke-width="1.1" x1="1" y1="1" x2="13" y2="13"></line>
<line fill="none" stroke="#000" stroke-width="1.1" x1="13" y1="1" x2="1" y2="13"></line>
</svg>
</a>
{{errorMessage}}</div> {{errorMessage}}</div>
</div> </div>
@ -82,6 +104,7 @@ export class BulkClaimComponent {
allIds: string[] = []; allIds: string[] = [];
foundIds: string[] = []; foundIds: string[] = [];
existedIds: string[] = [];
duplicateIds: string[] = []; duplicateIds: string[] = [];
duplicateIdsRow: number[] = []; duplicateIdsRow: number[] = [];
notFoundIds: string[] = []; notFoundIds: string[] = [];
@ -94,7 +117,7 @@ export class BulkClaimComponent {
enableUpload: boolean = true; enableUpload: boolean = true;
@Input() localStoragePrefix: string = ""; @Input() localStoragePrefix: string = "";
exceedsLimit = false; exceedsLimit = false;
limit = 150; @Input() basketLimit ;
constructor(private _searchCrossrefService: SearchCrossrefService, private _searchDataciteService: SearchDataciteService) { constructor(private _searchCrossrefService: SearchCrossrefService, private _searchDataciteService: SearchDataciteService) {
this.filesToUpload = []; this.filesToUpload = [];
@ -123,23 +146,18 @@ export class BulkClaimComponent {
this.exceedsLimit = false; this.exceedsLimit = false;
let invalid_rows = 0; let invalid_rows = 0;
this.duplicateIds = []; this.duplicateIds = [];
this.existedIds = [];
this.allIds = []; this.allIds = [];
this.foundIds = []; this.foundIds = [];
this.noValidIds = []; this.noValidIds = [];
this.results.slice(0, this.results.length); this.results.slice(0, this.results.length);
this.notFoundIds = []; this.notFoundIds = [];
if (rows.length + this.results.length > this.basketLimit) {
if (rows.length + this.results.length > this.limit) {
this.exceedsLimit = true; this.exceedsLimit = true;
UIkit.notification({
message: 'Your basket exceeds the number of allowed results (150)',
status: 'warning',
timeout: 1500,
pos: 'top-center'
});
} }
for (let i = 0; i < ((rows.length > this.limit - this.results.length) ? (this.limit - this.results.length) : rows.length); i++) { let currentLength = this.results.length;
for (let i = 0; i < ( rows.length); i++) {
if (rows[i] && rows[i] != null) { if (rows[i] && rows[i] != null) {
const values = rows[i].split(','); const values = rows[i].split(',');
@ -147,14 +165,16 @@ export class BulkClaimComponent {
if (DOI.isValidDOI(id)) { if (DOI.isValidDOI(id)) {
let accessMode = (values[1] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[1]) : "OPEN"; let accessMode = (values[1] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[1]) : "OPEN";
accessMode = (BulkClaimComponent.validateAccessMode(accessMode) ? accessMode : "OPEN"); accessMode = (BulkClaimComponent.validateAccessMode(accessMode) ? accessMode : "OPEN");
let embargoDate = (values[2] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[2]) : Dates.getDateToday(); let embargoDate = (values[2] != undefined) ? Dates.getDateFromString(BulkClaimComponent.removeDoubleQuotes(values[2])) : Dates.getDateToday();
embargoDate = (Dates.isValidDate(embargoDate) ? embargoDate : Dates.getDateToday());
if (this.allIds.indexOf(id) > -1) { if (this.allIds.indexOf(id) > -1) {
this.duplicateIds.push(id); this.duplicateIds.push(id);
this.duplicateIdsRow.push(i + 1); this.duplicateIdsRow.push(i + 1);
} else { } else {
this.allIds.push(id); this.allIds.push(id);
this.fetchResult(id, accessMode, embargoDate, i + 1); if (currentLength < this.basketLimit){
currentLength++;
this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1);
}
} }
} else { } else {
this.noValidIds.push(id); this.noValidIds.push(id);
@ -165,15 +185,14 @@ export class BulkClaimComponent {
} }
} }
if (rows.length == 0 || rows.length == invalid_rows || rows.length == (invalid_rows + this.noValidIds.length) || this.limit == this.results.length) { if (rows.length == 0 || rows.length == invalid_rows || rows.length == (invalid_rows + this.noValidIds.length) || this.basketLimit <= this.results.length) {
this.endOfFetching(); this.endOfFetching();
} }
}, (error) => { }, (error) => {
this.enableUpload = true; this.enableUpload = true;
console.log(error);
this.loading.close(); this.loading.close();
//this.errorMessage = "An error occured while uploading..."; this.errorMessage = "An error occured.";
BulkClaimComponent.handleError("Error uploading file", error); BulkClaimComponent.handleError("Error uploading file", error);
}); });
} }
@ -224,12 +243,15 @@ export class BulkClaimComponent {
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL, true).subscribe( this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL, true).subscribe(
data => { data => {
const result = data[1][0]; const result:ClaimEntity = data[1][0];
if (data[1].length > 0) { if (data[1].length > 0) {
this.foundIds.push(id); this.foundIds.push(id);
result["embargoEndDate"] = date; result.result.accessRights = accessMode;
result.result.embargoEndDate = date;
if(!this.isSelected(result)){ if(!this.isSelected(result)){
this.results.push(result); this.results.push(result);
}else{
this.existedIds.push(id);
} }
this.endOfFetching(); this.endOfFetching();
} else { } else {
@ -255,9 +277,12 @@ export class BulkClaimComponent {
var result = items[1][0]; var result = items[1][0];
this.foundIds.push(id); this.foundIds.push(id);
result["embargoEndDate"] = date; result.result.accessRights = accessMode;
result.result.embargoEndDate = date;
if(!this.isSelected(result)){ if(!this.isSelected(result)){
this.results.push(result); this.results.push(result);
}else{
this.existedIds.push(id);
} }
} else { } else {
this.notFoundIds.push(id); this.notFoundIds.push(id);
@ -276,12 +301,13 @@ export class BulkClaimComponent {
} }
endOfFetching() { endOfFetching() {
if (this.limit == this.results.length) { // if (this.basketLimit <= this.results.length) {
this.enableUpload = true; // this.enableUpload = true;
this.loading.close(); // this.loading.close();
return; // return;
} // }
if (this.allIds.length == this.foundIds.length + this.notFoundIds.length) { // console.log(this.allIds.length+" "+this.foundIds.length +" "+ this.notFoundIds.length+" "+this.existedIds.length + " " + this.results.length);
if (this.allIds.length == this.foundIds.length + this.notFoundIds.length || this.basketLimit <= (this.results.length+this.existedIds.length+this.notFoundIds.length)) {
this.showReport = true; this.showReport = true;
this.enableUpload = true; this.enableUpload = true;
this.loading.close(); this.loading.close();

View File

@ -51,20 +51,24 @@
</div> </div>
<div *ngIf="showOptions.show=='source'"> <div *ngIf="showOptions.show=='source'">
<claim-result-search-form [selectedResults]="sources" [properties]=properties <claim-result-search-form [selectedResults]="sources" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'sources'"></claim-result-search-form> [localStoragePrefix]="localStoragePrefix+'sources'" [basketLimit]="basketLimit"
></claim-result-search-form>
</div> </div>
<div *ngIf="showOptions.show=='project'"> <div *ngIf="showOptions.show=='project'">
<claim-projects-search-form [selectedProjects]="results" [properties]=properties <claim-projects-search-form [selectedProjects]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-projects-search-form> [localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"
></claim-projects-search-form>
</div> </div>
<div *ngIf="showOptions.show=='context'"> <div *ngIf="showOptions.show=='context'">
<claim-contexts-search-form [communityId]=communityId [results]="results" [sources]="sources" <claim-contexts-search-form [communityId]=communityId [results]="results" [sources]="sources"
[properties]=properties [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-contexts-search-form> [localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"
></claim-contexts-search-form>
</div> </div>
<div *ngIf="showOptions.show=='result'"> <div *ngIf="showOptions.show=='result'">
<claim-result-search-form [selectedResults]="results" [properties]=properties <claim-result-search-form [selectedResults]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></claim-result-search-form> [localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"
></claim-result-search-form>
</div> </div>
</div> </div>
@ -112,7 +116,7 @@
message="all sources" class="uk-float-right"></start-over> message="all sources" class="uk-float-right"></start-over>
<bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources" <bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources"
[properties]=properties [properties]=properties
[localStoragePrefix]="localStoragePrefix+'sources'" [localStoragePrefix]="localStoragePrefix+'sources'" [basketLimit]="basketLimit"
> >
</bulk-claim> </bulk-claim>
@ -122,6 +126,10 @@
<div *ngIf="(sources.length) == 0 " class="uk-alert no-selected-message uk-text-center"> <div *ngIf="(sources.length) == 0 " class="uk-alert no-selected-message uk-text-center">
No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file. No Sources added yet. Start adding sources from the left panel. Or upload a DOI's CSV file.
</div> </div>
<div *ngIf="sources.length >= basketLimit "
class="uk-alert uk-alert-warning uk-text-center">
Basket reached the size limit. No more sources can be added.
</div>
<claim-selected-results [results]="sources" <claim-selected-results [results]="sources"
[localStoragePrefix]="localStoragePrefix+'sources'" class="" [localStoragePrefix]="localStoragePrefix+'sources'" class=""
[enableRemove]="showOptions.show == 'source'"> [enableRemove]="showOptions.show == 'source'">
@ -197,15 +205,21 @@
message="all results (projects, communities, research results)" message="all results (projects, communities, research results)"
class="uk-float-right"></start-over> class="uk-float-right"></start-over>
<bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties <bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties
[localStoragePrefix]="localStoragePrefix+'results'"></bulk-claim> [localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"></bulk-claim>
</div> </div>
<div class="uk-padding-small uk-animation-slide-top-small"> <div class="uk-padding-small uk-animation-slide-top-small">
<div *ngIf="results.length >= basketLimit "
class="uk-alert uk-alert-warning uk-text-center">
Basket reached the size limit. No more entities can be added.
</div>
<claim-selected-results title="Selected Results" [results]="results" <claim-selected-results title="Selected Results" [results]="results"
[localStoragePrefix]="localStoragePrefix+'results'"> [localStoragePrefix]="localStoragePrefix+'results'">
</claim-selected-results> </claim-selected-results>
<div *ngIf="(results.length) == 0 " class="uk-alert no-selected-message uk-text-center"> <div *ngIf="(results.length) == 0 " class="uk-alert no-selected-message uk-text-center">
No entities to link with the sources. Start adding entities from the left panel. No entities to link with the sources. Start adding entities from the left panel.
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -24,6 +24,7 @@ export class LinkingGenericComponent {
step:number = 1; step:number = 1;
@Input() results:ClaimEntity[] = []; @Input() results:ClaimEntity[] = [];
@Input() inlineEntity:ClaimEntity = null; @Input() inlineEntity:ClaimEntity = null;
basketLimit =100;
@Input() showOptions:ShowOptions = new ShowOptions(); @Input() showOptions:ShowOptions = new ShowOptions();
//show values: source, result, project, context, claim //show values: source, result, project, context, claim

View File

@ -148,7 +148,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class=" uk-margin-auto-vertical"> <div class=" uk-margin-auto-vertical uk-padding-remove-left uk-margin-small-left">
<a class=" uk-icon-button " <a class=" uk-icon-button "
(click)="remove(entity, false)"> (click)="remove(entity, false)">
<span class="uk-icon"> <span class="uk-icon">
@ -289,7 +289,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class=" uk-margin-auto-vertical"> <div class="uk-margin-auto-vertical uk-padding-remove-left uk-margin-small-left">
<a class="uk-icon-button " <a class="uk-icon-button "
(click)="remove(entity, true)"> (click)="remove(entity, true)">
<span class="uk-icon"> <span class="uk-icon">

View File

@ -61,8 +61,6 @@ export class MetadataPreviewComponent {
let myDate = new Date(); let myDate = new Date();
if(date){ if(date){
myDate = new Date(date); myDate = new Date(date);
}else{
myDate = new Date();
} }
return myDate; return myDate;
} }

View File

@ -9,7 +9,7 @@
<claim-result-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-result-metadata> <claim-result-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-result-metadata>
<claim-project-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-project-metadata> <claim-project-metadata [entity]="entity" [slice]="true" [sliceSize]="5" [shortVersion]="true"></claim-project-metadata>
</div> </div>
<div class="uk-margin-auto-vertical" *ngIf="enableRemove"> <div class="uk-margin-auto-vertical uk-padding-remove-left uk-margin-small-left" *ngIf="enableRemove">
<a class=" uk-icon-button " (click)="remove(entity)" > <a class=" uk-icon-button " (click)="remove(entity)" >
<span class="uk-icon" > <span class="uk-icon" >
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="1"><rect height="1" width="18" y="9" x="1"></rect></svg> <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="minus" ratio="1"><rect height="1" width="18" y="9" x="1"></rect></svg>

View File

@ -19,7 +19,7 @@ import {Meta, Title} from '@angular/platform-browser';
<div> <div>
<displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false <displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false
moreClaimsURL="/participate/claim" [claimsInfoURL]=claimsInfoURL moreClaimsURL="/participate/claim" [claimsInfoURL]=claimsInfoURL
[showLatestClaims]=showLatestClaims></displayClaims> ></displayClaims>
</div> </div>
</div> </div>
</div> </div>
@ -30,7 +30,6 @@ import {Meta, Title} from '@angular/platform-browser';
}) })
export class MyClaimsComponent { export class MyClaimsComponent {
@Input() claimsInfoURL: string; @Input() claimsInfoURL: string;
@Input() showLatestClaims: boolean;
constructor(private _meta: Meta, private _title: Title) { constructor(private _meta: Meta, private _title: Title) {
let title = "OpenAIRE | My links"; let title = "OpenAIRE | My links";

View File

@ -550,11 +550,9 @@
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
</div> </div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" <helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']""></helper> [texts]="pageContents['bottom']"></helper>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
<div [id]="(mainComponent)?'tm-main':''" [class]="(mainComponent)?'uk-section uk-margin-small-top tm-middle':''"> <div [id]="(mainComponent)?'tm-main':''" [class]="(mainComponent)?'uk-section uk-padding-remove-top tm-middle':''">
<div uk-grid uk-grid> <div uk-grid uk-grid>
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> <div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">

View File

@ -69,8 +69,8 @@ export class Dates {
var myDate = new Date(); var myDate = new Date();
myDate.setFullYear(+date.substring(0,4)); myDate.setFullYear(+date.substring(0,4));
myDate.setMonth(+date.substring(5,7)-1); myDate.setMonth(((date.length>5 )?(+date.substring(5,7)-1):(0)));
myDate.setDate(+date.substring(8,11)) myDate.setDate(((date.length>8 )?(+date.substring(8,11)):(1)));
return myDate; return myDate;
} }