diff --git a/craco.config.js b/craco.config.js index fa1bc014..2ff20ab1 100755 --- a/craco.config.js +++ b/craco.config.js @@ -1,17 +1,14 @@ const CracoAlias = require("craco-alias"); module.exports = { - plugins: [ - { - plugin: CracoAlias, - options: { - source: "tsconfig", - // baseUrl SHOULD be specified - // plugin does not take it from tsconfig - baseUrl: "./src", - // tsConfigPath should point to the file where "baseUrl" and "paths" are specified - tsConfigPath: "./tsconfig.extend.json" - } - } - ] -}; \ No newline at end of file + plugins: [ + { + plugin: CracoAlias, + options: { + source: "tsconfig", + baseUrl: "./src", + tsConfigPath: "./tsconfig.extend.json", + }, + }, + ], +}; diff --git a/cypress/e2e/quizHomePageFields.cy.ts b/cypress/e2e/quizHomePageFields.cy.ts index 4336c5a0..d8c60dfd 100644 --- a/cypress/e2e/quizHomePageFields.cy.ts +++ b/cypress/e2e/quizHomePageFields.cy.ts @@ -61,8 +61,6 @@ describe("Тестирование полей главной страницы", cy.wait(500); - // cy.get('[data-cy="create-question"]').click(); - cy.get(`[data-cy="select-questiontype-images"]`).click(); cy.get( '[data-cy="checkbox-optional-question"] > .PrivateSwitchBase-input', diff --git a/cypress/e2e/quizQuestionsFields.cy.ts b/cypress/e2e/quizQuestionsFields.cy.ts index 03d3d2bb..a8a46991 100644 --- a/cypress/e2e/quizQuestionsFields.cy.ts +++ b/cypress/e2e/quizQuestionsFields.cy.ts @@ -22,7 +22,6 @@ describe("Тестирование полей вопросов", () => { cy.get('[data-cy="setup-questions"]').click(); cy.wait(500); - // cy.get('[data-cy="create-question"]').click(); cy.get(`[data-cy="select-questiontype-images"]`).click(); diff --git a/cypress/e2e/quizResultsPage.cy.ts b/cypress/e2e/quizResultsPage.cy.ts index 420bbf6d..f1fd7fdd 100644 --- a/cypress/e2e/quizResultsPage.cy.ts +++ b/cypress/e2e/quizResultsPage.cy.ts @@ -137,17 +137,5 @@ describe("Тест на появление страницы Результато cy.get("#buttonFurther").click(); cy.wait(2000); cy.get("#find-out-more-button").should("not.exist"); - - // let linkText; - - // cy.get('[data-cy="link-test"]') - // .invoke("text") - // .then((text) => { - // linkText = text; - // }); - - // cy.wait(2000).then(() => { - // cy.visit(linkText); - // }); }); }); diff --git a/src/api/auth.ts b/src/api/auth.ts index 6368bcd5..d15cc3d4 100644 --- a/src/api/auth.ts +++ b/src/api/auth.ts @@ -67,7 +67,7 @@ export async function logout(): Promise<[unknown, string?]> { } catch (nativeError) { const [error] = parseAxiosError(nativeError); - //return [null, `Не удалось выйти. ${error}`]; + return [null]; } } diff --git a/src/api/makeRequest.ts b/src/api/makeRequest.ts index a3bdef6c..b9b4c436 100644 --- a/src/api/makeRequest.ts +++ b/src/api/makeRequest.ts @@ -26,7 +26,6 @@ async function makeRequest( return response as TResponse; } catch (e) { const error = e as AxiosError; - //@ts-ignore if ( error.response?.status === 400 && error.response?.data?.message === "refreshToken is empty" diff --git a/src/api/question.ts b/src/api/question.ts index 7af6280b..3990299d 100644 --- a/src/api/question.ts +++ b/src/api/question.ts @@ -44,6 +44,7 @@ async function getQuestionList(body?: Partial) { (question) => { let data = question; for (let key in question) { + const k = key as keyof RawQuestion; //@ts-ignore if (question[key] === " ") data[key] = ""; } diff --git a/src/assets/LandingPict/notebook.tsx b/src/assets/LandingPict/notebook.tsx index bc6caea0..4b9e4fbb 100644 --- a/src/assets/LandingPict/notebook.tsx +++ b/src/assets/LandingPict/notebook.tsx @@ -141,7 +141,6 @@ export default function Notebook({ color }: Props) { = ({ data }) => { > Статистика по ответам - {/* - Фильтры - - - - */} = ({ data, funnelData }) => { const isSmallMonitor = useMediaQuery(theme.breakpoints.down(1150)); const isMobile = useMediaQuery(theme.breakpoints.down(850)); - useEffect(() => { - // const requestFunnel = async () => { - // const [funnelResponse, funnelError] = await getGeneral("14761"); - // if (funnelError) { - // enqueueSnackbar(funnelError); - // return; - // } - // if (!funnelResponse) { - // enqueueSnackbar("Воронка пуста."); - // return; - // } - // setFunnel(funnelResponse); - // }; - // requestFunnel(); - }, []); - if (!data) return ( diff --git a/src/pages/Analytics/Devices.tsx b/src/pages/Analytics/Devices.tsx index 8e7bc0c4..6fbbe9dd 100644 --- a/src/pages/Analytics/Devices.tsx +++ b/src/pages/Analytics/Devices.tsx @@ -100,28 +100,6 @@ export const Devices: FC = ({ data }) => { const isTablet = useMediaQuery(theme.breakpoints.down(1000)); const isMobile = useMediaQuery(theme.breakpoints.down(700)); - // useEffect(() => { - // const requestDevices = async () => { - // const [devicesResponse, devicesError] = await getDevices("14761"); - - // if (devicesError) { - // enqueueSnackbar(devicesError); - - // return; - // } - - // if (!devicesResponse) { - // enqueueSnackbar("Список девайсов пуст."); - - // return; - // } - - // setDevices(devicesResponse); - // }; - - // // requestDevices(); - // }, []); - return ( moment.unix(v).format("ss:mm:HH")).reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})} height={220} colors={[color]} sx={{ @@ -185,7 +184,6 @@ const GeneralItemTimeConv = ({ }, }, ]} - // dataset={Object.entries(general).map(([, v]) => moment.unix(v).format("ss:mm:HH")).reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {})} height={220} colors={[color]} sx={{ diff --git a/src/pages/ContactFormPage/BranchingForm.tsx b/src/pages/ContactFormPage/BranchingForm.tsx index 8186bbf8..e575d2c2 100644 --- a/src/pages/ContactFormPage/BranchingForm.tsx +++ b/src/pages/ContactFormPage/BranchingForm.tsx @@ -120,8 +120,6 @@ export default function BranchingForm() { component="button" variant="body2" sx={{ color: theme.palette.brightPurple.main }} - // onClick={() => { - // }} > Добавить условие diff --git a/src/pages/ContactFormPage/ContactFormPage.tsx b/src/pages/ContactFormPage/ContactFormPage.tsx index cf5c9e04..7875f7df 100644 --- a/src/pages/ContactFormPage/ContactFormPage.tsx +++ b/src/pages/ContactFormPage/ContactFormPage.tsx @@ -63,28 +63,6 @@ export default function ContactFormPage() { mt: "67px", }} > - {/**/} - {/* */} - {/* Как собрать данные посетителя*/} - {/* {" "}*/} - {/* /!* */} - {/* */} - {/* *!/*/} - {/**/} {!quiz?.config.formContact.fields.name.used && !quiz?.config.formContact.fields.email.used && !quiz?.config.formContact.fields.phone.used && @@ -162,7 +140,6 @@ function ContactFormParent({ outerContainerSx: sx, children }: Props) { > )} - {/* drawerMessengerHC(true)} - sx={{ - fontSize: "16px", - lineHeight: "19px", - color: theme.palette.brightPurple.main, - textDecorationColor: theme.palette.brightPurple.main, - textAlign: "left", - }} - > - Добавить мессенджеры - */} - ); @@ -408,17 +371,6 @@ const EmptyCard = ({ - {/* - Добавить мессенджеры - */} ); diff --git a/src/pages/ContactFormPage/NewField/NewFieldParent.tsx b/src/pages/ContactFormPage/NewField/NewFieldParent.tsx index 32b4bebc..d44da31b 100644 --- a/src/pages/ContactFormPage/NewField/NewFieldParent.tsx +++ b/src/pages/ContactFormPage/NewField/NewFieldParent.tsx @@ -80,44 +80,6 @@ export default function NewFieldParent({ )} - - {/**/} - {/* Ключ*/} - {/* {*/} - {/* updateQuiz(quiz.id, (quiz) => {*/} - {/* quiz.config.formContact.fields[defaultValue].key = target.value;*/} - {/* });*/} - {/* }}*/} - {/* placeholder="text"*/} - {/* sx={{*/} - {/* "& .css-1d3z3hw-MuiOutlinedInput-notchedOutline": {*/} - {/* border: "none",*/} - {/* },*/} - {/* "& .MuiInputBase-root": {*/} - {/* height: "48px",*/} - {/* borderRadius: "10px",*/} - {/* backgroundColor: "#EEE4FC",*/} - {/* },*/} - {/* }}*/} - {/* />*/} - {/* {*/} - {/* updateQuiz(quiz.id, (quiz) => {*/} - {/* quiz.config.formContact.fields[defaultValue].required =*/} - {/* target.checked;*/} - {/* });*/} - {/* }}*/} - {/* label={"Обязательно к заполнению"}*/} - {/* />*/} - {/**/} - {/* - Запрашивать на - - - */} {children} - {/**/} ); } -// export default function InstallQuiz() { - -// const [display, setDisplay] = React.useState("1"); -// const handleChange = (event: SelectChangeEvent) => { -// setDisplay(event.target.value); -// }; - -// const [openVk, setOpenVk] = React.useState(false); -// const handleOpenVk = () => setOpenVk(true); -// const handleCloseVk = () => setOpenVk(false); - -// const [openDom, setOpenDom] = React.useState(false); -// const handleOpenDom = () => setOpenDom(true); -// const handleCloseDom = () => setOpenDom(false); - -// const [backgroundType, setBackgroundType] = useState("text"); - -// const theme = useTheme(); - -// return ( -// <> -// -// -// -// -// Ссылка на квиз - -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - -// Не опубликован -// -// -// -// -// -// Вконтакте -// - -// Для публикации сниппета на стене группы, призывающего пройти тест. -// -// Подключить -// -// -// -// -// -// Свой домен -// -// Подключите свой домен, если хотите, чтобы квиз открывался по вашей ссылке. -// -// Подключить -// -// -// -// -// -// -// Установка квизов на сайте -// -// -// Способ установки -// -// -// -// {buttonInstall.map((e, i) => ( -// {}} -// sx={{ -// display: "flex", -// flexDirection: "column", -// justifyContent: "start", -// alignItems: "start", -// maxWidth: "205px", -// gap: "15px", -// }} -// > -// -// {e.title} -// -// {e.text} -// -// -// ))} -// -// -// -// -// -// -// -// -// -// -// -// - -// -// -// -// Добавить квиз в группу ВК -// -// -// -// 1. Добавьте приложение в сообщество -// -// -// Для публикации сниппета на стене, призывающего пройти тест, вставьте в новую запись ссылку на приложение -// -// -// -// где XXXXXXXXXXX - id вашего сообщества (полный адрес ссылки можно узнать в браузерной строке, открыв -// приложение в вашей группе -// -// - -// -// 2. Откройте квиз в группе (вы должны быть администратором группы) -// -// Справа снизу нажмите на значок "редактировать" В появившемся окне введите id квиза и нажмите -// "Привязать". Готово! Квиз привязан к группе -// -// ID этого квиза -// -// - -// -// -// -// -// -// -// - -// -// -// -// Подключить свой домен -// -// -// -// -// Подключите домен к проекту, чтобы создать несколько квизов на одном домене -// -// 1. Настройте записи в регистраторе домена -// -// setBackgroundType("text")}> -// Для поддоменов -// -// setBackgroundType("video")}> -// Для доменов -// -// - -// -// Создайте для нужного поддомена две cname-записи -// -// - -// -// -// Как подключить свой домен/поддомен к квизу? Ошибки при подключении домена -// -// - -// -// 2. Укажите домен и сохраните квиз - -// -// -// -// -// -// -// } -// label="Password" -// /> -// -// - -// -// -// Привязка домена и обновление DNS записей может занять до 48 часов -// -// -// -// -// -// -// -// -// ); -// } - const buttonInstall: { icon: string; title: string; text: string }[] = [ { icon: OnButton, diff --git a/src/pages/InstallQuiz/InstallQzCode.tsx b/src/pages/InstallQuiz/InstallQzCode.tsx index f2cd65ce..2474d0e5 100644 --- a/src/pages/InstallQuiz/InstallQzCode.tsx +++ b/src/pages/InstallQuiz/InstallQzCode.tsx @@ -67,77 +67,8 @@ export default function InstallQzCode() { }} /> - {/**/} - {/* 2. Код кнопки*/} - {/* */} - {/* Установите код в то место, где должна быть кнопка открытия quiz*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* ),*/} - {/* }}*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* {*/} - {/* // }}*/} - {/* >*/} - {/* Инструкция к платформам*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/**/} - {/* 3. Проверьте правильность установки*/} - {/* */} - {/* Введите полный адрес страницы, где вы установили quiz и нажмите*/} - {/* "проверить"*/} - {/* */} - {/**/} - {/**/} - {/* Для добавления нескольких quiz на одну страницу, код инициализации*/} - {/* достаточно добавить один раз с любого quiz, а затем вставить кнопки*/} - {/* открытия с нужных quiz*/} - {/**/} ); diff --git a/src/pages/InstallQuiz/OnButtonInstall.tsx b/src/pages/InstallQuiz/OnButtonInstall.tsx index ead1c384..20c2393d 100644 --- a/src/pages/InstallQuiz/OnButtonInstall.tsx +++ b/src/pages/InstallQuiz/OnButtonInstall.tsx @@ -15,16 +15,13 @@ export default function OnButtonInstall() { return ( <> - {/*левая часть*/} - {/*бокс с кнопкой*/} - {/*правая часть*/} - {/*левая часть*/} @@ -39,7 +38,6 @@ export default function VidjetInstall() { сохраняются. - {/*правая часть*/} Расположение diff --git a/src/pages/Landing/QuizCard.tsx b/src/pages/Landing/QuizCard.tsx new file mode 100644 index 00000000..af3a45bd --- /dev/null +++ b/src/pages/Landing/QuizCard.tsx @@ -0,0 +1,77 @@ +import { Box, Fade, Typography, useTheme, useMediaQuery } from "@mui/material"; + +import type { FC } from "react"; + +interface Iprops { + header: string; + image: string; + text: string; +} + +export const QuizCard: FC = ({ header, image, text }) => { + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(600)); + const isTablet = useMediaQuery(theme.breakpoints.down(1113)); + + return ( + + + + + {header} + + + + {text} + + + + + + + + + ); +}; diff --git a/src/pages/Landing/images/icons/YoutubeButton.tsx b/src/pages/Landing/images/icons/YoutubeButton.tsx new file mode 100644 index 00000000..95b266bf --- /dev/null +++ b/src/pages/Landing/images/icons/YoutubeButton.tsx @@ -0,0 +1,29 @@ +import { Box } from "@mui/material"; + +type Props = { + width?: number; +}; + +export default function ({ width = 120 }: Props) { + return ( + + + + + + + + + ); +} diff --git a/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx b/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx index 82297803..40794d5f 100644 --- a/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx +++ b/src/pages/Questions/AnswerDraggableList/AnswerItem.tsx @@ -105,38 +105,6 @@ const AnswerItem = memo( ), endAdornment: ( - {/**/} - {/* */} - {/**/} - {/**/} - {/* */} - {/* setQuestionVariantAnswer(e.target.value || " ")*/} - {/* }*/} - {/* onKeyDown={(*/} - {/* event: KeyboardEvent,*/} - {/* ) => event.stopPropagation()}*/} - {/* />*/} - {/**/} diff --git a/src/pages/Questions/BranchingMap/helper.ts b/src/pages/Questions/BranchingMap/helper.ts index adf021f3..de8f5ba1 100644 --- a/src/pages/Questions/BranchingMap/helper.ts +++ b/src/pages/Questions/BranchingMap/helper.ts @@ -82,13 +82,6 @@ export const storeToNodes = (questions: AnyTypedQuizQuestion[]) => { }, classes: "multiline-auto", }); - // nodes.push({ - // data: { - // id: "delete" + question.content.id, - // label: "X", - // parent: question.content.id, - // } - // },) if (question.content.rule.parentId !== "root") edges.push({ data: { diff --git a/src/pages/Questions/BranchingMap/hooks/usePopper.ts b/src/pages/Questions/BranchingMap/hooks/usePopper.ts index 0a543399..58588f1f 100644 --- a/src/pages/Questions/BranchingMap/hooks/usePopper.ts +++ b/src/pages/Questions/BranchingMap/hooks/usePopper.ts @@ -38,7 +38,6 @@ type NodeSingularWithPopper = NodeSingular & { popper: (config: PopperConfig) => PopperInstance; }; -/** @deprecated */ export const usePopper = ({ cyRef, }: { diff --git a/src/pages/Questions/BranchingModal/Settings.tsx b/src/pages/Questions/BranchingModal/Settings.tsx index b45d399a..d4fa576b 100644 --- a/src/pages/Questions/BranchingModal/Settings.tsx +++ b/src/pages/Questions/BranchingModal/Settings.tsx @@ -42,7 +42,7 @@ interface Props { setParentQuestion: (q: AnyTypedQuizQuestion) => void; } -//Этот компонент вызывается 1 раз на каждое условие родителя для перехода к этому вопросу. Поэтому для изменения стора мы знаем индекс +// Этот компонент вызывается 1 раз на каждое условие родителя для перехода к этому вопросу. Поэтому для изменения стора мы знаем индекс export const TypeSwitch = ({ parentQuestion, targetQuestion, @@ -50,10 +50,6 @@ export const TypeSwitch = ({ setParentQuestion, }: Props) => { switch (parentQuestion.type) { - // case 'nonselected': - // return - // break; - case "variant": case "images": case "varimg": @@ -69,7 +65,6 @@ export const TypeSwitch = ({ setParentQuestion={setParentQuestion} /> ); - //Реализован break; case "date": @@ -93,7 +88,6 @@ export const TypeSwitch = ({ setParentQuestion={setParentQuestion} /> ); - //Реализован break; case "page": @@ -111,7 +105,6 @@ export const TypeSwitch = ({ setParentQuestion={setParentQuestion} /> ); - //Реализован break; case "file": @@ -123,7 +116,6 @@ export const TypeSwitch = ({ setParentQuestion={setParentQuestion} /> ); - //Реализован break; case "rating": @@ -135,7 +127,6 @@ export const TypeSwitch = ({ setParentQuestion={setParentQuestion} /> ); - //Реализован break; default: @@ -292,8 +283,6 @@ const DateInputsType = ({ setParentQuestion(newParentQuestion); }, [firstDate, secondDate, firstTime, secondTime]); - // {/* //dateRange выбор диапазона дат */} - // {/* time выбор времени */} return ( )} - - {/* ) => { - - let newParentQuestion = JSON.parse(JSON.stringify(parentQuestion)) - newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[0] = Number((event.target as HTMLInputElement).value.replace(/[^0-9,\s]/g, "")) - if (newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[1] === undefined) newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[1] = 0 - setParentQuestion(newParentQuestion) - - }} - /> - {parentQuestion.content.chooseRange && - ) => { - - let newParentQuestion = JSON.parse(JSON.stringify(parentQuestion)) - newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[1] = Number((event.target as HTMLInputElement).value.replace(/[^0-9,\s]/g, "")) - if (newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[0] === undefined) newParentQuestion.content.rule.main[ruleIndex].rules[0].answers[0] = 0 - setParentQuestion(newParentQuestion) - - }} - /> - - } */} ); }; diff --git a/src/pages/Questions/ButtonsOptions.tsx b/src/pages/Questions/ButtonsOptions.tsx index ecf76879..424231ba 100644 --- a/src/pages/Questions/ButtonsOptions.tsx +++ b/src/pages/Questions/ButtonsOptions.tsx @@ -25,6 +25,8 @@ import Branching from "../../assets/icons/questionsPage/branching"; import SettingIcon from "../../assets/icons/questionsPage/settingIcon"; import { QuestionType } from "@model/question/question"; +import type { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; + interface Props { switchState: string; SSHC: (data: string) => void; @@ -88,8 +90,7 @@ const ButtonsOptions = memo(function ({ ), title: "Ветвление", value: "branching", - // @ts-ignore - myFunc: (question) => { + myFunc: (question: AnyTypedQuizQuestion) => { setOpenBranchingPage(true); updateDesireToOpenABranchingModal(question.content.id); }, diff --git a/src/pages/Questions/ButtonsOptionsAndPict.tsx b/src/pages/Questions/ButtonsOptionsAndPict.tsx index 07f6580a..8f816911 100644 --- a/src/pages/Questions/ButtonsOptionsAndPict.tsx +++ b/src/pages/Questions/ButtonsOptionsAndPict.tsx @@ -153,7 +153,6 @@ const ButtonsOptionsAndPict = memo(function ({ {isIconMobile ? null : "Ветвление"} )} - {/* */} setButtonHover("image")} onMouseLeave={() => setButtonHover("")} diff --git a/src/pages/Questions/DataOptions/settingData.tsx b/src/pages/Questions/DataOptions/settingData.tsx index dfb7382f..59044ab4 100644 --- a/src/pages/Questions/DataOptions/settingData.tsx +++ b/src/pages/Questions/DataOptions/settingData.tsx @@ -21,45 +21,6 @@ export default function SettingsData({ question }: SettingsDataProps) { flexDirection: isWrappColumn ? "column" : null, }} > - {/* - - Настройки календаря - - { - updateQuestion(question.id, question => { - if (question.type !== "date") return; - - question.content.dateRange = target.checked; - }); - }} - /> - { - updateQuestion(question.id, question => { - if (question.type !== "date") return; - - question.content.time = target.checked; - }); - }} - /> - */} - {/**/} - {/* {*/} - {/* updateQuestion(question.id, question => {*/} - {/* question.content.innerNameCheck = target.checked;*/} - {/* question.content.innerName = target.checked ? question.content.innerName : "";*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/*{question.content.innerNameCheck && (*/} - {/* setInnerName(target.value || " ")}*/} - {/* />*/} - {/*)}*/} ); diff --git a/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx b/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx index 1815e502..6e34c8cb 100644 --- a/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx +++ b/src/pages/Questions/Form/FormDraggableList/QuestionPageCard.tsx @@ -264,33 +264,6 @@ export default function QuestionsPageCard({ borderRight: "solid 1px #4D4D4D", }} > - {/* - } - checkedIcon={} - /> - } - label={""} - sx={{ - color: theme.palette.grey2.main, - ml: "-9px", - mr: 0, - userSelect: "none", - }} - /> */} copyQuestion(question.id, question.quizId)} diff --git a/src/pages/Questions/OptionsPicture/settingOpytionsPict.tsx b/src/pages/Questions/OptionsPicture/settingOpytionsPict.tsx index 52d2dca0..ee1b061a 100644 --- a/src/pages/Questions/OptionsPicture/settingOpytionsPict.tsx +++ b/src/pages/Questions/OptionsPicture/settingOpytionsPict.tsx @@ -90,7 +90,6 @@ export default SettingOptionsPict; interface Props { Icon: (props: { color: string }) => JSX.Element; - // Icon: React.ElementType; isActive?: boolean; onClick: () => void; } diff --git a/src/pages/Questions/PageOptions/PageOptions.tsx b/src/pages/Questions/PageOptions/PageOptions.tsx index 39645770..ac9b4b48 100644 --- a/src/pages/Questions/PageOptions/PageOptions.tsx +++ b/src/pages/Questions/PageOptions/PageOptions.tsx @@ -92,9 +92,6 @@ export default function PageOptions({ disableInput, question }: Props) { gap: "6px", }} > - {/* - - */} copyQuestion(question.id, question.quizId)} @@ -167,13 +164,6 @@ export default function PageOptions({ disableInput, question }: Props) { - - {/**/} - {/**/} ); } diff --git a/src/pages/Questions/PageOptions/SettingPageOptions.tsx b/src/pages/Questions/PageOptions/SettingPageOptions.tsx index a5cb8233..c219a2f7 100644 --- a/src/pages/Questions/PageOptions/SettingPageOptions.tsx +++ b/src/pages/Questions/PageOptions/SettingPageOptions.tsx @@ -35,37 +35,6 @@ export default function SettingPageOptions({ > Настройки вопроса - {/**/} - {/* */} - {/* updateQuestion(question.id, question => {*/} - {/* question.content.innerNameCheck = target.checked;*/} - {/* question.content.innerName = "";*/} - {/* })*/} - {/* }*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/*{question.content.innerNameCheck && (*/} - {/* setInnerName(target.value)}*/} - {/* />*/} - {/*)}*/} ); } diff --git a/src/pages/Questions/RatingOptions/settingRating.tsx b/src/pages/Questions/RatingOptions/settingRating.tsx index 966b9d21..6b8b79d7 100644 --- a/src/pages/Questions/RatingOptions/settingRating.tsx +++ b/src/pages/Questions/RatingOptions/settingRating.tsx @@ -175,39 +175,6 @@ export default function SettingSlider({ question }: SettingSliderProps) { }); }} /> - {/**/} - {/* {*/} - {/* updateQuestion(question.id, question => {*/} - {/* if (question.type !== "rating") return;*/} - - {/* question.content.innerNameCheck = target.checked;*/} - {/* question.content.innerName = target.checked ? question.content.innerName : "";*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/*{question.content.innerNameCheck && (*/} - {/* setInnerName(target.value)}*/} - {/* />*/} - {/*)}*/} ); diff --git a/src/pages/Questions/SliderOptions/settingSlider.tsx b/src/pages/Questions/SliderOptions/settingSlider.tsx index 045bc1a0..7ad9d712 100644 --- a/src/pages/Questions/SliderOptions/settingSlider.tsx +++ b/src/pages/Questions/SliderOptions/settingSlider.tsx @@ -97,43 +97,6 @@ export default function SettingSlider({ question }: SettingSliderProps) { }); }} /> - {/**/} - {/* {*/} - {/* updateQuestion(question.id, question => {*/} - {/* if (question.type !== "number") return;*/} - - {/* question.content.innerNameCheck = target.checked;*/} - {/* question.content.innerName = target.checked ? question.content.innerName : "";*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/*{question.content.innerNameCheck && (*/} - {/* setInnerName(target.value)}*/} - {/* />*/} - {/*)}*/} ); diff --git a/src/pages/Questions/SwitchBranchingPanel/QuestionsList.tsx b/src/pages/Questions/SwitchBranchingPanel/QuestionsList.tsx index 6f6e54a0..5950ac00 100644 --- a/src/pages/Questions/SwitchBranchingPanel/QuestionsList.tsx +++ b/src/pages/Questions/SwitchBranchingPanel/QuestionsList.tsx @@ -15,15 +15,12 @@ import { import { useUiTools } from "@root/uiTools/store"; const getItemStyle = (isDragging: any, draggableStyle: any) => ({ - // some basic styles to make the items look a bit nicer userSelect: "none", padding: 5 * 2, margin: `0 0 5px 0`, - // change background colour if dragging background: isDragging ? "lightgreen" : "grey", - // styles we need to apply on draggables ...draggableStyle, }); type AnyQuestion = UntypedQuizQuestion | AnyTypedQuizQuestion; diff --git a/src/pages/Questions/UploadFile/UploadFile.tsx b/src/pages/Questions/UploadFile/UploadFile.tsx index 26bc658f..74f73412 100644 --- a/src/pages/Questions/UploadFile/UploadFile.tsx +++ b/src/pages/Questions/UploadFile/UploadFile.tsx @@ -27,7 +27,6 @@ type DesignItem = { }; const DESIGN_TYPES: DesignItem[] = [ - // { name: "Все типы файлов", value: "all" }, { name: "Изображения", value: "picture" }, { name: "Видео", value: "video" }, { name: "Аудио", value: "audio" }, diff --git a/src/pages/Questions/UploadFile/settingUpload.tsx b/src/pages/Questions/UploadFile/settingUpload.tsx index 4bfdece1..8c82c726 100644 --- a/src/pages/Questions/UploadFile/settingUpload.tsx +++ b/src/pages/Questions/UploadFile/settingUpload.tsx @@ -35,19 +35,6 @@ export default function SettingsUpload({ question }: SettingsUploadProps) { > Настройки вопросов - {/* { - updateQuestion(question.id, question => { - question.content.autofill = target.checked; - }); - }} - /> */} - {/**/} - {/* {*/} - {/* updateQuestion(question.id, question => {*/} - {/* question.content.innerNameCheck = target.checked;*/} - {/* question.content.innerName = target.checked ? question.content.innerName : "";*/} - {/* });*/} - {/* }}*/} - {/* />*/} - {/* */} - {/* */} - {/* */} - {/* */} - {/* */} - {/**/} - {/*{question.content.innerNameCheck && (*/} - {/* setInnerName(target.value)}*/} - {/* sx={{ paddingRight: "20px" }}*/} - {/* />*/} - {/*)}*/} ); } diff --git a/src/pages/Questions/UploadImage/UploadImageModal.tsx b/src/pages/Questions/UploadImage/UploadImageModal.tsx index fe010269..23060b17 100644 --- a/src/pages/Questions/UploadImage/UploadImageModal.tsx +++ b/src/pages/Questions/UploadImage/UploadImageModal.tsx @@ -116,7 +116,7 @@ export const UploadImageModal: React.FC = ({ gap: "55px", flexDirection: isMobile ? "column" : undefined, }} - onDragEnter={handleDragEnter} // Применяем обработчик onDragEnter напрямую + onDragEnter={handleDragEnter} > @@ -130,55 +130,6 @@ export const UploadImageModal: React.FC = ({ - {/* */} - {/* */} - {/* Или выберите на фотостоке*/} - {/* */} - {/* */} - {/* */} - {/* path": { stroke: "#9A9AAF" },*/} - {/* }}*/} - {/* >*/} - {/* */} - {/* */} - {/* ),*/} - {/* }}*/} - {/* />*/} diff --git a/src/pages/Questions/branchingQuestions.tsx b/src/pages/Questions/branchingQuestions.tsx deleted file mode 100644 index 9c780bec..00000000 --- a/src/pages/Questions/branchingQuestions.tsx +++ /dev/null @@ -1,337 +0,0 @@ -import InfoIcon from "@icons/Info"; -import { DeleteIcon } from "@icons/questionsPage/deleteIcon"; -import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -import { - Box, - Button, - Chip, - FormControl, - FormControlLabel, - IconButton, - Link, - Modal, - Radio, - RadioGroup, - Tooltip, - Typography, - useTheme, -} from "@mui/material"; -import { updateQuestion } from "@root/questions/actions"; -import RadioCheck from "@ui_kit/RadioCheck"; -import RadioIcon from "@ui_kit/RadioIcon"; -import { useEffect, useRef, useState } from "react"; -import { Select } from "./Select"; - -type BranchingQuestionsProps = { - question: AnyTypedQuizQuestion; -}; - -const ACTIONS = ["Показать", "Скрыть"]; -const STIPULATIONS = ["Условие 1", "Условие 2", "Условие 3"]; -const ANSWERS = ["Ответ 1", "Ответ 2", "Ответ 3"]; -const CONDITIONS = [ - "Все условия обязательны", - "Обязательно хотя бы одно условие", -]; - -export default function BranchingQuestions({ - question, -}: BranchingQuestionsProps) { - const theme = useTheme(); - const [title, setTitle] = useState(""); - const [titleInputWidth, setTitleInputWidth] = useState(0); - const titleRef = useRef(null); - - useEffect(() => { - setTitleInputWidth(titleRef.current?.offsetWidth || 0); - }, [title]); - - const handleClose = () => { - updateQuestion(question.id, (question) => { - question.openedModalSettings = false; - }); - }; - - return ( - <> - - - {/* - - ( - - - {title} - - setTitle(target.value)} - style={{ - width: titleInputWidth ? titleInputWidth : 170, - outline: "none", - background: "transparent", - border: "none", - fontSize: "18px", - minWidth: "50px", - maxWidth: "500px", - fontFamily: "Rubik", - transition: ".2s", - }} - /> - - ) - - - - - - - - - - { - updateQuestion(question.id, question => { - question.content.rule.reqs[index].id = String( - STIPULATIONS.findIndex((item) => item.includes(stipulation)) - ); - }); - }} - sx={{ marginBottom: "15px" }} - /> - {request.id && ( - <> - - - Дан ответ - - - (Укажите один или несколько вариантов) - - -