при создании узла ребенок не равен родителю
This commit is contained in:
parent
ff826e5e71
commit
fb2aed7927
@ -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
|
||||
//если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа
|
||||
|
||||
@ -85,11 +85,12 @@ export default function SettingEmoji({ question }: SettingEmojiProps) {
|
||||
<CustomCheckbox
|
||||
sx={{ mr: isMobile ? "0px" : "16px" }}
|
||||
label={"Необязательный вопрос"}
|
||||
checked={!question.required}
|
||||
handleChange={(e) => 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;
|
||||
})}
|
||||
/>
|
||||
<Box
|
||||
|
||||
Loading…
Reference in New Issue
Block a user