From 25ce62509bb2bc1ca51b8c47af5eccbf17d86c99 Mon Sep 17 00:00:00 2001 From: Nastya Date: Mon, 4 Dec 2023 10:50:55 +0300 Subject: [PATCH] -- --- .../Questions/BranchingMap/CsComponent.tsx | 6 +++- .../BranchingQuestionsModal.tsx | 30 +++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/pages/Questions/BranchingMap/CsComponent.tsx b/src/pages/Questions/BranchingMap/CsComponent.tsx index 6cdc66d9..d7c8e75f 100644 --- a/src/pages/Questions/BranchingMap/CsComponent.tsx +++ b/src/pages/Questions/BranchingMap/CsComponent.tsx @@ -684,10 +684,14 @@ if (e.cy().data('firstNode') !== 'root') { }} /> + ); diff --git a/src/pages/Questions/BranchingModal/BranchingQuestionsModal.tsx b/src/pages/Questions/BranchingModal/BranchingQuestionsModal.tsx index 0c140f52..ed16971d 100644 --- a/src/pages/Questions/BranchingModal/BranchingQuestionsModal.tsx +++ b/src/pages/Questions/BranchingModal/BranchingQuestionsModal.tsx @@ -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) + }} > Добавить условие