diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 8fb416ce9..d0a2ad41e 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -1009,7 +1009,7 @@ src/app/components/app-frame/global-search/global-search.component.ts - 91 + 92 @@ -1069,11 +1069,11 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 86 + 100 src/app/components/document-list/filter-editor/filter-editor.component.html - 104 + 110 src/app/components/manage/mail/mail.component.html @@ -1363,7 +1363,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 92 + 106 src/app/components/manage/custom-fields/custom-fields.component.html @@ -1438,7 +1438,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 146 + 160 src/app/components/manage/custom-fields/custom-fields.component.html @@ -1874,12 +1874,12 @@ 37 - src/app/components/document-list/document-list.component.html - 236 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 11 - src/app/components/document-list/filter-editor/filter-editor.component.html - 90 + src/app/components/document-list/document-list.component.html + 236 src/app/data/document.ts @@ -2109,11 +2109,11 @@ src/app/components/app-frame/global-search/global-search.component.html - 41 + 50 src/app/components/app-frame/global-search/global-search.component.html - 57 + 66 src/app/components/common/input/permissions/permissions-form/permissions-form.component.html @@ -2249,11 +2249,11 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 594 + 714 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 633 + 753 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2300,15 +2300,15 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 635 + 755 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 668 + 788 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 687 + 807 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2665,32 +2665,43 @@ Search src/app/components/app-frame/global-search/global-search.component.html - 6 + 8 + + + + Advanced search + + src/app/components/app-frame/global-search/global-search.component.html + 19 + + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 143 Open src/app/components/app-frame/global-search/global-search.component.html - 35 + 44 src/app/components/app-frame/global-search/global-search.component.html - 38 + 47 Filter documents src/app/components/app-frame/global-search/global-search.component.html - 44 + 53 Download src/app/components/app-frame/global-search/global-search.component.html - 54 + 63 src/app/components/dashboard/widgets/saved-view-widget/saved-view-widget.component.html @@ -2702,7 +2713,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 118 + 132 src/app/components/document-list/document-card-large/document-card-large.component.html @@ -2717,113 +2728,113 @@ No results src/app/components/app-frame/global-search/global-search.component.html - 67 + 76 Documents src/app/components/app-frame/global-search/global-search.component.html - 70 + 79 Saved Views src/app/components/app-frame/global-search/global-search.component.html - 76 + 85 Tags src/app/components/app-frame/global-search/global-search.component.html - 83 + 92 Correspondents src/app/components/app-frame/global-search/global-search.component.html - 90 + 99 Document types src/app/components/app-frame/global-search/global-search.component.html - 97 + 106 Storage paths src/app/components/app-frame/global-search/global-search.component.html - 104 + 113 Users src/app/components/app-frame/global-search/global-search.component.html - 111 + 120 Groups src/app/components/app-frame/global-search/global-search.component.html - 118 + 127 Custom fields src/app/components/app-frame/global-search/global-search.component.html - 125 + 134 Mail accounts src/app/components/app-frame/global-search/global-search.component.html - 132 + 141 Mail rules src/app/components/app-frame/global-search/global-search.component.html - 139 + 148 Workflows src/app/components/app-frame/global-search/global-search.component.html - 146 + 155 Successfully updated object. src/app/components/app-frame/global-search/global-search.component.ts - 167 + 168 src/app/components/app-frame/global-search/global-search.component.ts - 205 + 206 Error occurred saving object. src/app/components/app-frame/global-search/global-search.component.ts - 170 + 171 src/app/components/app-frame/global-search/global-search.component.ts - 208 + 209 @@ -2833,12 +2844,20 @@ 2 - src/app/components/common/date-dropdown/date-dropdown.component.html - 34 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 38 - src/app/components/common/date-dropdown/date-dropdown.component.html - 55 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 59 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 104 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 125 @@ -2867,19 +2886,23 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 370 + 401 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 410 + 441 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 448 + 479 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 486 + 517 + + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 579 @@ -3022,50 +3045,81 @@ now - src/app/components/common/date-dropdown/date-dropdown.component.html - 21 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 25 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 91 After - src/app/components/common/date-dropdown/date-dropdown.component.html - 30 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 34 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 100 Before - src/app/components/common/date-dropdown/date-dropdown.component.html - 51 + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 55 + + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 121 + + + + Added + + src/app/components/common/dates-dropdown/dates-dropdown.component.html + 76 + + + src/app/components/document-list/document-list.component.html + 245 + + + src/app/data/document.ts + 42 + + + src/app/data/document.ts + 93 Last 7 days - src/app/components/common/date-dropdown/date-dropdown.component.ts - 42 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 45 Last month - src/app/components/common/date-dropdown/date-dropdown.component.ts - 47 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 50 Last 3 months - src/app/components/common/date-dropdown/date-dropdown.component.ts - 52 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 55 Last year - src/app/components/common/date-dropdown/date-dropdown.component.ts - 57 + src/app/components/common/dates-dropdown/dates-dropdown.component.ts + 60 @@ -5225,7 +5279,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 315 + 346 this string is used to separate processing, failed and added on the file upload widget @@ -5300,7 +5354,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 96 + 110 @@ -5329,7 +5383,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 99 + 113 @@ -5373,7 +5427,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 125 + 131 src/app/data/document.ts @@ -5766,7 +5820,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 631 + 751 @@ -5833,7 +5887,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 664 + 784 @@ -5851,7 +5905,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 666 + 786 @@ -5933,64 +5987,90 @@ 77 + + Custom fields + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 82 + + + src/app/components/document-list/filter-editor/filter-editor.component.html + 89 + + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 139 + + + + Filter custom fields + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 83 + + + src/app/components/document-list/filter-editor/filter-editor.component.html + 90 + + Merge src/app/components/document-list/bulk-editor/bulk-editor.component.html - 102 + 116 Include: src/app/components/document-list/bulk-editor/bulk-editor.component.html - 124 + 138 Archived files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 128 + 142 Original files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 132 + 146 Use formatted filename src/app/components/document-list/bulk-editor/bulk-editor.component.html - 137 + 151 Error executing bulk operation src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 232 + 250 "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 307 + 338 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 313 + 344 "" and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 309 + 340 This is for messages like 'modify "tag1" and "tag2"' @@ -5998,7 +6078,7 @@ and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 317,319 + 348,350 this is for messages like 'modify "tag1", "tag2" and "tag3"' @@ -6006,14 +6086,14 @@ Confirm tags assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 334 + 365 This operation will add the tag "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 340 + 371 @@ -6022,14 +6102,14 @@ )"/> to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 345,347 + 376,378 This operation will remove the tag "" from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 353 + 384 @@ -6038,7 +6118,7 @@ )"/> from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 358,360 + 389,391 @@ -6049,126 +6129,176 @@ )"/> on selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 362,366 + 393,397 Confirm correspondent assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 403 + 434 This operation will assign the correspondent "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 405 + 436 This operation will remove the correspondent from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 407 + 438 Confirm document type assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 441 + 472 This operation will assign the document type "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 443 + 474 This operation will remove the document type from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 445 + 476 Confirm storage path assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 479 + 510 This operation will assign the storage path "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 481 + 512 This operation will remove the storage path from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 483 + 514 + + + + Confirm custom field assignment + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 543 + + + + This operation will assign the custom field "" to selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 549 + + + + This operation will assign the custom fields to selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 554,556 + + + + This operation will remove the custom field "" from selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 562 + + + + This operation will remove the custom fields from selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 567,569 + + + + This operation will assign the custom fields and remove the custom fields on selected document(s). + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 571,575 Delete confirm src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 592 + 712 This operation will permanently delete selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 593 + 713 Delete document(s) src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 596 + 716 This operation will permanently redo OCR for selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 632 + 752 This operation will permanently rotate the original version of document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 665 + 785 Merge confirm src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 685 + 805 This operation will merge selected documents into a new document. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 686 + 806 Merged document will be queued for consumption. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 699 + 819 @@ -6407,7 +6537,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.html - 110 + 116 @@ -6432,7 +6562,7 @@ src/app/components/document-list/filter-editor/filter-editor.component.ts - 130 + 136 src/app/data/document.ts @@ -6514,25 +6644,6 @@ 241 - - Added - - src/app/components/document-list/document-list.component.html - 245 - - - src/app/components/document-list/filter-editor/filter-editor.component.html - 96 - - - src/app/data/document.ts - 42 - - - src/app/data/document.ts - 93 - - Shared @@ -6597,67 +6708,60 @@ 331 + + Dates + + src/app/components/document-list/filter-editor/filter-editor.component.html + 100 + + Title & content src/app/components/document-list/filter-editor/filter-editor.component.ts - 128 - - - - Custom fields - - src/app/components/document-list/filter-editor/filter-editor.component.ts - 133 - - - - Advanced search - - src/app/components/document-list/filter-editor/filter-editor.component.ts - 137 + 134 More like src/app/components/document-list/filter-editor/filter-editor.component.ts - 143 + 149 equals src/app/components/document-list/filter-editor/filter-editor.component.ts - 149 + 155 is empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 153 + 159 is not empty src/app/components/document-list/filter-editor/filter-editor.component.ts - 157 + 163 greater than src/app/components/document-list/filter-editor/filter-editor.component.ts - 161 + 167 less than src/app/components/document-list/filter-editor/filter-editor.component.ts - 165 + 171 @@ -6666,14 +6770,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 185,187 + 191,193 Without correspondent src/app/components/document-list/filter-editor/filter-editor.component.ts - 189 + 195 @@ -6682,14 +6786,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 195,197 + 201,203 Without document type src/app/components/document-list/filter-editor/filter-editor.component.ts - 199 + 205 @@ -6698,14 +6802,14 @@ )?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 205,207 + 211,213 Without storage path src/app/components/document-list/filter-editor/filter-editor.component.ts - 209 + 215 @@ -6713,49 +6817,65 @@ ?.name"/> src/app/components/document-list/filter-editor/filter-editor.component.ts - 213,214 + 219,220 Without any tag src/app/components/document-list/filter-editor/filter-editor.component.ts - 218 + 224 + + + + Custom fields: + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 228,230 + + + + Without any custom field + + src/app/components/document-list/filter-editor/filter-editor.component.ts + 234 Title: src/app/components/document-list/filter-editor/filter-editor.component.ts - 222 + 238 ASN: src/app/components/document-list/filter-editor/filter-editor.component.ts - 225 + 241 Owner: src/app/components/document-list/filter-editor/filter-editor.component.ts - 228 + 244 Owner not in: src/app/components/document-list/filter-editor/filter-editor.component.ts - 231 + 247 Without an owner src/app/components/document-list/filter-editor/filter-editor.component.ts - 234 + 250 diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.html b/src-ui/src/app/components/app-frame/global-search/global-search.component.html index 9db58ab14..8df6cabff 100644 --- a/src-ui/src/app/components/app-frame/global-search/global-search.component.html +++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.html @@ -2,16 +2,25 @@
- -
- @if (loading) { -
+
+
+ +
+ @if (loading) { +
+ } +
+
+ @if (query && (searchResults?.documents.length === searchService.searchResultObjectLimit || searchService.searchDbOnly)) { + }
- diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.scss b/src-ui/src/app/components/app-frame/global-search/global-search.component.scss index aa91548d5..646e40dde 100644 --- a/src-ui/src/app/components/app-frame/global-search/global-search.component.scss +++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.scss @@ -1,7 +1,7 @@ form { position: relative; - > i-bs { + > i-bs[name="search"] { position: absolute; left: 0.6rem; top: .35rem; @@ -14,7 +14,7 @@ form { } &:focus-within { - i-bs, + i-bs[name="search"], .badge { display: none !important; } @@ -27,25 +27,34 @@ form { .badge { font-size: 0.8rem; } -} -.form-control { - color: rgba(255, 255, 255, 0.3); - background-color: rgba(0, 0, 0, 0.15); - padding-left: 1.8rem; - border-color: rgba(255, 255, 255, 0.2); - transition: all .3s ease, padding-left 0s ease, background-color 0s ease; // Safari requires all - - &::placeholder { - color: rgba(255, 255, 255, 0.4); + .input-group .btn { + border-color: rgba(255, 255, 255, 0.2); + color: var(--pngx-primary-text-contrast); } - &:focus { - background-color: rgba(0, 0, 0, 0.3); - color: var(--bs-light); - flex-grow: 1; - padding-left: 0.5rem; + .form-control { + color: rgba(255, 255, 255, 0.3); + background-color: rgba(0, 0, 0, 0.15); + padding-left: 1.8rem; + border-color: rgba(255, 255, 255, 0.2); + transition: all .3s ease, padding-left 0s ease, background-color 0s ease; // Safari requires all + > input { + outline: none; + + &::placeholder { + color: rgba(255, 255, 255, 0.4); + } + } + + &:focus-within { + background-color: rgba(0, 0, 0, 0.3); + color: var(--bs-light); + flex-grow: 1; + padding-left: 0.5rem; + } } + } * { diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.spec.ts b/src-ui/src/app/components/app-frame/global-search/global-search.component.spec.ts index 59c0f4b4b..a58db61dc 100644 --- a/src-ui/src/app/components/app-frame/global-search/global-search.component.spec.ts +++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.spec.ts @@ -20,6 +20,7 @@ import { DocumentListViewService } from 'src/app/services/document-list-view.ser import { HttpClientTestingModule } from '@angular/common/http/testing' import { FormsModule, ReactiveFormsModule } from '@angular/forms' import { + FILTER_FULLTEXT_QUERY, FILTER_HAS_CORRESPONDENT_ANY, FILTER_HAS_DOCUMENT_TYPE_ANY, FILTER_HAS_STORAGE_PATH_ANY, @@ -440,4 +441,13 @@ describe('GlobalSearchComponent', () => { component.onButtonHover(event as any) expect(focusSpy).toHaveBeenCalled() }) + + it('should support explicit advanced search', () => { + const qfSpy = jest.spyOn(documentListViewService, 'quickFilter') + component.query = 'test' + component.runAdvanedSearch() + expect(qfSpy).toHaveBeenCalledWith([ + { rule_type: FILTER_FULLTEXT_QUERY, value: 'test' }, + ]) + }) }) diff --git a/src-ui/src/app/components/app-frame/global-search/global-search.component.ts b/src-ui/src/app/components/app-frame/global-search/global-search.component.ts index 58184cbed..f2f191513 100644 --- a/src-ui/src/app/components/app-frame/global-search/global-search.component.ts +++ b/src-ui/src/app/components/app-frame/global-search/global-search.component.ts @@ -10,6 +10,7 @@ import { Router } from '@angular/router' import { NgbDropdown, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' import { Subject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs' import { + FILTER_FULLTEXT_QUERY, FILTER_HAS_CORRESPONDENT_ANY, FILTER_HAS_DOCUMENT_TYPE_ANY, FILTER_HAS_STORAGE_PATH_ANY, @@ -62,7 +63,7 @@ export class GlobalSearchComponent implements OnInit { @ViewChildren('secondaryButton') secondaryButtons: QueryList constructor( - private searchService: SearchService, + public searchService: SearchService, private router: Router, private modalService: NgbModal, private documentService: DocumentService, @@ -351,4 +352,11 @@ export class GlobalSearchComponent implements OnInit { object ) } + + runAdvanedSearch() { + this.documentListViewService.quickFilter([ + { rule_type: FILTER_FULLTEXT_QUERY, value: this.query }, + ]) + this.reset(true) + } } diff --git a/src-ui/src/app/services/rest/search.service.ts b/src-ui/src/app/services/rest/search.service.ts index 9bedbf974..7a82d4f2f 100644 --- a/src-ui/src/app/services/rest/search.service.ts +++ b/src-ui/src/app/services/rest/search.service.ts @@ -37,6 +37,8 @@ export interface GlobalSearchResult { providedIn: 'root', }) export class SearchService { + public readonly searchResultObjectLimit: number = 3 // documents/views.py GlobalSearchView > OBJECT_LIMIT + constructor( private http: HttpClient, private settingsService: SettingsService @@ -51,7 +53,7 @@ export class SearchService { globalSearch(query: string): Observable { let params = new HttpParams().set('query', query) - if (this.settingsService.get(SETTINGS_KEYS.SEARCH_DB_ONLY)) { + if (this.searchDbOnly) { params = params.set('db_only', true) } return this.http.get( @@ -59,4 +61,8 @@ export class SearchService { { params } ) } + + public get searchDbOnly(): boolean { + return this.settingsService.get(SETTINGS_KEYS.SEARCH_DB_ONLY) + } }