diff --git a/packages/builder/src/components/backend/DataTable/modals/ExportModal.test.js b/packages/builder/src/components/backend/DataTable/modals/ExportModal.test.js index a5d24d7435..4927f51a8d 100644 --- a/packages/builder/src/components/backend/DataTable/modals/ExportModal.test.js +++ b/packages/builder/src/components/backend/DataTable/modals/ExportModal.test.js @@ -79,6 +79,8 @@ describe("Export Modal", () => { props: propsCfg, }) + expect(propsCfg.filters[0].field).toBe("1:Cost") + expect(screen.getByTestId("filters-applied")).toBeVisible() expect(screen.getByTestId("filters-applied").textContent).toBe( "Filters applied" diff --git a/packages/shared-core/src/utils.ts b/packages/shared-core/src/utils.ts index dce1b8b960..2bfd166414 100644 --- a/packages/shared-core/src/utils.ts +++ b/packages/shared-core/src/utils.ts @@ -147,8 +147,12 @@ export const processSearchFilters = ( { logicalOperator: allOr ? UILogicalOperator.ANY : UILogicalOperator.ALL, filters: filters.map(filter => { - filter.field = removeKeyNumbering(filter.field) - return _.pick(filter, FILTER_ALLOWED_KEYS) as SearchFilter + const trimmedFilter = _.pick( + filter, + FILTER_ALLOWED_KEYS + ) as SearchFilter + trimmedFilter.field = removeKeyNumbering(trimmedFilter.field) + return trimmedFilter }), }, ],