added field_name attribute
This commit is contained in:
parent
00f4726f38
commit
77a1a9c065
3 changed files with 10 additions and 6 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { useContext, useState } from "react";
|
||||
import { TabsContext } from "../../../../contexts/tabsContext";
|
||||
import { useState } from "react";
|
||||
import InputListComponent from "../../../../components/inputListComponent";
|
||||
import Dropdown from "../../../../components/dropdownComponent";
|
||||
import TextAreaComponent from "../../../../components/textAreaComponent";
|
||||
|
|
@ -150,6 +149,7 @@ export default function ModalField({
|
|||
) : type === "prompt" ? (
|
||||
<div className="w-1/2">
|
||||
<PromptAreaComponent
|
||||
field_name={name}
|
||||
disabled={false}
|
||||
value={data.node.template[name].value ?? ""}
|
||||
onChange={(t: string) => {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import { FileText } from "lucide-react";
|
|||
import { APIClassType } from "../../types/api";
|
||||
|
||||
export default function GenericModal({
|
||||
field_name = "",
|
||||
value,
|
||||
setValue,
|
||||
buttonText,
|
||||
|
|
@ -27,6 +28,7 @@ export default function GenericModal({
|
|||
nodeClass,
|
||||
setNodeClass,
|
||||
}: {
|
||||
field_name?: string;
|
||||
setValue: (value: string) => void;
|
||||
value: string;
|
||||
buttonText: string;
|
||||
|
|
@ -60,8 +62,8 @@ export default function GenericModal({
|
|||
<DialogTitle className="flex items-center">
|
||||
<span className="pr-2">{myModalTitle}</span>
|
||||
<FileText
|
||||
strokeWidth={1.5}
|
||||
className="h-6 w-6 text-primary pl-1 "
|
||||
strokeWidth={1.5}
|
||||
className="h-6 w-6 pl-1 text-primary "
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</DialogTitle>
|
||||
|
|
@ -84,7 +86,7 @@ export default function GenericModal({
|
|||
<div className="mt-2 flex h-full w-full">
|
||||
<Textarea
|
||||
ref={ref}
|
||||
className=" h-[300px] w-full form-primary "
|
||||
className=" form-primary h-[300px] w-full "
|
||||
value={myValue}
|
||||
onChange={(e) => {
|
||||
setMyValue(e.target.value);
|
||||
|
|
@ -103,7 +105,8 @@ export default function GenericModal({
|
|||
setModalOpen(false);
|
||||
break;
|
||||
case 2:
|
||||
postValidatePrompt(myValue, nodeClass)
|
||||
console.log("postValidatePrompt");
|
||||
postValidatePrompt(field_name, myValue, nodeClass)
|
||||
.then((apiReturn) => {
|
||||
if (apiReturn.data) {
|
||||
setNodeClass(apiReturn.data.frontend_node);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ export type InputListComponentType = {
|
|||
};
|
||||
|
||||
export type TextAreaComponentType = {
|
||||
field_name?: string;
|
||||
nodeClass?: APIClassType;
|
||||
setNodeClass?: (value: APIClassType) => void;
|
||||
disabled: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue