Merge branch 'dev' into 'staging'

Dev

See merge request frontend/squiz!352
This commit is contained in:
Nastya 2024-07-10 10:40:43 +00:00
commit ee788bd8ed
7 changed files with 19 additions and 18 deletions

@ -35,7 +35,8 @@ export const getAccount = async (): Promise<[AccountResponse | null, string?]> =
return [response]; return [response];
} catch (nativeError) { } catch (nativeError) {
const [error] = parseAxiosError(nativeError); const [error] = parseAxiosError(nativeError);
return [null, `Не удалось получить информацию об аккаунте. ${error}`]; return [null, ""];
// return [null, `Не удалось получить информацию об аккаунте. ${error}`];
} }
}; };

@ -53,8 +53,8 @@ export default function Analytics() {
}); });
const resetTime = () => { const resetTime = () => {
setFrom(moment(0)); setFrom(moment(new Date(quiz.created_at)));
setTo(moment(Date.now())); setTo(moment().add(1, "days"));
}; };
useEffect(() => { useEffect(() => {

@ -66,7 +66,7 @@ const FunnelItem = ({ title, percent, index, funnel }: FunnelItemProps) => {
}, },
}} }}
> >
<IconButton {/* <IconButton
sx={{ padding: "0", margin: "5px" }} sx={{ padding: "0", margin: "5px" }}
onClick={() => expandedHC(!isExpanded)} onClick={() => expandedHC(!isExpanded)}
> >
@ -77,7 +77,7 @@ const FunnelItem = ({ title, percent, index, funnel }: FunnelItemProps) => {
rotate: isExpanded ? "180deg" : undefined rotate: isExpanded ? "180deg" : undefined
}} }}
/> />
</IconButton> </IconButton> */}
<Box <Box
sx={{ sx={{
display: "flex", display: "flex",

@ -28,7 +28,7 @@ export default function SettingsData({ questionId, isRequired, isDateRange, isTi
pt: isTablet ? "5px" : "0px", pt: isTablet ? "5px" : "0px",
}} }}
> >
<Box {/* <Box
sx={{ sx={{
boxSizing: "border-box", boxSizing: "border-box",
pt: "20px", pt: "20px",
@ -71,7 +71,7 @@ export default function SettingsData({ questionId, isRequired, isDateRange, isTi
}); });
}} }}
/> />
</Box> </Box> */}
<Box <Box
sx={{ sx={{
boxSizing: "border-box", boxSizing: "border-box",

@ -44,7 +44,7 @@ const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isR
pt: isTablet ? "5px" : "0px", pt: isTablet ? "5px" : "0px",
}} }}
> >
<Box {/* <Box
sx={{ sx={{
boxSizing: "border-box", boxSizing: "border-box",
pt: "20px", pt: "20px",
@ -93,7 +93,7 @@ const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isR
/> />
))} ))}
</RadioGroup> </RadioGroup>
</Box> </Box> */}
<Box <Box
sx={{ sx={{
boxSizing: "border-box", boxSizing: "border-box",
@ -115,7 +115,7 @@ const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isR
> >
Настройки вопросов Настройки вопросов
</Typography> </Typography>
<CustomCheckbox {/* <CustomCheckbox
dataCy="checkbox-optional-autofill" dataCy="checkbox-optional-autofill"
sx={{ sx={{
display: isMobile ? "flex" : "block", display: isMobile ? "flex" : "block",
@ -129,7 +129,7 @@ const SettingTextField = memo<SettingTextFieldProps>(function ({ questionId, isR
question.content.autofill = e.target.checked; question.content.autofill = e.target.checked;
}); });
}} }}
/> /> */}
<CustomCheckbox <CustomCheckbox
dataCy="checkbox-optional-question" dataCy="checkbox-optional-question"
sx={{ sx={{

@ -145,7 +145,7 @@ function TariffPage() {
link.href = `https://${isTestServer ? "s" : ""}hub.pena.digital/quizpayment?action=squizpay&dif=${cashDif}&data=${token}&userid=${userId}`; link.href = `https://${isTestServer ? "s" : ""}hub.pena.digital/quizpayment?action=squizpay&dif=${cashDif}&data=${token}&userid=${userId}`;
document.body.appendChild(link); document.body.appendChild(link);
console.log(link) console.log(link)
// link.click(); link.click();
return; return;
} }

@ -36,12 +36,12 @@ export const parseAxiosError = (nativeError: unknown): [string, number?] => {
// return [error.response.statusText]; // return [error.response.statusText];
// } // }
if ("statusCode" in serverError) { // if ("statusCode" in serverError) {
SEMessage = serverError?.message.toLowerCase() || ""; // SEMessage = serverError?.message.toLowerCase() || "";
} // }
if ("error" in serverError && !("statusCode" in (error.response.data as ServerError))) { // if ("error" in serverError && !("statusCode" in (error.response.data as ServerError))) {
SEMessage = serverError.error.toLowerCase() || ""; // SEMessage = serverError.error.toLowerCase() || "";
} // }
const translatedMessage = translateMessage[SEMessage || ""]?.toLowerCase(); const translatedMessage = translateMessage[SEMessage || ""]?.toLowerCase();
if (translatedMessage !== undefined) SEMessage = translatedMessage; if (translatedMessage !== undefined) SEMessage = translatedMessage;
return [SEMessage || "", serverError.statusCode]; return [SEMessage || "", serverError.statusCode];