Skip to content

Commit f4dc040

Browse files
committed
Enhance ListView component; streamline onFilterChange handling and improve filter processing logic in ObjectStackAdapter
1 parent a0e3467 commit f4dc040

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/data-objectstack/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,12 @@ export class ObjectStackAdapter<T = unknown> implements DataSource<T> {
495495

496496
// Filtering - convert to ObjectStack FilterNode AST format
497497
if (params.$filter) {
498-
options.filters = convertFiltersToAST(params.$filter);
498+
if (Array.isArray(params.$filter)) {
499+
// Assume active AST format if it's already an array
500+
options.filters = params.$filter;
501+
} else {
502+
options.filters = convertFiltersToAST(params.$filter);
503+
}
499504
}
500505

501506
// Sorting - convert to ObjectStack format

packages/plugin-list/src/ListView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const ListView: React.FC<ListViewProps> = ({
6161
schema,
6262
className,
6363
onViewChange,
64-
onFilterChange: _onFilterChange,
64+
onFilterChange,
6565
onSortChange,
6666
onSearchChange,
6767
...props
@@ -392,7 +392,7 @@ export const ListView: React.FC<ListViewProps> = ({
392392
// Convert FilterBuilder format to OData $filter string if needed
393393
// For now we just update state and notify listener
394394
// In a real app, this would likely build an OData string
395-
onFilterChange?.(newFilters);
395+
if (onFilterChange) onFilterChange(newFilters);
396396
}}
397397
/>
398398
</div>

0 commit comments

Comments
 (0)