Set failed node's output as red (#11358)

| Error | Success |
|--------|--------|
| ![CleanShot 2025-04-02 at 18 18
45@2x](https://github.com/user-attachments/assets/6674d4d2-344a-4e16-9608-a70cde07a376)
| ![CleanShot 2025-04-02 at 18 20
23@2x](https://github.com/user-attachments/assets/55b5a467-528f-4f07-9166-40ed14943ee2)
|

Closes https://github.com/twentyhq/core-team-issues/issues/716
This commit is contained in:
Baptiste Devessier
2025-04-03 08:58:56 +02:00
committed by GitHub
parent 183dc40916
commit bea75b9532
12 changed files with 119 additions and 31 deletions

View File

@ -11,6 +11,7 @@ import { getActionIcon } from '@/workflow/workflow-steps/workflow-actions/utils/
import { getActionIconColorOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionIconColorOrThrow';
import { useTheme } from '@emotion/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import {
IconBrackets,
JsonNestedNode,
@ -18,7 +19,6 @@ import {
ShouldExpandNodeInitiallyProps,
useIcons,
} from 'twenty-ui';
import { isDefined } from 'twenty-shared/utils';
export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
const { t, i18n } = useLingui();
@ -105,7 +105,8 @@ export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
emptyStringLabel: t`[empty string]`,
arrowButtonCollapsedLabel: t`Expand`,
arrowButtonExpandedLabel: t`Collapse`,
shouldHighlightNode: (keyPath) => variablesUsedInStep.has(keyPath),
getNodeHighlighting: (keyPath) =>
variablesUsedInStep.has(keyPath) ? 'blue' : undefined,
shouldExpandNodeInitially: isFirstNodeDepthOfPreviousStep,
}}
>

View File

@ -9,7 +9,12 @@ import { getActionIconColorOrThrow } from '@/workflow/workflow-steps/workflow-ac
import { useTheme } from '@emotion/react';
import { useLingui } from '@lingui/react/macro';
import { isDefined } from 'twenty-shared/utils';
import { isTwoFirstDepths, JsonTree, useIcons } from 'twenty-ui';
import {
GetJsonNodeHighlighting,
isTwoFirstDepths,
JsonTree,
useIcons,
} from 'twenty-ui';
export const WorkflowRunStepOutputDetail = ({ stepId }: { stepId: string }) => {
const { t, i18n } = useLingui();
@ -42,6 +47,8 @@ export const WorkflowRunStepOutputDetail = ({ stepId }: { stepId: string }) => {
});
const headerType = getActionHeaderTypeOrThrow(stepDefinition.definition.type);
const setRedHighlightingForEveryNode: GetJsonNodeHighlighting = () => 'red';
return (
<>
<WorkflowStepHeader
@ -61,6 +68,11 @@ export const WorkflowRunStepOutputDetail = ({ stepId }: { stepId: string }) => {
emptyStringLabel={t`[empty string]`}
arrowButtonCollapsedLabel={t`Expand`}
arrowButtonExpandedLabel={t`Collapse`}
getNodeHighlighting={
isDefined(stepOutput.error)
? setRedHighlightingForEveryNode
: undefined
}
/>
</WorkflowRunStepJsonContainer>
</>