refactor(GenericNode/index.tsx): import Loading component for better code organization and readability
fix(GenericNode/index.tsx): update the button onClick logic to prevent building flow when the build status is already set to 'BUILDING'
This commit is contained in:
parent
85a67488cc
commit
165491e60b
2 changed files with 11 additions and 6 deletions
6
src/frontend/package-lock.json
generated
6
src/frontend/package-lock.json
generated
|
|
@ -5347,9 +5347,9 @@
|
||||||
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.4.677",
|
"version": "1.4.679",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.677.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.679.tgz",
|
||||||
"integrity": "sha512-erDa3CaDzwJOpyvfKhOiJjBVNnMM0qxHq47RheVVwsSQrgBA9ZSGV9kdaOfZDPXcHzhG7lBxhj6A7KvfLJBd6Q=="
|
"integrity": "sha512-NhQMsz5k0d6m9z3qAxnsOR/ebal4NAGsrNVRwcDo4Kc/zQ7KdsTKZUxZoygHcVRb0QDW3waEDIcE3isZ79RP6g=="
|
||||||
},
|
},
|
||||||
"node_modules/emoji-regex": {
|
"node_modules/emoji-regex": {
|
||||||
"version": "8.0.0",
|
"version": "8.0.0",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import { handleKeyDown, scapedJSONStringfy } from "../../utils/reactflowUtils";
|
||||||
import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils";
|
import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils";
|
||||||
import { classNames, cn, getFieldTitle } from "../../utils/utils";
|
import { classNames, cn, getFieldTitle } from "../../utils/utils";
|
||||||
import ParameterComponent from "./components/parameterComponent";
|
import ParameterComponent from "./components/parameterComponent";
|
||||||
|
import Loading from "../../components/ui/loading";
|
||||||
|
|
||||||
export default function GenericNode({
|
export default function GenericNode({
|
||||||
data,
|
data,
|
||||||
|
|
@ -183,7 +184,7 @@ export default function GenericNode({
|
||||||
validationStatus: validationStatusType | null,
|
validationStatus: validationStatusType | null,
|
||||||
) => {
|
) => {
|
||||||
if (buildStatus === BuildStatus.BUILDING) {
|
if (buildStatus === BuildStatus.BUILDING) {
|
||||||
return getIconPlayOrPauseComponent("Square", "red-status");
|
return <Loading/>
|
||||||
} else {
|
} else {
|
||||||
const className = getStatusClassName(validationStatus);
|
const className = getStatusClassName(validationStatus);
|
||||||
return <>{getIconPlayOrPauseComponent("Play", className)}</>;
|
return <>{getIconPlayOrPauseComponent("Play", className)}</>;
|
||||||
|
|
@ -460,9 +461,13 @@ export default function GenericNode({
|
||||||
)}
|
)}
|
||||||
{showNode && (
|
{showNode && (
|
||||||
<Button
|
<Button
|
||||||
|
|
||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-9 px-1.5"
|
className={"h-9 px-1.5"}
|
||||||
onClick={() => buildFlow(data.id)}
|
onClick={() => {
|
||||||
|
if(data?.build_status === BuildStatus.BUILDING) return;
|
||||||
|
buildFlow(data.id)
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue