Show app logo and name in workflow step side panel header (#21689)
Show app logo and name in workflow step side panel header ## Before <img width="798" height="106" alt="CleanShot 2026-06-16 at 17 59 39@2x" src="https://github.com/user-attachments/assets/a8881d1c-355c-4e3a-9379-0c3a7cfbf42f" /> ## After <img width="800" height="102" alt="CleanShot 2026-06-16 at 18 05 27@2x" src="https://github.com/user-attachments/assets/43820d1a-6445-42d8-8f45-963e8741cbb7" /> <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/21689?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
import { useApplicationChipData } from '@/applications/hooks/useApplicationChipData';
|
||||
import { useIsThirdPartyApplication } from '@/applications/hooks/useIsThirdPartyApplication';
|
||||
import { logicFunctionsSelector } from '@/logic-functions/states/logicFunctionsSelector';
|
||||
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
type LogicFunctionThirdPartyApplicationInformation = {
|
||||
applicationId: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export const useLogicFunctionThirdPartyApplicationInformation = (
|
||||
logicFunctionId?: string,
|
||||
): LogicFunctionThirdPartyApplicationInformation | undefined => {
|
||||
const logicFunctions = useAtomStateValue(logicFunctionsSelector);
|
||||
|
||||
const applicationId = isDefined(logicFunctionId)
|
||||
? logicFunctions.find(
|
||||
(logicFunction) => logicFunction.id === logicFunctionId,
|
||||
)?.applicationId
|
||||
: undefined;
|
||||
|
||||
const isThirdPartyApplication = useIsThirdPartyApplication(applicationId);
|
||||
|
||||
const { applicationChipData } = useApplicationChipData({ applicationId });
|
||||
|
||||
if (!isThirdPartyApplication || !isDefined(applicationId)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
applicationId,
|
||||
name: applicationChipData.name,
|
||||
};
|
||||
};
|
||||
+28
-3
@@ -1,3 +1,5 @@
|
||||
import { AppChip } from '@/applications/components/AppChip';
|
||||
import { useLogicFunctionThirdPartyApplicationInformation } from '@/logic-functions/hooks/useLogicFunctionThirdPartyApplicationInformation';
|
||||
import { useUpdateSidePanelPageInfo } from '@/side-panel/hooks/useUpdateSidePanelPageInfo';
|
||||
import { useSidePanelWorkflowIdOrThrow } from '@/side-panel/pages/workflow/hooks/useSidePanelWorkflowIdOrThrow';
|
||||
import { sidePanelWorkflowStepIdComponentState } from '@/side-panel/pages/workflow/states/sidePanelWorkflowStepIdComponentState';
|
||||
@@ -85,6 +87,15 @@ export const SidePanelWorkflowStepInfo = ({
|
||||
|
||||
const isTrigger = stepDefinition?.type === 'trigger';
|
||||
|
||||
const logicFunctionId =
|
||||
stepDefinition?.type === 'action' &&
|
||||
stepDefinition.definition.type === 'LOGIC_FUNCTION'
|
||||
? stepDefinition.definition.settings.input.logicFunctionId
|
||||
: undefined;
|
||||
|
||||
const thirdPartyApplicationInformation =
|
||||
useLogicFunctionThirdPartyApplicationInformation(logicFunctionId);
|
||||
|
||||
const agentId = getAgentIdFromStep(stepDefinition);
|
||||
const { updateAgentLabel } = useUpdateAgentLabel(agentId);
|
||||
const stepName =
|
||||
@@ -126,6 +137,10 @@ export const SidePanelWorkflowStepInfo = ({
|
||||
|
||||
const headerType = isTrigger ? t`Trigger` : t`Action`;
|
||||
|
||||
const label = isDefined(thirdPartyApplicationInformation)
|
||||
? thirdPartyApplicationInformation.name
|
||||
: headerType;
|
||||
|
||||
const Icon = getIcon(headerIcon ?? 'IconDefault');
|
||||
|
||||
const saveTitle = async () => {
|
||||
@@ -169,11 +184,21 @@ export const SidePanelWorkflowStepInfo = ({
|
||||
return (
|
||||
<SidePanelPageInfoLayout
|
||||
icon={
|
||||
headerIcon ? (
|
||||
isDefined(thirdPartyApplicationInformation) ? (
|
||||
<AppChip
|
||||
applicationId={thirdPartyApplicationInformation.applicationId}
|
||||
size="md"
|
||||
chipOnly
|
||||
/>
|
||||
) : headerIcon ? (
|
||||
<Icon size={theme.icon.size.md} stroke={theme.icon.stroke.sm} />
|
||||
) : undefined
|
||||
}
|
||||
iconColor={headerIconColor}
|
||||
iconColor={
|
||||
isDefined(thirdPartyApplicationInformation)
|
||||
? undefined
|
||||
: headerIconColor
|
||||
}
|
||||
title={
|
||||
<TitleInput
|
||||
instanceId={`workflow-step-title-${sidePanelPageInstanceId}`}
|
||||
@@ -189,7 +214,7 @@ export const SidePanelWorkflowStepInfo = ({
|
||||
onShiftTab={saveTitle}
|
||||
/>
|
||||
}
|
||||
label={isTrigger ? t`Trigger` : t`Action`}
|
||||
label={label}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user