Adds information dialogue on DMP Wizard Save button when list of datasets is empty. (Issue #189)

This commit is contained in:
apapachristou 2019-10-08 17:44:18 +03:00
parent 9bdeaa6375
commit 27ddc0a184
3 changed files with 15 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<h2 mat-dialog-title>{{notification.title}}</h2>
<mat-dialog-content>{{notification.message}}</mat-dialog-content>
<mat-dialog-actions>
<button mat-button mat-dialog-close>{{'NOTIFICATION-COMPONENT.POPUP.CLOSE-BUTTON' | translate}}</button>
<mat-dialog-actions class="d-flex">
<button class="ml-auto" mat-button mat-dialog-close>{{'GENERAL.NOTIFICATION-DIALOG.POPUP.CLOSE' | translate}}</button>
</mat-dialog-actions>

View File

@ -13,7 +13,7 @@ import { BaseComponent } from "../../../core/common/base/base.component";
import { DatasetStatus } from '../../../core/common/enum/dataset-status';
import { DmpStatus } from '../../../core/common/enum/dmp-status';
import { DatasetService } from '../../../core/services/dataset/dataset.service';
import { SnackBarNotificationLevel, UiNotificationService } from '../../../core/services/notification/ui-notification-service';
import { SnackBarNotificationLevel, UiNotificationService, PopupNotification } from '../../../core/services/notification/ui-notification-service';
import { QuickWizardService } from '../../../core/services/quick-wizard/quick-wizard.service';
import { ConfirmationDialogComponent } from '../../../library/confirmation-dialog/confirmation-dialog.component';
import { DmpFinalizeDialogComponent, DmpFinalizeDialogDataset, DmpFinalizeDialogInput } from '../../dmp/editor/dmp-finalize-dialog/dmp-finalize-dialog.component';
@ -25,6 +25,7 @@ import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model';
import { FunderFormModel } from '../../dmp/editor/grant-tab/funder-form-model';
import { ProjectFormModel } from '../../dmp/editor/grant-tab/project-form-model';
import { CheckDeactivateBaseComponent } from '../../../library/deactivate/deactivate.component';
import { PopupNotificationDialogComponent } from '../../../library/notification/popup/popup-notification.component';
@Component({
selector: 'app-quick-wizard-editor-component',
@ -91,6 +92,7 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp
}
this.onSubmitSave();
} else {
this.uiNotificationService.popupNotification(this.language.instant('GENERAL.NOTIFICATION-DIALOG.POPUP.TITLE'), this.language.instant('GENERAL.NOTIFICATION-DIALOG.POPUP.MESSAGE'));
return;
}
}
@ -123,6 +125,8 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp
}
this.formGroup.get('dmp').get('status').setValue(DmpStatus.Finalized);
this.onSubmitSaveAndFinalize();
} else {
this.uiNotificationService.popupNotification(this.language.instant('GENERAL.NOTIFICATION-DIALOG.POPUP.TITLE'), this.language.instant('GENERAL.NOTIFICATION-DIALOG.POPUP.MESSAGE'));
}
}
});

View File

@ -52,6 +52,13 @@
"LEAVE": "Leave"
}
},
"NOTIFICATION-DIALOG": {
"POPUP": {
"TITLE": "Missing Dataset",
"MESSAGE": "At least one dataset has to be created to proceed on saving DMP.",
"CLOSE": "Close"
}
},
"ACTIONS": {
"VIEW-ALL": "View All",
"SHOW-MORE": "Show more",