Allow to select full object and object id in filters (#14083)

Today WorkflowVariablesDropdownAllItems is used for variable picker in
all workflow steps, and for step field picker in filters.
Using that component in filters prevent us from knowing if a full record
or only the id has been selected.

This PR:
- creates a new component WorkflowDropdownStepOutputItems, mostly
copying the logic of WorkflowVariablesDropdownAllItems
- call it WorkflowStepFilterFieldSelect, removing the display logic from
that parent component
- store isFullRecord in filter. So we now know if we should display a
record picker or a uuid picker

Before - selecting id makes picker behaves like when we select an object


https://github.com/user-attachments/assets/bde34dc5-8011-4983-8d0f-d8cb0cb3c045

After - selecting object and id are two different things


https://github.com/user-attachments/assets/49289990-3e6d-4ad7-abc1-e3ade2a821bb
This commit is contained in:
Thomas Trompette
2025-08-26 15:31:15 +02:00
committed by GitHub
parent 1640aea44a
commit f4312422ce
23 changed files with 335 additions and 256 deletions
@@ -39,7 +39,6 @@ export const WorkflowVariablesDropdown = ({
shouldDisplayRecordFields,
shouldDisplayRecordObjects,
fieldTypesToExclude,
shouldEnableSelectRelationObject,
multiline,
clickableComponent,
}: {
@@ -48,7 +47,6 @@ export const WorkflowVariablesDropdown = ({
shouldDisplayRecordFields: boolean;
shouldDisplayRecordObjects: boolean;
fieldTypesToExclude?: InputSchemaPropertyType[];
shouldEnableSelectRelationObject?: boolean;
disabled?: boolean;
multiline?: boolean;
clickableComponent?: React.ReactNode;
@@ -134,7 +132,6 @@ export const WorkflowVariablesDropdown = ({
step={selectedStep}
onSelect={handleSubItemSelect}
onBack={handleBack}
shouldEnableSelectRelationObject={shouldEnableSelectRelationObject}
/>
) : (
<WorkflowVariablesDropdownFieldItems
@@ -24,14 +24,12 @@ type WorkflowVariablesDropdownAllItemsProps = {
step: StepOutputSchema;
onSelect: (value: string) => void;
onBack: () => void;
shouldEnableSelectRelationObject?: boolean;
};
export const WorkflowVariablesDropdownAllItems = ({
step,
onSelect,
onBack,
shouldEnableSelectRelationObject,
}: WorkflowVariablesDropdownAllItemsProps) => {
const { t } = useLingui();
const { getIcon } = useIcons();
@@ -65,25 +63,12 @@ export const WorkflowVariablesDropdownAllItems = ({
return;
}
const isRelationField = currentSubStep.object.isRelationField ?? false;
const isRelationObjectSelectable =
shouldEnableSelectRelationObject ?? false;
if (isRelationField && isRelationObjectSelectable) {
onSelect(
getVariableTemplateFromPath({
stepId: step.id,
path: currentPath,
}),
);
} else {
onSelect(
getVariableTemplateFromPath({
stepId: step.id,
path: [...currentPath, currentSubStep.object.fieldIdName],
}),
);
}
onSelect(
getVariableTemplateFromPath({
stepId: step.id,
path: [...currentPath, currentSubStep.object.fieldIdName],
}),
);
};
const displayedSubStepObject = getDisplayedSubStepObject();