Removes edit functionality on /plans/edit/:finalized_id

This commit is contained in:
apapachristou 2019-06-25 16:02:54 +03:00
parent 868e6886b3
commit 825f792a5d
9 changed files with 24 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row d-flex"> <div class="row d-flex">
<div class="col-12 pr-4 pl-4" *ngIf="!isPublic"> <div class="col-12 pr-4 pl-4" *ngIf="!isPublic && !isFinalized">
<div class="add-dataset"> <div class="add-dataset">
<button mat-raised-button color="primary" (click)="addDataset(dmp.id)" <button mat-raised-button color="primary" (click)="addDataset(dmp.id)"
class="lightblue-btn ml-2 text-uppercase"> class="lightblue-btn ml-2 text-uppercase">

View File

@ -13,6 +13,7 @@ export class DatasetsTabComponent implements OnInit {
@Input() dmp: DmpEditorModel; @Input() dmp: DmpEditorModel;
@Input() isPublic: boolean; @Input() isPublic: boolean;
@Input() isFinalized: boolean;
constructor( constructor(
private router: Router private router: Router

View File

@ -9,7 +9,7 @@
<h4 class="card-title">{{ 'DMP-EDITOR.TITLE.NEW' | translate }}</h4> <h4 class="card-title">{{ 'DMP-EDITOR.TITLE.NEW' | translate }}</h4>
</div> </div>
<div class="d-flex ml-auto p-2" *ngIf="!isNew"> <div class="d-flex ml-auto p-2" *ngIf="!isNew">
<button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon" <button *ngIf="!isFinalized" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon"
(click)="$event.stopImmediatePropagation();"> (click)="$event.stopImmediatePropagation();">
<mat-icon class="more-horiz">more_horiz</mat-icon> <mat-icon class="more-horiz">more_horiz</mat-icon>
</button> </button>
@ -51,21 +51,21 @@
<mat-icon class="mr-2">work_outline</mat-icon> <mat-icon class="mr-2">work_outline</mat-icon>
{{ 'DMP-LISTING.COLUMNS.PROJECT' | translate }} {{ 'DMP-LISTING.COLUMNS.PROJECT' | translate }}
</ng-template> </ng-template>
<app-project-tab [formGroup]="formGroup.get('project')" [isNew]="isNew"></app-project-tab> <app-project-tab [formGroup]="formGroup.get('project')" [isNew]="isNew" [isFinalized]="isFinalized"></app-project-tab>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!isNew"> <mat-tab *ngIf="!isNew">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon class="mr-2">library_books</mat-icon> <mat-icon class="mr-2">library_books</mat-icon>
{{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }} {{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }}
</ng-template> </ng-template>
<app-datasets-tab [dmp]="dmp" [isPublic]="isPublic"></app-datasets-tab> <app-datasets-tab [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized"></app-datasets-tab>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!isNew"> <mat-tab *ngIf="!isNew">
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon class="mr-2">person</mat-icon> <mat-icon class="mr-2">person</mat-icon>
{{ 'DMP-LISTING.COLUMNS.PEOPLE' | translate }} {{ 'DMP-LISTING.COLUMNS.PEOPLE' | translate }}
</ng-template> </ng-template>
<app-people-tab [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic"></app-people-tab> <app-people-tab [formGroup]="formGroup" [dmp]="dmp" [isPublic]="isPublic" [isFinalized]="isFinalized"></app-people-tab>
</mat-tab> </mat-tab>
<mat-tab *ngIf="isNew"> <mat-tab *ngIf="isNew">
<ng-template mat-tab-label></ng-template> <ng-template mat-tab-label></ng-template>
@ -81,7 +81,7 @@
</mat-tab> --> </mat-tab> -->
</mat-tab-group> </mat-tab-group>
<div class="d-flex justify-content-end pt-2 pb-4 pl-2 pr-2"> <div *ngIf="!isFinalized" class="d-flex justify-content-end pt-2 pb-4 pl-2 pr-2">
<div *ngIf="!isNew"> <div *ngIf="!isNew">
<button mat-raised-button color="primary" (click)="cancel(dmp.id)" type="button" <button mat-raised-button color="primary" (click)="cancel(dmp.id)" type="button"
class="text-uppercase mr-2"> class="text-uppercase mr-2">

View File

@ -49,6 +49,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
breadCrumbs: Observable<BreadcrumbItem[]>; breadCrumbs: Observable<BreadcrumbItem[]>;
isNew = true; isNew = true;
isPublic = false; isPublic = false;
isFinalized = false;
dmp: DmpEditorModel; dmp: DmpEditorModel;
formGroup: FormGroup = null; formGroup: FormGroup = null;
@ -97,7 +98,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
// displayFn: (item) => item['label'], // displayFn: (item) => item['label'],
// titleFn: (item) => item['label'] // titleFn: (item) => item['label']
// }; // };
if (itemId != null) { if (itemId != null) {
this.isNew = false; this.isNew = false;
this.dmpService.getSingle(itemId).map(data => data as DmpModel) this.dmpService.getSingle(itemId).map(data => data as DmpModel)
@ -108,7 +108,10 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
this.dmp.fromModel(data); this.dmp.fromModel(data);
this.formGroup = this.dmp.buildForm(); this.formGroup = this.dmp.buildForm();
//this.registerFormEventsForDmpProfile(this.dmp.definition); //this.registerFormEventsForDmpProfile(this.dmp.definition);
if (!this.editMode || this.dmp.status === Status.Inactive) { this.formGroup.disable(); } if (!this.editMode || this.dmp.status === Status.Inactive) {
this.isFinalized = true;
this.formGroup.disable();
}
if (this.isAuthenticated) { if (this.isAuthenticated) {
// if (!this.isAuthenticated) { // if (!this.isAuthenticated) {
const breadCrumbs = []; const breadCrumbs = [];
@ -156,7 +159,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
if (!this.editMode || this.dmp.status === Status.Inactive) { this.formGroup.disable(); } if (!this.editMode || this.dmp.status === Status.Inactive) { this.formGroup.disable(); }
// if (!this.isAuthenticated) { // if (!this.isAuthenticated) {
const breadcrumbs = []; const breadcrumbs = [];
breadcrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-PUBLIC-DMPS').toUpperCase(), url: '/plans' }); breadcrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS').toUpperCase(), url: '/plans' });
breadcrumbs.push({ parentComponentName: null, label: this.dmp.label, url: '/plans/publicEdit/' + this.dmp.id }); breadcrumbs.push({ parentComponentName: null, label: this.dmp.label, url: '/plans/publicEdit/' + this.dmp.id });
this.breadCrumbs = Observable.of(breadcrumbs); this.breadCrumbs = Observable.of(breadcrumbs);
// this.breadCrumbs = Observable.of([ // this.breadCrumbs = Observable.of([

View File

@ -3,7 +3,7 @@
<div class="col-12 pt-4 pb-4 pl-4"> <div class="col-12 pt-4 pb-4 pl-4">
<div class="table-header col-auto d-flex"> <div class="table-header col-auto d-flex">
<span class="table-title">Collaborators</span> <span class="table-title">Collaborators</span>
<div class="table-action" *ngIf="!isPublic" (click)="openShareDialog(dmp.id, dmp.label)"> <div class="table-action" *ngIf="!isPublic && !isFinalized" (click)="openShareDialog(dmp.id, dmp.label)">
<mat-icon>add</mat-icon><span>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}</span> <mat-icon>add</mat-icon><span>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}</span>
</div> </div>
</div> </div>

View File

@ -20,6 +20,7 @@ export class PeopleTabComponent implements OnInit {
@Input() formGroup: FormGroup; @Input() formGroup: FormGroup;
@Input() dmp: DmpEditorModel; @Input() dmp: DmpEditorModel;
@Input() isPublic: boolean; @Input() isPublic: boolean;
@Input() isFinalized: boolean;
constructor( constructor(
private dialog: MatDialog, private dialog: MatDialog,

View File

@ -2,7 +2,7 @@
<form *ngIf="formGroup" [formGroup]="formGroup"> <form *ngIf="formGroup" [formGroup]="formGroup">
<!-- Toggle Between Add Project or Use Existing --> <!-- Toggle Between Add Project or Use Existing -->
<div class="row"> <div class="row" *ngIf="!isFinalized">
<div class="col-12 add-project" *ngIf="isCreateNew" (click)="create()"> <div class="col-12 add-project" *ngIf="isCreateNew" (click)="create()">
<mat-icon>keyboard_backspace</mat-icon> <mat-icon>keyboard_backspace</mat-icon>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</span> <span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</span>
@ -15,7 +15,7 @@
<!-- Create New DMP Mode --> <!-- Create New DMP Mode -->
<div class="row" *ngIf="!isCreateNew"> <div class="row" *ngIf="!isCreateNew">
<div class="col-6 pb-4 pl-4"> <div class="col-6 pb-4 pl-4 pt-2">
<mat-form-field> <mat-form-field>
<app-single-auto-complete required='true' [formControl]="formGroup.get('existProject')" <app-single-auto-complete required='true' [formControl]="formGroup.get('existProject')"
placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}" placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}"

View File

@ -16,6 +16,7 @@ export class ProjectTabComponent implements OnInit {
@Input() formGroup: FormGroup; @Input() formGroup: FormGroup;
@Input() isNew: boolean; @Input() isNew: boolean;
@Input() isFinalized: boolean;
isCreateNew = false; isCreateNew = false;
project: ProjectTabModel; project: ProjectTabModel;
@ -42,10 +43,6 @@ export class ProjectTabComponent implements OnInit {
this.project = new ProjectTabModel(); this.project = new ProjectTabModel();
this.formGroup = this.project.buildForm(); this.formGroup = this.project.buildForm();
} }
this.formGroup.get('existProject').enable();
this.formGroup.get('label').disable();
this.formGroup.get('description').disable();
} }
searchProject(query: string) { searchProject(query: string) {

View File

@ -63,7 +63,6 @@
"DMP": "DMP", "DMP": "DMP",
"DMPS": "DMPs", "DMPS": "DMPs",
"MY-DMPS": "MY DMPs", "MY-DMPS": "MY DMPs",
"MY-PUBLIC-DMPS": "My Public DMPs",
"DATASETS": "Datasets", "DATASETS": "Datasets",
"DATASET": "Dataset", "DATASET": "Dataset",
"PUBLIC-DATASETS": "Explore OpenDMP", "PUBLIC-DATASETS": "Explore OpenDMP",
@ -73,8 +72,8 @@
"ABOUT": "About", "ABOUT": "About",
"MY-DATASET-DESCRIPTIONS": "MY DATASET DESCRIPTIONS", "MY-DATASET-DESCRIPTIONS": "MY DATASET DESCRIPTIONS",
"DATASET-DESCRIPTION-WIZARD": "Dataset description wizard", "DATASET-DESCRIPTION-WIZARD": "Dataset description wizard",
"PUBLIC DATASETS": "PUBLIC DATASETS", "PUBLIC DATASETS": "PUBLISHED DATASETS",
"PUBLIC DMPS": "PUBLIC DMPS", "PUBLIC-DMPS": "PUBLISHED DMPS",
"HOME": "HOME", "HOME": "HOME",
"DMP-WIZARD": "DMP Wizard", "DMP-WIZARD": "DMP Wizard",
"DATASET-TEMPLATES": "DATASET TEMPLATES", "DATASET-TEMPLATES": "DATASET TEMPLATES",
@ -98,9 +97,9 @@
"HISTORY": "HISTORY", "HISTORY": "HISTORY",
"HISTORY-VISITED": "LAST VISITED", "HISTORY-VISITED": "LAST VISITED",
"HISTORY-EDITED": "LAST EDITED", "HISTORY-EDITED": "LAST EDITED",
"PUBLIC": "PUBLIC", "PUBLIC": "PUBLISHED",
"PUBLIC-DMPS": "Public DMPs", "PUBLIC-DMPS": "Published DMPs",
"PUBLIC-DESC": "Public Dataset Descriptions", "PUBLIC-DESC": "Published Dataset Descriptions",
"ACCOUNT": "ACCOUNT", "ACCOUNT": "ACCOUNT",
"ADMIN": "ADMIN", "ADMIN": "ADMIN",
"DATASET-TEMPLATES": "Dataset Templates", "DATASET-TEMPLATES": "Dataset Templates",
@ -677,7 +676,7 @@
}, },
"DMP-VISIBILITY": { "DMP-VISIBILITY": {
"VISIBILITY": "Visibility", "VISIBILITY": "Visibility",
"PUBLIC": "Public", "PUBLIC": "Published",
"FINALIZED": "Finalized" , "FINALIZED": "Finalized" ,
"DRAFT": "Draft", "DRAFT": "Draft",
"ANY": "Any" "ANY": "Any"