feat: show search filtered total (#36083)

This commit is contained in:
Kaito Watanabe
2025-12-01 16:29:23 -05:00
committed by GitHub
parent db995ad5bf
commit 6e0960c3f5
5 changed files with 185 additions and 21 deletions

View File

@@ -271,6 +271,24 @@ const buildQuery: BuildQuery<TableChartFormData> = (
};
updateTableOwnState(options?.hooks?.setDataMask, modifiedOwnState);
}
if (formData.server_pagination) {
// Add search filter if search text exists
if (ownState.searchText && ownState?.searchColumn) {
queryObject = {
...queryObject,
filters: [
...(queryObject.filters || []),
{
col: ownState?.searchColumn,
op: 'ILIKE',
val: `${ownState.searchText}%`,
},
],
};
}
}
// Because we use same buildQuery for all table on the page we need split them by id
options?.hooks?.setCachedChanges({
[formData.slice_id]: queryObject.filters,
@@ -320,23 +338,6 @@ const buildQuery: BuildQuery<TableChartFormData> = (
];
}
if (formData.server_pagination) {
// Add search filter if search text exists
if (ownState.searchText && ownState?.searchColumn) {
queryObject = {
...queryObject,
filters: [
...(queryObject.filters || []),
{
col: ownState?.searchColumn,
op: 'ILIKE',
val: `${ownState.searchText}%`,
},
],
};
}
}
// Now since row limit control is always visible even
// in case of server pagination
// we must use row limit from form data