diff --git a/src/app/applications/application-add-edit/application-add-edit.component.html b/src/app/applications/application-add-edit/application-add-edit.component.html index 0a3cfeba..ba8894f7 100644 --- a/src/app/applications/application-add-edit/application-add-edit.component.html +++ b/src/app/applications/application-add-edit/application-add-edit.component.html @@ -17,10 +17,15 @@

Crown land File: {{application['clFile']}}  &r {{isSubmitting ? 'Saving' : 'Save'}} + diff --git a/src/app/applications/application-add-edit/application-add-edit.component.ts b/src/app/applications/application-add-edit/application-add-edit.component.ts index bbf670d8..1c81853c 100644 --- a/src/app/applications/application-add-edit/application-add-edit.component.ts +++ b/src/app/applications/application-add-edit/application-add-edit.component.ts @@ -498,10 +498,36 @@ export class ApplicationAddEditComponent implements OnInit, OnDestroy { } if (this.applicationForm.invalid) { + if (this.application.isPublished) { + this.dialogService.addDialog(ConfirmComponent, + { + title: 'Cannot Publish Changes', + message: 'Please check for required fields or errors.', + okOnly: true + }, { + backdropColor: 'rgba(0, 0, 0, 0.5)' + }) + .takeUntil(this.ngUnsubscribe); + return; + } else { + this.dialogService.addDialog(ConfirmComponent, + { + title: 'Cannot Save Application', + message: 'Please check for required fields or errors.', + okOnly: true + }, { + backdropColor: 'rgba(0, 0, 0, 0.5)' + }) + .takeUntil(this.ngUnsubscribe); + return; + } + } + + if (this.application.isPublished && !this.application.description) { this.dialogService.addDialog(ConfirmComponent, { - title: 'Cannot Save Application', - message: 'Please check for required fields or errors.', + title: 'Cannot Publish Changes', + message: 'A description for this application is required to publish.', okOnly: true }, { backdropColor: 'rgba(0, 0, 0, 0.5)'