From 7dc71b91e1b2487d490084ca2c38516cd83e3164 Mon Sep 17 00:00:00 2001 From: IlyaDoronin Date: Tue, 14 May 2024 17:27:14 +0300 Subject: [PATCH] fix: requests --- src/assets/icons/CopyIcon.tsx | 9 +- src/pages/DesignPage/DesignFilling.tsx | 2 +- .../QuizInstallationCard.tsx | 11 +- .../Instructions/VKInstruction.tsx | 6 +- .../Instructions/YandexInstruction.tsx | 6 +- src/pages/Landing/HowItWorks.tsx | 5 +- .../DraggableList/QuestionPageCardTitle.tsx | 541 +++++++++--------- src/pages/ResultPage/cards/ResultCard.tsx | 68 +-- .../tariffsUtils/createTariffElements.tsx | 8 +- src/stores/results/actions.ts | 8 +- 10 files changed, 343 insertions(+), 321 deletions(-) diff --git a/src/assets/icons/CopyIcon.tsx b/src/assets/icons/CopyIcon.tsx index 16409e1e..2079ab74 100644 --- a/src/assets/icons/CopyIcon.tsx +++ b/src/assets/icons/CopyIcon.tsx @@ -4,10 +4,15 @@ interface Props { color?: string; bgcolor?: string; marL?: string; - width?: string + width?: string; } -export default function CopyIcon({ color, bgcolor, marL, width = "36px" }: Props) { +export default function CopyIcon({ + color, + bgcolor, + marL, + width = "36px", +}: Props) { const theme = useTheme(); return ( diff --git a/src/pages/DesignPage/DesignFilling.tsx b/src/pages/DesignPage/DesignFilling.tsx index 74e744be..c6cbfd42 100644 --- a/src/pages/DesignPage/DesignFilling.tsx +++ b/src/pages/DesignPage/DesignFilling.tsx @@ -122,7 +122,7 @@ export const DesignFilling = ({ width: "100%", borderRadius: "12px", height: "calc(100vh - 300px)", - mb: "76px" + mb: "76px", }} > navigator.clipboard.writeText( // TODO + onClick={() => + navigator.clipboard.writeText( + // TODO document.getElementById( - "outlined-multiline-static" - ).value - )} + "outlined-multiline-static", + ).value, + ) + } > { • Посетитель отправил заявку с заполненным полем Х: - penaquiz-formfield-X, где X — одно из полей. - Например, + penaquiz-formfield-X, где X — одно из полей. Например, @@ -163,7 +162,8 @@ export const VKPixelInstruction = () => { - penaquiz-formfield-text (это будет кастомное поле, которое вы настроили сами) + penaquiz-formfield-text (это будет кастомное поле, + которое вы настроили сами) diff --git a/src/pages/IntegrationsPage/PartnersBoard/AnalyticsModal/IntsructionsBlock/Instructions/YandexInstruction.tsx b/src/pages/IntegrationsPage/PartnersBoard/AnalyticsModal/IntsructionsBlock/Instructions/YandexInstruction.tsx index b7ba8d52..310e520f 100644 --- a/src/pages/IntegrationsPage/PartnersBoard/AnalyticsModal/IntsructionsBlock/Instructions/YandexInstruction.tsx +++ b/src/pages/IntegrationsPage/PartnersBoard/AnalyticsModal/IntsructionsBlock/Instructions/YandexInstruction.tsx @@ -132,8 +132,7 @@ export const YandexInstruction = () => { • Посетитель отправил заявку с заполненным полем Х: - penaquiz-formfield-X, где X — одно из полей. - Например, + penaquiz-formfield-X, где X — одно из полей. Например, @@ -159,7 +158,8 @@ export const YandexInstruction = () => { - penaquiz-formfield-text (это будет кастомное поле, которое вы настроили сами) + penaquiz-formfield-text (это будет кастомное поле, + которое вы настроили сами) diff --git a/src/pages/Landing/HowItWorks.tsx b/src/pages/Landing/HowItWorks.tsx index 34accaba..55b1b05b 100644 --- a/src/pages/Landing/HowItWorks.tsx +++ b/src/pages/Landing/HowItWorks.tsx @@ -168,10 +168,7 @@ export default function HowItWorks() { }} > - - {" "} - на сайте - + на сайте (function ({ return ( <> - + + setTitle(target.value || " ")} + onFocus={handleInputFocus} + onBlur={handleInputBlur} + inputProps={{ + maxLength: maxLengthTextField, + }} + InputProps={{ + startAdornment: ( + + setOpen((isOpened) => !isOpened)} + > + {IconAndrom(isExpanded, questionType)} + + setOpen(false)} + anchorRef={anchorRef} + questionId={questionId} + questionContentId={questionContentId} + questionType={questionType} + /> + + ), + endAdornment: isTextFieldtActive && + title.length >= maxLengthTextField - 7 && ( + + {title.length} + / + + {maxLengthTextField} + + + ), + }} sx={{ + flexGrow: 1, + margin: isMobile ? "10px 0" : 0, + "& .MuiInputBase-root": { + color: "#000000", + backgroundColor: isExpanded + ? theme.palette.background.default + : "transparent", + height: "48px", + borderRadius: "10px", + ".MuiOutlinedInput-notchedOutline": { + borderWidth: "1px !important", + border: !isExpanded ? "none" : null, + }, + "& .MuiInputBase-input::placeholder": { + color: "#4D4D4D", + opacity: 0.8, + }, + }, + }} + /> + + + + + + toggleExpandQuestion(questionId)} + > + {isExpanded ? ( + + ) : ( + + )} + + {isExpanded ? ( + <> + ) : ( + + copyQuestion(questionId, quizId)} + > + + + { + if (questionType === null) { + deleteQuestion(questionId); + return; + } + if (questionHasParent) { + setOpenDelete(true); + } else { + deleteQuestionWithTimeout(questionId, () => + DeleteFunction(questionId), + ); + } + }} + data-cy="delete-question" + > + + + setOpenDelete(false)}> + + + Вы удаляете вопрос, участвующий в ветвлении. Все его потомки + потеряют данные ветвления. Вы уверены, что хотите удалить + вопрос? + + + + + + + + + )} + {page !== null && ( + - - setTitle(target.value || " ")} - onFocus={handleInputFocus} - onBlur={handleInputBlur} - inputProps={{ - maxLength: maxLengthTextField, - }} - InputProps={{ - startAdornment: ( - - setOpen((isOpened) => !isOpened)} - > - {IconAndrom(isExpanded, questionType)} - - setOpen(false)} - anchorRef={anchorRef} - questionId={questionId} - questionContentId={questionContentId} - questionType={questionType} - /> - - ), - endAdornment: isTextFieldtActive && - title.length >= maxLengthTextField - 7 && ( - - {title.length} - / - {maxLengthTextField} - - ), - }} - sx={{ - flexGrow: 1, - margin: isMobile ? "10px 0" : 0, - "& .MuiInputBase-root": { - color: "#000000", - backgroundColor: isExpanded - ? theme.palette.background.default - : "transparent", - height: "48px", - borderRadius: "10px", - ".MuiOutlinedInput-notchedOutline": { - borderWidth: "1px !important", - border: !isExpanded ? "none" : null, - }, - "& .MuiInputBase-input::placeholder": { - color: "#4D4D4D", - opacity: 0.8, - }, - }, - }} - /> - - - - - - toggleExpandQuestion(questionId)} - > - {isExpanded ? ( - - ) : ( - - )} - - {isExpanded ? ( - <> - ) : ( - - copyQuestion(questionId, quizId)} - > - - - { - if (questionType === null) { - deleteQuestion(questionId); - return; - } - if (questionHasParent) { - setOpenDelete(true); - } else { - deleteQuestionWithTimeout(questionId, () => - DeleteFunction(questionId), - ); - } - }} - data-cy="delete-question" - > - - - setOpenDelete(false)}> - - - Вы удаляете вопрос, участвующий в ветвлении. Все его потомки - потеряют данные ветвления. Вы уверены, что хотите удалить - вопрос? - - - - - - - - - )} - {page !== null && ( - - {page + 1} - - )} + {page + 1} - + )} - {questionType !== null && - + {questionType !== null && ( + - ID Вопроса - {questionBackendId} - navigator.clipboard.writeText(document.querySelector("#id-copy").innerText) - } - > - - - } + padding: "0 20px 20px 20px", + }} + > + ID Вопроса + {questionBackendId} + + navigator.clipboard.writeText( + document.querySelector("#id-copy").innerText, + ) + } + > + + + + )} ); }); diff --git a/src/pages/ResultPage/cards/ResultCard.tsx b/src/pages/ResultPage/cards/ResultCard.tsx index 7fdc033a..0a3b2758 100644 --- a/src/pages/ResultPage/cards/ResultCard.tsx +++ b/src/pages/ResultPage/cards/ResultCard.tsx @@ -9,16 +9,17 @@ import { useCurrentQuiz } from "@root/quizes/hooks"; import CustomTextField from "@ui_kit/CustomTextField"; import { - Box, - IconButton, - Paper, - Button, - Typography, - TextField, - useMediaQuery, - useTheme, - FormControl, - Popover, InputAdornment, + Box, + IconButton, + Paper, + Button, + Typography, + TextField, + useMediaQuery, + useTheme, + FormControl, + Popover, + InputAdornment, } from "@mui/material"; import MiniButtonSetting from "@ui_kit/MiniButtonSetting"; @@ -260,28 +261,31 @@ export const ResultCard = ({ resultContract, resultData }: Props) => { }} > - - ID результата - {resultData.backendId} - navigator.clipboard.writeText(document.querySelector("#id-copy").innerText) - } - > - - - + + ID результата + {resultData.backendId} + + navigator.clipboard.writeText( + document.querySelector("#id-copy").innerText, + ) + } + > + + + - {currencyFormatter.format(Math.trunc(priceBeforeDiscounts) / 100)} + {currencyFormatter.format( + Math.trunc(priceBeforeDiscounts) / 100, + )} )} - {currencyFormatter.format(Math.trunc(priceAfterDiscounts) / 100)} + {currencyFormatter.format( + Math.trunc(priceAfterDiscounts) / 100, + )} } diff --git a/src/stores/results/actions.ts b/src/stores/results/actions.ts index aa6eb4e4..d1d09ef9 100644 --- a/src/stores/results/actions.ts +++ b/src/stores/results/actions.ts @@ -96,13 +96,15 @@ export const ExportResults = async ( parseFilters(filterNew, filterDate), ); - console.log(typeof data) + console.log(typeof data); - const blob = new Blob([data as BlobPart], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8" }); + const blob = new Blob([data as BlobPart], { + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", + }); const link = document.createElement("a"); link.href = window.URL.createObjectURL(data as Blob); - console.log(link) + console.log(link); link.download = `report_${new Date().getTime()}.xlsx`; link.click(); } catch (nativeError) {