diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html index 589739d78..b547b8505 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.html @@ -35,7 +35,7 @@ [showCounts]="!this.selectionSpansPages" [showRemoveAll]="this.selectionSpansPages" (open)="tagsDropdownOpen()" - (removeAll)="applyTags([], true)" + (removeAll)="removeAllTags()" (editingComplete)="applyTags($event)"> diff --git a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts index 56ccfae53..c88a44e25 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -149,24 +149,36 @@ export class BulkEditorComponent { this.initialDocumentTypesToggleableItems = this._documentTypesToggleableItems } - applyTags(newTagsToggleableItems: ToggleableItem[], forceApply:boolean = false) { + applyTags(newTagsToggleableItems: ToggleableItem[]) { let changedTags = this.checkForChangedItems(this.initialTagsToggleableItems, newTagsToggleableItems) if (changedTags.itemsToAdd.length > 0) this.setTags.emit(changedTags.itemsToAdd) if (changedTags.itemsToRemove.length > 0) this.removeTags.emit(changedTags.itemsToRemove) } - applyCorrespondent(newCorrespondentsToggleableItems: ToggleableItem[], forceApply:boolean = false) { + removeAllTags() { + this.setTags.emit(null) + } + + applyCorrespondent(newCorrespondentsToggleableItems: ToggleableItem[]) { let changedCorrespondents = this.checkForChangedItems(this.initialCorrespondentsToggleableItems, newCorrespondentsToggleableItems) if (changedCorrespondents.itemsToAdd.length > 0) this.setCorrespondent.emit(changedCorrespondents.itemsToAdd[0]) else if (changedCorrespondents.itemsToRemove.length > 0) this.removeCorrespondents.emit(changedCorrespondents.itemsToRemove) } - applyDocumentType(newDocumentTypesToggleableItems: ToggleableItem[], forceApply:boolean = false) { + removeAllCorrespondents() { + this.setDocumentType.emit(null) + } + + applyDocumentType(newDocumentTypesToggleableItems: ToggleableItem[]) { let changedDocumentTypes = this.checkForChangedItems(this.initialDocumentTypesToggleableItems, newDocumentTypesToggleableItems) if (changedDocumentTypes.itemsToAdd.length > 0) this.setDocumentType.emit(changedDocumentTypes.itemsToAdd[0]) else if (changedDocumentTypes.itemsToRemove.length > 0) this.removeDocumentTypes.emit(changedDocumentTypes.itemsToRemove) } + removeAllDocumentTypes() { + this.setDocumentType.emit(null) + } + checkForChangedItems(toggleableItemsA: ToggleableItem[], toggleableItemsB: ToggleableItem[]): ChangedItems { let itemsToAdd: any[] = [] let itemsToRemove: any[] = []