Search record schema migration breaks following workflow steps (#14833)

If iterator loop feature flag is not enabled, `all` field in undefined
in search record schema. We need to handle that case properly.
This commit is contained in:
Thomas Trompette
2025-10-02 11:04:38 +02:00
committed by GitHub
parent 7b16796a20
commit 3fa12bb9fc
3 changed files with 60 additions and 44 deletions
@@ -229,28 +229,34 @@ export const WorkflowDropdownStepOutputItems = ({
{filteredOptions.length > 0 && shouldDisplaySubStepObject && (
<DropdownMenuSeparator />
)}
{filteredOptions.map(([key, subStep]) => (
<MenuItemSelect
key={key}
selected={false}
focused={false}
onClick={() => handleSelectField(key)}
text={subStep.label || key}
hasSubMenu={!subStep.isLeaf}
LeftIcon={
subStep.icon
? getIcon(subStep.icon)
: getIcon(
getStepItemIcon({
itemType: subStep.type,
}),
)
}
contextualText={
subStep.isLeaf ? subStep?.value?.toString() : undefined
}
/>
))}
{filteredOptions.map(([key, subStep]) => {
if (!isDefined(subStep)) {
return null;
}
return (
<MenuItemSelect
key={key}
selected={false}
focused={false}
onClick={() => handleSelectField(key)}
text={subStep.label || key}
hasSubMenu={!subStep.isLeaf}
LeftIcon={
subStep.icon
? getIcon(subStep.icon)
: getIcon(
getStepItemIcon({
itemType: subStep.type,
}),
)
}
contextualText={
subStep.isLeaf ? subStep?.value?.toString() : undefined
}
/>
);
})}
</DropdownMenuItemsContainer>
</DropdownContent>
);
@@ -136,28 +136,34 @@ export const WorkflowVariablesDropdownStepItems = ({
{filteredOptions.length > 0 && shouldDisplaySubStepObject && (
<DropdownMenuSeparator />
)}
{filteredOptions.map(([key, subStep]) => (
<MenuItemSelect
key={key}
selected={false}
focused={false}
onClick={() => handleSelectField(key)}
text={subStep.label || key}
hasSubMenu={!subStep.isLeaf}
LeftIcon={
subStep.icon
? getIcon(subStep.icon)
: getIcon(
getStepItemIcon({
itemType: subStep.type,
}),
)
}
contextualText={
subStep.isLeaf ? subStep?.value?.toString() : undefined
}
/>
))}
{filteredOptions.map(([key, subStep]) => {
if (!isDefined(subStep)) {
return null;
}
return (
<MenuItemSelect
key={key}
selected={false}
focused={false}
onClick={() => handleSelectField(key)}
text={subStep.label || key}
hasSubMenu={!subStep.isLeaf}
LeftIcon={
subStep.icon
? getIcon(subStep.icon)
: getIcon(
getStepItemIcon({
itemType: subStep.type,
}),
)
}
contextualText={
subStep.isLeaf ? subStep?.value?.toString() : undefined
}
/>
);
})}
</DropdownMenuItemsContainer>
</DropdownContent>
);
@@ -104,6 +104,10 @@ const filterBaseOutputSchema = ({
for (const key in outputSchema) {
const field = outputSchema[key];
if (!isDefined(field)) {
continue;
}
if (field.isLeaf) {
if (isFieldTypeCompatibleWithRecordId(field.type)) {
filteredSchema[key] = field;