argos/dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.html

209 lines
12 KiB
HTML

<div class="main-content dmp-overview pl-5 pr-5">
<div class="container-fluid pl-0 pr-0">
<div *ngIf="dmp">
<a class="row mb-2 pl-1" (click)="goBack()" role="button">
<mat-icon class="back-icon pointer">chevron_left</mat-icon>
<p class="label-txt pointer">{{'DMP-OVERVIEW.ACTIONS.BACK' | translate}}</p>
</a>
<div class="row">
<div class="col-md-8 col-lg-8 pl-4">
<div class="row">
<span class="dmp-logo">{{ 'DMP-OVERVIEW.TITLE' | translate }}</span>
<p class="dmp-label ml-3 mb-0">{{ dmp.label }}</p>
</div>
<div class="row d-flex align-items-center mt-3 mb-4 label-txt">
<div *ngIf="isUserDmpRelated()" class="d-flex">
<p class="ml-0 mb-0 label2-txt">
{{ enumUtils.toDmpUserRolesString(dmpService.getCurrentUserRolesInDmp(dmp?.dmpUsers)) }}
</div>
<span *ngIf="isUserDmpRelated() && (isPublishedDmp() || isLocked)" class="ml-2 mr-2">.</span>
<div *ngIf="isPublishedDmp()" class="d-flex flex-row">
<mat-icon class="status-icon">public</mat-icon>
{{'DMP-OVERVIEW.PUBLIC' | translate}}
</div>
<span *ngIf="isPublishedDmp() && isLocked" class="ml-2 mr-2">.</span>
<div *ngIf="isLocked" class="d-flex flex-row">
<mat-icon class="status-icon">lock_outline</mat-icon>
{{'DMP-OVERVIEW.LOCKED' | translate}}
</div>
<mat-form-field appearance="outline" subscriptSizing="dynamic" class="dense-3 versions-select ml-3 mr-3">
<mat-select placeholder="{{'DMP-OVERVIEW.VERSION' | translate}} {{dmp.version}}" [(ngModel)]="version" (ngModelChange)="versionChanged(version.id)">
<mat-option *ngFor="let version of pastVersions" [value]="version">
{{'DMP-OVERVIEW.VERSION' | translate}} {{version.version}}</mat-option>
</mat-select>
</mat-form-field>
<div class="d-flex mr-4">{{'DMP-OVERVIEW.EDITED' | translate}} :
{{dmp.updatedAt | dateTimeCultureFormatter: "d MMMM y"}}
</div>
<div class="d-flex mr-4">
<div *ngIf="dmp.status== dmpStatusEnum.Finalized" class="d-flex flex-row uppercase">
<mat-icon class="status-icon">check</mat-icon>
{{'DMP-OVERVIEW.FINALISED' | translate}}
</div>
</div>
</div>
<div class="row">
<!-- <button *ngIf="isDraftDmp(dmp) && isDmpOwner(dmp) && !isLocked" (click)="editClicked(dmp)" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above"> -->
<button *ngIf="canEditDmp() && !isLocked" (click)="editClicked()" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.EDIT' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">create</mat-icon>
</button>
<button *ngIf="canCloneDmp()" (click)="cloneClicked()" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="canDeleteDmp() && !isLocked" (click)="deleteClicked()" mat-mini-fab class="mr-3 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.DELETE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>
</div>
<div *ngIf="referenceService.hasRerefenceOfTypes(dmp?.dmpReferences, [this.referenceTypeService.getGrantReferenceType()])">
<div class="row header">{{'DMP-OVERVIEW.GRANT' | translate}}</div>
<div class="row dmp-label">{{referenceService.getReferencesForTypesFirstSafe(dmp?.dmpReferences, [this.referenceTypeService.getGrantReferenceType()])?.reference?.label}}</div>
</div>
<div class="row header">{{'DESCRIPTION-OVERVIEW.RESEARCHERS' | translate}}</div>
<div class="row">
<div *ngFor="let dmpReference of researchers let last = last">
<span *ngIf="isOrcid(dmpReference.reference)">
<a href="{{ getOrcidPathForResearcher(dmpReference.reference?.reference) }}" target="blank" class="researcher">
<div class="id-btn">&nbsp;</div>
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
</a>
</span>
<span *ngIf="!isOrcid(dmpReference.reference)">
<div *ngIf="!last">{{ dmpReference.reference?.label }}, </div>
<div *ngIf="last">{{ dmpReference.reference?.label }}</div>
</span>
</div>
<span *ngIf="!researchers || researchers.length === 0" class="material-icons">horizontal_rule</span>
</div>
<div class="row header">{{'DMP-OVERVIEW.DESCRIPTION' | translate}}</div>
<div class="row" *ngIf="dmp.description">
<p class="desc-txt" [innerHTML]="dmp.description"></p>
</div>
<div class="row" *ngIf="!dmp.description">
<span class="material-icons">horizontal_rule</span>
</div>
<div class="row header">{{'DMP-OVERVIEW.DESCRIPTIONS' | translate}}</div>
<div class="d-flex flex-column">
<div *ngFor="let description of dmp.descriptions">
<a class="row description" [routerLink]="isPublicView ? ['/descriptions/overview/public/' + description.id] : ['/descriptions/overview/' + description.id]" target="_blank">
<button mat-raised-button class="mb-2 mr-2 pl-0 pr-0 h-100">
<div matTooltip="{{ description.label }}" class="col-auto" [ngClass]="{'description-btn': description.status === descriptionStatusEnum.Draft, 'description-finalized-btn': description.status === descriptionStatusEnum.Finalized}">
<div class="description-btn-label">{{ description.label }}</div>
<mat-icon>launch</mat-icon>
</div>
</button>
</a>
</div>
<div class="row" *ngIf="!dmp.descriptions || dmp.descriptions.length === 0">
<span class="material-icons">horizontal_rule</span>
</div>
</div>
<div class="row mt-2 add-description-txt" *ngIf="!isLocked">
<a class="add-description-btn" *ngIf="canEditDmp()" [routerLink]="['/plans/edit/' + dmp.id]" target="_blank">
<mat-icon>add</mat-icon>
{{'DMP-OVERVIEW.ACTIONS.ADD-DESCRIPTION' | translate}}
</a>
</div>
</div>
<div class="col-md-4 col-lg-4 p-0">
<ng-container *ngIf="!hasDoi(dmp)">
<div class="row ml-0 mr-0 mb-3">
<span class="col-auto pl-0">{{'DMP-OVERVIEW.DOI-PROVIDED' | translate}}: </span>
<ng-container *ngIf="selectedModel">
<mat-select class="select-repo col" [placeholder]="selectedModel.repositoryId">
<mat-option *ngFor="let entityDoi of dmp.entityDois" (click)="selectDoi(entityDoi)">
{{entityDoi.repositoryId}}
</mat-option>
</mat-select>
</ng-container>
</div>
<div class="row d-flex flex-column ml-0 mr-0 mb-3">
<div *ngIf="dmp.entityDois && selectedModel" class="doi-panel">
<span class="ml-3 mr-3">{{selectedModel.doi}}</span>
<div class="d-flex justify-content-end ml-3">
<button (click)="copyDoi(selectedModel.doi)" mat-mini-fab class="mr-2 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.COPY' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="depositRepos?.length > 0" mat-mini-fab class="mr-2 d-flex justify-content-center align-items-center" matTooltip="{{'DMP-OVERVIEW.ACTIONS.VISIT-WEBSITE' | translate}}" matTooltipPosition="above">
<a [href]="createDoiLink(selectedModel)" class="doi-link" target="_blank">
<mat-icon class="mat-mini-fab-icon">launch</mat-icon>
</a>
</button>
</div>
</div>
</div>
</ng-container>
<div class="frame mb-3 pt-4 pl-3 pr-5 pb-1" *ngIf="isAuthenticated()">
<div *ngIf="isDraftDmp() && canFinalizeDmp() && !isLocked">
<div class="row ml-0 mr-0 pl-4 d-flex align-items-center" (click)="finalize(dmp)">
<button mat-mini-fab class="finalize-btn">
<mat-icon class="mat-mini-fab-icon">check</mat-icon>
</button>
<p class="mb-0 pl-2 finalize-txt">{{ 'DMP-OVERVIEW.ACTIONS.FINALIZE' | translate }}</p>
</div>
<div class="row ml-0 mr-0 pl-4 d-flex align-items-center">
<hr class="hr-line">
</div>
</div>
<app-dmp-deposit-dropdown *ngIf="(hasDoi(dmp) || moreDeposit()) && isFinalizedDmp(dmp) && !this.isPublicView && canDepositDmp(dmp) && inputRepos.length > 0" [inputRepos]="inputRepos" [dmp]="dmp" (outputReposEmitter)="afterDeposit($event)"></app-dmp-deposit-dropdown>
<div *ngIf="isFinalizedDmp(dmp) && hasDoi(dmp) && !isPublishedDmp(dmp) && canFinalizeDmp(dmp)" (click)="reverseFinalization()" class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center">
<button mat-mini-fab class="frame-btn">
<mat-icon class="mat-mini-fab-icon">unarchive</mat-icon>
</button>
<p class="mb-0 pl-2 frame-txt">{{ 'DMP-OVERVIEW.ACTIONS.REVERSE' | translate }}</p>
</div>
<div *ngIf="canExportDmp() && fileTransformerService.availableFormats.length > 0" class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center">
<button mat-mini-fab class="frame-btn" [matMenuTriggerFor]="exportMenu">
<mat-icon class="mat-mini-fab-icon">open_in_new</mat-icon>
</button>
<p class="mb-0 mr-0 pl-2 frame-txt" [matMenuTriggerFor]="exportMenu">
{{ 'DMP-OVERVIEW.ACTIONS.EXPORT' | translate }}</p>
</div>
<div *ngIf="canCreateNewVersion()" class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center" (click)="newVersionClicked()">
<button mat-mini-fab class="frame-btn">
<mat-icon class="mat-mini-fab-icon">add_to_photos</mat-icon>
</button>
<p class="mb-0 pl-2 frame-txt">{{ 'DMP-OVERVIEW.ACTIONS.NEW-VERSION' | translate }}
</p>
</div>
<mat-menu #exportMenu="matMenu" xPosition="before">
<button mat-menu-item *ngFor='let fileTransformer of fileTransformerService.availableFormats' (click)="fileTransformerService.exportDmp(dmp.id, fileTransformer.repositoryId, fileTransformer.format)">
<i class="fa pr-2" [ngClass]="fileTransformer.icon ? fileTransformer.icon : 'fa-file-o'"></i>
<span>{{'GENERAL.FILE-TRANSFORMER.' + fileTransformer?.format?.toUpperCase() | translate}}</span>
</button>
</mat-menu>
</div>
<div class="frame mb-3 pt-4 pl-3 pr-3 pb-1">
<div class="row ml-0 mr-0 pl-4 pb-3">
<p class="header">{{ 'DMP-OVERVIEW.DMP-AUTHORS' | translate }}</p>
</div>
<div class="row ml-0 mr-0 pl-4 ml-2 pb-3 d-flex align-items-center">
<div *ngFor="let dmpUser of dmp.dmpUsers" class="row authors">
<div class="d-flex flex-row">
<button class="account_btn mr-3 pl-0">
<mat-icon class="account-icon">account_circle</mat-icon>
</button>
<div>
<p class="authors-label">{{ dmpUser.user?.name }}
<span *ngIf="isUserAuthor(dmpUser.user?.id)">
({{ 'DMP-OVERVIEW.YOU' | translate }})</span>
</p>
<p class="authors-role">{{ enumUtils.toDmpUserRoleString(dmpUser.role) }}</p>
</div>
</div>
<button *ngIf="canAssignDmpUsers(dmp) && dmp.status === dmpStatusEnum.Draft && dmpUser.role != dmpUserRoleEnum.Owner" (click)="removeUserFromDmp(dmpUser)" class="remove-btn">{{ 'DMP-OVERVIEW.ACTIONS.REMOVE-AUTHOR' | translate}}</button>
</div>
</div>
<div *ngIf="canInviteDmpUsers()" class="row mt-3 mb-3 d-flex align-items-center justify-content-center">
<button mat-raised-button class="invite-btn" (click)="openShareDialog(dmp.id,dmp.label)">
<mat-icon>group_add</mat-icon>
{{'DMP-OVERVIEW.ACTIONS.INVITE-SHORT' | translate}}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>