]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Enhancement: automatically refresh display list after custom field edit
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 21 Oct 2024 02:17:18 +0000 (19:17 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Mon, 21 Oct 2024 02:17:18 +0000 (19:17 -0700)
src-ui/src/app/components/manage/custom-fields/custom-fields.component.ts

index 60bbcc09cd97ad8c180b817c9f7f8818400ec20c..0933cd38f2054f125ba41178eb87a1b0b887a7ff 100644 (file)
@@ -15,6 +15,7 @@ import {
   CustomFieldQueryLogicalOperator,
   CustomFieldQueryOperator,
 } from 'src/app/data/custom-field-query'
+import { SettingsService } from 'src/app/services/settings.service'
 
 @Component({
   selector: 'pngx-custom-fields',
@@ -33,7 +34,8 @@ export class CustomFieldsComponent
     public permissionsService: PermissionsService,
     private modalService: NgbModal,
     private toastService: ToastService,
-    private documentListViewService: DocumentListViewService
+    private documentListViewService: DocumentListViewService,
+    private settingsService: SettingsService
   ) {
     super()
   }
@@ -62,6 +64,7 @@ export class CustomFieldsComponent
       .subscribe((newField) => {
         this.toastService.showInfo($localize`Saved field "${newField.name}".`)
         this.customFieldsService.clearCache()
+        this.settingsService.initializeDisplayFields()
         this.reload()
       })
     modal.componentInstance.failed
@@ -87,6 +90,7 @@ export class CustomFieldsComponent
           modal.close()
           this.toastService.showInfo($localize`Deleted field`)
           this.customFieldsService.clearCache()
+          this.settingsService.initializeDisplayFields()
           this.reload()
         },
         error: (e) => {