New behavior for editable fields (#1300)

* New behavior for editable fields

* fix

* fix

* fix coverage

* Add tests on NotFound

* fix

* fix

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Weiko
2023-08-24 15:56:43 +02:00
committed by GitHub
parent bf05e5917d
commit 10b68618d3
17 changed files with 134 additions and 136 deletions

View File

@ -1,26 +0,0 @@
import { useRecoilState } from 'recoil';
import { useRightDrawer } from '@/ui/right-drawer/hooks/useRightDrawer';
import { RightDrawerHotkeyScope } from '@/ui/right-drawer/types/RightDrawerHotkeyScope';
import { RightDrawerPages } from '@/ui/right-drawer/types/RightDrawerPages';
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
import { activityTargetableEntityArrayState } from '../states/activityTargetableEntityArrayState';
import { ActivityTargetableEntity } from '../types/ActivityTargetableEntity';
// TODO: refactor with recoil callback to avoid rerender
export function useOpenTimelineRightDrawer() {
const { openRightDrawer } = useRightDrawer();
const [, setActivityTargetableEntityArray] = useRecoilState(
activityTargetableEntityArrayState,
);
const setHotkeyScope = useSetHotkeyScope();
return function openTimelineRightDrawer(
activityTargetableEntityArray: ActivityTargetableEntity[],
) {
setHotkeyScope(RightDrawerHotkeyScope.RightDrawer, { goto: false });
setActivityTargetableEntityArray(activityTargetableEntityArray);
openRightDrawer(RightDrawerPages.Timeline);
};
}