argos/dmp-frontend/src/app/ui/dmp/dmp-finalize-dialog/dmp-finalize-dialog.compone...

82 lines
3.8 KiB
HTML
Raw Normal View History

2024-03-13 18:24:01 +01:00
<div class="row d-flex flex-row">
<div mat-dialog-title class="col-auto">{{ 'DMP-FINALISE-DIALOG.TITLE' | translate }}</div>
<div class="col-auto close-btn ml-auto" (click)="close()">
<mat-icon>close</mat-icon>
</div>
</div>
<div mat-dialog-content class="pt-2 pb-2">
<div class="container">
<mat-accordion [multi]="true">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{ 'DMP-FINALISE-DIALOG.DMP' | translate }}
</mat-panel-title>
<mat-panel-description class="dmp-title">
{{ dmp.label }}
</mat-panel-description>
</mat-expansion-panel-header>
{{ dmp.description }}
</mat-expansion-panel>
<mat-expansion-panel [expanded]="true">
<mat-expansion-panel-header>
<mat-panel-title>
{{ 'DMP-FINALISE-DIALOG.DESCRPIPTIONS' | translate }}
</mat-panel-title>
<mat-panel-description></mat-panel-description>
</mat-expansion-panel-header>
2024-03-15 08:39:36 +01:00
<div *ngIf="dmp.descriptions && dmp.descriptions.length > 0">
2024-03-13 18:24:01 +01:00
<div *ngFor="let description of dmp.descriptions" class="row pl-3 descriptions">
<mat-icon *ngIf="description.status == descriptionStatusEnum.Draft" class="col-1 draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="description.status == descriptionStatusEnum.Draft" class="col-11 ml-auto mt-1 mb-4">
2024-03-15 08:39:36 +01:00
<span>{{ 'TYPES.DESCRIPTION-STATUS.DRAFT' | translate }}
2024-03-13 18:24:01 +01:00
<ng-container *ngIf="!isDescriptionValid(description.id)">
({{'DMP-FINALISE-DIALOG.INVALID' | translate}})
</ng-container>
:</span>
{{ description.label }}
<i *ngIf="!isDescriptionValid(description.id)" class="fa fa-spinner fa-spin" ></i>
2024-03-13 18:24:01 +01:00
</h4>
<h4 *ngIf="description.status == descriptionStatusEnum.Finalized" class="col-11 ml-auto mt-1 mb-4">{{ description.label }}</h4>
</div>
</div>
2024-03-15 08:39:36 +01:00
<div *ngIf="!dmp.descriptions" class="emptyList">{{ 'DMP-FINALISE-DIALOG.EMPTY' | translate }} </div>
2024-03-13 18:24:01 +01:00
</mat-expansion-panel>
</mat-accordion>
<div *ngIf="validDraftDescriptions.length > 0" class="pt-4 pb-2">
<h4 class="pl-2">{{'DMP-FINALISE-DIALOG.FINALISE-TITLE' | translate}}</h4>
<mat-selection-list [(ngModel)]="descriptionsToBeFinalized">
<div class="styleBorder" *ngFor="let description of validDraftDescriptions">
<mat-list-option [value]='description.id' [disabled]="!isDescriptionValid(description.id)">
<span class="text-truncate" [matTooltip]="description.label">{{ description.label }}</span>
</mat-list-option>
</div>
</mat-selection-list>
</div>
<mat-error *ngIf="getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0">
{{'DMP-FINALISE-DIALOG.VALIDATION.AT-LEAST-ONE-DESCRPIPTION-FINALISED' | translate}}
</mat-error>
</div>
</div>
<div *ngIf="getFinalizedDescriptions().length != 0">
<div class="row pt-2 pb-2 pl-4 pr-4">
{{ 'DMP-FINALISE-DIALOG.IMPACT' | translate }}
</div>
<div *ngIf="dmp.accessType == dmpAccessTypeEnum.Public" class="row pl-4 pr-4">
{{ 'DMP-FINALISE-DIALOG.PUBLIC-DMP-MESSAGE' | translate }}
</div>
<div *ngIf="dmp.accessType == dmpAccessTypeEnum.Restricted" class="row pl-4 pr-4">
{{ 'DMP-FINALISE-DIALOG.RESTRICTED-DMP-MESSAGE' | translate }}
</div>
</div>
<div mat-dialog-actions class="d-flex justify-content-end mb-1">
<div class="col-auto">
<button mat-raised-button cdkFocusInitial (click)="close()" class="cancel-btn">{{ 'DMP-FINALISE-DIALOG.ACTIONS.CANCEL' | translate }}</button>
</div>
<div class="col-auto">
<button mat-raised-button [disabled]="getFinalizedDescriptions().length === 0 && descriptionsToBeFinalized.length === 0" class="submit-btn" (click)="onSubmit()">{{ 'DMP-FINALISE-DIALOG.ACTIONS.SUBMIT' | translate }}</button>
</div>
</div>