--
This commit is contained in:
parent
525977609d
commit
25ce62509b
@ -684,10 +684,14 @@ if (e.cy().data('firstNode') !== 'root') {
|
||||
}}
|
||||
/>
|
||||
<button onClick={() => {
|
||||
console.log("ELEMENTS____________________________")
|
||||
console.log("NODES____________________________")
|
||||
cyRef.current?.elements().forEach((ele:any) => {
|
||||
console.log(ele.data())
|
||||
})
|
||||
}}>nodes</button>
|
||||
<button onClick={() => {
|
||||
console.log("ELEMENTS____________________________")
|
||||
console.log(questions)
|
||||
}}>elements</button>
|
||||
</>
|
||||
);
|
||||
|
||||
@ -38,20 +38,20 @@ export default function BranchingQuestions() {
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (parentQuestion.content.rule.main.length === 0) updateQuestion(parentQuestion.id, question => question.content.rule.main.push({
|
||||
next: targetQuestion.content.id,
|
||||
or: true,
|
||||
rules: [{
|
||||
question: parentQuestion.content.id,
|
||||
answers: []
|
||||
}]
|
||||
}))
|
||||
next: targetQuestion.content.id,
|
||||
or: true,
|
||||
rules: [{
|
||||
question: parentQuestion.content.id,
|
||||
answers: []
|
||||
}]
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
if (targetQuestion === null || parentQuestion === null) {
|
||||
|
||||
console.log(openedModalSettingsId)
|
||||
console.log(openedModalSettingsId)
|
||||
enqueueSnackbar("Невозможно найти данные ветвления для этого вопроса")
|
||||
return <></>
|
||||
}
|
||||
@ -59,7 +59,7 @@ export default function BranchingQuestions() {
|
||||
const saveData = () => {
|
||||
console.log(parentQuestion)
|
||||
if (parentQuestion !== null) {
|
||||
updateQuestion(parentQuestion.content.id, question => question.content = parentQuestion.content)
|
||||
updateQuestion(parentQuestion.content.id, question => question.content = parentQuestion.content)
|
||||
}
|
||||
handleClose()
|
||||
|
||||
@ -148,11 +148,11 @@ export default function BranchingQuestions() {
|
||||
marginBottom: "10px",
|
||||
cursor: "pointer"
|
||||
}}
|
||||
onClick={() => {
|
||||
const mutate = JSON.parse(JSON.stringify(parentQuestion))
|
||||
mutate.content.rule.main.push(createBranchingRuleMain(targetQuestion.content.id, parentQuestion.content.id))
|
||||
setParentQuestion(mutate)
|
||||
}}
|
||||
onClick={() => {
|
||||
const mutate = JSON.parse(JSON.stringify(parentQuestion))
|
||||
mutate.content.rule.main.push(createBranchingRuleMain(targetQuestion.content.id, parentQuestion.content.id))
|
||||
setParentQuestion(mutate)
|
||||
}}
|
||||
>
|
||||
Добавить условие
|
||||
</Link>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user