Skip to content

Commit ef11837

Browse files
committed
Cleanup TaskDetails
1 parent 49d4edd commit ef11837

File tree

8 files changed

+194
-430
lines changed

8 files changed

+194
-430
lines changed

src/components/shared/ContextPanel/Blocks/LinkBlock.tsx

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/components/shared/ContextPanel/Blocks/ListBlock.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { BlockStack, InlineStack } from "@/components/ui/layout";
2+
import { Link } from "@/components/ui/link";
23
import { Heading, Paragraph } from "@/components/ui/typography";
34

4-
import { UrlBlock, type UrlBlockProps } from "./LinkBlock";
5-
65
export interface ListBlockItemProps {
76
name?: string;
8-
value?: string | UrlBlockProps;
7+
value?: string | { href: string; text: string };
98
critical?: boolean;
109
}
1110

@@ -73,8 +72,17 @@ const ListBlockItem = ({ name, value, critical }: ListBlockItemProps) => {
7372
{name}:
7473
</Paragraph>
7574
)}
76-
{isUrlBlock(value) ? (
77-
<UrlBlock href={value.href} text={value.text} />
75+
{isLink(value) ? (
76+
<Link
77+
href={value.href}
78+
size="xs"
79+
variant="classic"
80+
external
81+
target="_blank"
82+
rel="noopener noreferrer"
83+
>
84+
{value.text}
85+
</Link>
7886
) : (
7987
<Paragraph
8088
size="xs"
@@ -88,6 +96,8 @@ const ListBlockItem = ({ name, value, critical }: ListBlockItemProps) => {
8896
);
8997
};
9098

91-
const isUrlBlock = (val: string | UrlBlockProps): val is UrlBlockProps => {
99+
const isLink = (
100+
val: string | { href: string; text: string },
101+
): val is { href: string; text: string } => {
92102
return typeof val === "object" && val !== null && "href" in val;
93103
};

src/components/shared/ExecutionDetails/ExecutionDetails.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ export const ExecutionDetails = ({
102102
const executionJobLinks = getExecutionJobLinks(containerState);
103103
if (executionJobLinks) {
104104
executionJobLinks.forEach((linkInfo) => {
105+
if (!linkInfo.url) {
106+
return;
107+
}
108+
105109
items.push({
106110
name: linkInfo.name,
107111
value: { text: linkInfo.value, href: linkInfo.url },

src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskNodeCard/TaskNodeCard.tsx

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useNavigate } from "@tanstack/react-router";
22
import { useStore } from "@xyflow/react";
3-
import { CircleFadingArrowUp, CopyIcon } from "lucide-react";
43
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
54

65
import type { TooltipButtonProps } from "@/components/shared/Buttons/TooltipButton";
@@ -132,38 +131,26 @@ const TaskNodeCard = () => {
132131
const actions: Array<TooltipButtonProps> = [];
133132

134133
if (!readOnly) {
135-
actions.push(
136-
{
137-
children: (
138-
<div className="flex items-center gap-2">
139-
<CopyIcon />
140-
</div>
141-
),
142-
variant: "outline",
143-
tooltip: "Duplicate Task",
144-
onClick: callbacks.onDuplicate,
145-
},
146-
{
147-
children: (
148-
<div className="flex items-center gap-2">
149-
<CircleFadingArrowUp />
150-
</div>
151-
),
152-
variant: "outline",
153-
className: cn(isCustomComponent && "hidden"),
154-
tooltip: "Update Task from Source URL",
155-
onClick: callbacks.onUpgrade,
156-
},
157-
);
134+
actions.push({
135+
children: <Icon name="Copy" size="sm" />,
136+
variant: "outline",
137+
tooltip: "Duplicate Task",
138+
onClick: callbacks.onDuplicate,
139+
});
140+
}
141+
142+
if (!readOnly && !isCustomComponent) {
143+
actions.push({
144+
children: <Icon name="CircleFadingArrowUp" size="sm" />,
145+
variant: "outline",
146+
tooltip: "Update Task from Source URL",
147+
onClick: callbacks.onUpgrade,
148+
});
158149
}
159150

160151
if (isSubgraphNode && taskId && isSubgraphNavigationEnabled) {
161152
actions.push({
162-
children: (
163-
<div className="flex items-center gap-2">
164-
<Icon name="Workflow" size="sm" />
165-
</div>
166-
),
153+
children: <Icon name="Workflow" size="sm" />,
167154
variant: "outline",
168155
tooltip: `Enter Subgraph: ${subgraphDescription}`,
169156
onClick: () => navigateToSubgraph(taskId),
@@ -172,11 +159,7 @@ const TaskNodeCard = () => {
172159

173160
if (isInAppEditorEnabled) {
174161
actions.push({
175-
children: (
176-
<div className="flex items-center gap-2">
177-
<Icon name="FilePenLine" size="sm" />
178-
</div>
179-
),
162+
children: <Icon name="FilePenLine" size="sm" />,
180163
variant: "outline",
181164
tooltip: "Edit Component Definition",
182165
onClick: handleEditComponent,

src/components/shared/ReactFlow/FlowCanvas/TaskNode/TaskOverview/IOSection/IOCell/IOCellHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ const IOCellHeader = ({
9797
artifactData.is_dir || false,
9898
)}
9999
external
100-
iconClassName="h-2.5 w-2.5"
101-
className="font-mono break-all text-[10px] text-blue-600 hover:text-blue-800 hover:underline flex gap-1"
100+
size="sm"
101+
variant="classic"
102102
>
103103
Link
104104
</Link>

0 commit comments

Comments
 (0)