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