при создании узла ребенок не равен родителю
This commit is contained in:
parent
ff826e5e71
commit
fb2aed7927
@ -157,6 +157,12 @@ function CsComponent({
|
|||||||
}, [modalQuestionTargetContentId])
|
}, [modalQuestionTargetContentId])
|
||||||
|
|
||||||
const addNode = ({ parentNodeContentId, targetNodeContentId }: { parentNodeContentId: string, targetNodeContentId?: string }) => {
|
const addNode = ({ parentNodeContentId, targetNodeContentId }: { parentNodeContentId: string, targetNodeContentId?: string }) => {
|
||||||
|
|
||||||
|
|
||||||
|
//запрещаем работу родителя-ребенка если это один и тот же вопрос
|
||||||
|
if (parentNodeContentId === targetNodeContentId) return
|
||||||
|
|
||||||
|
|
||||||
const cy = cyRef?.current
|
const cy = cyRef?.current
|
||||||
const parentNodeChildren = cy?.$('edge[source = "' + parentNodeContentId + '"]')?.length
|
const parentNodeChildren = cy?.$('edge[source = "' + parentNodeContentId + '"]')?.length
|
||||||
//если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа
|
//если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа
|
||||||
|
|||||||
@ -85,11 +85,12 @@ export default function SettingEmoji({ question }: SettingEmojiProps) {
|
|||||||
<CustomCheckbox
|
<CustomCheckbox
|
||||||
sx={{ mr: isMobile ? "0px" : "16px" }}
|
sx={{ mr: isMobile ? "0px" : "16px" }}
|
||||||
label={"Необязательный вопрос"}
|
label={"Необязательный вопрос"}
|
||||||
checked={!question.required}
|
checked={question.content.required}
|
||||||
handleChange={(e) => updateQuestion(question.id, question => {
|
handleChange={({ target }) => updateQuestion(question.id, question => {
|
||||||
if (question.type !== "emoji") return;
|
if (question.type !== "emoji") return;
|
||||||
|
|
||||||
question.content.required = !e.target.checked;
|
console.log(target.checked)
|
||||||
|
question.content.required = target.checked;
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<Box
|
<Box
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user