feat: question classify node support use var in instruction (#4710)
This commit is contained in:
parent
86e7c7321f
commit
a38dfc006e
4 changed files with 87 additions and 20 deletions
|
|
@ -511,7 +511,10 @@ export const getNodeUsedVars = (node: Node): ValueSelector[] => {
|
|||
break
|
||||
}
|
||||
case BlockEnum.QuestionClassifier: {
|
||||
res = [(data as QuestionClassifierNodeType).query_variable_selector]
|
||||
const payload = (data as QuestionClassifierNodeType)
|
||||
res = [payload.query_variable_selector]
|
||||
const varInInstructions = matchNotSystemVars([payload.instruction || ''])
|
||||
res.push(...varInInstructions)
|
||||
break
|
||||
}
|
||||
case BlockEnum.HttpRequest: {
|
||||
|
|
@ -726,6 +729,7 @@ export const updateNodeVars = (oldNode: Node, oldVarSelector: ValueSelector, new
|
|||
const payload = data as QuestionClassifierNodeType
|
||||
if (payload.query_variable_selector.join('.') === oldVarSelector.join('.'))
|
||||
payload.query_variable_selector = newVarSelector
|
||||
payload.instruction = replaceOldVarInText(payload.instruction, oldVarSelector, newVarSelector)
|
||||
break
|
||||
}
|
||||
case BlockEnum.HttpRequest: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue