mikebridge commented on code in PR #45476:
URL: https://github.com/apache/superset/pull/45476#discussion_r4330245074
##########
superset-frontend/src/components/ListView/utils.ts:
##########
@@ -347,18 +353,30 @@ export function useListViewState<D extends object = any>({
const method =
typeof query.pageIndex !== 'undefined' &&
queryParams.pageIndex !== query.pageIndex
- ? 'push'
- : 'replace';
+ ? 'pushIn'
+ : 'replaceIn';
setQuery(queryParams, method);
fetchData({ pageIndex, pageSize, sortBy, filters });
}, [fetchData, pageIndex, pageSize, sortBy, filters]);
useEffect(() => {
+ previousQuery.current = query;
if (!isEqual(initialState.pageIndex, pageIndex)) {
gotoPage(initialState.pageIndex);
}
+ const restoredInternalFilters = mergeCreateFilterValues(
+ initialFilters,
+ query.filters || {},
+ );
+ const restoredFilters = convertFilters(restoredInternalFilters);
+ if (!isEqual(restoredFilters, filters)) {
+ setAllFilters(restoredFilters);
+ }
+ if (!isEqual(restoredInternalFilters, internalFilters)) {
+ setInternalFilters(restoredInternalFilters);
+ }
Review Comment:
Thanks, Amin — fixed in 14fd16ce5e. Back now restores the search text too.
Added a page-2 search regression covering the restored results and input, plus
a blur that does not reapply the stale filter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]