diff --git a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.html b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.html index 47795943f..3e0877065 100644 --- a/dmp-frontend/src/app/library/notification/popup/popup-notification.component.html +++ b/dmp-frontend/src/app/library/notification/popup/popup-notification.component.html @@ -1,5 +1,5 @@

{{notification.title}}

{{notification.message}} - - + + diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts index 2ef3ebbb6..6c7a758ff 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts @@ -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')); } } }); @@ -133,7 +137,7 @@ export class QuickWizardEditorComponent extends CheckDeactivateBaseComponent imp } public isFormValid() { - return this.formGroup.get('grant').valid && this.formGroup.get('funder').valid; + return this.formGroup.get('grant').valid && this.formGroup.get('funder').valid; } public touchAllFormFields(formControl: AbstractControl) { diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 3c653a58e..837a4d8f2 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -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",