-
+
@@ -96,6 +95,13 @@
Delete
+ @if (object.document_count > 0) {
+
+
+
+ }
}
diff --git a/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts b/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts
index 557d5f388..9aa876da2 100644
--- a/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts
+++ b/src-ui/src/app/components/manage/management-list/management-list.component.spec.ts
@@ -49,16 +49,19 @@ const tags: Tag[] = [
name: 'Tag1 Foo',
matching_algorithm: MATCH_LITERAL,
match: 'foo',
+ document_count: 35,
},
{
id: 2,
name: 'Tag2',
matching_algorithm: MATCH_NONE,
+ document_count: 0,
},
{
id: 3,
name: 'Tag3',
matching_algorithm: MATCH_AUTO,
+ document_count: 5,
},
]
@@ -180,7 +183,7 @@ describe('ManagementListComponent', () => {
const toastInfoSpy = jest.spyOn(toastService, 'showInfo')
const reloadSpy = jest.spyOn(component, 'reloadData')
- const editButton = fixture.debugElement.queryAll(By.css('button'))[7]
+ const editButton = fixture.debugElement.queryAll(By.css('button'))[6]
editButton.triggerEventHandler('click')
expect(modal).not.toBeUndefined()
@@ -205,7 +208,7 @@ describe('ManagementListComponent', () => {
const deleteSpy = jest.spyOn(tagService, 'delete')
const reloadSpy = jest.spyOn(component, 'reloadData')
- const deleteButton = fixture.debugElement.queryAll(By.css('button'))[8]
+ const deleteButton = fixture.debugElement.queryAll(By.css('button'))[7]
deleteButton.triggerEventHandler('click')
expect(modal).not.toBeUndefined()
@@ -225,7 +228,7 @@ describe('ManagementListComponent', () => {
it('should support quick filter for objects', () => {
const qfSpy = jest.spyOn(documentListViewService, 'quickFilter')
- const filterButton = fixture.debugElement.queryAll(By.css('button'))[6]
+ const filterButton = fixture.debugElement.queryAll(By.css('button'))[8]
filterButton.triggerEventHandler('click')
expect(qfSpy).toHaveBeenCalledWith([
{ rule_type: FILTER_HAS_TAGS_ALL, value: tags[0].id.toString() },