From df55d8a9d30fab4974743cf39dfdcf0454df98ed Mon Sep 17 00:00:00 2001 From: Nastya Date: Thu, 14 Dec 2023 20:58:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=82=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BA=D0=B0=D0=B7=D1=8B=D0=B2=D0=B0=D1=8E=D1=82=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D1=81=D1=8B=20=D1=83=20=D0=B4=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Questions/BranchingMap/CsComponent.tsx | 2 +- src/pages/Questions/BranchingMap/FirstNodeField.tsx | 4 ++-- src/pages/Questions/BranchingMap/helper.ts | 2 +- src/pages/Questions/ButtonsOptions.tsx | 7 ++++--- src/pages/Questions/ButtonsOptionsAndPict.tsx | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pages/Questions/BranchingMap/CsComponent.tsx b/src/pages/Questions/BranchingMap/CsComponent.tsx index 04817d41..48573745 100644 --- a/src/pages/Questions/BranchingMap/CsComponent.tsx +++ b/src/pages/Questions/BranchingMap/CsComponent.tsx @@ -178,7 +178,7 @@ function CsComponent({ { data: { id: targetQuestion.content.id, - label: targetQuestion.title || "noname" + label: targetQuestion.title === "" || targetQuestion.title === " " ? "noname" : targetQuestion.title } }, { diff --git a/src/pages/Questions/BranchingMap/FirstNodeField.tsx b/src/pages/Questions/BranchingMap/FirstNodeField.tsx index b86b713f..5bae72c1 100644 --- a/src/pages/Questions/BranchingMap/FirstNodeField.tsx +++ b/src/pages/Questions/BranchingMap/FirstNodeField.tsx @@ -19,8 +19,8 @@ export const FirstNodeField = ({ setOpenedModalQuestions, modalQuestionTargetCon useLayoutEffect(() => { updateOpenedModalSettingsId() console.log("first render firstComponent") - // updateRootContentId(quiz.id, "") - // clearRuleForAll() + updateRootContentId(quiz.id, "") + clearRuleForAll() }, []) diff --git a/src/pages/Questions/BranchingMap/helper.ts b/src/pages/Questions/BranchingMap/helper.ts index a2d8022e..0423d219 100644 --- a/src/pages/Questions/BranchingMap/helper.ts +++ b/src/pages/Questions/BranchingMap/helper.ts @@ -21,7 +21,7 @@ export const storeToNodes = (questions: AnyTypedQuizQuestion[]) => { if (question.content.rule.parentId) { nodes.push({data: { id: question.content.id, - label: question.title ? question.title : "noname" + label: question.title === "" || question.title === " " ? "noname" : question.title }}) // nodes.push({ // data: { diff --git a/src/pages/Questions/ButtonsOptions.tsx b/src/pages/Questions/ButtonsOptions.tsx index 58340ab6..54b927b4 100644 --- a/src/pages/Questions/ButtonsOptions.tsx +++ b/src/pages/Questions/ButtonsOptions.tsx @@ -44,10 +44,10 @@ export default function ButtonsOptions({ const isWrappMiniButtonSetting = useMediaQuery(theme.breakpoints.down(920)); const quiz = useCurrentQuiz(); const { questions } = useQuestionsStore.getState(); - const { openBranchingPanel } = useUiTools(); const openedModal = () => { - updateOpenedModalSettingsId(question.id); + updateOpenBranchingPanel(true); + updateDesireToOpenABranchingModal(question.content.id); }; @@ -88,7 +88,8 @@ export default function ButtonsOptions({ title: "Ветвление", value: "branching", myFunc: (question) => { - // updateOpenBranchingPanel(true); + console.log("buttons opiums") + updateOpenBranchingPanel(true); updateDesireToOpenABranchingModal(question.content.id); } }, diff --git a/src/pages/Questions/ButtonsOptionsAndPict.tsx b/src/pages/Questions/ButtonsOptionsAndPict.tsx index 16e51dc3..972e99cd 100644 --- a/src/pages/Questions/ButtonsOptionsAndPict.tsx +++ b/src/pages/Questions/ButtonsOptionsAndPict.tsx @@ -191,7 +191,8 @@ export default function ButtonsOptionsAndPict({ onMouseEnter={() => setButtonHover("branching")} onMouseLeave={() => setButtonHover("")} onClick={() => { - // updateOpenBranchingPanel(true); + console.log("buttonsOptions") + updateOpenBranchingPanel(true); updateDesireToOpenABranchingModal(question.content.id); }} sx={{