* feat: add 'View Responses' menu item to Routing Form dropdown Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: use nuqs createSerializer for URL generation Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * refactor: move serializer to data-table lib and use proper type constants Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: type errors in serializers and FormActions Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: use parseAsArrayOf with parseAsJson for proper nuqs serialization Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: update to use dataTableQueryParamsSerializer with proper nuqs pattern Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * refactor: extract parsers from DataTableProvider to be reused in serializers Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: remove deprecated activeFiltersSerializer and use empty array instead of null Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: only show View Responses menu when form id and teamId exist Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * remove teamId condition * refactor: improve viewResponses URL generation with cleaner conditional Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * Update packages/features/data-table/lib/parsers.ts * refactor: make constants in parsers.ts non-exported Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: add explicit type annotations to constants in parsers.ts Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: add explicit type annotations and export DEFAULT_PAGE_SIZE in parsers.ts Co-Authored-By: eunjae@cal.com <eunjae@cal.com> * fix: add explicit type assertions to DEFAULT_ACTIVE_FILTERS and DEFAULT_SORTING Co-Authored-By: eunjae@cal.com <eunjae@cal.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: eunjae@cal.com <eunjae@cal.com> Co-authored-by: Eunjae Lee <hey@eunjae.dev> Co-authored-by: Benny Joo <sldisek783@gmail.com>
29 lines
695 B
TypeScript
29 lines
695 B
TypeScript
import { createSerializer } from "nuqs";
|
|
|
|
import {
|
|
activeFiltersParser,
|
|
sortingParser,
|
|
columnVisibilityParser,
|
|
columnSizingParser,
|
|
segmentIdParser,
|
|
pageIndexParser,
|
|
pageSizeParser,
|
|
searchTermParser,
|
|
} from "./parsers";
|
|
|
|
/**
|
|
* Serializer for data table query parameters
|
|
* Used to generate URL query parameters for data tables
|
|
* Based on the parameters used in DataTableProvider
|
|
*/
|
|
export const dataTableQueryParamsSerializer = createSerializer({
|
|
activeFilters: activeFiltersParser,
|
|
sorting: sortingParser,
|
|
cols: columnVisibilityParser,
|
|
widths: columnSizingParser,
|
|
segment: segmentIdParser,
|
|
page: pageIndexParser,
|
|
size: pageSizeParser,
|
|
q: searchTermParser,
|
|
});
|