Merge branch 'result-page' into upload-file
This commit is contained in:
commit
11200a38ca
@ -216,6 +216,7 @@ function CsComponent({
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const removeNode = ({ targetNodeContentId }: { targetNodeContentId: string }) => {
|
||||
const deleteNodes = [] as string[]
|
||||
const deleteEdges: any = []
|
||||
@ -331,6 +332,7 @@ function CsComponent({
|
||||
}
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (startCreate) {
|
||||
addNode({ parentNodeContentId: startCreate });
|
||||
@ -734,10 +736,10 @@ function CsComponent({
|
||||
};
|
||||
|
||||
//node?.on("position", update);
|
||||
let pressed = false
|
||||
let pressed = false
|
||||
let hide = false
|
||||
cy?.on('mousedown',() => {pressed = true})
|
||||
cy?.on('mouseup',() => {
|
||||
cy?.on('mousedown', () => { pressed = true })
|
||||
cy?.on('mouseup', () => {
|
||||
pressed = false
|
||||
hide = false
|
||||
|
||||
@ -750,22 +752,22 @@ let pressed = false
|
||||
if (pc) pc.style.display = 'block'
|
||||
if (xc) xc.style.display = 'block'
|
||||
if (lc) lc.style.display = 'block'
|
||||
update()
|
||||
update()
|
||||
})
|
||||
|
||||
cy?.on('mousemove',() => {
|
||||
cy?.on('mousemove', () => {
|
||||
if (pressed && !hide) {
|
||||
hide = true
|
||||
const gc = gearsContainer.current
|
||||
if (gc) gc.style.display = 'none'
|
||||
const pc = plusesContainer.current
|
||||
const xc = crossesContainer.current
|
||||
const lc = layoutsContainer.current
|
||||
if (pc) pc.style.display = 'none'
|
||||
if (xc) xc.style.display = 'none'
|
||||
if (lc) lc.style.display = 'block'
|
||||
const pc = plusesContainer.current
|
||||
const xc = crossesContainer.current
|
||||
const lc = layoutsContainer.current
|
||||
if (pc) pc.style.display = 'none'
|
||||
if (xc) xc.style.display = 'none'
|
||||
if (lc) lc.style.display = 'block'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
cy?.on("zoom render", onZoom);
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Box } from "@mui/material"
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { updateDragQuestionContentId, updateQuestion } from "@root/questions/actions"
|
||||
import { deleteQuestion, updateDragQuestionContentId, updateQuestion } from "@root/questions/actions"
|
||||
import { updateRootContentId } from "@root/quizes/actions"
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks"
|
||||
import { useQuestionsStore } from "@root/questions/store"
|
||||
@ -11,8 +11,9 @@ interface Props {
|
||||
modalQuestionTargetContentId: string;
|
||||
}
|
||||
export const FirstNodeField = ({ setOpenedModalQuestions, modalQuestionTargetContentId }: Props) => {
|
||||
|
||||
const quiz = useCurrentQuiz();
|
||||
const { dragQuestionContentId } = useQuestionsStore()
|
||||
const { dragQuestionContentId, questions } = useQuestionsStore()
|
||||
const Container = useRef<HTMLDivElement | null>(null);
|
||||
|
||||
const modalOpen = () => setOpenedModalQuestions(true)
|
||||
@ -22,6 +23,11 @@ export const FirstNodeField = ({ setOpenedModalQuestions, modalQuestionTargetCon
|
||||
if (dragQuestionContentId) {
|
||||
updateRootContentId(quiz?.id, dragQuestionContentId)
|
||||
updateQuestion(dragQuestionContentId, (question) => question.content.rule.parentId = "root")
|
||||
//если были результаты - удалить
|
||||
questions.forEach((q) => {
|
||||
if (q.type === 'result') deleteQuestion(q.id)
|
||||
})
|
||||
|
||||
}
|
||||
} else {
|
||||
enqueueSnackbar("Нет информации о взятом опроснике")
|
||||
@ -44,6 +50,10 @@ export const FirstNodeField = ({ setOpenedModalQuestions, modalQuestionTargetCon
|
||||
if (modalQuestionTargetContentId) {
|
||||
updateRootContentId(quiz?.id, modalQuestionTargetContentId)
|
||||
updateQuestion(modalQuestionTargetContentId, (question) => question.content.rule.parentId = "root")
|
||||
//если были результаты - удалить
|
||||
questions.forEach((q) => {
|
||||
if (q.type === 'result') deleteQuestion(q.id)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
enqueueSnackbar("Нет информации о взятом опроснике")
|
||||
|
||||
@ -11,7 +11,7 @@ import {
|
||||
useMediaQuery,
|
||||
useTheme,
|
||||
} from "@mui/material";
|
||||
import { copyQuestion, deleteQuestion, updateOpenBranchingPanel, updateDesireToOpenABranchingModal } from "@root/questions/actions";
|
||||
import { copyQuestion, deleteQuestion, updateOpenBranchingPanel, updateDesireToOpenABranchingModal, updateOpenedModalSettingsId, clearRuleForAll } from "@root/questions/actions";
|
||||
import MiniButtonSetting from "@ui_kit/MiniButtonSetting";
|
||||
import { CopyIcon } from "../../assets/icons/questionsPage/CopyIcon";
|
||||
import Branching from "../../assets/icons/questionsPage/branching";
|
||||
@ -22,7 +22,7 @@ import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared";
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { useQuestionsStore } from "@root/questions/store";
|
||||
import { updateOpenedModalSettingsId } from "@root/questions/actions";
|
||||
import { updateRootContentId } from "@root/quizes/actions";
|
||||
|
||||
interface Props {
|
||||
switchState: string;
|
||||
@ -40,7 +40,7 @@ export default function ButtonsOptions({
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down(790));
|
||||
const isWrappMiniButtonSetting = useMediaQuery(theme.breakpoints.down(920));
|
||||
const quiz = useCurrentQuiz();
|
||||
const { openBranchingPanel } = useQuestionsStore.getState()
|
||||
const { questions } = useQuestionsStore.getState()
|
||||
|
||||
const openedModal = () => {
|
||||
updateOpenedModalSettingsId(question.id)
|
||||
|
||||
@ -33,7 +33,6 @@ export const ResultSettings = () => {
|
||||
isReadyToLeave = false;
|
||||
}
|
||||
});
|
||||
console.log(`setting isReadyToLeaveRef to ${isReadyToLeave}`);
|
||||
isReadyToLeaveRef.current = isReadyToLeave;
|
||||
}, [results])
|
||||
|
||||
|
||||
@ -1409,7 +1409,7 @@
|
||||
|
||||
"@frontend/kitui@^1.0.54":
|
||||
version "1.0.54"
|
||||
resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/21/packages/npm/@frontend/kitui/-/@frontend/kitui-1.0.54.tgz"
|
||||
resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/21/packages/npm/@frontend/kitui/-/@frontend/kitui-1.0.54.tgz#0235d5a8effb9b92351471c3c7775f28cb2839f6"
|
||||
integrity sha1-AjXVqO/7m5I1FHHDx3dfKMsoOfY=
|
||||
dependencies:
|
||||
immer "^10.0.2"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user