Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const PropertyComboBox = ({
<Button
aria-expanded={open}
className={twMerge(
'relative w-full justify-between',
'relative h-auto w-full justify-between whitespace-normal',
leadingIcon && 'relative',
showInputTypeSwitchButton && 'mt-0'
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const PropertyInput = forwardRef<HTMLInputElement, PropertyInputProps>(
<div className={twMerge([label && type !== 'hidden' && 'mt-1', leadingIcon && 'relative'])} title={title}>
<div
className={twMerge(
'ring-2 ring-blue-500 focus-visible:outline-none',
'focus:ring-2 focus:ring-blue-500 focus-visible:outline-none',
leadingIcon && 'relative rounded-md',
type === 'hidden' && 'border-0',
error && 'ring-rose-300'
Expand All @@ -102,7 +102,7 @@ const PropertyInput = forwardRef<HTMLInputElement, PropertyInputProps>(

<Input
className={twMerge(
'outline-none ring-2 ring-blue-500 focus-visible:outline-none focus-visible:ring-blue-500',
'outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500',
error &&
'border-rose-300 pr-10 text-rose-900 placeholder-rose-300 ring-rose-300 focus-visible:ring-rose-300',
disabled && 'bg-gray-100 text-gray-500',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ const WorkflowEditorLayout = ({

let previousComponentDefinitions: ComponentDefinitionBasic[] = [];

let filteredWorkflowNodeOutputs;

if (!currentNode?.trigger && workflowNodeOutputs) {
const filteredWorkflowNodeOutputs = workflowNodeOutputs.filter(
filteredWorkflowNodeOutputs = workflowNodeOutputs.filter(
(workflowNodeOutput) => workflowNodeOutput.actionDefinition || workflowNodeOutput.triggerDefinition
);

Expand Down Expand Up @@ -112,15 +114,15 @@ const WorkflowEditorLayout = ({
<WorkflowNodeDetailsPanel
previousComponentDefinitions={previousComponentDefinitions}
updateWorkflowMutation={updateWorkflowMutation}
workflowNodeOutputs={workflowNodeOutputs ?? []}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
)}

{(workflowNodeOutputs || (!workflowNodeOutputs && currentNode?.trigger)) &&
{(filteredWorkflowNodeOutputs || (!filteredWorkflowNodeOutputs && currentNode?.trigger)) &&
previousComponentDefinitions && (
<DataPillPanel
previousComponentDefinitions={previousComponentDefinitions}
workflowNodeOutputs={workflowNodeOutputs ?? []}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
)}
</ReactFlowProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Skeleton} from '@/components/ui/skeleton';
import {Tooltip, TooltipContent, TooltipTrigger} from '@/components/ui/tooltip';
import Properties from '@/pages/platform/workflow-editor/components/Properties/Properties';
import DataStreamComponentsTab from '@/pages/platform/workflow-editor/components/node-details-tabs/DataStreamComponentsTab';
import {CONDITION_CASE_FALSE, CONDITION_CASE_TRUE} from '@/shared/constants';
import {
ActionDefinitionApi,
ComponentDefinition,
Expand Down Expand Up @@ -374,7 +375,28 @@ const WorkflowNodeDetailsPanel = ({
return;
}

const dataPills = getDataPillsFromProperties(previousComponentProperties!, workflow, previousNodeNames);
let filteredNodeNames = previousNodeNames;

if (currentNode?.conditionData) {
const parentConditionTask = workflow.tasks?.find(
(task) => task.name === currentNode.conditionData?.conditionId
);

const {conditionCase} = currentNode.conditionData;

const oppositeConditionCase =
conditionCase === CONDITION_CASE_TRUE ? CONDITION_CASE_FALSE : CONDITION_CASE_TRUE;

const oppositeConditionCaseNodeNames = parentConditionTask?.parameters?.[oppositeConditionCase].map(
(task: WorkflowTask) => task.name
);

filteredNodeNames = previousNodeNames.filter(
(nodeName) => !oppositeConditionCaseNodeNames?.includes(nodeName)
);
}

const dataPills = getDataPillsFromProperties(previousComponentProperties!, workflow, filteredNodeNames);

setAvailableDataPills(dataPills.flat(Infinity));
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export default function getDataPillsFromProperties(

const existingProperties = getExistingProperties(componentProperty.properties);

const nodeName = workflow.triggers?.length ? previousNodeNames[index] : previousNodeNames[index + 1];
const filteredNodeNames = previousNodeNames.filter(
(name) => name !== 'manual' && name !== 'trigger_1' && !name.includes('condition')
);

const nodeName = filteredNodeNames[index];

dataPills.push({
componentIcon: componentDefinition.icon,
Expand Down
Loading