From 19d5feb483550c090ec4e9d58f45c00f6ff35626 Mon Sep 17 00:00:00 2001
From: Michael Shamoon <4887959+shamoon@users.noreply.github.com>
Date: Fri, 1 Apr 2022 21:50:53 -0700
Subject: [PATCH] Fix save view error for filter_rules
see #601
---
.../components/document-list/document-list.component.ts | 8 ++++++--
.../save-view-config-dialog.component.html | 5 +++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts
index fac5e3535..9e058fb64 100644
--- a/src-ui/src/app/components/document-list/document-list.component.ts
+++ b/src-ui/src/app/components/document-list/document-list.component.ts
@@ -243,8 +243,12 @@ export class DocumentListComponent implements OnInit, OnDestroy, AfterViewInit {
$localize`View "${savedView.name}" created successfully.`
)
},
- error: (error) => {
- modal.componentInstance.error = error.error
+ error: (httpError) => {
+ let error = httpError.error
+ if (error.filter_rules) {
+ error.filter_rules = error.filter_rules.map((r) => r.value)
+ }
+ modal.componentInstance.error = error
modal.componentInstance.buttonsEnabled = true
},
})
diff --git a/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html b/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html
index d03588589..ae20031a2 100644
--- a/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html
+++ b/src-ui/src/app/components/document-list/save-view-config-dialog/save-view-config-dialog.component.html
@@ -8,6 +8,11 @@