From f041498d058bee438c3e443a5f6f44d9ccb5eeff Mon Sep 17 00:00:00 2001 From: Nastya Date: Wed, 8 May 2024 01:27:57 +0300 Subject: [PATCH 1/7] =?UTF-8?q?up=20version=20publication=20&&=20=D0=BE?= =?UTF-8?q?=D1=82=D1=81=D1=82=D1=83=D0=BF=20=D0=B2=20=D0=B4=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D0=B9=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/pages/DesignPage/DesignFilling.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 87493c39..af12ffe6 100755 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@frontend/kitui": "^1.0.82", - "@frontend/squzanswerer": "^1.0.37", + "@frontend/squzanswerer": "^1.0.38", "@mui/icons-material": "^5.10.14", "@mui/material": "^5.10.14", "@mui/x-charts": "^6.19.5", diff --git a/src/pages/DesignPage/DesignFilling.tsx b/src/pages/DesignPage/DesignFilling.tsx index ade55b80..74e744be 100644 --- a/src/pages/DesignPage/DesignFilling.tsx +++ b/src/pages/DesignPage/DesignFilling.tsx @@ -122,6 +122,7 @@ export const DesignFilling = ({ width: "100%", borderRadius: "12px", height: "calc(100vh - 300px)", + mb: "76px" }} > Date: Fri, 10 May 2024 16:50:27 +0300 Subject: [PATCH 2/7] fix: images route --- src/App.tsx | 2 +- yarn.lock | 81 +++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 9b451632..1ce92906 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -283,8 +283,8 @@ export default function App() { path={"/qaz"} element={} />} /> + } /> }> - } /> {routeslink.map((e, i) => ( Date: Fri, 10 May 2024 16:52:55 +0300 Subject: [PATCH 3/7] fix --- yarn.lock | 81 +++++-------------------------------------------------- 1 file changed, 6 insertions(+), 75 deletions(-) diff --git a/yarn.lock b/yarn.lock index 51c9ffbe..9785f209 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1121,14 +1121,6 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime-corejs3@^7.24.4": - version "7.24.5" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.24.5.tgz#d2a5f46a088caf8f3899ad095054f83b0a686194" - integrity sha512-GWO0mgzNMLWaSYM4z4NVIuY0Cd1fl8cPnuetuddu5w/qGuvt5Y7oUi/kvvQGK9xgOkFJDQX2heIvTRn/OQ1XTg== - dependencies: - core-js-pure "^3.30.2" - regenerator-runtime "^0.14.0" - "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.24.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd" @@ -1527,19 +1519,16 @@ immer "^10.0.2" reconnecting-eventsource "^1.6.2" -"@frontend/squzanswerer@^1.0.38": - version "1.0.38" - resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/@frontend/squzanswerer/-/@frontend/squzanswerer-1.0.38.tgz#51f382368d73f9ad36c4f7f3357dedb32d5453e8" - integrity sha1-UfOCNo1z+a02xPfzNX3tsy1UU+g= +"@frontend/squzanswerer@^1.0.37": + version "1.0.37" + resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/@frontend/squzanswerer/-/@frontend/squzanswerer-1.0.37.tgz#76d6b90488b3d42e83bd37c9c8e0dc6ccd47e76f" + integrity sha1-dta5BIiz1C6DvTfJyODcbM1H528= dependencies: bowser "1.9.4" country-flag-emoji-polyfill "^0.1.8" current-device "^0.10.2" hex-rgb "^5.0.0" mobile-detect "^1.4.5" - mui-tel-input "^5.1.2" - react-imask "^7.6.0" - react-phone-number-input "^3.4.1" "@humanwhocodes/config-array@^0.11.14": version "0.11.14" @@ -2600,13 +2589,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.96.tgz#eb0012d23ff53d14d64ec8a352bf89792de6aade" integrity sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ== -"@types/node@^20.11.17": - version "20.12.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be" - integrity sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw== - dependencies: - undici-types "~5.26.4" - "@types/parse-json@^4.0.0": version "4.0.2" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" @@ -3926,7 +3908,7 @@ cjs-module-lexer@^1.0.0: resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz#6c370ab19f8a3394e318fe682686ec0ac684d107" integrity sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ== -classnames@^2.2.5, classnames@^2.5.1: +classnames@^2.2.5: version "2.5.1" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.5.1.tgz#ba774c614be0f016da105c858e7159eae8e7687b" integrity sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow== @@ -4194,7 +4176,7 @@ core-js-compat@^3.31.0, core-js-compat@^3.36.1: dependencies: browserslist "^4.23.0" -core-js-pure@^3.23.3, core-js-pure@^3.30.2: +core-js-pure@^3.23.3: version "3.37.0" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.37.0.tgz#ce99fb4a7cec023fdbbe5b5bd1f06bbcba83316e" integrity sha512-d3BrpyFr5eD4KcbRvQ3FTUx/KWmaDesr7+a3+1+P46IUnNoEt+oiLijPINZMEon7w9oGkIINWxrBAU9DEciwFQ== @@ -4249,11 +4231,6 @@ country-flag-emoji-polyfill@^0.1.8: resolved "https://registry.yarnpkg.com/country-flag-emoji-polyfill/-/country-flag-emoji-polyfill-0.1.8.tgz#d2cfb23dd2f949b80d83eb9822b613bf62957173" integrity sha512-Mbah52sADS3gshUYhK5142gtUuJpHYOXlXtLFI3Ly4RqgkmPMvhX9kMZSTqDM8P7UqtSW99eHKFphhQSGXA3Cg== -country-flag-icons@^1.5.11: - version "1.5.11" - resolved "https://registry.yarnpkg.com/country-flag-icons/-/country-flag-icons-1.5.11.tgz#04c0556728e517a6207946656355698ac6237080" - integrity sha512-B+mvFywunkRJs270k7kCBjhogvIA0uNn6GAXv6m2cPn3rrwqZzZVr2gBWcz+Cz7OGVWlcbERlYRIX0S6OGr8Bw== - craco-alias@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/craco-alias/-/craco-alias-3.0.1.tgz#45e5cb338b222a7f62d17e398b54aff7cf1572af" @@ -6532,13 +6509,6 @@ ignore@^5.2.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== -imask@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/imask/-/imask-7.6.0.tgz#ed071748cfdf6b12ac153f69878e08c4333df984" - integrity sha512-6EHsq1q7v5+M4Vas2MGrs2oRpxPRWPwPDiL0HmG1ikBI/0hOwvkxRhVRFQnWIlZcTG7R8iw0az5V+z868qnQ9A== - dependencies: - "@babel/runtime-corejs3" "^7.24.4" - immediate@~3.0.5: version "3.0.6" resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" @@ -6608,13 +6578,6 @@ ini@^1.3.5: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -input-format@^0.3.10: - version "0.3.10" - resolved "https://registry.yarnpkg.com/input-format/-/input-format-0.3.10.tgz#e8a8855e2e89e3b1cd995333f6277c14865f0e35" - integrity sha512-5cFv/kOZD7Ch0viprVkuYPDkAU7HBZYBx8QrIpQ6yXUWbAQ0+RQ8IIojDJOf/RO6FDJLL099HDSK2KoVZ2zevg== - dependencies: - prop-types "^15.8.1" - internal-slot@^1.0.4, internal-slot@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" @@ -7814,11 +7777,6 @@ levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libphonenumber-js@^1.10.55, libphonenumber-js@^1.10.61: - version "1.11.1" - resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.11.1.tgz#2596683e1876bfee74082bb49339fe0a85ae34f9" - integrity sha512-Wze1LPwcnzvcKGcRHFGFECTaLzxOtujwpf924difr5zniyYv1C2PiW0419qDR7m8lKDxsImu5mwxFuXhXpjmvw== - lie@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" @@ -8232,14 +8190,6 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -mui-tel-input@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/mui-tel-input/-/mui-tel-input-5.1.2.tgz#3e26a3cbe63e10ceed4d6226079fdeafa0257579" - integrity sha512-KVco/YT8oFzkuAHvNR8S7kjMzDubGDAY/aUgqI0GnOQb3DXkKgyPIQpwfaO1WLtUgM8whGJqH2onAefOfihHYA== - dependencies: - "@types/node" "^20.11.17" - libphonenumber-js "^1.10.55" - multicast-dns@^7.2.5: version "7.2.5" resolved "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-7.2.5.tgz#77eb46057f4d7adbd16d9290fa7299f6fa64cced" @@ -9638,14 +9588,6 @@ react-image-file-resizer@^0.4.8: resolved "https://registry.yarnpkg.com/react-image-file-resizer/-/react-image-file-resizer-0.4.8.tgz#85f4ae4469fd2867d961568af660ef403d7a79af" integrity sha512-Ue7CfKnSlsfJ//SKzxNMz8avDgDSpWQDOnTKOp/GNRFJv4dO9L5YGHNEnj40peWkXXAK2OK0eRIoXhOYpUzUTQ== -react-imask@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/react-imask/-/react-imask-7.6.0.tgz#5948fc39e1d7d036292d4fade43df4636d43e7b7" - integrity sha512-SilPct67Xw4TN+dqn3SM4BVpy+FwNSeT0wblA/DXQ3El2KPBEWwrn4x3gQ39ZohFAphp7yG7w6gSKq5SeR/6Kg== - dependencies: - imask "^7.6.0" - prop-types "^15.8.1" - react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -9666,17 +9608,6 @@ react-lazily@^0.9.2: resolved "https://registry.yarnpkg.com/react-lazily/-/react-lazily-0.9.2.tgz#74596dbde43c8e0f607445da5c4839cf6cc48ab5" integrity sha512-oBVRDQ+SuMPWenBO/0Kq+iZk34lOYJEmjiTto4bYRufndf8pux3E50BT3mJZbsq0vBsAVbX3fpQjlUvsXgDVag== -react-phone-number-input@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/react-phone-number-input/-/react-phone-number-input-3.4.1.tgz#c9a73cace2ac4a7c5fd625e1020baae7607a4d49" - integrity sha512-guuenZqU/DYvDBFzFdTrppC4rs+q5ybTFHrxEo9VGvX0pPLWM4ZXlRa0llT7LRAvfxX8RjQNnQkkCiTHTzhLZA== - dependencies: - classnames "^2.5.1" - country-flag-icons "^1.5.11" - input-format "^0.3.10" - libphonenumber-js "^1.10.61" - prop-types "^15.8.1" - react-redux@^7.2.0: version "7.2.9" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.9.tgz#09488fbb9416a4efe3735b7235055442b042481d" From 1a8fb106bc2d1f936394fadcd861192c8db490df Mon Sep 17 00:00:00 2001 From: Nastya Date: Sat, 11 May 2024 21:37:59 +0300 Subject: [PATCH 4/7] =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=A4=D0=9B=20?= =?UTF-8?q?=D0=B0=D0=BA=D0=BA=20=D0=B8=20=D0=BA=D0=B0=D1=81=D1=82=D0=BE?= =?UTF-8?q?=D0=BC=D0=B5=D1=80=20=D0=B0=D0=BA=D0=BA=20=D0=BD=D0=B5=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui_kit/CheckFastlink.tsx | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/ui_kit/CheckFastlink.tsx b/src/ui_kit/CheckFastlink.tsx index b54aa09f..6eb7060a 100644 --- a/src/ui_kit/CheckFastlink.tsx +++ b/src/ui_kit/CheckFastlink.tsx @@ -12,18 +12,20 @@ import { parseAxiosError } from "@utils/parse-error"; import type { Discount } from "@model/discounts"; export function CheckFastlink() { - const userId = useUserStore((state) => state.userId); + const user = useUserStore(); const [discounts, setDiscounts] = useState([]); const [askToChange, setAskToChange] = useState(false); const [promocode, setPromocode] = useState(""); - + console.log( + user.userAccount, + user.customerAccount) useEffect(() => { const get = async () => { - if (!userId) { + if (!user.userId) { return; } - const [discounts] = await getDiscounts(userId); + const [discounts] = await getDiscounts(user.userId); if (discounts?.length) { setDiscounts(discounts); @@ -75,16 +77,19 @@ export function CheckFastlink() { if (flLS !== null && flLS.length > 0) { setPromocode(flLS); - if (userId !== null) { + if (user.userId !== null) { //У нас есть промокод и юзер авторизован. Проверяем есть ли у него применённый промокод - if (discounts?.find((e) => e.Condition.User === userId)) { - setAskToChange(true); - } else { - fetchPromocode(); + //Проверяем были ли запросы на аккаунт и кастомер аккаунт + if (user.userAccount !== null && user.customerAccount !== null) { + if (discounts?.find((e) => e.Condition.User === user.userId)) { + setAskToChange(true); + } else { + fetchPromocode(); + } } } } - }, [userId, discounts]); + }, [user.userId, discounts]); return ( Date: Sat, 11 May 2024 22:08:05 +0300 Subject: [PATCH 5/7] -- --- src/ui_kit/CheckFastlink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui_kit/CheckFastlink.tsx b/src/ui_kit/CheckFastlink.tsx index 6eb7060a..7480d4a9 100644 --- a/src/ui_kit/CheckFastlink.tsx +++ b/src/ui_kit/CheckFastlink.tsx @@ -89,7 +89,7 @@ export function CheckFastlink() { } } } - }, [user.userId, discounts]); + }, [user.userId, discounts, user]); return ( Date: Sat, 11 May 2024 22:28:00 +0300 Subject: [PATCH 6/7] -- --- src/ui_kit/CheckFastlink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui_kit/CheckFastlink.tsx b/src/ui_kit/CheckFastlink.tsx index 7480d4a9..416ddbb6 100644 --- a/src/ui_kit/CheckFastlink.tsx +++ b/src/ui_kit/CheckFastlink.tsx @@ -89,7 +89,7 @@ export function CheckFastlink() { } } } - }, [user.userId, discounts, user]); + }, [user.userId, discounts, user.customerAccount?.createdAt, user.userAccount?.created_at]); return ( Date: Sun, 12 May 2024 04:03:56 +0300 Subject: [PATCH 7/7] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD=D1=82=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=84=D0=B0=D1=81=D1=82=D0=BB=D0=B8=D0=BD=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui_kit/CheckFastlink.tsx | 22 ++++++++-- yarn.lock | 81 +++++++++++++++++++++++++++++++++--- 2 files changed, 94 insertions(+), 9 deletions(-) diff --git a/src/ui_kit/CheckFastlink.tsx b/src/ui_kit/CheckFastlink.tsx index 416ddbb6..ce2a673d 100644 --- a/src/ui_kit/CheckFastlink.tsx +++ b/src/ui_kit/CheckFastlink.tsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useState } from "react"; +import {useEffect, useLayoutEffect, useRef, useState} from "react"; import { Box, Button, Modal, Typography } from "@mui/material"; import { enqueueSnackbar } from "notistack"; import { mutate } from "swr"; @@ -6,13 +6,18 @@ import { mutate } from "swr"; import makeRequest from "@api/makeRequest"; import { getDiscounts } from "@api/discounts"; -import { useUserStore } from "@root/user"; +import {clearUserData, OriginalUserAccount, setUserAccount, useUserStore} from "@root/user"; import { parseAxiosError } from "@utils/parse-error"; - +import { useUserAccountFetcher } from "../App"; import type { Discount } from "@model/discounts"; +import {clearAuthToken, createUserAccount, devlog, getMessageFromFetchError} from "@frontend/kitui"; +import {useNavigate} from "react-router-dom"; +import {isAxiosError} from "axios"; export function CheckFastlink() { const user = useUserStore(); + const userId = useUserStore((state) => state.userId); + const navigate = useNavigate(); const [discounts, setDiscounts] = useState([]); const [askToChange, setAskToChange] = useState(false); const [promocode, setPromocode] = useState(""); @@ -50,6 +55,16 @@ export function CheckFastlink() { }); enqueueSnackbar("Промокод успешно применён"); localStorage.setItem("fl", ""); + const controller = new AbortController(); + const responseAccount = await makeRequest({ + url: process.env.REACT_APP_DOMAIN + "/squiz/account/get", + contentType: true, + method: "GET", + useToken: true, + withCredentials: false, + signal: controller.signal, + }) + setUserAccount(responseAccount) mutate("discounts"); return response.greetings; } catch (nativeError) { @@ -91,6 +106,7 @@ export function CheckFastlink() { } }, [user.userId, discounts, user.customerAccount?.createdAt, user.userAccount?.created_at]); + return (