Feature: separate save / save & close buttons (#3575)

* Add setting to decide whether the edit dialog should automatically close on save

* Add the actual button to the ui

* Revert "Add the actual button to the ui"

This reverts commit e1f5a8bde0.

* Revert "Add setting to decide whether the edit dialog should automatically close on save"

This reverts commit feef3c909b.

* Add button for save without exit

* Correct save button ordering, ensure perms, update translation strings

* fix e2e tests

* Add unit testing for save / save & close button

---------

Update messages.xlf

Update document-detail.component.spec.ts

Co-Authored-By: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Daniel Dietzler
2023-06-18 06:47:52 +02:00
committed by shamoon
parent 4c4b571a88
commit 4693632c7d
5 changed files with 236 additions and 172 deletions

View File

@@ -518,7 +518,7 @@ export class DocumentDetailComponent
})
}
save() {
save(close: boolean = false) {
this.networkActive = true
this.documentsService
.update(this.document)
@@ -527,7 +527,7 @@ export class DocumentDetailComponent
next: () => {
this.store.next(this.documentForm.value)
this.toastService.showInfo($localize`Document saved successfully.`)
this.close()
close && this.close()
this.networkActive = false
this.error = null
},
@@ -535,7 +535,7 @@ export class DocumentDetailComponent
this.networkActive = false
if (!this.userCanEdit) {
this.toastService.showInfo($localize`Document saved successfully.`)
this.close()
close && this.close()
} else {
this.error = error.error
this.toastService.showError(