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=="
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.677",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.677.tgz",
|
||||
"integrity": "sha512-erDa3CaDzwJOpyvfKhOiJjBVNnMM0qxHq47RheVVwsSQrgBA9ZSGV9kdaOfZDPXcHzhG7lBxhj6A7KvfLJBd6Q=="
|
||||
"version": "1.4.679",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.679.tgz",
|
||||
"integrity": "sha512-NhQMsz5k0d6m9z3qAxnsOR/ebal4NAGsrNVRwcDo4Kc/zQ7KdsTKZUxZoygHcVRb0QDW3waEDIcE3isZ79RP6g=="
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import { handleKeyDown, scapedJSONStringfy } from "../../utils/reactflowUtils";
|
|||
import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils";
|
||||
import { classNames, cn, getFieldTitle } from "../../utils/utils";
|
||||
import ParameterComponent from "./components/parameterComponent";
|
||||
import Loading from "../../components/ui/loading";
|
||||
|
||||
export default function GenericNode({
|
||||
data,
|
||||
|
|
@ -183,7 +184,7 @@ export default function GenericNode({
|
|||
validationStatus: validationStatusType | null,
|
||||
) => {
|
||||
if (buildStatus === BuildStatus.BUILDING) {
|
||||
return getIconPlayOrPauseComponent("Square", "red-status");
|
||||
return <Loading/>
|
||||
} else {
|
||||
const className = getStatusClassName(validationStatus);
|
||||
return <>{getIconPlayOrPauseComponent("Play", className)}</>;
|
||||
|
|
@ -460,9 +461,13 @@ export default function GenericNode({
|
|||
)}
|
||||
{showNode && (
|
||||
<Button
|
||||
|
||||
variant="outline"
|
||||
className="h-9 px-1.5"
|
||||
onClick={() => buildFlow(data.id)}
|
||||
className={"h-9 px-1.5"}
|
||||
onClick={() => {
|
||||
if(data?.build_status === BuildStatus.BUILDING) return;
|
||||
buildFlow(data.id)
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<Tooltip
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue