On New DMP (Expert): Removes finalize button since user don't have at least one finalized dataset at this point, Removes unnecessary tabs

This commit is contained in:
apapachristou 2019-06-24 10:46:39 +03:00
parent 0296b18022
commit 695ce63343
2 changed files with 15 additions and 9 deletions

View File

@ -53,20 +53,26 @@
</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"></app-project-tab>
</mat-tab> </mat-tab>
<mat-tab [disabled]="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"></app-datasets-tab>
</mat-tab> </mat-tab>
<mat-tab [disabled]="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"></app-people-tab>
</mat-tab> </mat-tab>
<mat-tab *ngIf="isNew">
<ng-template mat-tab-label></ng-template>
</mat-tab>
<mat-tab *ngIf="isNew">
<ng-template mat-tab-label></ng-template>
</mat-tab>
<!-- <mat-tab> <!-- <mat-tab>
<ng-template mat-tab-label> <ng-template mat-tab-label>
<mat-icon class="mr-2">settings</mat-icon> <mat-icon class="mr-2">settings</mat-icon>
@ -96,7 +102,7 @@
{{'DMP-EDITOR.ACTIONS.SAVE' | translate}} {{'DMP-EDITOR.ACTIONS.SAVE' | translate}}
</button> </button>
</div> </div>
<div *ngIf="formGroup.enabled"> <div *ngIf="formGroup.enabled && !isNew">
<button type="button" mat-raised-button color="primary" [disabled]="!formGroup.valid" class="text-uppercase mr-2" <button type="button" mat-raised-button color="primary" [disabled]="!formGroup.valid" class="text-uppercase mr-2"
(click)="saveAndFinalize()">{{'DMP-EDITOR.ACTIONS.FINALISE' | translate}} (click)="saveAndFinalize()">{{'DMP-EDITOR.ACTIONS.FINALISE' | translate}}
</button> </button>

View File

@ -51,8 +51,8 @@ export class DmpEditorModel {
this.organisations = item.organisations; this.organisations = item.organisations;
this.researchers = item.researchers; this.researchers = item.researchers;
this.profiles = item.profiles; this.profiles = item.profiles;
this.datasets = item.datasets; // this.datasets = item.datasets;
this.datasetsToBeFinalized = item.datasetsToBeFinalized; // this.datasetsToBeFinalized = item.datasetsToBeFinalized;
this.associatedUsers = item.associatedUsers; this.associatedUsers = item.associatedUsers;
this.users = item.users; this.users = item.users;
if (item.definition) { this.definition = item.definition; } if (item.definition) { this.definition = item.definition; }
@ -76,8 +76,8 @@ export class DmpEditorModel {
organisations: [{ value: this.organisations, disabled: disabled }, context.getValidation('organisations').validators], organisations: [{ value: this.organisations, disabled: disabled }, context.getValidation('organisations').validators],
researchers: [{ value: this.researchers, disabled: disabled }, context.getValidation('researchers').validators], researchers: [{ value: this.researchers, disabled: disabled }, context.getValidation('researchers').validators],
profiles: [{ value: this.profiles, disabled: disabled }, context.getValidation('profiles').validators], profiles: [{ value: this.profiles, disabled: disabled }, context.getValidation('profiles').validators],
datasets: [{ value: this.datasets, disabled: disabled }, context.getValidation('datasets').validators], // datasets: [{ value: this.datasets, disabled: disabled }, context.getValidation('datasets').validators],
datasetsToBeFinalized: [{ value: this.datasetsToBeFinalized, disabled: disabled }, context.getValidation('datasetsToBeFinalized').validators], // datasetsToBeFinalized: [{ value: this.datasetsToBeFinalized, disabled: disabled }],
associatedUsers: [{ value: this.associatedUsers, disabled: disabled }, context.getValidation('associatedUsers').validators], associatedUsers: [{ value: this.associatedUsers, disabled: disabled }, context.getValidation('associatedUsers').validators],
users: [{ value: this.users, disabled: disabled }, context.getValidation('users').validators] users: [{ value: this.users, disabled: disabled }, context.getValidation('users').validators]
}); });
@ -102,8 +102,8 @@ export class DmpEditorModel {
baseContext.validation.push({ key: 'organisations', validators: [BackendErrorValidator(this.validationErrorModel, 'organisations')] }); baseContext.validation.push({ key: 'organisations', validators: [BackendErrorValidator(this.validationErrorModel, 'organisations')] });
baseContext.validation.push({ key: 'researchers', validators: [BackendErrorValidator(this.validationErrorModel, 'researchers')] }); baseContext.validation.push({ key: 'researchers', validators: [BackendErrorValidator(this.validationErrorModel, 'researchers')] });
baseContext.validation.push({ key: 'profiles', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'profiles')] }); baseContext.validation.push({ key: 'profiles', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'profiles')] });
baseContext.validation.push({ key: 'datasets', validators: [BackendErrorValidator(this.validationErrorModel, 'datasets')] }); // baseContext.validation.push({ key: 'datasets', validators: [BackendErrorValidator(this.validationErrorModel, 'datasets')] });
baseContext.validation.push({ key: 'datasetsToBeFinalized', validators: [BackendErrorValidator(this.validationErrorModel, 'datasetsToBeFinalized')] }); // baseContext.validation.push({ key: 'datasetsToBeFinalized', validators: [BackendErrorValidator(this.validationErrorModel, 'datasetsToBeFinalized')] });
baseContext.validation.push({ key: 'associatedUsers', validators: [BackendErrorValidator(this.validationErrorModel, 'associatedUsers')] }); baseContext.validation.push({ key: 'associatedUsers', validators: [BackendErrorValidator(this.validationErrorModel, 'associatedUsers')] });
baseContext.validation.push({ key: 'users', validators: [BackendErrorValidator(this.validationErrorModel, 'users')] }); baseContext.validation.push({ key: 'users', validators: [BackendErrorValidator(this.validationErrorModel, 'users')] });