Skip to content

Commit

Permalink
Revert "Revert "change filter processor to be more verbose and have c…
Browse files Browse the repository at this point in the history
…ompModelType in scope""

This reverts commit be37bee.
  • Loading branch information
lane-formio committed Jul 8, 2024
1 parent df060ba commit d5314ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/process/filter/__tests__/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 () => {
Expand All @@ -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}});
});
8 changes: 6 additions & 2 deletions src/types/process/filter/FilterScope.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ProcessorScope } from "..";
export type FilterScope = {
filter: Record<string, any>;
} & ProcessorScope;
filter: Record<string, {
compModelType: string;
include: boolean;
value?: any;
}>;
} & ProcessorScope;

0 comments on commit d5314ae

Please sign in to comment.