RED-9090: modal displays actual state & other improvements.
This commit is contained in:
parent
e72ba642e2
commit
478a661ca4
@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, HostListener } from '@angular/core';
|
||||
import { IconButtonTypes, IqserDialogComponent, LoadingService, Toaster } from '@iqser/common-ui';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { DictionaryService } from '@services/entity-services/dictionary.service';
|
||||
@ -36,6 +36,11 @@ export class EditDictionaryDialogComponent extends IqserDialogComponent<EditDict
|
||||
super();
|
||||
}
|
||||
|
||||
@HostListener('window:keydown.Escape')
|
||||
closeOnEscape(): void {
|
||||
this.close();
|
||||
}
|
||||
|
||||
async save() {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
@ -45,13 +50,14 @@ export class EditDictionaryDialogComponent extends IqserDialogComponent<EditDict
|
||||
this.data.dossierId,
|
||||
this.form.controls.addToDictionaryAction.value,
|
||||
);
|
||||
this.close(this.form.value as ReturnType);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
this._toaster.error(_('edit-dossier-dialog.dictionary.edit-dialog.error.generic'));
|
||||
this.close();
|
||||
}
|
||||
|
||||
this._loadingService.stop();
|
||||
this.close(this.form.value as ReturnType);
|
||||
}
|
||||
|
||||
protected readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
@ -39,6 +39,7 @@
|
||||
*ngIf="selectedDictionary.dossierDictionaryOnly && selectedDictionary.hasDictionary"
|
||||
(action)="openEditDictionaryModal()"
|
||||
[size]="20"
|
||||
[tooltip]="'edit-dossier-dialog.dictionary.edit-button-tooltip' | translate"
|
||||
icon="iqser:edit"
|
||||
class="p-left-8"
|
||||
></iqser-circle-button>
|
||||
|
||||
@ -118,7 +118,9 @@ export class EditDossierDictionaryComponent implements OnInit {
|
||||
})
|
||||
.result();
|
||||
|
||||
this.selectedDictionary = { ...this.selectedDictionary, addToDictionaryAction: result.addToDictionaryAction } as Dictionary;
|
||||
if (result) {
|
||||
this.selectedDictionary = { ...this.selectedDictionary, addToDictionaryAction: result.addToDictionaryAction } as Dictionary;
|
||||
}
|
||||
await this.#retrieveDictionaries();
|
||||
}
|
||||
|
||||
|
||||
@ -1140,6 +1140,7 @@
|
||||
"change-successful": "Dossier wurde aktualisiert.",
|
||||
"delete-successful": "Dossier wurde gelöscht.",
|
||||
"dictionary": {
|
||||
"edit-button-tooltip": "",
|
||||
"edit-dialog": {
|
||||
"add-to-dictionary-action": "",
|
||||
"cancel": "",
|
||||
|
||||
@ -1140,6 +1140,7 @@
|
||||
"change-successful": "Dossier {dossierName} was updated.",
|
||||
"delete-successful": "Dossier {dossierName} was deleted.",
|
||||
"dictionary": {
|
||||
"edit-button-tooltip": "Edit dossier dictionary settings",
|
||||
"edit-dialog": {
|
||||
"add-to-dictionary-action": "Available in add/edit dialogs in this dossier",
|
||||
"cancel": "Cancel",
|
||||
|
||||
@ -1140,6 +1140,7 @@
|
||||
"change-successful": "Dossier wurde aktualisiert.",
|
||||
"delete-successful": "Dossier wurde gelöscht.",
|
||||
"dictionary": {
|
||||
"edit-button-tooltip": "",
|
||||
"edit-dialog": {
|
||||
"add-to-dictionary-action": "",
|
||||
"cancel": "",
|
||||
|
||||
@ -1140,6 +1140,7 @@
|
||||
"change-successful": "Dossier {dossierName} was updated.",
|
||||
"delete-successful": "Dossier {dossierName} was deleted.",
|
||||
"dictionary": {
|
||||
"edit-button-tooltip": "",
|
||||
"edit-dialog": {
|
||||
"add-to-dictionary-action": "",
|
||||
"cancel": "",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user