Activity cache injection (#3791)

* WIP

* Minor fixes

* Added TODO

* Fix post merge

* Fix

* Fixed warnings

* Fixed comments

* Fixed comments

* Fixed naming

* Removed comment

* WIP

* WIP 2

* Finished working version

* Fixes

* Fixed typing

* Fixes

* Fixes

* Fixes

* Naming fixes

* WIP

* Fix import

* WIP

* Working version on title

* Fixed create record id overwrite

* Removed unecessary callback

* Masterpiece

* Fixed delete on click outside drawer or delete

* Cleaned

* Cleaned

* Cleaned

* Minor fixes

* Fixes

* Fixed naming

* WIP

* Fix

* Fixed create from target inline cell

* Removed console.log

* Fixed delete activity optimistic effect

* Fixed no title

* Fixed debounce and title body creation

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Lucas Bordeau
2024-02-09 14:51:30 +01:00
committed by GitHub
parent 9ceff84bbf
commit cca72da708
87 changed files with 2195 additions and 1058 deletions

View File

@ -58,7 +58,9 @@ export const RightDrawer = () => {
useListenClickOutside({
refs: [rightDrawerRef],
callback: () => closeRightDrawer(),
callback: () => {
closeRightDrawer();
},
mode: ClickOutsideMode.comparePixels,
});

View File

@ -1,6 +1,6 @@
import styled from '@emotion/styled';
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
import { useOpenCreateActivityDrawerV2 } from '@/activities/hooks/useOpenCreateActivityDrawerV2';
import { ActivityType } from '@/activities/types/Activity';
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
@ -19,17 +19,19 @@ const StyledContainer = styled.div`
`;
export const ShowPageAddButton = ({
entity,
activityTargetObject,
}: {
entity: ActivityTargetableObject;
activityTargetObject: ActivityTargetableObject;
}) => {
const { closeDropdown, toggleDropdown } = useDropdown(
SHOW_PAGE_ADD_BUTTON_DROPDOWN_ID,
);
const openCreateActivity = useOpenCreateActivityDrawer();
const { closeDropdown, toggleDropdown } = useDropdown('add-show-page');
const openCreateActivity = useOpenCreateActivityDrawerV2();
const handleSelect = (type: ActivityType) => {
openCreateActivity({ type, targetableObjects: [entity] });
openCreateActivity({
type,
targetableObjects: [activityTargetObject],
timelineTargetableObject: activityTargetObject,
});
closeDropdown();
};