dmp-overview_update

This commit is contained in:
gpapavgeri 2020-07-01 18:32:22 +03:00
parent ee61bf4ffb
commit 134313eb3e
6 changed files with 187 additions and 86 deletions

View File

@ -1,16 +1,14 @@
<div class="main-content pl-5 pr-5">
<div class="container-fluid pl-0 pr-0">
<div *ngIf="dmp">
<a class="row mb-2" (click)="goBack()" role="button">
<a class="row mb-2 pl-1" (click)="goBack()" role="button">
<mat-icon class="back-icon">chevron_left</mat-icon>
<p class="label-txt">{{'DMP-WIZARD.ACTIONS.BACK' | translate}}</p>
</a>
<div class="row">
<div class="col-md-8 col-lg-8">
<div class="col-md-8 col-lg-8 pl-4">
<div class="row">
<button mat-raised-button primary class="dmp-btn">
<span class="dmp-btn-label">{{ 'DATASET-LISTING.COLUMNS.DMP' | translate }}</span>
</button>
<span class="dmp-logo">{{ 'DATASET-LISTING.COLUMNS.DMP' | translate }}</span>
<p class="dmp-label ml-2 mb-0">{{ dmp.label }}</p>
</div>
<div class="row d-flex align-items-center mt-3 mb-4 label-txt">
@ -28,29 +26,25 @@
{{'DMP-OVERVIEW.PRIVATE' | translate}}
</div>
</div>
<div class="d-flex mr-4">
<div *ngIf="dmp.status" class="d-flex flex-row">
<div class="d-flex mr-4" (click)="checkLockStatus(dmp.id)">
<div *ngIf="lockStatus" class="d-flex flex-row">
<mat-icon class="status-icon">lock_outline</mat-icon>
{{'DMP-OVERVIEW.LOCKED' | translate}}
</div>
<div *ngIf="!dmp.status" class="d-flex flex-row">
<div *ngIf="!lockStatus" class="d-flex flex-row">
<mat-icon class="status-icon">lock_open</mat-icon>
{{'DMP-OVERVIEW.UNLOCKED' | translate}}
</div>
</div>
<button class="d-flex mr-4 version-btn label2-txt">
{{'DMP-LISTING.COLUMNS.VERSION' | translate}}
<mat-select>
<mat-option *ngFor="let version of dmp.version" [value]="version">
{{version}}
</mat-option>
</mat-select>
<button class="d-flex mr-4 version-btn label2-txt"
(click)="viewVersions(dmp.groupId, dmp.label)">
{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
</button>
<div class="d-flex mr-4">{{'GENERAL.STATUSES.EDIT' | translate}} :
{{dmp.modifiedTime | date:"longDate"}}
</div>
<div class="d-flex mr-4">
<div *ngIf="dmp.status" class="d-flex flex-row finalized">
<div *ngIf="dmp.status" class="d-flex flex-row uppercase">
<mat-icon class="status-icon">check</mat-icon>
{{'DATASET-LISTING.COLUMNS.FINALIZED' | translate}}
</div>
@ -72,19 +66,33 @@
matTooltip="{{'DMP-LISTING.ACTIONS.DELETE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">delete</mat-icon>
</button>
<button *ngIf="isDraftDmp(dmp) && isUserOwner" (click)="finalize(dmp)" mat-mini-fab
<!-- <button *ngIf="isDraftDmp(dmp) && isUserOwner" (click)="finalize(dmp)" mat-mini-fab
class="mr-3 d-flex justify-content-center align-items-center"
matTooltip="{{'DMP-LISTING.ACTIONS.FINALIZE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">lock_outline</mat-icon>
</button> -->
<button *ngIf="isDraftDmp(dmp) && isUserOwner" mat-mini-fab
class="mr-3 d-flex justify-content-center align-items-center">
<div>
<div *ngIf="checkLockStatus(dmp.id)">
<mat-icon (click)="createOrUpdate(dmp.id)" class="mat-mini-fab-icon"
matTooltip="{{'DMP-OVERVIEW.LOCK' | translate}}" matTooltipPosition="above">
lock_outline
</mat-icon>
</div>
</div>
</button>
</div>
<div class="row header">{{'DMP-OVERVIEW.GRANT' | translate}}</div>
<div class="row dmp-label">{{ dmp.grant.label }}</div>
<div class="row header">{{'DMP-OVERVIEW.RESEARCHERS' | translate}}</div>
<div class="row">
<div *ngFor="let researcher of dmp.researchers" class="d-flex flex-row align-items-center">
<div *ngFor="let researcher of dmp.researchers; let last = last"
class="d-flex flex-row align-items-center">
<div class="id-btn">&nbsp;</div>
<div class="researcher">{{ researcher.name }}</div>
<div class="researcher" *ngIf="!last">{{ researcher.name }}, </div>
<div class="researcher" *ngIf="last">{{ researcher.name }}</div>
</div>
</div>
<div class="row header">{{'DATASET-LISTING.COLUMNS.DESCRIPTION' | translate}}</div>
@ -112,7 +120,7 @@
</div>
</div>
<div *ngIf="dmp.datasets.length > 3" class="show-more-btn">
<button mat-button (click)="datasetsClicked(dmp.id)" class="show-more-txt">
<button mat-button (click)="datasetsClicked(dmp.id)">
<mat-icon class="mr-2">expand_more</mat-icon>
{{ 'GENERAL.ACTIONS.SHOW-MORE' | translate }}
</button>
@ -127,20 +135,18 @@
</div>
</div>
<div class="col-md-4 col-lg-4 p-0">
<div class="row d-flex flex-column ml-0 mr-0 mb-3">
<div *ngIf="!hasDoi(dmp)" class="row d-flex flex-column ml-0 mr-0 mb-3">
<p class="doi-label">{{'DMP-EDITOR.TITLE.SUBTITLE' | translate}}</p>
<div class="doi-panel">
<p *ngIf="!hasDoi(dmp)" class="mb-0 ml-2">
<a [href]="createDoiLink(dmp.doi)" class="doi-txt">{{ dmp.doi }}</a></p>
<p *ngIf="hasDoi(dmp)" class="mb-0 ml-2">&nbsp;</p>
<p *ngIf="!hasDoi(dmp)" class="mb-0 ml-3">
<span class="doi-txt">{{ dmp.doi }}</span></p>
<div class="d-flex justify-content-end">
<button *ngIf="isAuthenticated()" (click)="cloneClicked(dmp)" mat-mini-fab
class="mr-2 d-flex justify-content-center align-items-center"
matTooltip="{{'DMP-LISTING.ACTIONS.CLONE' | translate}}" matTooltipPosition="above">
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
</button>
<button *ngIf="!hasDoi(dmp)" mat-mini-fab
class="mr-2 d-flex justify-content-center align-items-center"
<button mat-mini-fab class="mr-2 d-flex justify-content-center align-items-center"
matTooltip="{{'GRANT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate}}"
matTooltipPosition="above">
<a [href]="createDoiLink(dmp.doi)" class="doi-link" target="_blank">
@ -150,21 +156,33 @@
</div>
</div>
</div>
<div class="frame mb-3">
<div class="row ml-0 mr-0 pl-4 pt-4 mb-3 d-flex align-items-center">
<div class="frame mb-3 pt-4 pl-3 pr-5 pb-1">
<div *ngIf="!dmp.status && isDraftDmp(dmp) && isUserOwner">
<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-LISTING.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>
<div *ngIf="hasDoi(dmp) && isFinalizedDmp(dmp) && !this.isPublicView && isUserOwner"
(click)="getDoi(dmp)" 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">archive</mat-icon>
</button>
<p class="mb-0 pl-2 frame-txt">{{ 'DMP-LISTING.ACTIONS.DEPOSIT' | translate }}</p>
</div>
<div class="row ml-0 mr-0 pl-4 mb-3 d-flex align-items-center">
<div 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-LISTING.ACTIONS.EXPORT' | translate }}</p>
</div>
<div class="row ml-0 mr-0 pl-4 mb-3 d-flex align-items-center" *ngIf="isUserOwner"
<div class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center" *ngIf="isUserOwner"
(click)="newVersion(dmp.id, dmp.label)">
<button mat-mini-fab class="frame-btn">
<mat-icon class="mat-mini-fab-icon">add_to_photos</mat-icon>
@ -173,7 +191,7 @@
</p>
</div>
<div *ngIf="!dmp.isPublic && showPublishButton(dmp) && isUserOwner"
class="row ml-0 mr-0 pl-4 mb-3 d-flex align-items-center" (click)="publish(dmp.id)">
class="row ml-0 mr-0 pl-4 pb-3 d-flex align-items-center" (click)="publish(dmp.id)">
<button mat-mini-fab class="frame-btn">
<mat-icon class="mat-mini-fab-icon">public</mat-icon>
</button>
@ -198,23 +216,30 @@
</button>
</mat-menu>
</div>
<div class="frame mb-3">
<div class="row ml-0 mr-0 pl-4 pt-4 mb-3">
<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-3 mb-3 d-flex align-items-center" *ngIf="!isPublicView">
<button class="account_btn mr-4 pl-0">
<mat-icon class="account-icon">account_circle</mat-icon>
</button>
<div class="row">
<div *ngFor="let user of dmp.users">
<p class="mb-0 pl-2 authors-label">{{ user.name }}</p>
<p class="mb-0 pl-2 authors-role">{{ roleDisplay(user) }}</p>
<div class="row ml-0 mr-0 pl-4 ml-2 pb-3 d-flex align-items-center">
<div *ngFor="let user of dmp.users" 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">{{ user.name }}
<span *ngIf="!user.role"> ({{ 'DMP-OVERVIEW.YOU' | translate }})</span>
</p>
<p class="authors-role">{{ roleDisplay(user) }}</p>
</div>
</div>
<button *ngIf="isUserOwner && !dmp.status && user.role"
(click)="removeCollaborator(user.id)"
class="remove-btn">{{ 'GENERAL.CONFIRMATION-DIALOG.ACTIONS.REMOVE' | translate}}</button>
</div>
</div>
<div *ngIf="isUserOwner" (click)="openShareDialog(dmp.id,dmp.label)"
class="row mt-4 mb-3 d-flex align-items-center justify-content-center">
class="row mt-3 mb-3 d-flex align-items-center justify-content-center">
<button mat-raised-button class="invite-btn">
<mat-icon>group_add</mat-icon>
{{'DMP-LISTING.ACTIONS.INVITE-SHORT' | translate}}

View File

@ -17,7 +17,6 @@
.mat-mini-fab-icon, .status-icon {
font-size: 1.2em;
}
.status-icon {
@ -30,18 +29,12 @@
// ********BUTTONS********
.dmp-btn {
width: 4.8em;
height: 2.6em;
background: #129D99;
border-radius: 4px;
}
.version-btn {
width: 6.7em;
// width: 6.7em;
height: 1.8em;
border: 1px solid #707070;
border-radius: 4px;
background-color: transparent;
}
.id-btn {
@ -64,17 +57,39 @@
.show-more-btn {
width: 31.6em;
padding: 0 1em;
background-color: #ffffff00;
color: #129D99;
font-weight: 700;
}
.add-dataset-btn {
border: none;
font: Bold 0.875em Open Sans;
color: #444444;
background-color: transparent;
}
.frame-btn {
border: 1px solid #212121;
color: black;
}
.finalize-btn {
border: 1px solid #129D99;
color: #129D99;
}
.frame-btn, .finalize-btn {
background: #FFFFFF;
box-shadow: 0px 2px 6px #00000029;
color: black;
}
.remove-btn {
border: none;
background-color: transparent;
font-size: 0.875em;
font-weight: bold;
margin-left: auto;
}
.invite-btn{
@ -95,6 +110,16 @@
// ********TEXT********
.dmp-logo {
width: 4.8em;
height: 2.6em;
background: #129D99;
border-radius: 4px;
font-size: 0.875em;
color: #FFFFFF;
opacity: 0.8;
}
.label-txt {
font-size: 0.875em;
}
@ -107,17 +132,11 @@
color: #848484;
}
.dmp-btn-label {
font-size: 1em;
color: #FFFFFF;
opacity: 0.8;
}
.dmp-label {
font-weight: bold;
}
.finalized {
.uppercase {
text-transform: uppercase;
}
@ -151,17 +170,6 @@
overflow: hidden;
}
.show-more-txt {
background-color: #ffffff00;
color: #129D99;
font-weight: 700;
}
.add-dataset-txt {
font: Bold 0.875em Open Sans;
color: #444444;
}
.doi-label {
font-size: 1em;
color: #212121;
@ -189,44 +197,67 @@
}
.frame {
height: 14.6em;
background: #FFFFFF;
box-shadow: 0px 1px 5px #00000026;
border-radius: 4px;
overflow: hidden;
}
.frame-txt {
color: #000000;
}
.finalize-txt {
color: #129D99;
}
.frame-txt, .finalize-txt {
font-size: 0.75em;
font-weight: bold;
letter-spacing: 0px;
color: #000000;
text-transform: uppercase;
cursor: pointer;
}
.hr-line {
border: 1px solid #DBDBDB;
// width: 274px;
// width: 17em;
width: 100%;
}
.authors {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
}
.authors-label {
font-size: 0.875em;
color: #212121;
height: 1.4em;
margin-bottom: 0px;
}
.authors-role {
font-size: 0.875em;
color: #A8A8A8;
height: 1.4em;
margin-bottom: 0px;
}
// ********CENTER ELEMENTS********
.mat-mini-fab, .mat-mini-fab-icon,
.status-icon, .frame-btn {
.mat-mini-fab, .mat-mini-fab-icon,
.status-icon, .dmp-logo, .frame-btn, .finalize-btn {
display: flex;
justify-content: center;
align-items: center;
}
.dmp-label, .dataset-btn, .add-dataset-btn,
.add-dataset-txt, .doi-panel {
.dmp-label, .dataset-btn, .add-dataset-btn,
.doi-panel {
display: flex;
align-items: center;
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DatasetStatus } from '@app/core/common/enum/dataset-status';
@ -30,6 +30,10 @@ import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-d
import { isNullOrUndefined } from 'util';
import { UserService } from '@app/core/services/user/user.service';
import { Location } from '@angular/common';
import { FormGroup } from '@angular/forms';
import { LockService } from '@app/core/services/lock/lock.service';
import { ReturnStatement } from '@angular/compiler';
import { LockModel } from '@app/core/model/lock/lock.model';
@Component({
selector: 'app-dmp-overview',
@ -47,6 +51,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
isUserOwner: boolean;
expand = false;
hasDOIToken = false;
lock: LockModel;
lockStatus: Boolean;
@Input() formGroup: FormGroup;
constructor(
private route: ActivatedRoute,
@ -60,7 +68,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
private configurationService: ConfigurationService,
private oauth2DialogService: Oauth2DialogService,
private userService: UserService,
private location: Location
private location: Location,
private lockService: LockService
) {
super();
}
@ -532,18 +541,48 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
reverse() {
this.dmpService.unfinalize(this.dmp.id).pipe(takeUntil(this._destroyed))
.subscribe(
complete => {
this.dmp.status = DmpStatus.Draft;
this.onCallbackSuccess()
},
error => this.onFinalizeCallbackError(error)
);;
.subscribe(
complete => {
this.dmp.status = DmpStatus.Draft;
this.onCallbackSuccess()
},
error => this.onFinalizeCallbackError(error)
);;
}
goBack(): void {
this.location.back();
}
}
removeCollaborator(id: string) {
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
maxWidth: '300px',
data: {
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.DELETE-USER'),
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.REMOVE'),
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
isDeleteConfirmation: false
}
});
dialogRef.afterClosed().subscribe(result => {
if (result) {
this.formGroup.get('users').setValue(this.formGroup.get('users').value.filter(function (val, index, arr) {
return val.id !== id;
}));
}
});
}
checkLockStatus(id: string): Observable<boolean> {
return this.lockService.checkLockStatus(id);
}
createOrUpdate(id: string): Observable<string> {
// this.lock = new LockModel(id, this.getUserFromDMP());
return this.lockService.createOrUpdate(this.lock);
}
// advancedClicked() {
// const dialogRef = this.dialog.open(ExportMethodDialogComponent, {

View File

@ -541,6 +541,8 @@
"PRIVATE": "Private",
"LOCKED": "Locked",
"UNLOCKED": "Unlocked",
"YOU": "you",
"LOCK": "Lock",
"TOOLTIP": {
"LEVEL-OF-ACCESS": "Level of Access",
"INVOLVED-DATASETS": "Involved Dataset Descriptions",

View File

@ -541,6 +541,8 @@
"PRIVATE": "Privado",
"LOCKED": "Bloqueado",
"UNLOCKED": "Desbloqueado",
"YOU": "tú",
"LOCK": "Bloquear",
"TOOLTIP": {
"LEVEL-OF-ACCESS": "Nivel de acceso",
"INVOLVED-DATASETS": "Descripciones del Dataset implicadas",

View File

@ -541,6 +541,8 @@
"PRIVATE": "Ιδιωτικό",
"LOCKED": "Κλειδωμένο",
"UNLOCKED": "Ακλείδωτο",
"YOU": "εσύ",
"LOCK": "Κλείδωσε",
"TOOLTIP": {
"LEVEL-OF-ACCESS": "Επίπεδο Πρόσβασης",
"INVOLVED-DATASETS": "Εμπλεκόμενες Περιγραφές Συνόλου Δεδομένων",