fix(chatComponent): import processFlow function from reactflowUtils to fix reference error
fix(chatComponent): update validation check to use processFlow function to correctly count nodes fix(formModal): remove unnecessary spread operator on processFlow function call fix(reactflowUtils): update getGroupStatus function to correctly return status based on ssData
This commit is contained in:
parent
0555c6a371
commit
0192d3461d
3 changed files with 9 additions and 7 deletions
|
|
@ -10,7 +10,7 @@ import { FlowType } from "../../../types/flow";
|
||||||
import { TabsContext } from "../../../contexts/tabsContext";
|
import { TabsContext } from "../../../contexts/tabsContext";
|
||||||
import { parsedDataType } from "../../../types/components";
|
import { parsedDataType } from "../../../types/components";
|
||||||
import { TabsState } from "../../../types/tabs";
|
import { TabsState } from "../../../types/tabs";
|
||||||
import { validateNodes } from "../../../utils/reactflowUtils";
|
import { processFlow, validateNodes } from "../../../utils/reactflowUtils";
|
||||||
import RadialProgressComponent from "../../RadialProgress";
|
import RadialProgressComponent from "../../RadialProgress";
|
||||||
import IconComponent from "../../genericIconComponent";
|
import IconComponent from "../../genericIconComponent";
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ export default function BuildTrigger({
|
||||||
// Step 3: Wait for the stream to finish
|
// Step 3: Wait for the stream to finish
|
||||||
while (!finished) {
|
while (!finished) {
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
finished = validationResults.length === flow.data!.nodes.length;
|
finished = validationResults.length === processFlow(flow.data!).nodes.length;
|
||||||
}
|
}
|
||||||
// Step 4: Return true if all nodes are valid, false otherwise
|
// Step 4: Return true if all nodes are valid, false otherwise
|
||||||
return validationResults.every((result) => result);
|
return validationResults.every((result) => result);
|
||||||
|
|
|
||||||
|
|
@ -368,7 +368,7 @@ export default function FormModal({
|
||||||
tabsState[flow.id].formKeysData.template
|
tabsState[flow.id].formKeysData.template
|
||||||
);
|
);
|
||||||
sendAll({
|
sendAll({
|
||||||
...processFlow(reactFlowInstance?.toObject()!),
|
...reactFlowInstance?.toObject()!,
|
||||||
inputs: inputs!,
|
inputs: inputs!,
|
||||||
chatHistory,
|
chatHistory,
|
||||||
name: flow.name,
|
name: flow.name,
|
||||||
|
|
|
||||||
|
|
@ -921,16 +921,18 @@ export function getGroupStatus(
|
||||||
flow: FlowType,
|
flow: FlowType,
|
||||||
ssData: { [key: string]: { valid: boolean; params: string } }
|
ssData: { [key: string]: { valid: boolean; params: string } }
|
||||||
) {
|
) {
|
||||||
let Nodestatus: Array<string> = [];
|
let status = { valid: true, params: "Built sucessfully ✨" };
|
||||||
const { nodes } = flow.data!;
|
const { nodes } = flow.data!;
|
||||||
const ids = nodes.map((n: NodeType) => n.data.id);
|
const ids = nodes.map((n: NodeType) => n.data.id);
|
||||||
|
ids.forEach((id)=>console.log(ssData[id]))
|
||||||
ids.forEach((id) => {
|
ids.forEach((id) => {
|
||||||
if (!ssData[id]) {
|
if (!ssData[id]) {
|
||||||
return ssData[id];
|
status = ssData[id]
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (!ssData[id].valid) {
|
if (!ssData[id].valid) {
|
||||||
return { valid: false, params: ssData[id].params };
|
status = { valid: false, params: ssData[id].params };
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return { valid: true, params: "Built sucessfully ✨" };
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue