From 99daf19724c2d635e76541e5db63d396ca194c6c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:36:26 -0800 Subject: [PATCH] All field types --- src-ui/messages.xlf | 160 +++++++++++------- ...tom-fields-bulk-edit-dialog.component.html | 87 ++++++++-- ...ustom-fields-bulk-edit-dialog.component.ts | 17 +- src/documents/tests/test_bulk_edit.py | 2 +- 4 files changed, 184 insertions(+), 82 deletions(-) diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 0dac319f2..7cf0a5522 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -594,6 +594,10 @@ src/app/components/document-detail/document-detail.component.html 341 + + src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html + 91 + src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html 21 @@ -1149,7 +1153,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 101 + 104 src/app/components/document-list/filter-editor/filter-editor.component.html @@ -1438,6 +1442,10 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html 4 + + src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html + 90 + src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html 20 @@ -1744,7 +1752,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 107 + 110 src/app/components/manage/custom-fields/custom-fields.component.html @@ -2037,7 +2045,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 161 + 164 src/app/components/manage/custom-fields/custom-fields.component.html @@ -2508,15 +2516,15 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 758 + 759 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 791 + 792 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 810 + 811 src/app/components/manage/custom-fields/custom-fields.component.ts @@ -2941,7 +2949,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 133 + 136 src/app/components/document-list/document-card-large/document-card-large.component.html @@ -3102,27 +3110,27 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 401 + 402 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 441 + 442 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 479 + 480 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 517 + 518 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 579 + 580 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 712 + 713 @@ -4938,11 +4946,18 @@ 64 + + + + src/app/components/common/filterable-dropdown/filterable-dropdown.component.html + 71 + + Click again to exclude items. src/app/components/common/filterable-dropdown/filterable-dropdown.component.html - 71 + 76 @@ -4957,7 +4972,7 @@ Open filter src/app/components/common/filterable-dropdown/filterable-dropdown.component.ts - 486 + 492 @@ -6098,7 +6113,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 346 + 347 this string is used to separate processing, failed and added on the file upload widget @@ -6173,7 +6188,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 111 + 114 @@ -6202,7 +6217,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.html - 114 + 117 @@ -6628,7 +6643,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 714 + 715 @@ -6639,7 +6654,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 716 + 717 @@ -6650,7 +6665,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 754 + 755 @@ -6724,7 +6739,7 @@ src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 788 + 789 @@ -6874,64 +6889,75 @@ 83 + + Set values + + src/app/components/document-list/bulk-editor/bulk-editor.component.html + 93 + + Merge src/app/components/document-list/bulk-editor/bulk-editor.component.html - 117 + 120 Include: src/app/components/document-list/bulk-editor/bulk-editor.component.html - 139 + 142 Archived files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 143 + 146 Original files src/app/components/document-list/bulk-editor/bulk-editor.component.html - 147 + 150 Use formatted filename src/app/components/document-list/bulk-editor/bulk-editor.component.html - 152 + 155 Error executing bulk operation src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 250 + 251 + + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 855 "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 338 + 339 src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 344 + 345 "" and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 340 + 341 This is for messages like 'modify "tag1" and "tag2"' @@ -6939,7 +6965,7 @@ and "" src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 348,350 + 349,351 this is for messages like 'modify "tag1", "tag2" and "tag3"' @@ -6947,14 +6973,14 @@ Confirm tags assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 365 + 366 This operation will add the tag "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 371 + 372 @@ -6963,14 +6989,14 @@ )"/> to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 376,378 + 377,379 This operation will remove the tag "" from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 384 + 385 @@ -6979,7 +7005,7 @@ )"/> from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 389,391 + 390,392 @@ -6990,84 +7016,84 @@ )"/> on selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 393,397 + 394,398 Confirm correspondent assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 434 + 435 This operation will assign the correspondent "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 436 + 437 This operation will remove the correspondent from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 438 + 439 Confirm document type assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 472 + 473 This operation will assign the document type "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 474 + 475 This operation will remove the document type from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 476 + 477 Confirm storage path assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 510 + 511 This operation will assign the storage path "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 512 + 513 This operation will remove the storage path from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 514 + 515 Confirm custom field assignment src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 543 + 544 This operation will assign the custom field "" to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 549 + 550 @@ -7076,14 +7102,14 @@ )"/> to selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 554,556 + 555,557 This operation will remove the custom field "" from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 562 + 563 @@ -7092,7 +7118,7 @@ )"/> from selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 567,569 + 568,570 @@ -7103,56 +7129,70 @@ )"/> on selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 571,575 + 572,576 Move selected document(s) to the trash? src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 713 + 714 This operation will permanently recreate the archive files for selected document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 755 + 756 The archive files will be re-generated with the current settings. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 756 + 757 This operation will permanently rotate the original version of document(s). src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 789 + 790 Merge confirm src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 808 + 809 This operation will merge selected documents into a new document. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 809 + 810 Merged document will be queued for consumption. src/app/components/document-list/bulk-editor/bulk-editor.component.ts - 825 + 826 + + + + Bulk operation executed successfully + + src/app/components/document-list/bulk-editor/bulk-editor.component.ts + 845 + + + + Select custom fields + + src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html + 12 diff --git a/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html b/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html index 519fceccf..896cdfa98 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html +++ b/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.html @@ -6,19 +6,80 @@ diff --git a/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.ts b/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.ts index ce07045ec..bcdc6b919 100644 --- a/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.ts +++ b/src-ui/src/app/components/document-list/bulk-editor/custom-fields-bulk-edit-dialog/custom-fields-bulk-edit-dialog.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { first } from 'rxjs' -import { CustomField } from 'src/app/data/custom-field' +import { CustomField, CustomFieldDataType } from 'src/app/data/custom-field' import { DocumentService } from 'src/app/services/rest/document.service' @Component({ @@ -11,6 +11,8 @@ import { DocumentService } from 'src/app/services/rest/document.service' styleUrl: './custom-fields-bulk-edit-dialog.component.scss', }) export class CustomFieldsBulkEditDialogComponent { + CustomFieldDataType = CustomFieldDataType + @Output() succeeded = new EventEmitter() @@ -26,14 +28,14 @@ export class CustomFieldsBulkEditDialogComponent { return this._selectedFields } - private _selectedFieldIds: number[] = [] + private _selectedFieldsIds: number[] = [] public get selectedFieldsIds() { - return this._selectedFieldIds + return this._selectedFieldsIds } public set selectedFieldsIds(ids: number[]) { - this._selectedFieldIds = ids + this._selectedFieldsIds = ids this._selectedFields = this.customFields.filter((field) => - this._selectedFieldIds.includes(field.id) + this._selectedFieldsIds.includes(field.id) ) this.initForm() } @@ -49,13 +51,12 @@ export class CustomFieldsBulkEditDialogComponent { initForm() { this.form = new FormGroup({}) - this._selectedFieldIds.forEach((field_id) => { + this._selectedFieldsIds.forEach((field_id) => { this.form.addControl(field_id.toString(), new FormControl(null)) }) } public save() { - console.log('save', this.form.value) this.documentService .bulkEdit(this.documents, 'modify_custom_fields', { add_custom_fields: this.form.value, @@ -78,7 +79,7 @@ export class CustomFieldsBulkEditDialogComponent { } public removeField(fieldId: number) { - this._selectedFieldIds = this._selectedFieldIds.filter( + this.selectedFieldsIds = this._selectedFieldsIds.filter( (id) => id !== fieldId ) } diff --git a/src/documents/tests/test_bulk_edit.py b/src/documents/tests/test_bulk_edit.py index 00a72845f..03c177343 100644 --- a/src/documents/tests/test_bulk_edit.py +++ b/src/documents/tests/test_bulk_edit.py @@ -264,7 +264,7 @@ class TestBulkEdit(DirectoriesMixin, TestCase): ) cf2 = CustomField.objects.create( name="cf2", - data_type=CustomField.FieldDataType.INT, + data_type=CustomField.FieldDataType.MONETARY, ) cf3 = CustomField.objects.create( name="cf3",