Changed status circle to icon
This commit is contained in:
parent
4f47bf11cb
commit
5dd0df05a0
4 changed files with 53 additions and 37 deletions
|
|
@ -110,7 +110,7 @@ export default function GenericNode({
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderIconStatus = () => {
|
const renderIconStatus = () => {
|
||||||
return iconStatus;
|
return <div className="cursor-help">{iconStatus}</div>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNodeBorderClassName = (
|
const getNodeBorderClassName = (
|
||||||
|
|
@ -518,30 +518,6 @@ export default function GenericNode({
|
||||||
{showNode && (
|
{showNode && (
|
||||||
<>
|
<>
|
||||||
<div className="flex flex-shrink-0 items-center gap-2">
|
<div className="flex flex-shrink-0 items-center gap-2">
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
if (buildStatus === BuildStatus.BUILDING || isBuilding)
|
|
||||||
return;
|
|
||||||
setValidationStatus(null);
|
|
||||||
buildFlow({ stopNodeId: data.id });
|
|
||||||
}}
|
|
||||||
variant="none"
|
|
||||||
size="none"
|
|
||||||
className="group p-1"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
data-testid={
|
|
||||||
`button_run_` + data?.node?.display_name.toLowerCase()
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<IconComponent
|
|
||||||
name="Play"
|
|
||||||
className={
|
|
||||||
"h-5 w-5 fill-current stroke-2 text-muted-foreground transition-all group-hover:text-medium-indigo group-hover/node:opacity-100"
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Button>
|
|
||||||
<ShadTooltip
|
<ShadTooltip
|
||||||
content={
|
content={
|
||||||
buildStatus === BuildStatus.BUILDING ? (
|
buildStatus === BuildStatus.BUILDING ? (
|
||||||
|
|
@ -573,6 +549,30 @@ export default function GenericNode({
|
||||||
>
|
>
|
||||||
{renderIconStatus()}
|
{renderIconStatus()}
|
||||||
</ShadTooltip>
|
</ShadTooltip>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
if (buildStatus === BuildStatus.BUILDING || isBuilding)
|
||||||
|
return;
|
||||||
|
setValidationStatus(null);
|
||||||
|
buildFlow({ stopNodeId: data.id });
|
||||||
|
}}
|
||||||
|
variant="none"
|
||||||
|
size="none"
|
||||||
|
className="group p-1"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
data-testid={
|
||||||
|
`button_run_` + data?.node?.display_name.toLowerCase()
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<IconComponent
|
||||||
|
name="Play"
|
||||||
|
className={
|
||||||
|
"h-5 w-5 fill-current stroke-2 text-muted-foreground transition-all group-hover:text-medium-indigo group-hover/node:opacity-100"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
|
import ForwardedIconComponent from "../../components/genericIconComponent";
|
||||||
|
import Checkmark from "../../components/ui/checkmark";
|
||||||
import Loading from "../../components/ui/loading";
|
import Loading from "../../components/ui/loading";
|
||||||
|
import Xmark from "../../components/ui/xmark";
|
||||||
import { BuildStatus } from "../../constants/enums";
|
import { BuildStatus } from "../../constants/enums";
|
||||||
import { VertexBuildTypeAPI } from "../../types/api";
|
import { VertexBuildTypeAPI } from "../../types/api";
|
||||||
import { cn } from "../../utils/utils";
|
import { cn } from "../../utils/utils";
|
||||||
|
|
@ -21,18 +24,29 @@ const useIconStatus = (
|
||||||
return <Loading className="text-medium-indigo" />;
|
return <Loading className="text-medium-indigo" />;
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div
|
<>
|
||||||
className={cn(
|
{conditionSuccess ? (
|
||||||
"h-4 w-4 shrink-0 cursor-pointer rounded-full",
|
<Checkmark
|
||||||
conditionSuccess
|
className="h-6 w-6 stroke-2 text-status-green transition-all"
|
||||||
? "bg-status-green"
|
isVisible={true}
|
||||||
: conditionInactive
|
/>
|
||||||
? "bg-status-gray"
|
) : conditionInactive ? (
|
||||||
: conditionError
|
<ForwardedIconComponent
|
||||||
? "bg-status-red"
|
name="Ellipsis"
|
||||||
: "bg-muted-foreground/40",
|
className="h-6 w-6 fill-current stroke-2 text-status-gray opacity-30"
|
||||||
|
/>
|
||||||
|
) : conditionError ? (
|
||||||
|
<Xmark
|
||||||
|
isVisible={true}
|
||||||
|
className="h-6 w-6 fill-current stroke-2 text-status-red"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<ForwardedIconComponent
|
||||||
|
name="Ellipsis"
|
||||||
|
className="h-6 w-6 fill-current stroke-2 text-status-gray opacity-70"
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export default function Checkmark({ initial = true, isVisible, className }) {
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
fill="none"
|
fill="none"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 24 24"
|
||||||
strokeWidth={1.5}
|
strokeWidth={2}
|
||||||
stroke="currentColor"
|
stroke="currentColor"
|
||||||
className={"CheckIcon " + className}
|
className={"CheckIcon " + className}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ import {
|
||||||
Download,
|
Download,
|
||||||
DownloadCloud,
|
DownloadCloud,
|
||||||
Edit,
|
Edit,
|
||||||
|
Ellipsis,
|
||||||
Eraser,
|
Eraser,
|
||||||
ExternalLink,
|
ExternalLink,
|
||||||
Eye,
|
Eye,
|
||||||
|
|
@ -530,6 +531,7 @@ export const nodeIconsLucide: iconsType = {
|
||||||
ScreenShare,
|
ScreenShare,
|
||||||
Code,
|
Code,
|
||||||
Type,
|
Type,
|
||||||
|
Ellipsis,
|
||||||
Braces,
|
Braces,
|
||||||
FlaskConical,
|
FlaskConical,
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue