diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index e19a67b28..d37d90dca 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -1086,7 +1086,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 152 + 153 @@ -2935,7 +2935,7 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 147 + 143 @@ -2969,7 +2969,7 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 153 + 149 @@ -6259,7 +6259,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 140 + 141 src/app/data/document.ts @@ -6870,7 +6870,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 148 + 149 @@ -7227,11 +7227,11 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 80,81 + 76,77 src/app/components/document-list/document-card-small/document-card-small.component.html - 95,96 + 91,92 @@ -7242,11 +7242,11 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 81,82 + 77,78 src/app/components/document-list/document-card-small/document-card-small.component.html - 96,97 + 92,93 @@ -7257,11 +7257,11 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 82,83 + 78,79 src/app/components/document-list/document-card-small/document-card-small.component.html - 97,98 + 93,94 @@ -7272,7 +7272,7 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 110 + 106 @@ -7283,7 +7283,7 @@ src/app/components/document-list/document-card-small/document-card-small.component.html - 129 + 125 src/app/data/document.ts @@ -7319,14 +7319,14 @@ Toggle document type filter src/app/components/document-list/document-card-small/document-card-small.component.html - 63 + 59 Toggle storage path filter src/app/components/document-list/document-card-small/document-card-small.component.html - 70 + 66 @@ -7458,7 +7458,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 145 + 146 src/app/data/document.ts @@ -7662,147 +7662,147 @@ Title & content src/app/components/document-list/filter-editor/filter-editor.component.ts - 143 + 144 More like src/app/components/document-list/filter-editor/filter-editor.component.ts - 158 + 159 equals src/app/components/document-list/filter-editor/filter-editor.component.ts - 164 + 165 is empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 168 + 169 is not empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 172 + 173 greater than src/app/components/document-list/filter-editor/filter-editor.component.ts - 176 + 177 less than src/app/components/document-list/filter-editor/filter-editor.component.ts - 180 + 181 Correspondent: src/app/components/document-list/filter-editor/filter-editor.component.ts - 200,202 + 201,203 Without correspondent src/app/components/document-list/filter-editor/filter-editor.component.ts - 204 + 205 Document type: src/app/components/document-list/filter-editor/filter-editor.component.ts - 210,212 + 211,213 Without document type src/app/components/document-list/filter-editor/filter-editor.component.ts - 214 + 215 Storage path: src/app/components/document-list/filter-editor/filter-editor.component.ts - 220,222 + 221,223 Without storage path src/app/components/document-list/filter-editor/filter-editor.component.ts - 224 + 225 Tag: src/app/components/document-list/filter-editor/filter-editor.component.ts - 228,230 + 229,231 Without any tag src/app/components/document-list/filter-editor/filter-editor.component.ts - 234 + 235 Custom fields query src/app/components/document-list/filter-editor/filter-editor.component.ts - 238 + 239 Title: src/app/components/document-list/filter-editor/filter-editor.component.ts - 241 + 242 ASN: src/app/components/document-list/filter-editor/filter-editor.component.ts - 244 + 245 Owner: src/app/components/document-list/filter-editor/filter-editor.component.ts - 247 + 248 Owner not in: src/app/components/document-list/filter-editor/filter-editor.component.ts - 250 + 251 Without an owner src/app/components/document-list/filter-editor/filter-editor.component.ts - 253 + 254 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.html index da789aaf6..ae7c1f5f0 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 @@ -1,6 +1,6 @@
-
+
@@ -36,7 +36,7 @@
@if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.Tag) && tags.length > 0) { - } @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.Correspondent) && correspondents.length > 0) { - } @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.DocumentType) && documentTypes.length > 0) { - } @if (permissionsService.currentUserCan(PermissionAction.View, PermissionType.StoragePath) && storagePaths.length > 0) { - 0) { - } - - diff --git a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.scss b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.scss index 82ad7e7a5..5304721c6 100644 --- a/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.scss +++ b/src-ui/src/app/components/document-list/filter-editor/filter-editor.component.scss @@ -25,3 +25,7 @@ input[type="text"] { .z-10 { z-index: 10; } + +.reveal { + opacity: 1; +} 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.ts index 24ef1b347..e34e66524 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 @@ -101,6 +101,7 @@ import { CustomFieldQueryExpression, CustomFieldQueryAtom, } from 'src/app/utils/custom-field-query-element' +import { LoadingComponentWithPermissions } from '../../loading-component/loading.component' const TEXT_FILTER_TARGET_TITLE = 'title' const TEXT_FILTER_TARGET_TITLE_CONTENT = 'title-content' @@ -187,7 +188,7 @@ const DEFAULT_TEXT_FILTER_MODIFIER_OPTIONS = [ styleUrls: ['./filter-editor.component.scss'], }) export class FilterEditorComponent - extends ComponentWithPermissions + extends LoadingComponentWithPermissions implements OnInit, OnDestroy, AfterViewInit { generateFilterName() { @@ -289,8 +290,6 @@ export class FilterEditorComponent _moreLikeId: number _moreLikeDoc: Document - unsubscribeNotifier: Subject = new Subject() - get textFilterTargets() { if (this.textFilterTarget == TEXT_FILTER_TARGET_FULLTEXT_MORELIKE) { return DEFAULT_TEXT_FILTER_TARGET_OPTIONS.concat([ @@ -955,16 +954,30 @@ export class FilterEditorComponent @Input() public disabled: boolean = false + private loadingCountTotal: number = 0 + private loadingCount: number = 0 + + private maybeCompleteLoading() { + this.loadingCount++ + if (this.loadingCount == this.loadingCountTotal) { + this.loading = false + this.reveal = true + } + } + ngOnInit() { + this.loading = true if ( this.permissionsService.currentUserCan( PermissionAction.View, PermissionType.Tag ) ) { - this.tagService - .listAll() - .subscribe((result) => (this.tags = result.results)) + this.loadingCountTotal++ + this.tagService.listAll().subscribe((result) => { + this.tags = result.results + this.maybeCompleteLoading() + }) } if ( this.permissionsService.currentUserCan( @@ -972,9 +985,11 @@ export class FilterEditorComponent PermissionType.Correspondent ) ) { - this.correspondentService - .listAll() - .subscribe((result) => (this.correspondents = result.results)) + this.loadingCountTotal++ + this.correspondentService.listAll().subscribe((result) => { + this.correspondents = result.results + this.maybeCompleteLoading() + }) } if ( this.permissionsService.currentUserCan( @@ -982,9 +997,11 @@ export class FilterEditorComponent PermissionType.DocumentType ) ) { - this.documentTypeService - .listAll() - .subscribe((result) => (this.documentTypes = result.results)) + this.loadingCountTotal++ + this.documentTypeService.listAll().subscribe((result) => { + this.documentTypes = result.results + this.maybeCompleteLoading() + }) } if ( this.permissionsService.currentUserCan( @@ -992,9 +1009,11 @@ export class FilterEditorComponent PermissionType.StoragePath ) ) { - this.storagePathService - .listAll() - .subscribe((result) => (this.storagePaths = result.results)) + this.loadingCountTotal++ + this.storagePathService.listAll().subscribe((result) => { + this.storagePaths = result.results + this.maybeCompleteLoading() + }) } if ( this.permissionsService.currentUserCan( @@ -1002,9 +1021,11 @@ export class FilterEditorComponent PermissionType.CustomField ) ) { - this.customFieldService - .listAll() - .subscribe((result) => (this.customFields = result.results)) + this.loadingCountTotal++ + this.customFieldService.listAll().subscribe((result) => { + this.customFields = result.results + this.maybeCompleteLoading() + }) } this.textFilterDebounce = new Subject()