diff --git a/src/backend/langflow/template/frontend_node/prompts.py b/src/backend/langflow/template/frontend_node/prompts.py
index da5d2a300..c48628a8f 100644
--- a/src/backend/langflow/template/frontend_node/prompts.py
+++ b/src/backend/langflow/template/frontend_node/prompts.py
@@ -43,6 +43,7 @@ class PromptFrontendNode(FrontendNode):
# All prompt fields should be password=False
field.password = False
+ field.dynamic = True
class PromptTemplateNode(FrontendNode):
diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
index f41fa8068..71c3e3ab0 100644
--- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
+++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx
@@ -299,6 +299,7 @@ export default function ParameterComponent({
) : left === true && type === "code" ? (
{
data.node = nodeClass;
@@ -334,6 +335,7 @@ export default function ParameterComponent({
) : left === true && type === "prompt" ? (
{
data.node = nodeClass;
diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx
index 3efefd9ac..46bb56617 100644
--- a/src/frontend/src/CustomNodes/GenericNode/index.tsx
+++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx
@@ -74,6 +74,7 @@ export default function GenericNode({
setValidationStatus(null);
}
}, [sseData, data.id]);
+ console.log(data.node)
return (
<>
diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx
index a402fb3ed..d83383c9d 100644
--- a/src/frontend/src/components/codeAreaComponent/index.tsx
+++ b/src/frontend/src/components/codeAreaComponent/index.tsx
@@ -12,6 +12,7 @@ export default function CodeAreaComponent({
nodeClass,
dynamic,
setNodeClass,
+ readonly=false
}: CodeAreaComponentType) {
const [myValue, setMyValue] = useState(
typeof value == "string" ? value : JSON.stringify(value)
@@ -30,6 +31,7 @@ export default function CodeAreaComponent({
return (
{
if (disabled) {
@@ -22,7 +23,7 @@ export default function PromptAreaComponent({
}, [disabled]);
useEffect(() => {
- if (value !== "" && !editNode) {
+ if (value !== "" && !editNode && !readonly) {
postValidatePrompt(field_name!, value, nodeClass!).then((apiReturn) => {
if (apiReturn.data) {
setNodeClass!(apiReturn.data.frontend_node);
@@ -35,6 +36,7 @@ export default function PromptAreaComponent({
return (
-
diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx
index b29c5acf8..29d9ea3bc 100644
--- a/src/frontend/src/modals/genericModal/index.tsx
+++ b/src/frontend/src/modals/genericModal/index.tsx
@@ -34,6 +34,7 @@ export default function GenericModal({
nodeClass,
setNodeClass,
children,
+ readonly=false,
}: genericModalPropsType): JSX.Element {
const [myButtonText] = useState(buttonText);
const [myModalTitle] = useState(modalTitle);
@@ -194,7 +195,7 @@ export default function GenericModal({
"flex h-full w-full"
)}
>
- {type === TypeModal.PROMPT && isEdit ? (
+ {type === TypeModal.PROMPT && isEdit && !readonly ? (
- ) : type === TypeModal.PROMPT && !isEdit ? (
+ ) : type === TypeModal.PROMPT && (!isEdit || readonly) ? (
) : type !== TypeModal.PROMPT ? (
{
switch (myModalType) {
case TypeModal.TEXT:
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts
index fce0bb6d7..730305de2 100644
--- a/src/frontend/src/types/components/index.ts
+++ b/src/frontend/src/types/components/index.ts
@@ -65,6 +65,7 @@ export type TextAreaComponentType = {
onChange: (value: string[] | string) => void;
value: string;
editNode?: boolean;
+ readonly?: boolean;
};
export type CodeAreaComponentType = {
@@ -75,6 +76,7 @@ export type CodeAreaComponentType = {
nodeClass?: APIClassType;
setNodeClass?: (value: APIClassType) => void;
dynamic?: boolean;
+ readonly?: boolean;
};
export type FileComponentType = {
diff --git a/src/frontend/src/utils/reactflowUtils.ts b/src/frontend/src/utils/reactflowUtils.ts
index 86bb4f6fa..869f7edde 100644
--- a/src/frontend/src/utils/reactflowUtils.ts
+++ b/src/frontend/src/utils/reactflowUtils.ts
@@ -533,9 +533,6 @@ function updateGroupNodeTemplate(template: APITemplateType) {
!input_types
) {
template[key].advanced = true;
- if (template[key].dynamic) {
- template[key].readonly = true;
- }
}
});
return template;