Fix wrong label formatting (#9830)
Fixes https://discord.com/channels/1130383047699738754/1324785862830985266 ## Before <img width="451" alt="image" src="https://github.com/user-attachments/assets/53ae96f9-4bbd-40e3-beaa-a5702f2adee4" /> ## After <img width="388" alt="image" src="https://github.com/user-attachments/assets/e36da162-bc60-4596-823b-ffb6ddfed98d" />
This commit is contained in:
@ -115,7 +115,20 @@ export const WorkflowVariablesDropdownFieldItems = ({
|
||||
}
|
||||
};
|
||||
|
||||
const headerLabel = currentPath.length === 0 ? step.name : currentPath.at(-1);
|
||||
const getHeaderLabel = () => {
|
||||
if (currentPath.length === 0) {
|
||||
return step.name;
|
||||
}
|
||||
|
||||
const subStepName = currentPath.at(-1);
|
||||
|
||||
if (isDefined(subStepName) && isRecordOutputSchema(step.outputSchema)) {
|
||||
return step.outputSchema.fields[subStepName].label;
|
||||
}
|
||||
|
||||
return subStepName;
|
||||
};
|
||||
|
||||
const displayedObject = getDisplayedSubStepFields();
|
||||
const options = displayedObject ? Object.entries(displayedObject) : [];
|
||||
|
||||
@ -134,7 +147,7 @@ export const WorkflowVariablesDropdownFieldItems = ({
|
||||
onClick={goBack}
|
||||
style={{ position: 'fixed' }}
|
||||
>
|
||||
<OverflowingTextWithTooltip text={headerLabel} />
|
||||
<OverflowingTextWithTooltip text={getHeaderLabel()} />
|
||||
</DropdownMenuHeader>
|
||||
<DropdownMenuSearchInput
|
||||
autoFocus
|
||||
|
||||
Reference in New Issue
Block a user