rename missing type
This commit is contained in:
parent
30e9dec88b
commit
b6cd284972
@ -4,7 +4,7 @@ import CytoscapeComponent from "react-cytoscapejs";
|
||||
import popper from "cytoscape-popper";
|
||||
import { useCurrentQuiz } from "@root/quizes/hooks";
|
||||
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 { cleardragQuestionContentId, updateQuestion, updateOpenedModalSettingsId, getQuestionByContentId } from "@root/questions/actions";
|
||||
|
||||
@ -135,7 +135,7 @@ export const CsComponent = ({
|
||||
const cy = cyRef?.current
|
||||
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) {
|
||||
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({ parentNodeContentId, targetQuestion, parentNodeChildren })
|
||||
//предупреждаем добавленный вопрос о том, кто его родитель
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { AnyQuizQuestion } from "@model/questionTypes/shared"
|
||||
import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"
|
||||
|
||||
interface Nodes {
|
||||
data: {
|
||||
@ -14,7 +14,7 @@ interface Edges {
|
||||
}
|
||||
}
|
||||
|
||||
export const storeToNodes = (questions: AnyQuizQuestion[]) => {
|
||||
export const storeToNodes = (questions: AnyTypedQuizQuestion[]) => {
|
||||
console.log(questions)
|
||||
const nodes: Nodes[] = []
|
||||
const edges: Edges[] = []
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
useTheme,
|
||||
Checkbox,
|
||||
} from "@mui/material";
|
||||
import { AnyQuizQuestion, createBranchingRuleMain } from "../../../model/questionTypes/shared"
|
||||
import { AnyTypedQuizQuestion, createBranchingRuleMain } from "../../../model/questionTypes/shared"
|
||||
import { Select } from "../Select";
|
||||
|
||||
import RadioCheck from "@ui_kit/RadioCheck";
|
||||
@ -31,9 +31,9 @@ export default function BranchingQuestions() {
|
||||
const theme = useTheme();
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
useLayoutEffect(() => {
|
||||
|
||||
@ -6,7 +6,7 @@ import { useState, useRef, useEffect } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useQuestionsStore } from "@root/questions/store";
|
||||
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 InfoIcon from "@icons/Info";
|
||||
@ -17,10 +17,10 @@ const CONDITIONS = [
|
||||
"Обязательно хотя бы одно условие",
|
||||
];
|
||||
interface Props {
|
||||
parentQuestion: AnyQuizQuestion;
|
||||
targetQuestion: AnyQuizQuestion;
|
||||
parentQuestion: AnyTypedQuizQuestion;
|
||||
targetQuestion: AnyTypedQuizQuestion;
|
||||
ruleIndex: number;
|
||||
setParentQuestion: (q:AnyQuizQuestion) => void;
|
||||
setParentQuestion: (q:AnyTypedQuizQuestion) => void;
|
||||
}
|
||||
|
||||
|
||||
@ -518,4 +518,4 @@ const RatingInputsType = ({ parentQuestion, targetQuestion, ruleIndex, setParent
|
||||
// default: ID string
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -248,7 +248,7 @@ export default function QuestionsPageCard({ question, draggableProps, isDragging
|
||||
// removeQuestionForce(quizId, removedId);
|
||||
// }, 5000);
|
||||
|
||||
// updateQuestionsList<AnyQuizQuestion>(quizId, totalIndex, {
|
||||
// updateQuestionsList<AnyTypedQuizQuestion>(quizId, totalIndex, {
|
||||
// ...question,
|
||||
// deleteTimeoutId: newTimeoutId,
|
||||
// });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user