A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Change: Revert dropdown sorting by doc count (#8887)
shamoon13cfd6f90477
diff --git a/src-ui/messages.xlf b/src-ui/messages.xlfindex 4d628135c..9cc4086ae 100644--- a/src-ui/messages.xlf+++ b/src-ui/messages.xlf@@ -4974,7 +4974,7 @@<source>Not assigned</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts</context>- <context context-type="linenumber">390</context>+ <context context-type="linenumber">380</context></context-group><note priority="1" from="description">Filter drop down element to filter for documents with no correspondent/type/tag assigned</note></trans-unit>@@ -4982,7 +4982,7 @@<source>Open <x id="PH" equiv-text="this.title"/> filter</source><context-group purpose="location"><context context-type="sourcefile">src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts</context>- <context context-type="linenumber">511</context>+ <context context-type="linenumber">501</context></context-group></trans-unit><trans-unit id="7005745151564974365" datatype="html">diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.spec.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.spec.tsindex 245d34830..0dcc8c9cf 100644--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.spec.ts+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.spec.ts@@ -490,37 +490,6 @@ describe('FilterableDropdownComponent & FilterableDropdownSelectionModel', () =>])})- it('selection model should sort items by state and document counts, if set', () => {- component.items = items.concat([{ id: 4, name: 'Item D' }])- component.selectionModel = selectionModel- component.documentCounts = [- { id: 1, document_count: 0 }, // Tag1- { id: 2, document_count: 1 }, // Tag2- { id: 4, document_count: 2 },- ]- component.selectionModel.apply()- expect(selectionModel.items).toEqual([- nullItem,- { id: 4, name: 'Item D' },- items[1], // Tag2- items[0], // Tag1- ])-- selectionModel.toggle(items[1].id)- component.documentCounts = [- { id: 1, document_count: 0 },- { id: 2, document_count: 1 },- { id: 4, document_count: 0 },- ]- selectionModel.apply()- expect(selectionModel.items).toEqual([- nullItem,- items[1], // Tag2- { id: 4, name: 'Item D' },- items[0], // Tag1- ])- })-it('should set support create, keep open model and call createRef method', fakeAsync(() => {component.items = itemscomponent.icon = 'tag-fill'diff --git a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.tsindex 3f8ee0dc3..73b7fd27b 100644--- a/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts+++ b/src-ui/src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts@@ -81,16 +81,6 @@ export class FilterableDropdownSelectionModel {this.getNonTemporary(b.id) == ToggleableItemState.NotSelected) {return -1- } else if (- this._documentCounts.length &&- this.getDocumentCount(a.id) > this.getDocumentCount(b.id)- ) {- return -1- } else if (- this._documentCounts.length &&- this.getDocumentCount(a.id) < this.getDocumentCount(b.id)- ) {- return 1} else {return a.name.localeCompare(b.name)}