Disables project input on /plans/edit/:finalized_id, fixes Breadcrumb translate, fixes message on dialog of finalizing dmp with no datasets

This commit is contained in:
apapachristou 2019-06-26 18:34:43 +03:00
parent 6607714e4c
commit b8c498013e
5 changed files with 49 additions and 36 deletions

View File

@ -179,19 +179,20 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
this.formGroup = this.dmp.buildForm();
this.registerFormEventsForNewItem();
if (this.isAuthenticated) {
const breadCrumbs = [];
breadCrumbs.push({
parentComponentName: null,
label: this.language.instant('NAV-BAR.MY-DMPS'),
url: "/plans"
});
breadCrumbs.push({
parentComponentName: null,
label: "CREATE NEW DMP",
url: "/plans/new"
}
);
this.breadCrumbs = Observable.of(breadCrumbs);
this.language.get('NAV-BAR.MY-DMPS').pipe(takeUntil(this._destroyed)).subscribe(x => {
this.breadCrumbs = Observable.of([
{
parentComponentName: null,
label: x,
url: '/plans'
},
{
parentComponentName: null,
label: "CREATE NEW DMP",
url: "/plans/new"
}
]);
})
}
}
});
@ -450,6 +451,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
}
}
});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {});
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { });
}
}

View File

@ -25,14 +25,17 @@
</mat-panel-title>
<mat-panel-description></mat-panel-description>
</mat-expansion-panel-header>
<div *ngFor="let dataset of allDatasets" class="row pl-3 datasets">
<mat-icon *ngIf="isDraft(dataset)" class="col-1 draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="!isDraft(dataset)" class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="isDraft(dataset)" class="col-11 ml-auto mt-1 mb-4">
<span>{{ 'TYPES.DATASET-STATUS.DRAFT' | translate }}:</span>
{{ dataset.label }}</h4>
<h4 *ngIf="!isDraft(dataset)" class="col-11 ml-auto mt-1 mb-4">{{ dataset.label }}</h4>
<div *ngIf="allDatasets.length > 0">
<div *ngFor="let dataset of allDatasets" class="row pl-3 datasets">
<mat-icon *ngIf="isDraft(dataset)" class="col-1 draft-bookmark">bookmark</mat-icon>
<mat-icon *ngIf="!isDraft(dataset)" class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 *ngIf="isDraft(dataset)" class="col-11 ml-auto mt-1 mb-4">
<span>{{ 'TYPES.DATASET-STATUS.DRAFT' | translate }}:</span>
{{ dataset.label }}</h4>
<h4 *ngIf="!isDraft(dataset)" class="col-11 ml-auto mt-1 mb-4">{{ dataset.label }}</h4>
</div>
</div>
<div *ngIf="allDatasets.length === 0" class="emptyList">{{ 'DMP-FINALISE-DIALOG.EMPTY' | translate }} </div>
</mat-expansion-panel>
</mat-accordion>
@ -70,18 +73,21 @@
</mat-panel-title>
<mat-panel-description></mat-panel-description>
</mat-expansion-panel-header>
<div *ngFor="let label of allDatasetLabels" class="row pl-3 datasets">
<mat-icon class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 class="col-11 ml-auto mt-1 mb-4">{{ label }}</h4>
<div *ngIf="allDatasetLabels.length > 0">
<div *ngFor="let label of allDatasetLabels" class="row pl-3 datasets">
<mat-icon class="col-1 finalized-bookmark">bookmark</mat-icon>
<h4 class="col-11 ml-auto mt-1 mb-4">{{ label }}</h4>
</div>
</div>
<div *ngIf="allDatasetLabels.length === 0" class="emptyList"> {{ 'DMP-FINALISE-DIALOG.EMPTY' | translate }} </div>
</mat-expansion-panel>
</mat-accordion>
</div>
<div>
<mat-error class="row pt-2 pb-2 pl-4 pr-4">
<div *ngIf="datasetsFinalized && datasetsFinalized.length != 0">
<div class="row pt-2 pb-2 pl-4 pr-4">
{{ 'DMP-FINALISE-DIALOG.IMPACT' | translate }}
</mat-error>
</div>
<div class="row pl-4 pr-4">
{{ 'DMP-FINALISE-DIALOG.AFTER-FINALIZATION' | translate }}
</div>

View File

@ -60,10 +60,15 @@
}
.close-btn {
margin-left: auto;
cursor: pointer;
margin-left: auto;
cursor: pointer;
}
.datasets span {
color: #4687f0;
color: #4687f0;
}
.emptyList {
font-style: italic;
color:rgba(0, 0, 0, 0.26);
}

View File

@ -39,11 +39,6 @@ export class ProjectTabComponent implements OnInit {
titleFn: (item) => item['label']
};
if (!this.formGroup) {
this.project = new ProjectTabModel();
this.formGroup = this.project.buildForm();
}
this.isCreateNew = (this.formGroup.get('label').value != null && this.formGroup.get('label').value.length > 0);
this.setValidators();
}
@ -65,7 +60,12 @@ export class ProjectTabComponent implements OnInit {
this.formGroup.get('existProject').disable();
this.formGroup.get('label').enable();
this.formGroup.get('description').enable();
} else {
} else if (this.isFinalized) {
this.formGroup.get('existProject').disable();
this.formGroup.get('label').disable();
this.formGroup.get('description').disable();
}
else {
this.formGroup.get('existProject').enable();
this.formGroup.get('label').disable();
this.formGroup.get('label').reset();

View File

@ -848,6 +848,7 @@
"DMP-FINALISE-DIALOG": {
"DMP": "DMP",
"DATASETS": "Datasets",
"EMPTY": "No Datasets for this DMP so far",
"SUBMIT": "Submit",
"FINALISE-TITLE": "Do you want to finalise any of the following Draft Datasets?",
"ALREADY-FINALISED-DATASETS": "Already Finalized Datasets",