Skip to content

Commit

Permalink
Merge pull request #476 from bento-platform/fix/manager/workflow-io-d…
Browse files Browse the repository at this point in the history
…isplay

fix(manager): clean up workflow array type display
  • Loading branch information
davidlougheed authored Jan 7, 2025
2 parents ec1bbd3 + ec41b9d commit 035e6bb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/manager/WorkflowListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ const TYPE_TAG_DISPLAY = {
};

const WorkflowInputTag = ({ id, type, children }) => {
const display = useMemo(() => TYPE_TAG_DISPLAY[type.replace("[]", "")], [type]);
const typeNoArray = type.replace("[]", "");
const display = useMemo(() => TYPE_TAG_DISPLAY[typeNoArray], [typeNoArray]);
return (
<Tag key={id} color={display.color} style={{ marginBottom: "2px" }}>
{display.icon}&nbsp;
{id} ({children || type}
{id} ({children || typeNoArray}
{type.endsWith("[]") ? " array" : ""})
</Tag>
);
Expand All @@ -77,7 +78,7 @@ const WorkflowListItem = ({ onClick, workflow, rightAlignedTags, style }) => {
.filter((i) => !i.hidden && !i.injected) // Filter out hidden/injected inputs
.map(({ id, type, pattern }) => (
<WorkflowInputTag key={id} id={id} type={type}>
{type.startsWith("file") ? (pattern ?? "") : ""}
{type.startsWith("file") && ![".*", ".+"].includes(pattern) ? (pattern ?? "") : ""}
</WorkflowInputTag>
)),
[inputs],
Expand Down

0 comments on commit 035e6bb

Please sign in to comment.