rename missing type

This commit is contained in:
nflnkr 2023-12-03 16:09:57 +03:00
parent 30e9dec88b
commit b6cd284972
5 changed files with 14 additions and 14 deletions

@ -4,7 +4,7 @@ import CytoscapeComponent from "react-cytoscapejs";
import popper from "cytoscape-popper"; import popper from "cytoscape-popper";
import { useCurrentQuiz } from "@root/quizes/hooks"; import { useCurrentQuiz } from "@root/quizes/hooks";
import { updateRootContentId } from "@root/quizes/actions" import { updateRootContentId } from "@root/quizes/actions"
import { AnyQuizQuestion } from "@model/questionTypes/shared" import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"
import { useQuestionsStore } from "@root/questions/store"; import { useQuestionsStore } from "@root/questions/store";
import { cleardragQuestionContentId, updateQuestion, updateOpenedModalSettingsId, getQuestionByContentId } from "@root/questions/actions"; import { cleardragQuestionContentId, updateQuestion, updateOpenedModalSettingsId, getQuestionByContentId } from "@root/questions/actions";
@ -135,7 +135,7 @@ export const CsComponent = ({
const cy = cyRef?.current const cy = cyRef?.current
const parentNodeChildren = cy?.$('edge[source = "' + parentNodeContentId + '"]')?.length const parentNodeChildren = cy?.$('edge[source = "' + parentNodeContentId + '"]')?.length
//если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа //если есть инфо о выбранном вопросе из модалки - берём родителя из инфо модалки. Иначе из значения дропа
const targetQuestion = { ...getQuestionByContentId(targetNodeContentId || dragQuestionContentId) } as AnyQuizQuestion const targetQuestion = { ...getQuestionByContentId(targetNodeContentId || dragQuestionContentId) } as AnyTypedQuizQuestion
if (Object.keys(targetQuestion).length !== 0 && Object.keys(targetQuestion).length !== 0 && parentNodeContentId && parentNodeChildren !== undefined) { if (Object.keys(targetQuestion).length !== 0 && Object.keys(targetQuestion).length !== 0 && parentNodeContentId && parentNodeChildren !== undefined) {
clearDataAfterAddNode({ parentNodeContentId, targetQuestion, parentNodeChildren }) clearDataAfterAddNode({ parentNodeContentId, targetQuestion, parentNodeChildren })
@ -160,7 +160,7 @@ export const CsComponent = ({
} }
} }
const clearDataAfterAddNode = ({ parentNodeContentId, targetQuestion, parentNodeChildren }: { parentNodeContentId: string, targetQuestion: AnyQuizQuestion, parentNodeChildren: number }) => { const clearDataAfterAddNode = ({ parentNodeContentId, targetQuestion, parentNodeChildren }: { parentNodeContentId: string, targetQuestion: AnyTypedQuizQuestion, parentNodeChildren: number }) => {
console.log("записываю на бек ид родителя") console.log("записываю на бек ид родителя")
console.log({ parentNodeContentId, targetQuestion, parentNodeChildren }) console.log({ parentNodeContentId, targetQuestion, parentNodeChildren })
//предупреждаем добавленный вопрос о том, кто его родитель //предупреждаем добавленный вопрос о том, кто его родитель

@ -1,4 +1,4 @@
import { AnyQuizQuestion } from "@model/questionTypes/shared" import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"
interface Nodes { interface Nodes {
data: { data: {
@ -14,7 +14,7 @@ interface Edges {
} }
} }
export const storeToNodes = (questions: AnyQuizQuestion[]) => { export const storeToNodes = (questions: AnyTypedQuizQuestion[]) => {
console.log(questions) console.log(questions)
const nodes: Nodes[] = [] const nodes: Nodes[] = []
const edges: Edges[] = [] const edges: Edges[] = []

@ -13,7 +13,7 @@ import {
useTheme, useTheme,
Checkbox, Checkbox,
} from "@mui/material"; } from "@mui/material";
import { AnyQuizQuestion, createBranchingRuleMain } from "../../../model/questionTypes/shared" import { AnyTypedQuizQuestion, createBranchingRuleMain } from "../../../model/questionTypes/shared"
import { Select } from "../Select"; import { Select } from "../Select";
import RadioCheck from "@ui_kit/RadioCheck"; import RadioCheck from "@ui_kit/RadioCheck";
@ -31,9 +31,9 @@ export default function BranchingQuestions() {
const theme = useTheme(); const theme = useTheme();
const { openedModalSettingsId } = useQuestionsStore(); const { openedModalSettingsId } = useQuestionsStore();
const [targetQuestion, setTargetQuestion] = useState<AnyQuizQuestion | null>(getQuestionById(openedModalSettingsId) || getQuestionByContentId(openedModalSettingsId)) const [targetQuestion, setTargetQuestion] = useState<AnyTypedQuizQuestion | null>(getQuestionById(openedModalSettingsId) || getQuestionByContentId(openedModalSettingsId))
console.log(targetQuestion) console.log(targetQuestion)
const [parentQuestion, setParentQuestion] = useState<AnyQuizQuestion | null>(getQuestionByContentId(targetQuestion?.content.rule.parentId)) const [parentQuestion, setParentQuestion] = useState<AnyTypedQuizQuestion | null>(getQuestionByContentId(targetQuestion?.content.rule.parentId))
console.log(parentQuestion) console.log(parentQuestion)
useLayoutEffect(() => { useLayoutEffect(() => {

@ -6,7 +6,7 @@ import { useState, useRef, useEffect } from "react";
import { useParams } from "react-router-dom"; import { useParams } from "react-router-dom";
import { useQuestionsStore } from "@root/questions/store"; import { useQuestionsStore } from "@root/questions/store";
import { updateQuestion, getQuestionById } from "@root/questions/actions"; import { updateQuestion, getQuestionById } from "@root/questions/actions";
import { AnyQuizQuestion } from "../../../model/questionTypes/shared" import { AnyTypedQuizQuestion } from "../../../model/questionTypes/shared"
import { SelectChangeEvent } from '@mui/material/Select'; import { SelectChangeEvent } from '@mui/material/Select';
import InfoIcon from "@icons/Info"; import InfoIcon from "@icons/Info";
@ -17,10 +17,10 @@ const CONDITIONS = [
"Обязательно хотя бы одно условие", "Обязательно хотя бы одно условие",
]; ];
interface Props { interface Props {
parentQuestion: AnyQuizQuestion; parentQuestion: AnyTypedQuizQuestion;
targetQuestion: AnyQuizQuestion; targetQuestion: AnyTypedQuizQuestion;
ruleIndex: number; ruleIndex: number;
setParentQuestion: (q:AnyQuizQuestion) => void; setParentQuestion: (q:AnyTypedQuizQuestion) => void;
} }
@ -518,4 +518,4 @@ const RatingInputsType = ({ parentQuestion, targetQuestion, ruleIndex, setParent
// default: ID string // default: ID string
// } // }
// } // }
// } // }

@ -248,7 +248,7 @@ export default function QuestionsPageCard({ question, draggableProps, isDragging
// removeQuestionForce(quizId, removedId); // removeQuestionForce(quizId, removedId);
// }, 5000); // }, 5000);
// updateQuestionsList<AnyQuizQuestion>(quizId, totalIndex, { // updateQuestionsList<AnyTypedQuizQuestion>(quizId, totalIndex, {
// ...question, // ...question,
// deleteTimeoutId: newTimeoutId, // deleteTimeoutId: newTimeoutId,
// }); // });