From 7a875819d50b4cab28a4104e5217d39e714dc522 Mon Sep 17 00:00:00 2001 From: Nastya Date: Fri, 16 Feb 2024 18:48:08 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D1=8E=D0=B7?= =?UTF-8?q?=D0=B5=D1=80=20=D0=BD=D0=B5=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B6=D0=B0=D0=BB=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20-?= =?UTF-8?q?=20=D1=8D=D1=82=D0=BE=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D0=B5=D1=82=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dashboard/ModalUser/VerificationTab.tsx | 1 + src/utils/parse-error.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/dashboard/ModalUser/VerificationTab.tsx b/src/pages/dashboard/ModalUser/VerificationTab.tsx index ffe8048..7e2702a 100644 --- a/src/pages/dashboard/ModalUser/VerificationTab.tsx +++ b/src/pages/dashboard/ModalUser/VerificationTab.tsx @@ -76,6 +76,7 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => { await requestVefification(); }; + console.log("verificationInfo", verificationInfo) return ( = { export const parseAxiosError = (nativeError: unknown): [string, number?] => { const error = nativeError as AxiosError; + console.log(error) if ( - error.response?.data && + error.response?.data && error.response?.data !== "Not Found" && "statusCode" in (error.response.data as ServerError) ) { const serverError = error.response.data as ServerError From 7729b293c06f00072026e8ff6f5919749c832872 Mon Sep 17 00:00:00 2001 From: Nastya Date: Mon, 19 Feb 2024 23:47:32 +0300 Subject: [PATCH 2/3] =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=B8=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B8=20=D0=B8=D0=BD=D0=BD=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=BD=D1=8B=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/dashboard/ModalUser/VerificationTab.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pages/dashboard/ModalUser/VerificationTab.tsx b/src/pages/dashboard/ModalUser/VerificationTab.tsx index 7e2702a..7a21c72 100644 --- a/src/pages/dashboard/ModalUser/VerificationTab.tsx +++ b/src/pages/dashboard/ModalUser/VerificationTab.tsx @@ -24,6 +24,7 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => { const [verificationResponse, verificationError] = await verification( userId ); + console.log(verificationResponse) setIsLoading(false); @@ -39,9 +40,15 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => { }; const debouncedINNHC = useDebouncedCallback((str) => { + if (!verificationInfo) { + return; + } patchVerification({ - taxnumber: str.replace(/[^0-9]/g,""), + comment, + taxnumber: str, id: verificationInfo?._id, + status: verificationInfo?.status, + accepted: verificationInfo?.accepted, }); }, 2000); @@ -59,6 +66,7 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => { accepted, comment, id: verificationInfo._id, + taxnumber: INN, status: verificationInfo.status, }); @@ -136,8 +144,8 @@ export const VerificationTab = ({ userId }: VerificationTabProps) => { if (!verificationInfo) { return; } - setINN(event.target.value) - debouncedINNHC(event.target.value)} + setINN(event.target.value.replace(/[^0-9]/g,"")) + debouncedINNHC(event.target.value.replace(/[^0-9]/g,""))} } placeholder="ИНН" /> From aa6821c55415da0add0d70561cfb037c3c889345 Mon Sep 17 00:00:00 2001 From: skeris Date: Tue, 20 Feb 2024 09:57:30 +0300 Subject: [PATCH 3/3] ci: staging --- .gitlab-ci.yml | 57 +++++++------------------ deployments/staging/docker-compose.yaml | 2 +- 2 files changed, 17 insertions(+), 42 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4f5987..98bb044 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,59 +1,34 @@ include: - project: "devops/pena-continuous-integration" file: "/templates/docker/build-template.gitlab-ci.yml" - - project: "devops/pena-continuous-integration" - file: "/templates/docker/clean-template.gitlab-ci.yml" - project: "devops/pena-continuous-integration" file: "/templates/docker/deploy-template.gitlab-ci.yml" stages: - - clean - build - deploy - -clear-old-images: - tags: - - frontbuild - extends: .clean_template - variables: - STAGING_BRANCH: "main" - PRODUCTION_BRANCH: "main" - image: - name: docker/compose:1.28.0 - entrypoint: [""] - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker images - script: - - docker system prune -af build-app: tags: - frontbuild stage: build - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - echo STAGING_BRANCH = $STAGING_BRANCH - - echo CI_REGISTRY = $CI_REGISTRY - - echo CI_REGISTRY_USER = $CI_REGISTRY_USER - - echo CI_PROJECT_DIR = $CI_PROJECT_DIR - - echo CI_REGISTRY_IMAGE = $CI_REGISTRY_IMAGE - - echo CI_COMMIT_REF_SLUG = $CI_COMMIT_REF_SLUG - - echo DOCKER_BUILD_PATH = $DOCKER_BUILD_PATH - - echo CI_PIPELINE_ID = $CI_PIPELINE_ID + extends: .build_template variables: - DOCKER_BUILD_PATH: "build/Dockerfile" + DOCKER_BUILD_PATH: "./Dockerfile" PRODUCTION_BRANCH: main - STAGING_BRANCH: "main" - rules: - - if: $CI_COMMIT_BRANCH == $PRODUCTION_BRANCH || $CI_COMMIT_BRANCH == $STAGING_BRANCH - - script: - - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID $CI_PROJECT_DIR - - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID - + STAGING_BRANCH: staging deploy-to-staging: + tags: + - front + - staging + rules: + - if: "$CI_COMMIT_BRANCH == $STAGING_BRANCH" extends: .deploy_template - variables: - DEPLOY_TO: "staging" - BRANCH: "main" + +deploy-to-prod: + tags: + - front + - prod + rules: + - if: "$CI_COMMIT_BRANCH == $PRODUCTION_BRANCH" + extends: .deploy_template diff --git a/deployments/staging/docker-compose.yaml b/deployments/staging/docker-compose.yaml index d7042bb..1382983 100644 --- a/deployments/staging/docker-compose.yaml +++ b/deployments/staging/docker-compose.yaml @@ -3,7 +3,7 @@ services: admin_front: container_name: admin_front restart: unless-stopped - image: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID + image: $CI_REGISTRY_IMAGE/staging:$CI_COMMIT_REF_SLUG.$CI_PIPELINE_ID networks: - marketplace_penahub_frontend - default