Linking:
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:
parent
3e5c6bae88
commit
322492af79
|
@ -32,8 +32,8 @@
|
|||
|
||||
</div>
|
||||
<div class="uk-margin-right uk-padding">
|
||||
<span *ngFor="let community of communities">
|
||||
<span [class]="' uk-margin-small-bottom uk-margin-small-right '+getCommunityClass(community)"
|
||||
<span *ngFor="let community of communities" [title]="(this.results.length>=basketLimit)?'Basket reached the size limit':''">
|
||||
<span [class]="((this.results.length>=basketLimit)?'uk-disabled':'')+' uk-margin-small-bottom uk-margin-small-right '+getCommunityClass(community)"
|
||||
(click)="select(community)" style="cursor:pointer;">
|
||||
<a href="#modal-categories" uk-toggle>
|
||||
{{community.label}}
|
||||
|
@ -74,7 +74,7 @@
|
|||
No aditional community paths found for this community.
|
||||
</div>
|
||||
<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]">
|
||||
<span (click)="browseConcepts(category.id)">
|
||||
<span *ngIf="!conceptsClassDisplay[category.id]" class="uk-icon"><svg width="20" height="20"
|
||||
|
@ -89,8 +89,8 @@
|
|||
{{category.label}} - {{category.id}}</span>
|
||||
<a *ngIf="!isSelected(category.id)"
|
||||
(click)="addNewContext(selectedCommunityLabel,category.label,{'id':category.id, 'label':category.label})"
|
||||
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" [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"
|
||||
ratio="0.8"><rect x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17"
|
||||
height="1"></rect></svg>
|
||||
|
@ -126,7 +126,7 @@
|
|||
</span>
|
||||
<a *ngIf="!isSelected(concept1.id)"
|
||||
(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
|
||||
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
|
||||
</span></a>
|
||||
|
@ -154,7 +154,7 @@
|
|||
{{concept2.label}}</span>
|
||||
<a *ngIf="!isSelected(concept2.id)"
|
||||
(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
|
||||
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
|
||||
</span></a>
|
||||
|
@ -166,10 +166,10 @@
|
|||
</span>
|
||||
<ul *ngIf="concept2.concepts && conceptsClassDisplay[concept2.id] "
|
||||
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)"
|
||||
(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
|
||||
x="9" y="1" width="1" height="17"></rect><rect x="1" y="9" width="17" height="1"></rect></svg>
|
||||
</span></a>
|
||||
|
|
|
@ -19,6 +19,7 @@ export class ClaimContextSearchFormComponent {
|
|||
@Input() public properties: EnvProperties;
|
||||
@Input() communityId: string = null;
|
||||
@Input() public inlineClaim: boolean = false;
|
||||
@Input() basketLimit;
|
||||
|
||||
public selectedCommunityId: string = "0";
|
||||
public selectedCategoryId: string = "0";
|
||||
|
@ -85,15 +86,15 @@ export class ClaimContextSearchFormComponent {
|
|||
}
|
||||
|
||||
addNewContext(community, category, concept, notify = true) {
|
||||
if (this.results.length > 50) {
|
||||
UIkit.notification({
|
||||
message: 'Your basket exceeds the number of allowed concepts (50)',
|
||||
status: 'warning',
|
||||
timeout: 1500,
|
||||
pos: 'top-center'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (this.results.length > 50) {
|
||||
// UIkit.notification({
|
||||
// message: 'Your basket exceeds the number of allowed concepts (50)',
|
||||
// status: 'warning',
|
||||
// timeout: 1500,
|
||||
// pos: 'top-center'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
const entity: ClaimEntity = new ClaimEntity() ;
|
||||
entity.type = "community";
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<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>
|
||||
<claim-results [localStoragePrefix]="localStoragePrefix" [results]=openaireResults
|
||||
[selectedResults]=selectedProjects></claim-results>
|
||||
[selectedResults]=selectedProjects [basketLimit]="basketLimit"></claim-results>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -34,6 +34,7 @@ export class ClaimProjectsSearchFormComponent {
|
|||
@Input() public properties:EnvProperties;
|
||||
@Input() public inlineClaim:boolean=false;
|
||||
@Input() localStoragePrefix:string = "";
|
||||
@Input() basketLimit;
|
||||
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
public projects:string[];
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<div>
|
||||
|
||||
<claim-results [localStoragePrefix]=localStoragePrefix [results]=crossrefResults
|
||||
[selectedResults]=selectedResults></claim-results>
|
||||
[selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -185,7 +185,7 @@
|
|||
class="uk-animation-fade uk-margin-top uk-width-1-1"
|
||||
role="alert"><span class="loading-gif uk-align-center"></span></div>
|
||||
<claim-results [localStoragePrefix]=localStoragePrefix
|
||||
[results]=openaireResults [selectedResults]=selectedResults></claim-results>
|
||||
[results]=openaireResults [selectedResults]=selectedResults [basketLimit]="basketLimit"></claim-results>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -240,7 +240,7 @@
|
|||
<div>
|
||||
<claim-results [localStoragePrefix]=localStoragePrefix
|
||||
*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>
|
||||
</div>
|
||||
|
@ -275,7 +275,7 @@
|
|||
role="alert"><span class="loading-gif uk-align-center"></span></div>
|
||||
<div>
|
||||
<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>
|
||||
|
|
|
@ -29,6 +29,7 @@ export class ClaimResultSearchFormComponent {
|
|||
@Input() public selectedResults: ClaimEntity[];
|
||||
@Input() public properties: EnvProperties;
|
||||
@Input() localStoragePrefix: string = "";
|
||||
@Input() basketLimit;
|
||||
|
||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ declare var UIkit: any;
|
|||
<claim-result-metadata [entity]="entity"></claim-result-metadata>
|
||||
<claim-project-metadata [entity]="entity"></claim-project-metadata>
|
||||
</div>
|
||||
<div class="uk-margin-auto-vertical">
|
||||
<a class="uk-icon-button" *ngIf="!isSelected(entity)"
|
||||
<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]="(this.selectedResults.length>=basketLimit)?'uk-icon-button uk-disabled':'uk-icon-button'" *ngIf="!isSelected(entity)"
|
||||
(click)="add(entity)">
|
||||
<span class="uk-icon">
|
||||
<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() selectedResults: ClaimEntity[];
|
||||
@Input() localStoragePrefix: string = "";
|
||||
|
||||
@Input() basketLimit;
|
||||
private isSelected(result: ClaimEntity) {
|
||||
|
||||
let found: boolean = false;
|
||||
|
@ -64,15 +64,15 @@ export class ClaimResultsComponent {
|
|||
}
|
||||
|
||||
add(item: ClaimEntity) {
|
||||
if (this.selectedResults.length > 150) {
|
||||
UIkit.notification({
|
||||
message: 'Your basket exceeds the number of allowed results (150)',
|
||||
status: 'warning',
|
||||
timeout: 1500,
|
||||
pos: 'top-center'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (this.selectedResults.length > this.basketLimit) {
|
||||
// UIkit.notification({
|
||||
// message: 'Your basket exceeds the number of allowed results (150)',
|
||||
// status: 'warning',
|
||||
// timeout: 1500,
|
||||
// pos: 'top-center'
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
let found: boolean = this.isSelected(item);
|
||||
if (!found) {
|
||||
this.selectedResults.push(item);
|
||||
|
|
|
@ -151,19 +151,9 @@
|
|||
(click)="changeOrderby('date')">
|
||||
Claim Date
|
||||
</th>
|
||||
<th *ngIf="showLatestClaims">Status
|
||||
<!-- <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>'">-->
|
||||
<!-- <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>'" >
|
||||
<th >Status
|
||||
<span class="uk-icon"
|
||||
[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="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>
|
||||
</th>
|
||||
|
|
|
@ -30,7 +30,6 @@ export class DisplayClaimsComponent {
|
|||
@Input() showUserEmail: boolean = true;
|
||||
@Input() myClaims: boolean = false;
|
||||
@Input() isAdmin: boolean = false;
|
||||
@Input() showLatestClaims: boolean = false;
|
||||
page: number=1;
|
||||
size: number=10;
|
||||
sizes = [10, 20, 30, 50];
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import {Component, ViewChild, Input} from '@angular/core';
|
||||
import {Location} from '@angular/common';
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {Title, Meta} from '@angular/platform-browser';
|
||||
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'claims-admin',
|
||||
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 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">
|
||||
|
|
|
@ -16,8 +16,8 @@ declare var UIkit: any;
|
|||
<div class="uk-animation uk-text-center" style=" ">
|
||||
<form class=" ">
|
||||
|
||||
<div class="uk-grid">
|
||||
<div class="uk-width-expand">
|
||||
<div>
|
||||
<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-->
|
||||
<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">
|
||||
<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>
|
||||
<div>Uploaded file contains {{allIds.length}} {{((allIds.length == 1) ? 'DOI' : 'DOIs')}}.
|
||||
<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>
|
||||
<div>Uploaded file contains <span
|
||||
class="uk-text-bold">{{allIds.length}} {{((allIds.length == 1) ? 'DOI' : 'DOIs')}}</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
|
||||
*ngIf="duplicateIds.length > 0">{{duplicateIds.length | number}} duplicate DOIs in {{((duplicateIds.length == 1) ? 'line' : 'lines')}} {{duplicateIdsRow}}.
|
||||
</div>
|
||||
<div *ngIf="notFoundIds.length > 0">Couldn't be found:
|
||||
<div *ngIf="notFoundIds.length > 0">Couldn't be fetched:
|
||||
<ul class="">
|
||||
<li *ngFor="let id of notFoundIds; let i = index">"{{id}}" in line {{notFoundIdsRow[i]}}</li>
|
||||
</ul>
|
||||
|
@ -50,12 +66,18 @@ declare var UIkit: any;
|
|||
</ul>
|
||||
</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 *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>
|
||||
|
||||
</div>
|
||||
|
@ -82,6 +104,7 @@ export class BulkClaimComponent {
|
|||
|
||||
allIds: string[] = [];
|
||||
foundIds: string[] = [];
|
||||
existedIds: string[] = [];
|
||||
duplicateIds: string[] = [];
|
||||
duplicateIdsRow: number[] = [];
|
||||
notFoundIds: string[] = [];
|
||||
|
@ -94,7 +117,7 @@ export class BulkClaimComponent {
|
|||
enableUpload: boolean = true;
|
||||
@Input() localStoragePrefix: string = "";
|
||||
exceedsLimit = false;
|
||||
limit = 150;
|
||||
@Input() basketLimit ;
|
||||
|
||||
constructor(private _searchCrossrefService: SearchCrossrefService, private _searchDataciteService: SearchDataciteService) {
|
||||
this.filesToUpload = [];
|
||||
|
@ -123,23 +146,18 @@ export class BulkClaimComponent {
|
|||
this.exceedsLimit = false;
|
||||
let invalid_rows = 0;
|
||||
this.duplicateIds = [];
|
||||
this.existedIds = [];
|
||||
this.allIds = [];
|
||||
this.foundIds = [];
|
||||
this.noValidIds = [];
|
||||
this.results.slice(0, this.results.length);
|
||||
this.notFoundIds = [];
|
||||
|
||||
if (rows.length + this.results.length > this.limit) {
|
||||
if (rows.length + this.results.length > this.basketLimit) {
|
||||
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) {
|
||||
const values = rows[i].split(',');
|
||||
|
||||
|
@ -147,14 +165,16 @@ export class BulkClaimComponent {
|
|||
if (DOI.isValidDOI(id)) {
|
||||
let accessMode = (values[1] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[1]) : "OPEN";
|
||||
accessMode = (BulkClaimComponent.validateAccessMode(accessMode) ? accessMode : "OPEN");
|
||||
let embargoDate = (values[2] != undefined) ? BulkClaimComponent.removeDoubleQuotes(values[2]) : Dates.getDateToday();
|
||||
embargoDate = (Dates.isValidDate(embargoDate) ? embargoDate : Dates.getDateToday());
|
||||
let embargoDate = (values[2] != undefined) ? Dates.getDateFromString(BulkClaimComponent.removeDoubleQuotes(values[2])) : Dates.getDateToday();
|
||||
if (this.allIds.indexOf(id) > -1) {
|
||||
this.duplicateIds.push(id);
|
||||
this.duplicateIdsRow.push(i + 1);
|
||||
} else {
|
||||
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 {
|
||||
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();
|
||||
}
|
||||
|
||||
}, (error) => {
|
||||
this.enableUpload = true;
|
||||
console.log(error);
|
||||
this.loading.close();
|
||||
//this.errorMessage = "An error occured while uploading...";
|
||||
this.errorMessage = "An error occured.";
|
||||
BulkClaimComponent.handleError("Error uploading file", error);
|
||||
});
|
||||
}
|
||||
|
@ -224,12 +243,15 @@ export class BulkClaimComponent {
|
|||
this._searchCrossrefService.searchCrossrefByDOIs([id], this.properties.searchCrossrefAPIURL, true).subscribe(
|
||||
data => {
|
||||
|
||||
const result = data[1][0];
|
||||
const result:ClaimEntity = data[1][0];
|
||||
if (data[1].length > 0) {
|
||||
this.foundIds.push(id);
|
||||
result["embargoEndDate"] = date;
|
||||
result.result.accessRights = accessMode;
|
||||
result.result.embargoEndDate = date;
|
||||
if(!this.isSelected(result)){
|
||||
this.results.push(result);
|
||||
}else{
|
||||
this.existedIds.push(id);
|
||||
}
|
||||
this.endOfFetching();
|
||||
} else {
|
||||
|
@ -255,9 +277,12 @@ export class BulkClaimComponent {
|
|||
var result = items[1][0];
|
||||
|
||||
this.foundIds.push(id);
|
||||
result["embargoEndDate"] = date;
|
||||
result.result.accessRights = accessMode;
|
||||
result.result.embargoEndDate = date;
|
||||
if(!this.isSelected(result)){
|
||||
this.results.push(result);
|
||||
}else{
|
||||
this.existedIds.push(id);
|
||||
}
|
||||
} else {
|
||||
this.notFoundIds.push(id);
|
||||
|
@ -276,12 +301,13 @@ export class BulkClaimComponent {
|
|||
}
|
||||
|
||||
endOfFetching() {
|
||||
if (this.limit == this.results.length) {
|
||||
this.enableUpload = true;
|
||||
this.loading.close();
|
||||
return;
|
||||
}
|
||||
if (this.allIds.length == this.foundIds.length + this.notFoundIds.length) {
|
||||
// if (this.basketLimit <= this.results.length) {
|
||||
// this.enableUpload = true;
|
||||
// this.loading.close();
|
||||
// return;
|
||||
// }
|
||||
// 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.enableUpload = true;
|
||||
this.loading.close();
|
||||
|
|
|
@ -51,20 +51,24 @@
|
|||
</div>
|
||||
<div *ngIf="showOptions.show=='source'">
|
||||
<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 *ngIf="showOptions.show=='project'">
|
||||
<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 *ngIf="showOptions.show=='context'">
|
||||
<claim-contexts-search-form [communityId]=communityId [results]="results" [sources]="sources"
|
||||
[properties]=properties
|
||||
[localStoragePrefix]="localStoragePrefix+'results'"></claim-contexts-search-form>
|
||||
[localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"
|
||||
></claim-contexts-search-form>
|
||||
</div>
|
||||
<div *ngIf="showOptions.show=='result'">
|
||||
<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>
|
||||
|
@ -112,7 +116,7 @@
|
|||
message="all sources" class="uk-float-right"></start-over>
|
||||
<bulk-claim *ngIf="showOptions.show == 'source'" [results]="sources"
|
||||
[properties]=properties
|
||||
[localStoragePrefix]="localStoragePrefix+'sources'"
|
||||
[localStoragePrefix]="localStoragePrefix+'sources'" [basketLimit]="basketLimit"
|
||||
>
|
||||
</bulk-claim>
|
||||
|
||||
|
@ -122,6 +126,10 @@
|
|||
<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.
|
||||
</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"
|
||||
[localStoragePrefix]="localStoragePrefix+'sources'" class=""
|
||||
[enableRemove]="showOptions.show == 'source'">
|
||||
|
@ -197,15 +205,21 @@
|
|||
message="all results (projects, communities, research results)"
|
||||
class="uk-float-right"></start-over>
|
||||
<bulk-claim *ngIf="showOptions.show=='result'" [results]="results" [properties]=properties
|
||||
[localStoragePrefix]="localStoragePrefix+'results'"></bulk-claim>
|
||||
[localStoragePrefix]="localStoragePrefix+'results'" [basketLimit]="basketLimit"></bulk-claim>
|
||||
</div>
|
||||
|
||||
<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"
|
||||
[localStoragePrefix]="localStoragePrefix+'results'">
|
||||
</claim-selected-results>
|
||||
<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.
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -24,6 +24,7 @@ export class LinkingGenericComponent {
|
|||
step:number = 1;
|
||||
@Input() results:ClaimEntity[] = [];
|
||||
@Input() inlineEntity:ClaimEntity = null;
|
||||
basketLimit =100;
|
||||
|
||||
@Input() showOptions:ShowOptions = new ShowOptions();
|
||||
//show values: source, result, project, context, claim
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
</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 "
|
||||
(click)="remove(entity, false)">
|
||||
<span class="uk-icon">
|
||||
|
@ -289,7 +289,7 @@
|
|||
</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 "
|
||||
(click)="remove(entity, true)">
|
||||
<span class="uk-icon">
|
||||
|
|
|
@ -61,8 +61,6 @@ export class MetadataPreviewComponent {
|
|||
let myDate = new Date();
|
||||
if(date){
|
||||
myDate = new Date(date);
|
||||
}else{
|
||||
myDate = new Date();
|
||||
}
|
||||
return myDate;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<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>
|
||||
</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)" >
|
||||
<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>
|
||||
|
|
|
@ -19,7 +19,7 @@ import {Meta, Title} from '@angular/platform-browser';
|
|||
<div>
|
||||
<displayClaims [enableDelete]=true [myClaims]=true [isAdmin]=false [showUserEmail]=false
|
||||
moreClaimsURL="/participate/claim" [claimsInfoURL]=claimsInfoURL
|
||||
[showLatestClaims]=showLatestClaims></displayClaims>
|
||||
></displayClaims>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -30,7 +30,6 @@ import {Meta, Title} from '@angular/platform-browser';
|
|||
})
|
||||
export class MyClaimsComponent {
|
||||
@Input() claimsInfoURL: string;
|
||||
@Input() showLatestClaims: boolean;
|
||||
|
||||
constructor(private _meta: Meta, private _title: Title) {
|
||||
let title = "OpenAIRE | My links";
|
||||
|
|
|
@ -550,11 +550,9 @@
|
|||
|
||||
|
||||
</div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']" styleName="uk-width-1-1"></helper>
|
||||
</div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']""></helper>
|
||||
[texts]="pageContents['bottom']"></helper>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -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 class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ export class Dates {
|
|||
|
||||
var myDate = new Date();
|
||||
myDate.setFullYear(+date.substring(0,4));
|
||||
myDate.setMonth(+date.substring(5,7)-1);
|
||||
myDate.setDate(+date.substring(8,11))
|
||||
myDate.setMonth(((date.length>5 )?(+date.substring(5,7)-1):(0)));
|
||||
myDate.setDate(((date.length>8 )?(+date.substring(8,11)):(1)));
|
||||
return myDate;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue