From fb2aed792744ea1a1a06b76fe193989a09850706 Mon Sep 17 00:00:00 2001 From: Nastya Date: Wed, 13 Dec 2023 13:53:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B8=20=D1=83=D0=B7=D0=BB=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B1=D0=B5=D0=BD=D0=BE=D0=BA=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B5=D0=BD=20=D1=80=D0=BE=D0=B4=D0=B8=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Questions/BranchingMap/CsComponent.tsx | 6 ++++++ src/pages/Questions/Emoji/settingEmoji.tsx | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/Questions/BranchingMap/CsComponent.tsx b/src/pages/Questions/BranchingMap/CsComponent.tsx index 096939b8..2dd51e94 100644 --- a/src/pages/Questions/BranchingMap/CsComponent.tsx +++ b/src/pages/Questions/BranchingMap/CsComponent.tsx @@ -157,6 +157,12 @@ function CsComponent({ }, [modalQuestionTargetContentId]) const addNode = ({ parentNodeContentId, targetNodeContentId }: { parentNodeContentId: string, targetNodeContentId?: string }) => { + + + //запрещаем работу родителя-ребенка если это один и тот же вопрос + if (parentNodeContentId === targetNodeContentId) return + + const cy = cyRef?.current const parentNodeChildren = cy?.$('edge[source = "' + parentNodeContentId + '"]')?.length //если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа diff --git a/src/pages/Questions/Emoji/settingEmoji.tsx b/src/pages/Questions/Emoji/settingEmoji.tsx index ec2753e9..da007509 100644 --- a/src/pages/Questions/Emoji/settingEmoji.tsx +++ b/src/pages/Questions/Emoji/settingEmoji.tsx @@ -85,11 +85,12 @@ export default function SettingEmoji({ question }: SettingEmojiProps) { updateQuestion(question.id, question => { + checked={question.content.required} + handleChange={({ target }) => updateQuestion(question.id, question => { if (question.type !== "emoji") return; - question.content.required = !e.target.checked; + console.log(target.checked) + question.content.required = target.checked; })} />