fix(parameterComponent): update readonly condition to only check for data.node?.flow
fix(promptComponent): prevent update from prompt template after group node if prompt is wrongly marked as not dynamic fix(EditNodeModal): update readonly condition to only check for myData.current.node?.flow
This commit is contained in:
parent
5a5ed630ed
commit
337f0f8794
3 changed files with 4 additions and 12 deletions
|
|
@ -438,11 +438,7 @@ export default function ParameterComponent({
|
||||||
) : left === true && type === "prompt" ? (
|
) : left === true && type === "prompt" ? (
|
||||||
<div className="mt-2 w-full">
|
<div className="mt-2 w-full">
|
||||||
<PromptAreaComponent
|
<PromptAreaComponent
|
||||||
readonly={
|
readonly={data.node?.flow ? true : false}
|
||||||
data.node?.flow && data.node.template[name].dynamic
|
|
||||||
? true
|
|
||||||
: false
|
|
||||||
}
|
|
||||||
field_name={name}
|
field_name={name}
|
||||||
setNodeClass={(nodeClass) => {
|
setNodeClass={(nodeClass) => {
|
||||||
data.node = nodeClass;
|
data.node = nodeClass;
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ export default function PromptAreaComponent({
|
||||||
}, [disabled]);
|
}, [disabled]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value !== "" && !editNode && !readonly) {
|
//prevent update from prompt template after group node if prompt is wrongly marked as not dynamic
|
||||||
|
if (value !== "" && !editNode && !readonly && !nodeClass?.flow) {
|
||||||
postValidatePrompt(field_name!, value, nodeClass!).then((apiReturn) => {
|
postValidatePrompt(field_name!, value, nodeClass!).then((apiReturn) => {
|
||||||
if (apiReturn.data) {
|
if (apiReturn.data) {
|
||||||
setNodeClass!(apiReturn.data.frontend_node);
|
setNodeClass!(apiReturn.data.frontend_node);
|
||||||
|
|
|
||||||
|
|
@ -438,12 +438,7 @@ const EditNodeModal = forwardRef(
|
||||||
<div className="mx-auto">
|
<div className="mx-auto">
|
||||||
<PromptAreaComponent
|
<PromptAreaComponent
|
||||||
readonly={
|
readonly={
|
||||||
myData.current.node?.flow &&
|
myData.current.node?.flow ? true : false
|
||||||
myData.current.node.template[
|
|
||||||
templateParam
|
|
||||||
].dynamic
|
|
||||||
? true
|
|
||||||
: false
|
|
||||||
}
|
}
|
||||||
field_name={templateParam}
|
field_name={templateParam}
|
||||||
editNode={true}
|
editNode={true}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue