Refactor/filters (#498)
* wip * - Added scopes on useHotkeys - Use new EditableCellV2 - Implemented Recoil Scoped State with specific context - Implemented soft focus position - Factorized open/close editable cell - Removed editable relation old components - Broke down entity table into multiple components - Added Recoil Scope by CellContext - Added Recoil Scope by RowContext * First working version * Use a new EditableCellSoftFocusMode * Fixes * wip * wip * wip * Use company filters * Refactored FilterDropdown into multiple components * Refactored entity search select in dropdown * Renamed states * Fixed people filters * Removed unused code * Cleaned states * Cleaned state * Better naming * fixed rebase * Fix * Fixed stories and mocked data and displayName bug * Fixed cancel sort * Fixed naming * Fixed dropdown height * Fix * Fixed lint
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { availableTableFiltersScopedState } from '@/filters-and-sorts/states/availableTableFiltersScopedState';
|
||||
import { TableFilterDefinition } from '@/filters-and-sorts/types/TableFilterDefinition';
|
||||
import { useRecoilScopedState } from '@/recoil-scope/hooks/useRecoilScopedState';
|
||||
|
||||
import { TableContext } from '../states/TableContext';
|
||||
|
||||
export function useInitializeEntityTableFilters({
|
||||
availableTableFilters,
|
||||
}: {
|
||||
availableTableFilters: TableFilterDefinition[];
|
||||
}) {
|
||||
const [, setAvailableTableFilters] = useRecoilScopedState(
|
||||
availableTableFiltersScopedState,
|
||||
TableContext,
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setAvailableTableFilters(availableTableFilters);
|
||||
}, [setAvailableTableFilters, availableTableFilters]);
|
||||
}
|
||||
3
front/src/modules/ui/tables/states/TableContext.ts
Normal file
3
front/src/modules/ui/tables/states/TableContext.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
export const TableContext = createContext<string | null>(null);
|
||||
Reference in New Issue
Block a user