add colors to borders when building
This commit is contained in:
parent
d153df478c
commit
09907ad943
3 changed files with 29 additions and 10 deletions
|
|
@ -172,7 +172,15 @@ export default function GenericNode({
|
||||||
className={classNames(
|
className={classNames(
|
||||||
selected ? "border border-ring" : "border",
|
selected ? "border border-ring" : "border",
|
||||||
showNode ? " w-96 rounded-lg" : " w-26 h-26 rounded-full",
|
showNode ? " w-96 rounded-lg" : " w-26 h-26 rounded-full",
|
||||||
"generic-node-div"
|
"generic-node-div",
|
||||||
|
data?.build_status === BuildStatus.BUILDED &&
|
||||||
|
validationStatus &&
|
||||||
|
!validationStatus.valid
|
||||||
|
? "border-none ring ring-red-300"
|
||||||
|
: "",
|
||||||
|
data?.build_status === BuildStatus.BUILDING
|
||||||
|
? " border-none ring"
|
||||||
|
: ""
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{data.node?.beta && showNode && (
|
{data.node?.beta && showNode && (
|
||||||
|
|
@ -384,7 +392,8 @@ export default function GenericNode({
|
||||||
<div>
|
<div>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={
|
title={
|
||||||
isBuilding ? (
|
isBuilding ||
|
||||||
|
data?.build_status === BuildStatus.BUILDING ? (
|
||||||
<span>Building...</span>
|
<span>Building...</span>
|
||||||
) : !validationStatus ? (
|
) : !validationStatus ? (
|
||||||
<span className="flex">
|
<span className="flex">
|
||||||
|
|
@ -409,7 +418,7 @@ export default function GenericNode({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="generic-node-status-position flex items-center justify-center">
|
<div className="generic-node-status-position flex items-center justify-center">
|
||||||
{data?.build_status === BuildStatus.TO_BUILD ? (
|
{data?.build_status === BuildStatus.BUILDING ? (
|
||||||
<>
|
<>
|
||||||
<IconComponent
|
<IconComponent
|
||||||
name="Square"
|
name="Square"
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,9 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onBuildUpdate: handleBuildUpdate,
|
onBuildUpdate: handleBuildUpdate,
|
||||||
onBuildError: (title, list) => {
|
onBuildError: (title, list, idList) => {
|
||||||
|
useFlowStore.getState().updateBuildStatus(idList, BuildStatus.BUILDED);
|
||||||
|
|
||||||
setErrorData({ list, title });
|
setErrorData({ list, title });
|
||||||
},
|
},
|
||||||
onBuildStart: (idList) => {
|
onBuildStart: (idList) => {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ type BuildVerticesParams = {
|
||||||
onProgressUpdate?: (progress: number) => void; // Replace number with the actual type if it's not a number
|
onProgressUpdate?: (progress: number) => void; // Replace number with the actual type if it's not a number
|
||||||
onBuildUpdate?: (data: any) => void; // Replace any with the actual type of data
|
onBuildUpdate?: (data: any) => void; // Replace any with the actual type of data
|
||||||
onBuildComplete?: (allNodesValid: boolean) => void;
|
onBuildComplete?: (allNodesValid: boolean) => void;
|
||||||
onBuildError?: (title, list) => void;
|
onBuildError?: (title, list, idList: string[]) => void;
|
||||||
onBuildStart?: (idList: string[]) => void;
|
onBuildStart?: (idList: string[]) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -62,7 +62,11 @@ export async function buildVertices({
|
||||||
let data = {};
|
let data = {};
|
||||||
if (!buildData.valid) {
|
if (!buildData.valid) {
|
||||||
if (onBuildError) {
|
if (onBuildError) {
|
||||||
onBuildError("Error Building Component", [buildData.params]);
|
onBuildError(
|
||||||
|
"Error Building Component",
|
||||||
|
[buildData.params],
|
||||||
|
verticesIds
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data[buildData.id] = buildData;
|
data[buildData.id] = buildData;
|
||||||
|
|
@ -72,10 +76,14 @@ export async function buildVertices({
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (onBuildError) {
|
if (onBuildError) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
onBuildError("Error Building Component", [
|
onBuildError(
|
||||||
(error as AxiosError<any>).response?.data?.detail ??
|
"Error Building Component",
|
||||||
"Unknown Error",
|
[
|
||||||
]);
|
(error as AxiosError<any>).response?.data?.detail ??
|
||||||
|
"Unknown Error",
|
||||||
|
],
|
||||||
|
verticesIds
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue