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:
@ -23,5 +23,5 @@ export const Action = ({
|
||||
onClick();
|
||||
};
|
||||
|
||||
return <ActionDisplay action={actionConfig} onClick={handleClick} />;
|
||||
return <ActionDisplay onClick={handleClick} />;
|
||||
};
|
||||
|
||||
@ -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} />;
|
||||
};
|
||||
|
||||
@ -46,7 +46,7 @@ export const ActionModal = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<ActionDisplay action={actionConfig} onClick={handleOpen} />
|
||||
<ActionDisplay onClick={handleOpen} />
|
||||
{isOpen &&
|
||||
createPortal(
|
||||
<ConfirmationModal
|
||||
|
||||
@ -44,5 +44,5 @@ export const ActionOpenSidePanelPage = ({
|
||||
}
|
||||
};
|
||||
|
||||
return <ActionDisplay action={actionConfig} onClick={handleClick} />;
|
||||
return <ActionDisplay onClick={handleClick} />;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user