Skip to content

The open alternative to Salesforce, designed for AI.

Display application info in workflow side panel (#20976)

martmull0503aa7982bb
diff --git a/packages/twenty-front/src/modules/applications/components/AppChip.tsx b/packages/twenty-front/src/modules/applications/components/AppChip.tsx
index 98faef32fdd..e0a8d5dd904 100644
--- a/packages/twenty-front/src/modules/applications/components/AppChip.tsx
+++ b/packages/twenty-front/src/modules/applications/components/AppChip.tsx
@@ -15,6 +15,7 @@ type AppChipProps = {
name?: string | null;
};
className?: string;
+ chipOnly?: boolean;
};
const StyledContainer = styled.div`
@@ -34,6 +35,7 @@ export const AppChip = ({
size = 'sm',
fallbackApplicationData,
className,
+ chipOnly = false,
}: AppChipProps) => {
const { applicationChipData } = useApplicationChipData({
applicationId,
@@ -52,7 +54,9 @@ export const AppChip = ({
backgroundColor={applicationChipData.colors?.backgroundColor}
borderColor={applicationChipData.colors?.borderColor}
/>
- <OverflowingTextWithTooltip text={applicationChipData.name} />
+ {!chipOnly && (
+ <OverflowingTextWithTooltip text={applicationChipData.name} />
+ )}
</StyledContainer>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx
index 4f51147c7b1..16e2d5fae75 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/SidePanelWorkflowSelectAction.tsx
@@ -9,11 +9,9 @@ import { CORE_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constan
import { FLOW_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/FlowActions';
import { HUMAN_INPUT_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/HumanInputActions';
import { RECORD_ACTIONS } from '@/workflow/workflow-steps/workflow-actions/constants/RecordActions';
-import { getActionIconColorOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionIconColorOrThrow';
+import { ToolMenuItem } from '@/side-panel/pages/workflow/action/components/ToolMenuItem';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
-import { IconFunction } from 'twenty-ui/display';
-import { MenuItem } from 'twenty-ui/navigation';
export type WorkflowActionSelection = {
type: WorkflowActionType;
@@ -91,19 +89,12 @@ export const SidePanelWorkflowSelectAction = ({
{toolFunctions.length > 0 && (
<>
<SidePanelWorkflowSelectStepTitle>
- {t`Applications`}
+ {t`Other`}
</SidePanelWorkflowSelectStepTitle>
{toolFunctions.map((fn) => (
- <MenuItem
+ <ToolMenuItem
key={fn.id}
- withIconContainer={true}
- LeftIcon={() => (
- <IconFunction
- color={getActionIconColorOrThrow('LOGIC_FUNCTION')}
- size={16}
- />
- )}
- text={fn.workflowActionTriggerSettings?.label ?? fn.name}
+ logicFunction={fn}
onClick={() => handleFunctionClick(fn.id)}
/>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/ToolMenuItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/ToolMenuItem.tsx
new file mode 100644
index 00000000000..c96ffc32b83
--- /dev/null
+++ b/packages/twenty-front/src/modules/side-panel/pages/workflow/action/components/ToolMenuItem.tsx
@@ -0,0 +1,33 @@
+import { AppChip } from '@/applications/components/AppChip';
+import { useApplicationChipData } from '@/applications/hooks/useApplicationChipData';
+import { type LogicFunction } from '@/logic-functions/types/LogicFunction';
+import { MenuItem } from 'twenty-ui/navigation';
+
+type ToolMenuItemProps = {
+ logicFunction: LogicFunction;
+ onClick: () => void;
+};
+
+export const ToolMenuItem = ({ logicFunction, onClick }: ToolMenuItemProps) => {
+ const { applicationChipData } = useApplicationChipData({
+ applicationId: logicFunction.applicationId,
+ });
+
+ return (
+ <MenuItem
+ withIconContainer={true}
+ LeftIcon={() => (
+ <AppChip
+ applicationId={logicFunction.applicationId}
+ size={'md'}
+ chipOnly
+ />
+ )}
+ text={
+ logicFunction.workflowActionTriggerSettings?.label ?? logicFunction.name
+ }
+ contextualText={applicationChipData.name}
+ onClick={onClick}
+ />
+ );
+};