From d5314ae91bd2e1f4ddac977abbbf6e1e4a731c70 Mon Sep 17 00:00:00 2001 From: lane-formio Date: Mon, 8 Jul 2024 13:46:52 -0500 Subject: [PATCH] Revert "Revert "change filter processor to be more verbose and have compModelType in scope"" This reverts commit be37bee8572c433d5069212316a64a1ebf0a7fd1. --- src/process/filter/__tests__/filter.test.ts | 6 +++--- src/types/process/filter/FilterScope.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/process/filter/__tests__/filter.test.ts b/src/process/filter/__tests__/filter.test.ts index 65b0b017..a6cea9f3 100644 --- a/src/process/filter/__tests__/filter.test.ts +++ b/src/process/filter/__tests__/filter.test.ts @@ -23,7 +23,7 @@ it('Should not filter empty array value for dataGrid component', async () => { }; const context: any = generateProcessorContext(dataGridComp, data); filterProcessSync(context); - expect(context.scope.filter).to.deep.equal({'dataGrid': true}); + expect(context.scope.filter).to.deep.equal({'dataGrid': {'compModelType': 'array', 'include': true}}); }); it('Should not filter empty array value for editGrid component', async () => { @@ -46,7 +46,7 @@ it('Should not filter empty array value for editGrid component', async () => { }; const context: any = generateProcessorContext(editGridComp, data); filterProcessSync(context); - expect(context.scope.filter).to.deep.equal({'editGrid': true}); + expect(context.scope.filter).to.deep.equal({'editGrid': {'compModelType': 'array', 'include': true}}); }); it('Should not filter empty array value for datTable component', async () => { @@ -69,5 +69,5 @@ it('Should not filter empty array value for datTable component', async () => { }; const context: any = generateProcessorContext(dataTableComp, data); filterProcessSync(context); - expect(context.scope.filter).to.deep.equal({'dataTable': true}); + expect(context.scope.filter).to.deep.equal({'dataTable': {'compModelType': 'array', 'include': true}}); }); diff --git a/src/types/process/filter/FilterScope.ts b/src/types/process/filter/FilterScope.ts index fdd3724d..e81db652 100644 --- a/src/types/process/filter/FilterScope.ts +++ b/src/types/process/filter/FilterScope.ts @@ -1,4 +1,8 @@ import { ProcessorScope } from ".."; export type FilterScope = { - filter: Record; -} & ProcessorScope; \ No newline at end of file + filter: Record; +} & ProcessorScope;