A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
ASN 'is null' from frontend
Michael Shamoon778543115232
diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.htmlindex 6280cff10..7a0f91899 100644--- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html+++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.html@@ -8,7 +8,13 @@<button *ngFor="let t of textFilterTargets" ngbDropdownItem [class.active]="textFilterTarget == t.id" (click)="changeTextFilterTarget(t.id)">{{t.name}}</button></div></div>- <input #textFilterInput class="form-control form-control-sm" type="text" [(ngModel)]="textFilter" (keyup.enter)="textFilterEnter()" [readonly]="textFilterTarget == 'fulltext-morelike'">+ <div *ngIf="textFilterTarget == 'asn'" class="input-group-text py-0">+ <div class="form-check form-switch m-0">+ <input class="form-check-input" type="checkbox" role="switch" [(ngModel)]="textFilterTargetIsNull" (change)="updateRules()">+ <label class="form-check-label" [class.text-muted]="!textFilterTargetIsNull" i18n>Is empty</label>+ </div>+ </div>+ <input #textFilterInput class="form-control form-control-sm" type="text" [disabled]="textFilterTargetIsNull" [(ngModel)]="textFilter" (keyup.enter)="textFilterEnter()" [readonly]="textFilterTarget == 'fulltext-morelike'"></div></div></div>diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.tsindex b222597fb..acfe2236a 100644--- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts+++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.ts@@ -33,6 +33,7 @@ import {FILTER_DOES_NOT_HAVE_TAG,FILTER_TITLE,FILTER_TITLE_CONTENT,+ FILTER_ASN_ISNULL,} from 'src/app/data/filter-rule-type'import { FilterableDropdownSelectionModel } from '../../common/filterable-dropdown/filterable-dropdown.component'import { ToggleableItemState } from '../../common/filterable-dropdown/toggleable-dropdown-button/toggleable-dropdown-button.component'@@ -135,6 +136,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {}textFilterTarget = TEXT_FILTER_TARGET_TITLE_CONTENT+ textFilterTargetIsNull: boolean = falseget textFilterTargetName() {return this.textFilterTargets.find((t) => t.id == this.textFilterTarget)@@ -176,6 +178,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {this.dateAddedAfter = nullthis.dateCreatedBefore = nullthis.dateCreatedAfter = null+ this.textFilterTargetIsNull = falsevalue.forEach((rule) => {switch (rule.rule_type) {@@ -254,6 +257,10 @@ export class FilterEditorComponent implements OnInit, OnDestroy {false)break+ case FILTER_ASN_ISNULL:+ this.textFilterTarget = TEXT_FILTER_TARGET_ASN+ this.textFilterTargetIsNull = rule.value == 'true'+ break}})this.checkIfRulesHaveChanged()@@ -273,8 +280,15 @@ export class FilterEditorComponent implements OnInit, OnDestroy {if (this._textFilter && this.textFilterTarget == TEXT_FILTER_TARGET_TITLE) {filterRules.push({ rule_type: FILTER_TITLE, value: this._textFilter })}- if (this._textFilter && this.textFilterTarget == TEXT_FILTER_TARGET_ASN) {- filterRules.push({ rule_type: FILTER_ASN, value: this._textFilter })+ if (this.textFilterTarget == TEXT_FILTER_TARGET_ASN) {+ if (this.textFilter?.length && !this.textFilterTargetIsNull) {+ filterRules.push({ rule_type: FILTER_ASN, value: this._textFilter })+ } else if (!this.textFilter?.length) {+ filterRules.push({+ rule_type: FILTER_ASN_ISNULL,+ value: this.textFilterTargetIsNull.toString(),+ })+ }}if (this._textFilter &&@@ -398,7 +412,7 @@ export class FilterEditorComponent implements OnInit, OnDestroy {}get textFilter() {- return this._textFilter+ return this.textFilterTargetIsNull ? '' : this._textFilter}set textFilter(value) {