diff --git a/src/frontend/src/alerts/error/index.tsx b/src/frontend/src/alerts/error/index.tsx index ed395018e..dd3f4bba7 100644 --- a/src/frontend/src/alerts/error/index.tsx +++ b/src/frontend/src/alerts/error/index.tsx @@ -20,6 +20,7 @@ export default function ErrorAlert({ }, 5000); } }, [id, removeAlert, show]); + return (

{title}

- {list.length !== 0 ? ( + {list?.length !== 0 && list?.some(item => item !== null && item !== undefined) ? (
    {list.map((item, index) => ( diff --git a/src/frontend/src/modals/EditNodeModal/index.tsx b/src/frontend/src/modals/EditNodeModal/index.tsx index 2c2191ed4..130241ad2 100644 --- a/src/frontend/src/modals/EditNodeModal/index.tsx +++ b/src/frontend/src/modals/EditNodeModal/index.tsx @@ -269,6 +269,10 @@ export default function EditNodeModal({ data }: { data: NodeDataType }) { field_name={n} editNode={true} disabled={false} + nodeClass={data.node} + setNodeClass={(nodeClass) => { + data.node = nodeClass; + }} value={data.node.template[n].value ?? ""} onChange={(t: string) => { handleOnNewValue(t, n); diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx index ba3fb672f..9eb714c9b 100644 --- a/src/frontend/src/modals/genericModal/index.tsx +++ b/src/frontend/src/modals/genericModal/index.tsx @@ -162,7 +162,7 @@ export default function GenericModal({ setIsEdit(true); return setErrorData({ title: "There is something wrong with this prompt, please review it", - list: [error.response.data.detail], + list: [error?.response?.data?.detail], }); }); } diff --git a/src/frontend/src/modals/promptModal/index.tsx b/src/frontend/src/modals/promptModal/index.tsx index 54fd46528..a1b3aa4ba 100644 --- a/src/frontend/src/modals/promptModal/index.tsx +++ b/src/frontend/src/modals/promptModal/index.tsx @@ -4,7 +4,6 @@ import { Fragment, useContext, useRef, useState } from "react"; import { alertContext } from "../../contexts/alertContext"; import { darkContext } from "../../contexts/darkContext"; import { PopUpContext } from "../../contexts/popUpContext"; -import { checkPrompt } from "../../controllers/API"; export default function PromptAreaModal({ value, setValue, @@ -105,36 +104,6 @@ export default function PromptAreaModal({ type="button" className="node-modal-button" onClick={() => { - checkPrompt(myValue) - .then((apiReturn) => { - if (apiReturn.data) { - let inputVariables = - apiReturn.data.input_variables; - if (inputVariables.length === 0) { - setErrorData({ - title: - "The template you are attempting to use does not contain any variables for data entry.", - }); - } else { - setSuccessData({ - title: "Prompt is ready", - }); - setModalOpen(false); - setValue(myValue); - } - } else { - setErrorData({ - title: "Something went wrong, please try again", - }); - } - }) - .catch((error) => { - return setErrorData({ - title: - "There is something wrong with this prompt, please review it", - list: [error.response.data.detail], - }); - }); }} > Check & Save