Fix run input tab for filters (#13961)
Previous step id was still calculated the old way for step following triggers: if first step in the array, means it follows the trigger. It was not working for steps inserted between trigger and first step. Removing that code for good. Before <img width="500" height="655" alt="Capture d’écran 2025-08-18 à 16 34 50" src="https://github.com/user-attachments/assets/31365bfe-8c7d-45b5-8141-ac3d4e31127f" /> After <img width="500" height="655" alt="Capture d’écran 2025-08-18 à 16 34 18" src="https://github.com/user-attachments/assets/b9b42c58-0416-48a6-bc65-2966366a888c" />
This commit is contained in:
+4
-11
@@ -3,7 +3,6 @@ import { useWorkflowRunIdOrThrow } from '@/workflow/hooks/useWorkflowRunIdOrThro
|
||||
import { getStepDefinitionOrThrow } from '@/workflow/utils/getStepDefinitionOrThrow';
|
||||
import { WorkflowRunStepJsonContainer } from '@/workflow/workflow-steps/components/WorkflowRunStepJsonContainer';
|
||||
import { WorkflowStepHeader } from '@/workflow/workflow-steps/components/WorkflowStepHeader';
|
||||
import { getWorkflowPreviousStepId } from '@/workflow/workflow-steps/utils/getWorkflowPreviousStepId';
|
||||
import { getWorkflowRunStepContext } from '@/workflow/workflow-steps/utils/getWorkflowRunStepContext';
|
||||
import { getWorkflowVariablesUsedInStep } from '@/workflow/workflow-steps/utils/getWorkflowVariablesUsedInStep';
|
||||
import { getActionHeaderTypeOrThrow } from '@/workflow/workflow-steps/workflow-actions/utils/getActionHeaderTypeOrThrow';
|
||||
@@ -19,8 +18,8 @@ import {
|
||||
JsonTreeContextProvider,
|
||||
type ShouldExpandNodeInitiallyProps,
|
||||
} from 'twenty-ui/json-visualizer';
|
||||
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
|
||||
import { type JsonValue } from 'type-fest';
|
||||
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
|
||||
|
||||
export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
|
||||
const { t, i18n } = useLingui();
|
||||
@@ -45,20 +44,12 @@ export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const previousStepId = getWorkflowPreviousStepId({
|
||||
stepId,
|
||||
steps: workflowRun.state.flow.steps,
|
||||
});
|
||||
|
||||
if (previousStepId === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const stepDefinition = getStepDefinitionOrThrow({
|
||||
stepId,
|
||||
trigger: workflowRun.state.flow.trigger,
|
||||
steps: workflowRun.state.flow.steps,
|
||||
});
|
||||
|
||||
if (stepDefinition?.type !== 'action') {
|
||||
throw new Error('The input tab must be rendered with an action step.');
|
||||
}
|
||||
@@ -86,6 +77,8 @@ export const WorkflowRunStepInputDetail = ({ stepId }: { stepId: string }) => {
|
||||
throw new Error('The input tab must be rendered with a non-empty context.');
|
||||
}
|
||||
|
||||
const previousStepId = stepContext[stepContext.length - 1].id;
|
||||
|
||||
const getNodeHighlighting: GetJsonNodeHighlighting = (keyPath: string) => {
|
||||
if (variablesUsedInStep.has(keyPath)) {
|
||||
return 'blue';
|
||||
|
||||
Reference in New Issue
Block a user