Adds all available options on DMP overview contetxt menu and creates new separate "Edit" button. (Issue #133)

This commit is contained in:
gkolokythas 2019-07-18 13:17:34 +03:00
parent 844ac467f6
commit f00ac97dbb
2 changed files with 29 additions and 17 deletions

View File

@ -9,13 +9,15 @@
</mat-card-subtitle>
</div>
<div class="d-flex ml-auto p-2">
<button *ngIf="isDraftDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon"
(click)="$event.stopImmediatePropagation();">
<button *ngIf="isDraftDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon" (click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
</button>
<mat-menu #actionsMenu="matMenu">
<button mat-menu-item (click)="editClicked(dmp)" class="menu-item">
<mat-icon>edit</mat-icon>{{ 'DMP-LISTING.ACTIONS.EDIT' | translate }}
<mat-menu #actionsMenu="matMenu" xPosition="before">
<button mat-menu-item *ngIf="!isPublic" (click)="newVersion(dmp.id, dmp.label)">
<mat-icon>queue</mat-icon>{{'DMP-LISTING.ACTIONS.NEW-VERSION' | translate}}
</button>
<button mat-menu-item *ngIf="!isPublic" (click)="viewVersions(dmp.groupId, dmp.label)">
<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
</button>
<button mat-menu-item (click)="cloneClicked(dmp)" class="menu-item">
<mat-icon>add</mat-icon>{{ 'DMP-LISTING.ACTIONS.CLONE' | translate }}
@ -28,14 +30,17 @@
</button>
</mat-menu>
<button *ngIf="isFinalizedDmp(dmp)" mat-icon-button [matMenuTriggerFor]="actionsMenuFinalized" class="ml-auto more-icon"
(click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
(click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
</button>
<mat-menu #actionsMenuFinalized="matMenu">
<button mat-menu-item (click)="advancedClickedFinalized()" class="menu-item">
<mat-icon>save_alt</mat-icon>{{ 'DMP-LISTING.ACTIONS.ADV-EXP' | translate }}
</button>
</mat-menu>
<button mat-raised-button color="primary" (click)="editClicked(dmp)" class="lightblue-btn ml-2">
<mat-icon>edit</mat-icon> {{ 'DMP-LISTING.ACTIONS.EDIT' | translate }}
</button>
<button mat-raised-button color="primary" (click)="downloadPDF(dmp.id)" class="lightblue-btn ml-2">
<mat-icon>save_alt</mat-icon> {{ 'DMP-LISTING.ACTIONS.EXPORT' | translate }}
</button>
@ -86,7 +91,8 @@
<div *ngIf="i < 9" class="dataset-card" (click)="datasetClicked(dataset.id)">
<mat-icon *ngIf="isDraftDataset(dataset)" class="draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="!isDraftDataset(dataset)" class="finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="isDraftDataset(dataset)"><span>{{ 'TYPES.DMP.DRAFT' | translate }}:</span> {{ dataset.label }}</h4>
<h4 *ngIf="isDraftDataset(dataset)">
<span>{{ 'TYPES.DMP.DRAFT' | translate }}:</span> {{ dataset.label }}</h4>
<h4 *ngIf="!isDraftDataset(dataset)">{{ dataset.label }}</h4>
<div matTooltip="{{ dataset.datasetTemplate.label }}" class="chip">
{{ dataset.datasetTemplate.label }}</div>
@ -102,19 +108,17 @@
<div class="col-md-3 col-lg-3">
<div class="project-item">
<div class="gray-container container-header">
<span class="ml-2 pt-2"
(click)="projectClicked(dmp.project.id)">{{ dmp.project.abbreviation }}</span>
<span class="ml-2 pt-2" (click)="projectClicked(dmp.project.id)">{{ dmp.project.abbreviation }}</span>
</div>
<p class="card-subtitle mt-3 mb-1 ml-3 mr-3">{{ dmp.project.label }}</p>
<p class="mb-1 ml-3 mr-3">{{ dmp.project.startDate | date: "shortDate" }} -
{{ dmp.project.endDate | date: "shortDate" }}</p>
<p class="mb-1 ml-3 mr-3">{{ dmp.project.startDate | date: "shortDate" }} - {{ dmp.project.endDate | date: "shortDate" }}</p>
<p class="ml-3 mr-3 desc">{{ dmp.project.description }}</p>
<button mat-flat-button class="show-more" (click)="projectClicked(dmp.project.id)">
<!-- <mat-icon class="mr-2">expand_more</mat-icon> -->
{{ 'GENERAL.ACTIONS.SHOW-MORE' | translate }}
</button>
<p class="ml-3 mr-3 desc">{{ dmp.project.description }}</p>
<button mat-flat-button class="show-more" (click)="projectClicked(dmp.project.id)">
<!-- <mat-icon class="mr-2">expand_more</mat-icon> -->
{{ 'GENERAL.ACTIONS.SHOW-MORE' | translate }}
</button>
<a mat-raised-button class="visit-website" href="{{dmp.project.uri}}" target="_blank">
<mat-icon class="mr-2">open_in_new</mat-icon>

View File

@ -365,4 +365,12 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
onFinalizeCallbackError(error) {
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-FINALIZE'), SnackBarNotificationLevel.Error);
}
newVersion(id: String, label: String) {
this.router.navigate(['/plans/new_version/' + id, { dmpLabel: label }]);
}
viewVersions(rowId: String, rowLabel: String) {
this.router.navigate(['/plans/versions/' + rowId], { queryParams: { groupLabel: rowLabel } });
}
}