Removes preview status of DMP at Dataset Public Editor.

This commit is contained in:
apapachristou 2019-10-17 10:43:28 +03:00
parent 52cfc6cde6
commit c1a6a8d30e
1 changed files with 17 additions and 10 deletions

View File

@ -89,9 +89,9 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.dmpAutoCompleteConfiguration = { this.dmpAutoCompleteConfiguration = {
filterFn: this.searchDmp.bind(this), filterFn: this.searchDmp.bind(this),
initialItems: (extraData) => this.searchDmp(''), initialItems: (extraData) => this.searchDmp(''),
displayFn: (item) => (item['status'] ? this.language.instant('TYPES.DATASET-STATUS.FINALISED').toUpperCase() : this.language.instant('TYPES.DATASET-STATUS.DRAFT').toUpperCase()) + ': ' + item['label'], displayFn: (item) => this.getDatasetDisplay(item),
titleFn: (item) => item['label'], titleFn: (item) => item['label'],
iconFn: (item) => item['status'] ? 'lock' : 'lock_open' iconFn: (item) => this.publicMode ? '' : (item['status'] ? 'lock' : 'lock_open')
}; };
const params = this.route.snapshot.params; const params = this.route.snapshot.params;
@ -368,6 +368,13 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
this.router.navigate(['/datasets']); this.router.navigate(['/datasets']);
} }
getDatasetDisplay(item: any): string {
if (!this.publicMode) {
return (item['status'] ? this.language.instant('TYPES.DATASET-STATUS.FINALISED').toUpperCase() : this.language.instant('TYPES.DATASET-STATUS.DRAFT').toUpperCase()) + ': ' + item['label'];
}
else { return item['label']; }
}
getDefinition() { getDefinition() {
// if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; } // if (this.formGroup.invalid) { setTimeout(() => this.stepper.selectedIndex = 0); return; }
this.datasetWizardService.getDefinition(this.formGroup.get('profile').value) this.datasetWizardService.getDefinition(this.formGroup.get('profile').value)
@ -437,7 +444,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
} }
hasNotReversableStatus(): boolean { hasNotReversableStatus(): boolean {
if (this.formGroup.get('dmp').value) { if (this.formGroup.get('dmp').value && !this.publicMode) {
return (this.formGroup.get('dmp').value.status == DmpStatus.Finalized && this.formGroup.get('status').value == DatasetStatus.Finalized); return (this.formGroup.get('dmp').value.status == DmpStatus.Finalized && this.formGroup.get('status').value == DatasetStatus.Finalized);
} else { } else {
return false; return false;