Implements new record sort CRUD (#10448)

This PR implements new record sorts CRUD as already done on record
filters, which is based on record sorts state instead of combined view
sorts.

It implements a new useSaveRecordSortsToViewSorts with its underlying
utils, to compute diff between two view sorts array.

The associated unit tests have also been written.

This PR also fixes the bug where the view bar disappeared when deleting
the already saved record sort of a view.
This commit is contained in:
Lucas Bordeau
2025-02-24 16:46:00 +01:00
committed by GitHub
parent dc7a9fc767
commit 970aa4c5a1
13 changed files with 463 additions and 77 deletions

View File

@ -179,8 +179,8 @@ export const ViewBarDetails = ({
const shouldExpandViewBar =
viewFiltersAreDifferentFromRecordFilters ||
((currentViewWithCombinedFiltersAndSorts?.viewSorts?.length ||
currentRecordFilters?.length) &&
viewSortsAreDifferentFromRecordSorts ||
((currentRecordSorts?.length || currentRecordFilters?.length) &&
isViewBarExpanded);
if (!shouldExpandViewBar) {