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:
@ -36,6 +36,7 @@ export function ActivityRelationEditableField({ activity }: OwnProps) {
|
||||
displayModeContent={
|
||||
<ActivityTargetChips targets={activity?.activityTargets} />
|
||||
}
|
||||
isDisplayModeContentEmpty={activity?.activityTargets?.length === 0}
|
||||
/>
|
||||
</RecoilScope>
|
||||
</RecoilScope>
|
||||
|
||||
@ -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);
|
||||
};
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { activityTargetableEntityArrayState } from '@/activities/states/activityTargetableEntityArrayState';
|
||||
import { Timeline } from '@/activities/timeline/components/Timeline';
|
||||
|
||||
export function RightDrawerTimeline() {
|
||||
const activityTargetableEntityArray = useRecoilValue(
|
||||
activityTargetableEntityArrayState,
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{activityTargetableEntityArray.map((targetableEntity) => (
|
||||
<Timeline
|
||||
key={targetableEntity.id}
|
||||
entity={{
|
||||
id: targetableEntity?.id ?? '',
|
||||
type: targetableEntity.type,
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user