openaire-library/claims/linking/selected/metadataPreview.component.html

454 lines
28 KiB
HTML

<div class="uk-section uk-padding-remove-top uk-padding-remove-bottom ">
<div
[class]="((defaultColors)?'linkingToolbar':'communityPanelBackground')+' uk-padding-small uk-margin-small-top'">
<div class="uk-container uk-container-large uk-margin-small-top uk-padding-small">
<div class="uk-grid">
<div class="uk-padding-remove-left uk-margin-auto-vertical back uk-link">
<span
(click)="showOptions.showLinkTo()"
style="cursor:pointer">
<span class="uk-icon">
<svg width="30" height="30" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-left"
ratio="1.5"><polyline fill="none" stroke="#000" stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
BACK
</span>
</div>
<div class="uk-width-expand">
<div class="uk-h5 uk-text-bold">
LINKING CONFIRMATION
</div>
Confirm that the links you provided are all correct
</div>
<claim-insert [results]="results" [sources]="sources" [inlineEntity]="inlineEntity"
[properties]=properties [localStoragePrefix]=localStoragePrefix
class=" " [errors]="errors" (insertFinished)="runValidation(false); updateLocalStorage();"
[defaultColors]="defaultColors" [communityId]="communityId">
</claim-insert>
</div>
</div>
</div>
</div>
<div id="tm-main" class="uk-section uk-margin-small-top tm-middle uk-padding-remove-top">
<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 uk-container-large">
<div *ngIf="properties" class="uk-section uk-section-default uk-padding-remove-top">
<div class="uk-margin-top">
<div class="uk-grid">
<div class="uk-width-expand">
<div>
<div class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showSources=!showSources; ">
SOURCES ({{sources.length + (inlineEntity ? 1 : 0) | number}})
<span *ngIf="!showSources" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="chevron-left"
ratio="1"><polyline fill="none" stroke="#000"
stroke-width="1.03"
points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showSources" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg" icon="chevron-down"
ratio="1"><polyline fill="none" stroke="#000"
stroke-width="1.03"
points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<ul *ngIf="inlineEntity && showSources" class="uk-list uk-animation-fade">
<li
[class]="((inlineEntity.warningMessages.length > 0)?' warningBorder ':'')+
+((inlineEntity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'" >
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!inlineEntity.result) ? inlineEntity.type : ((inlineEntity.result && inlineEntity.result.source == 'openaire') ? inlineEntity.type : (inlineEntity.result && inlineEntity.result.source + ' result'))}}
</div>
<div *ngIf="inlineEntity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<!-- <div class="uk-text-muted">-->
<!-- {{(!inlineEntity.result) ? inlineEntity.type : ((inlineEntity.result && inlineEntity.result.source == 'openaire') ? inlineEntity.type : (inlineEntity.result && inlineEntity.result.source + ' result'))}}-->
<!-- </div>-->
<div>
<claim-title [entity]="inlineEntity"></claim-title>
</div>
<claim-result-metadata [entity]="inlineEntity"></claim-result-metadata>
<claim-project-metadata [entity]="inlineEntity"></claim-project-metadata>
</li>
</ul>
<div *ngIf="!inlineEntity && sources.length == 0 && showSources">
<div class="uk-alert dangerBorder no-selected-message uk-text-center">
<span class="uk-text-bold uk-text-danger"> SOURCES cannot be empty.</span>
Start by adding your linking sources first, go to <a (click)="showOptions.showSource() " class="uk-link">
sources
page</a>.
</div>
</div>
<ul *ngIf="!inlineEntity && sources.length > 0 && showSources" class="uk-list uk-animation-fade">
<li *ngFor=" let entity of sources "
[class]="((entity.warningMessages.length > 0)?' warningBorder ':'')+
+((entity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'">
<!-- <div class="uk-text-muted">-->
<!-- {{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}-->
<!-- </div>-->
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div *ngIf="entity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<div class="uk-grid uk-margin-remove-top">
<div class="uk-width-expand">
<claim-title [entity]="entity"></claim-title>
<claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata>
<div *ngIf="entity.result && entity.result.source && entity.result.source!='openaire' "
class="uk-grid uk-margin-remove-left uk-margin-small-top uk-text-small">
<div class="uk-width-1-2 uk-padding-remove-left">
<!-- <span class="uk-text-muted">Type </span>-->
<!-- <mat-select [(ngModel)]="entity.type" name="{{'select_type_'+entity.id}}"-->
<!-- class="uk-select uk-width-small matSelection"-->
<!-- [disableOptionCentering]="true"-->
<!-- panelClass="entitiesSelectionPanel">-->
<!-- <mat-option [value]="'publication'"-->
<!-- (click)="onTypeChanged('publication',entity, false)">Publication-->
<!-- </mat-option>-->
<!-- <mat-option [value]="'dataset'"-->
<!-- (click)="onTypeChanged('dataset',entity, false)">Research data-->
<!-- </mat-option>-->
<!-- <mat-option [value]="'software'" (click)="onTypeChanged('software',entity, false)">Software-->
<!-- </mat-option>-->
<!-- <mat-option [value]="'other'"-->
<!-- (click)="onTypeChanged('other',entity, false)">Other research product-->
<!-- </mat-option>-->
<!-- </mat-select>-->
<mat-form-field class="matSelectionFormField">
<mat-label>Type</mat-label>
<mat-select [(ngModel)]="entity.type" name="{{'select_type_'+entity.id}}"
class="matSelection"
[disableOptionCentering]="true"
panelClass="entitiesSelectionPanel">
<mat-option [value]="'publication'"
(click)="onTypeChanged('publication',entity, false)">Publication
</mat-option>
<mat-option [value]="'dataset'"
(click)="onTypeChanged('dataset',entity, false)">Research data
</mat-option>
<mat-option [value]="'software'" (click)="onTypeChanged('software',entity, false)">Software
</mat-option>
<mat-option [value]="'other'"
(click)="onTypeChanged('other',entity, false)">Other research product
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="uk-width-1-2">
<div class="uk-grid">
<!-- <span class="uk-text-muted uk-margin-small-top uk-padding-remove-left">Access mode</span>-->
<mat-form-field class="matSelectionFormField">
<mat-label>Access mode </mat-label>
<mat-select [(ngModel)]="entity.result.accessRights" name="{{'select_rights_'+entity.id}}"
class="uk-padding-remove-left matSelection"
[disableOptionCentering]="true"
panelClass="matSelectionPanel">
<mat-option *ngFor="let type of accessTypes" [value]="type"
(click)="accessRightsTypeChanged(type,entity, false)">{{type}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="entity.result.accessRights== 'EMBARGO'">
<input matInput [matDatepicker]="picker" placeholder="Choose embargo end date"
(click)="picker.open()" [ngModel]="embargoEndDates[entity.id+'_source']"
(dateInput)="onDateChanged($event, entity, false)" (dateChange)="onDateChanged($event, entity, false)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker [startAt]="embargoEndDates[entity.id+'_source']" ng-model-options="{ timezone: 'utc' }"></mat-datepicker>
</mat-form-field>
</div>
<div *ngIf="entity.result.accessRights== 'EMBARGO' && getEmbargoEndDateMessage(entity)"
[class]="(getEmbargoEndDateMessage(entity)?'uk-text-warning':'')">{{getEmbargoEndDateMessage(entity)}}
</div>
</div>
</div>
</div>
<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">
<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>
</span>
</a>
</div>
</div>
</li>
</ul>
</div>
<!-- Results-->
<div>
<div class=" uk-margin uk-h6 uk-text-primary "
(click)="showLinksTo=!showLinksTo; ">
LINK TO ({{results.length | number}})
<span *ngIf="!showLinksTo" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showLinksTo" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="results.length == 0 && showLinksTo">
<div class="uk-alert dangerBorder no-selected-message uk-text-center">
<span class="uk-text-bold uk-text-danger"> LINK TO list cannot be empty.</span>
Select an entity type to link to:
<div class="uk-grid uk-text-center uk-margin-expand uk-padding-small uk-child-width-1-3 uk-width-large uk-margin-auto ">
<div *ngIf="showOptions.linkToEntities.indexOf('project')!=-1 "
(click)="goTo('project')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
width="17" x="1.5" y="6.5"></rect></svg></span>
</button>
<div>Projects</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('result')!=-1 " (click)="goTo('result')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
width="12" x="3.5" y="2.5"></rect><polyline
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
</button>
<div>Research results</div>
</div>
<div *ngIf="showOptions.linkToEntities.indexOf('context')!=-1 "
(click)="goTo('context')"
style="cursor:pointer;">
<button class="uk-icon-button portal-button">
<span class="uk-icon">
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
stroke="#000" stroke-width="1.1"></circle><path
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
stroke="#000" stroke-width="1.1"></path><path
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
</button>
<div>Communities</div>
</div>
</div>
</div>
</div>
<ul *ngIf="results.length > 0 && showLinksTo" class="uk-list uk-animation-fade">
<li *ngFor=" let entity of results "
[class]="((entity.warningMessages.length > 0)?' warningBorder ':'')+
+((entity.errorMessages.length > 0)?' dangerBorder ':'') +
' uk-alert'" style="z-index: 0 !important;">
<div class="uk-grid uk-text-small">
<div class="uk-text-muted uk-width-1-2">
{{(!entity.result) ? entity.type : ((entity.result && entity.result.source == 'openaire') ? entity.type : (entity.result && entity.result.source + ' result'))}}
</div>
<div *ngIf="entity.errorMessages.length > 0"
class="uk-text-danger uk-width-1-2"> Link couldn't be saved
</div>
</div>
<div class="uk-grid uk-margin-remove-top">
<div class="uk-width-expand">
<claim-title [entity]="entity"></claim-title>
<claim-result-metadata [entity]="entity"></claim-result-metadata>
<claim-project-metadata [entity]="entity"></claim-project-metadata>
<div *ngIf="entity.result && entity.result.source && entity.result.source!='openaire' "
class="uk-grid uk-text-small uk-margin-remove-left uk-margin-small-top">
<div class="uk-width-1-2 uk-padding-remove-left">
<!-- <span class="uk-text-muted">Type </span>-->
<mat-form-field class="matSelectionFormField">
<mat-label>Type BB</mat-label>
<mat-select [(ngModel)]="entity.type" name="{{'select_type_'+entity.id}}"
class=" matSelection"
[disableOptionCentering]="true"
panelClass="matSelectionPanel">
<mat-option [value]="'publication'"
(click)="onTypeChanged('publication',entity, false)">Publication
</mat-option>
<mat-option [value]="'dataset'"
(click)="onTypeChanged('dataset',entity, false)">Research data
</mat-option>
<mat-option [value]="'software'" (click)="onTypeChanged('software',entity, false)">Software
</mat-option>
<mat-option [value]="'other'"
(click)="onTypeChanged('other',entity, false)">Other research product
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div class="uk-width-1-2">
<div class="uk-grid">
<!-- <span class="uk-text-muted uk-margin-small-top uk-padding-remove-left">Access mode</span>-->
<mat-form-field class="matSelectionFormField">
<mat-label>Access mode </mat-label>
<mat-select [(ngModel)]="entity.result.accessRights" name="{{'select_rights_'+entity.id}}"
class=" uk-padding-remove-left matSelection"
[disableOptionCentering]="true"
panelClass="matSelectionPanel">
<mat-option *ngFor="let type of accessTypes" [value]="type"
(click)="accessRightsTypeChanged(type,entity, true)">{{type}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field *ngIf="entity.result.accessRights== 'EMBARGO'">
<input matInput [matDatepicker]="picker" placeholder="Choose embargo end date"
(click)="picker.open()" [ngModel]="embargoEndDates[entity.id+'_result']"
(dateInput)="onDateChanged($event, entity, true)"
(dateChange)="onDateChanged($event, entity, true)">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker [startAt]="embargoEndDates[entity.id+'_result']" ng-model-options="{ timezone: 'utc' }"></mat-datepicker>
</mat-form-field>
</div>
<div *ngIf="entity.result.accessRights== 'EMBARGO' && getEmbargoEndDateMessage(entity)"
[class]="(getEmbargoEndDateMessage(entity)?'uk-text-warning':'')">{{getEmbargoEndDateMessage(entity)}}
</div>
</div>
</div>
</div>
<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">
<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>
</span>
</a>
</div>
</div>
</li>
</ul>
</div>
</div>
<div class="uk-width-1-3" *ngIf="errors.length > 0 || warnings.length > 0">
<!-- Errors and Warning -->
<div *ngIf="errors.length > 0" class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showErrors=!showErrors ">
ERRORS ({{errors.length | number}})
<span *ngIf="!showErrors" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showErrors" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="errors.length > 0 && showErrors" class=" uk-animation-fade">
<div *ngFor=" let message of errors " class="uk-alert dangerBorder">
<div *ngIf="message.type == 'claimServiceFail2Insert'">
<div class="">
<span class="uk-text-danger uk-text-bold"> Fail to save {{message.failed|number}}
{{message.failed > 1 ? 'links.' : 'link.'}}</span>
<br>
<div
*ngIf="message.inserted>0">But {{message.inserted|number}} link{{message.inserted > 1 ? 's' : ''}} was
successfully inserted.
<div>
<a routerLinkActive="router-link-active" routerLink="/myclaims">Manage your links here</a>
</div>
</div>
</div>
</div>
<div *ngIf="message.type == 'claimServiceFail'">
<div class="">
<span class="uk-text-danger uk-text-bold"> An error occured while saving your links.</span>
<br>
None of the links saved.
</div>
</div>
</div>
</div>
<div *ngIf="warnings.length > 0"
class=" uk-margin uk-h6 uk-text-primary uk-animation-toggle"
(click)="showWarnings=!showWarnings "> WARNINGS
({{warnings.length
| number}})
<span *ngIf="!showWarnings" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-left" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="13 16 7 10 13 4"></polyline></svg></span>
<span *ngIf="showWarnings" class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
icon="chevron-down" ratio="1"><polyline
fill="none" stroke="#000" stroke-width="1.03" points="16 7 10 13 4 7"></polyline></svg></span>
</div>
<div *ngIf="warnings.length > 0 && showWarnings " class=" uk-animation-fade">
<div *ngFor=" let message of warnings " class="uk-alert warningBorder">
<div *ngIf="message.type == 'embargoEndDate'">
<div class="uk-text-warning uk-text-bold">
Embargo date must be later than published date in
</div>
<div class="">
{{message.resultTitle}}
</div>
</div>
<div *ngIf="message.type == 'projectDuration'">
<div class="uk-text-warning uk-text-bold">
Published date must be in the project's date boundaries
(from {{message.projectInfo.startDate}}{{(message.projectInfo.endDate) ? (' to ' + (addStringToNumber(message.projectInfo.endDate, 5))) : ''}}) in
</div>
<div class="">
{{message.resultTitle}}
</div>
<div class="uk-text-muted uk-text-small">
with link to
</div>
<div class="">
{{message.projectInfo.title}}
</div>
<div><span class="uk-text-muted uk-text-small">
Project boundaries: </span>({{message.projectInfo.startDate}}{{(message.projectInfo.endDate) ? (' - ' + (message.projectInfo.endDate) + ') +5 years') : ')'}}
</div>
</div>
</div>
</div>
</div>
<modal-alert (alertOutput)="confirmClose()">
</modal-alert>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0" [texts]="pageContents['bottom']"></helper>
</div>
</div>
</div>