Fix workflow with manual triggers and no selection not appearing in the command menu (#11544)

Fix workflow with manual triggers and no selection not appearing in the
command menu

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Raphaël Bosi
2025-04-14 11:03:29 +02:00
committed by GitHub
parent b5a1d1a895
commit ace515eea7
13 changed files with 86 additions and 70 deletions

View File

@ -23,5 +23,5 @@ export const Action = ({
onClick();
};
return <ActionDisplay action={actionConfig} onClick={handleClick} />;
return <ActionDisplay onClick={handleClick} />;
};

View File

@ -1,8 +1,6 @@
import { ActionDisplay } from '@/action-menu/actions/display/components/ActionDisplay';
import { ActionConfigContext } from '@/action-menu/contexts/ActionConfigContext';
import { useCloseActionMenu } from '@/action-menu/hooks/useCloseActionMenu';
import { AppPath } from '@/types/AppPath';
import { useContext } from 'react';
import { PathParam } from 'react-router-dom';
import { getAppPath } from '~/utils/navigation/getAppPath';
@ -15,21 +13,9 @@ export const ActionLink = <T extends AppPath>({
params?: { [key in PathParam<T>]: string | null };
queryParams?: Record<string, any>;
}) => {
const actionConfig = useContext(ActionConfigContext);
const { closeActionMenu } = useCloseActionMenu();
if (!actionConfig) {
return null;
}
const path = getAppPath(to, params, queryParams);
return (
<ActionDisplay
action={{ ...actionConfig }}
onClick={closeActionMenu}
to={path}
/>
);
return <ActionDisplay onClick={closeActionMenu} to={path} />;
};

View File

@ -46,7 +46,7 @@ export const ActionModal = ({
return (
<>
<ActionDisplay action={actionConfig} onClick={handleOpen} />
<ActionDisplay onClick={handleOpen} />
{isOpen &&
createPortal(
<ConfirmationModal

View File

@ -44,5 +44,5 @@ export const ActionOpenSidePanelPage = ({
}
};
return <ActionDisplay action={actionConfig} onClick={handleClick} />;
return <ActionDisplay onClick={handleClick} />;
};