Skip to content

Commit

Permalink
feat: saved filters should be configured to allow sorting (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fran McDade authored and Fran McDade committed Jun 21, 2024
1 parent 4936195 commit 1b633c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ TableProps<T>): JSX.Element => {
data: items,
enableColumnFilters: true, // client-side filtering.
enableFilters: true, // client-side filtering.
enableMultiSort: false,
enableMultiSort: clientFiltering,
enableRowSelection,
enableSorting: true, // client-side filtering.
enableSortingRemoval: false, // client-side filtering.
Expand Down
2 changes: 1 addition & 1 deletion src/config/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ type RelatedSearchFunction = (

export interface SavedFilter {
filters: SelectedFilter[];
sort?: ColumnSort;
sorting?: ColumnSort[];
title: string;
}
/**
Expand Down
3 changes: 1 addition & 2 deletions src/providers/exploreState/initializer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ function buildSavedFilterByCategoryValueKey(
if (!savedFilters) return;
const savedFilterByCategoryValueKey: SavedFilterByCategoryValueKey =
new Map();
for (const { filters, sort, title } of savedFilters) {
const sorting = sort ? [sort] : undefined;
for (const { filters, sorting, title } of savedFilters) {
savedFilterByCategoryValueKey.set(title, { filters, sorting, title });
}
return savedFilterByCategoryValueKey;
Expand Down

0 comments on commit 1b633c9

Please sign in to comment.