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="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">
<button mat-raised-button color="primary" (click)="addDataset(dmp.id)"
class="lightblue-btn ml-2 text-uppercase">

View File

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

View File

@ -9,7 +9,7 @@
<h4 class="card-title">{{ 'DMP-EDITOR.TITLE.NEW' | translate }}</h4>
</div>
<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();">
<mat-icon class="more-horiz">more_horiz</mat-icon>
</button>
@ -51,21 +51,21 @@
<mat-icon class="mr-2">work_outline</mat-icon>
{{ 'DMP-LISTING.COLUMNS.PROJECT' | translate }}
</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 *ngIf="!isNew">
<ng-template mat-tab-label>
<mat-icon class="mr-2">library_books</mat-icon>
{{ 'DMP-LISTING.COLUMNS.DATASETS' | translate }}
</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 *ngIf="!isNew">
<ng-template mat-tab-label>
<mat-icon class="mr-2">person</mat-icon>
{{ 'DMP-LISTING.COLUMNS.PEOPLE' | translate }}
</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 *ngIf="isNew">
<ng-template mat-tab-label></ng-template>
@ -81,7 +81,7 @@
</mat-tab> -->
</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">
<button mat-raised-button color="primary" (click)="cancel(dmp.id)" type="button"
class="text-uppercase mr-2">

View File

@ -49,6 +49,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
breadCrumbs: Observable<BreadcrumbItem[]>;
isNew = true;
isPublic = false;
isFinalized = false;
dmp: DmpEditorModel;
formGroup: FormGroup = null;
@ -97,7 +98,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
// displayFn: (item) => item['label'],
// titleFn: (item) => item['label']
// };
if (itemId != null) {
this.isNew = false;
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.formGroup = this.dmp.buildForm();
//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) {
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.isAuthenticated) {
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 });
this.breadCrumbs = Observable.of(breadcrumbs);
// this.breadCrumbs = Observable.of([

View File

@ -3,7 +3,7 @@
<div class="col-12 pt-4 pb-4 pl-4">
<div class="table-header col-auto d-flex">
<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>
</div>
</div>

View File

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

View File

@ -2,7 +2,7 @@
<form *ngIf="formGroup" [formGroup]="formGroup">
<!-- 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()">
<mat-icon>keyboard_backspace</mat-icon>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</span>
@ -15,7 +15,7 @@
<!-- Create New DMP Mode -->
<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>
<app-single-auto-complete required='true' [formControl]="formGroup.get('existProject')"
placeholder="{{this.languageResolverService.getBy('dmpEditor') | translate}}"

View File

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

View File

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