Fix View update button not being displayed in View Bar (#1469)

This commit is contained in:
Charles Bochet
2023-09-06 10:37:29 +02:00
committed by GitHub
parent c05d24d249
commit f332c3bee2
10 changed files with 37 additions and 52 deletions

View File

@ -5,6 +5,8 @@ import { DropdownRecoilScopeContext } from '@/ui/dropdown/states/recoil-scope-co
import { FilterDropdownButton } from '@/ui/filter-n-sort/components/FilterDropdownButton';
import SortAndFilterBar from '@/ui/filter-n-sort/components/SortAndFilterBar';
import { SortDropdownButton } from '@/ui/filter-n-sort/components/SortDropdownButton';
import { canPersistFiltersScopedSelector } from '@/ui/filter-n-sort/states/selectors/canPersistFiltersScopedSelector';
import { canPersistSortsScopedSelector } from '@/ui/filter-n-sort/states/selectors/canPersistSortsScopedSelector';
import { sortsScopedState } from '@/ui/filter-n-sort/states/sortsScopedState';
import { FiltersHotkeyScope } from '@/ui/filter-n-sort/types/FiltersHotkeyScope';
import { SelectedSortType, SortType } from '@/ui/filter-n-sort/types/interface';
@ -54,6 +56,13 @@ export function TableHeader<SortField>({
const canPersistTableColumns = useRecoilValue(
canPersistTableColumnsScopedSelector([tableScopeId, currentTableViewId]),
);
const canPersistFilters = useRecoilValue(
canPersistFiltersScopedSelector([tableScopeId, currentTableViewId]),
);
const canPersistSorts = useRecoilValue(
canPersistSortsScopedSelector([tableScopeId, currentTableViewId]),
);
const sortSelect = useCallback(
(newSort: SelectedSortType<SortField>) => {
@ -106,7 +115,9 @@ export function TableHeader<SortField>({
}
bottomComponent={
<SortAndFilterBar
canToggle={canPersistTableColumns}
canPersistView={
canPersistTableColumns || canPersistFilters || canPersistSorts
}
context={TableRecoilScopeContext}
sorts={sorts}
onRemoveSort={sortUnselect}