diff --git a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html index 9534b75f9..99f6d4412 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html +++ b/apps/red-ui/src/app/screens/admin/dictionary-listing-screen/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.html @@ -1,9 +1,11 @@ - + + {{ (dictionary ? 'add-edit-dictionary.title.edit' : 'add-edit-dictionary.title.new') | translate: { name: dictionary?.type | humanize } }} + - + diff --git a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html b/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html index 2f0f2840d..01704968e 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html +++ b/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.html @@ -4,7 +4,7 @@ - {{ dictionary.type }} + {{ dictionary.type | humanize }} @@ -98,7 +98,7 @@ - {{ dictionary.type }} + {{ dictionary.type | humanize }} @@ -123,3 +123,5 @@ + + diff --git a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts index 1304c7674..0e2b92d9c 100644 --- a/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/screens/admin/dictionary-overview-screen/dictionary-overview-screen.component.ts @@ -41,6 +41,8 @@ export class DictionaryOverviewScreenComponent { aceOptions = { showPrintMargin: false }; searchText = ''; + processing: boolean = true; + constructor( public readonly permissionsService: PermissionsService, private readonly _notificationService: NotificationService, @@ -64,10 +66,15 @@ export class DictionaryOverviewScreenComponent { } private _initialize() { - this._dictionaryControllerService.getDictionaryForType(this.dictionary.type).subscribe((data) => { - this.initialDictionaryEntries = data.entries.sort((str1, str2) => str1.localeCompare(str2, undefined, { sensitivity: 'accent' })); - this.revert(); - }); + this._dictionaryControllerService.getDictionaryForType(this.dictionary.type).subscribe( + (data) => { + this.initialDictionaryEntries = data.entries.sort((str1, str2) => str1.localeCompare(str2, undefined, { sensitivity: 'accent' })); + this.revert(); + }, + () => { + this.processing = false; + } + ); } openEditDictionaryDialog($event: any) { @@ -156,10 +163,14 @@ export class DictionaryOverviewScreenComponent { } get hasChanges() { - return this.activeEditMarkers.length > 0 || this.currentDictionaryEntries.length < this.initialDictionaryEntries.length; + return ( + this.activeEditMarkers.length > 0 || + this.currentDictionaryEntries.filter((e) => e && e.trim().length > 0).length < this.initialDictionaryEntries.length + ); } async saveEntries() { + this.processing = true; let entriesToAdd = []; this.currentDictionaryEntries.forEach((currentEntry) => { entriesToAdd.push(currentEntry); @@ -170,6 +181,7 @@ export class DictionaryOverviewScreenComponent { if (invalidRowsExist.length === 0) { // can add at least 1 let obs: Observable; + console.log('entriesToAdd', entriesToAdd, this); if (entriesToAdd.length > 0) { obs = this._dictionaryControllerService.addEntry(entriesToAdd, this.dictionary.type, true); } else { @@ -209,6 +221,7 @@ export class DictionaryOverviewScreenComponent { this.editorComponent.getEditor().setValue(this.dictionaryEntriesAsText); this.editorComponent.getEditor().clearSelection(); this.searchChanged(''); + this.processing = false; } nextSearchMatch() { diff --git a/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html b/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html index 7664cc0e8..2980c7283 100644 --- a/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html +++ b/apps/red-ui/src/app/screens/project-overview-screen/bulk-actions/bulk-actions.component.html @@ -20,7 +20,7 @@ *ngIf="canReanalyse" tooltip="project-overview.bulk.reanalyse" type="dark-bg" - icon="red:assign" + icon="red:refresh" >