diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a06cdca61..a8308927b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 + uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -53,7 +53,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 + uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -67,4 +67,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 + uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 # v3.26.2 diff --git a/package.json b/package.json index 542c96e0d..ce08e5ec9 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,13 @@ "@mui/icons-material": "5.16.7", "@mui/lab": "5.0.0-alpha.173", "@mui/material": "5.16.7", - "@mui/x-data-grid": "7.12.1", - "@mui/x-date-pickers": "7.12.1", + "@mui/x-data-grid": "7.13.0", + "@mui/x-date-pickers": "7.13.0", "bignumber.js": "9.1.2", "dayjs": "1.11.12", "formik": "2.4.6", "graphql": "16.9.0", - "highcharts": "11.4.6", + "highcharts": "11.4.7", "highcharts-react-official": "3.2.1", "immer": "10.1.1", "lodash": "4.17.21", @@ -84,12 +84,12 @@ "eslint-plugin-react-hooks": "4.6.2", "husky": "9.1.4", "knip": "5.27.2", - "lint-staged": "15.2.8", + "lint-staged": "15.2.9", "npm-run-all2": "6.2.2", "prettier": "3.3.3", "typescript": "5.5.4", - "typescript-eslint": "8.0.1", - "vite": "5.4.0", + "typescript-eslint": "8.1.0", + "vite": "5.4.1", "vite-plugin-checker": "0.7.2", "vite-tsconfig-paths": "5.0.1", "vitest": "2.0.5" @@ -115,6 +115,11 @@ "pnpm": { "overrides": { "ws@>=8.0.0 <8.17.1": ">=8.17.1" + }, + "auditConfig": { + "ignoreCves": [ + "CVE-2024-4067" + ] } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 19d9a5cb6..41056e5c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,11 +63,11 @@ importers: specifier: 5.16.7 version: 5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/x-data-grid': - specifier: 7.12.1 - version: 7.12.1(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 7.13.0 + version: 7.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/x-date-pickers': - specifier: 7.12.1 - version: 7.12.1(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(date-fns@3.6.0)(dayjs@1.11.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: 7.13.0 + version: 7.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(date-fns@3.6.0)(dayjs@1.11.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) bignumber.js: specifier: 9.1.2 version: 9.1.2 @@ -81,11 +81,11 @@ importers: specifier: 16.9.0 version: 16.9.0 highcharts: - specifier: 11.4.6 - version: 11.4.6 + specifier: 11.4.7 + version: 11.4.7 highcharts-react-official: specifier: 3.2.1 - version: 3.2.1(highcharts@11.4.6)(react@18.3.1) + version: 3.2.1(highcharts@11.4.7)(react@18.3.1) immer: specifier: 10.1.1 version: 10.1.1 @@ -140,7 +140,7 @@ importers: version: 4.11.3(typescript@5.5.4) '@lingui/vite-plugin': specifier: 4.11.3 - version: 4.11.3(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0)) + version: 4.11.3(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0)) '@parcel/watcher': specifier: 2.4.1 version: 2.4.1 @@ -164,10 +164,10 @@ importers: version: 1.8.8 '@vitejs/plugin-basic-ssl': specifier: 1.1.0 - version: 1.1.0(vite@5.4.0(@types/node@20.13.0)) + version: 1.1.0(vite@5.4.1(@types/node@20.13.0)) '@vitejs/plugin-react': specifier: 4.3.1 - version: 4.3.1(vite@5.4.0(@types/node@20.13.0)) + version: 4.3.1(vite@5.4.1(@types/node@20.13.0)) babel-plugin-macros: specifier: 3.1.0 version: 3.1.0 @@ -193,8 +193,8 @@ importers: specifier: 5.27.2 version: 5.27.2(@types/node@20.13.0)(typescript@5.5.4) lint-staged: - specifier: 15.2.8 - version: 15.2.8 + specifier: 15.2.9 + version: 15.2.9 npm-run-all2: specifier: 6.2.2 version: 6.2.2 @@ -205,17 +205,17 @@ importers: specifier: 5.5.4 version: 5.5.4 typescript-eslint: - specifier: 8.0.1 - version: 8.0.1(eslint@8.57.0)(typescript@5.5.4) + specifier: 8.1.0 + version: 8.1.0(eslint@8.57.0)(typescript@5.5.4) vite: - specifier: 5.4.0 - version: 5.4.0(@types/node@20.13.0) + specifier: 5.4.1 + version: 5.4.1(@types/node@20.13.0) vite-plugin-checker: specifier: 0.7.2 - version: 0.7.2(eslint@8.57.0)(optionator@0.9.4)(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0)) + version: 0.7.2(eslint@8.57.0)(optionator@0.9.4)(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0)) vite-tsconfig-paths: specifier: 5.0.1 - version: 5.0.1(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0)) + version: 5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0)) vitest: specifier: 2.0.5 version: 2.0.5(@types/node@20.13.0) @@ -1442,8 +1442,8 @@ packages: '@types/react': optional: true - '@mui/x-data-grid@7.12.1': - resolution: {integrity: sha512-/l9AslZKoHFfOultD2ehWIxRGuBI0RUwbhVbpAPwNP3ouDbTH0eyWfd5f6KCGhcUbG6xfceiOuTNr7uaPHqKiA==} + '@mui/x-data-grid@7.13.0': + resolution: {integrity: sha512-opV4OgNqc9UoKkQ1z5Ot2AkluwiVQMo6UmDaxmT/v0k2uQ77eQvxJqbnCwYll0XjsRzPz6ehiTaK3nbhXm0sIQ==} engines: {node: '>=14.0.0'} peerDependencies: '@emotion/react': ^11.9.0 @@ -1457,8 +1457,8 @@ packages: '@emotion/styled': optional: true - '@mui/x-date-pickers@7.12.1': - resolution: {integrity: sha512-Zj8kt3SCQbJp1qhMi+A3I4KqB8i5OY2Q11mdOEathFhqN/SQm1sUjIa1G09cGP1dPDgK1a6KM6qJGNtcw/nuWA==} + '@mui/x-date-pickers@7.13.0': + resolution: {integrity: sha512-cmpAfkzOjUgL4I8WenU4elm1QJO8vWpGmIPCezT3Q9wFjGL1QApQhJ5gMZ+X4tM6Gha9AhIWNQX5eXHKbSoyFQ==} engines: {node: '>=14.0.0'} peerDependencies: '@emotion/react': ^11.9.0 @@ -1493,8 +1493,8 @@ packages: moment-jalaali: optional: true - '@mui/x-internals@7.12.0': - resolution: {integrity: sha512-zgu/JqSXBflSvtzfFN8lNi5Wxw79czBv6V/crOrXqCCOzxAIsrcup2FZlwvXlzetm3otS7o/Tzfo/O5dE68NkA==} + '@mui/x-internals@7.13.0': + resolution: {integrity: sha512-eUK7iykkDWU+wBfTzE/S0qh4awgVgsORfrpvuPbUp+E6qUj1Xhu9M/WKzbwz0CPFnTJZwBQ9KYrxpGXnPBEpRQ==} engines: {node: '>=14.0.0'} peerDependencies: react: ^17.0.0 || ^18.0.0 @@ -1776,8 +1776,8 @@ packages: '@types/yargs@17.0.32': resolution: {integrity: sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==} - '@typescript-eslint/eslint-plugin@8.0.1': - resolution: {integrity: sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ==} + '@typescript-eslint/eslint-plugin@8.1.0': + resolution: {integrity: sha512-LlNBaHFCEBPHyD4pZXb35mzjGkuGKXU5eeCA1SxvHfiRES0E82dOounfVpL4DCqYvJEKab0bZIA0gCRpdLKkCw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -1787,8 +1787,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.0.1': - resolution: {integrity: sha512-5IgYJ9EO/12pOUwiBKFkpU7rS3IU21mtXzB81TNwq2xEybcmAZrE9qwDtsb5uQd9aVO9o0fdabFyAmKveXyujg==} + '@typescript-eslint/parser@8.1.0': + resolution: {integrity: sha512-U7iTAtGgJk6DPX9wIWPPOlt1gO57097G06gIcl0N0EEnNw8RGD62c+2/DiP/zL7KrkqnnqF7gtFGR7YgzPllTA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1801,12 +1801,12 @@ packages: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/scope-manager@8.0.1': - resolution: {integrity: sha512-NpixInP5dm7uukMiRyiHjRKkom5RIFA4dfiHvalanD2cF0CLUuQqxfg8PtEUo9yqJI2bBhF+pcSafqnG3UBnRQ==} + '@typescript-eslint/scope-manager@8.1.0': + resolution: {integrity: sha512-DsuOZQji687sQUjm4N6c9xABJa7fjvfIdjqpSIIVOgaENf2jFXiM9hIBZOL3hb6DHK9Nvd2d7zZnoMLf9e0OtQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.0.1': - resolution: {integrity: sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng==} + '@typescript-eslint/type-utils@8.1.0': + resolution: {integrity: sha512-oLYvTxljVvsMnldfl6jIKxTaU7ok7km0KDrwOt1RHYu6nxlhN3TIx8k5Q52L6wR33nOwDgM7VwW1fT1qMNfFIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1818,8 +1818,8 @@ packages: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/types@8.0.1': - resolution: {integrity: sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw==} + '@typescript-eslint/types@8.1.0': + resolution: {integrity: sha512-q2/Bxa0gMOu/2/AKALI0tCKbG2zppccnRIRCW6BaaTlRVaPKft4oVYPp7WOPpcnsgbr0qROAVCVKCvIQ0tbWog==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@typescript-eslint/typescript-estree@5.62.0': @@ -1831,8 +1831,8 @@ packages: typescript: optional: true - '@typescript-eslint/typescript-estree@8.0.1': - resolution: {integrity: sha512-8V9hriRvZQXPWU3bbiUV4Epo7EvgM6RTs+sUmxp5G//dBGy402S7Fx0W0QkB2fb4obCF8SInoUzvTYtc3bkb5w==} + '@typescript-eslint/typescript-estree@8.1.0': + resolution: {integrity: sha512-NTHhmufocEkMiAord/g++gWKb0Fr34e9AExBRdqgWdVBaKoei2dIyYKD9Q0jBnvfbEA5zaf8plUFMUH6kQ0vGg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -1846,8 +1846,8 @@ packages: peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - '@typescript-eslint/utils@8.0.1': - resolution: {integrity: sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA==} + '@typescript-eslint/utils@8.1.0': + resolution: {integrity: sha512-ypRueFNKTIFwqPeJBfeIpxZ895PQhNyH4YID6js0UoBImWYoSjBsahUn9KMiJXh94uOjVBgHD9AmkyPsPnFwJA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1856,8 +1856,8 @@ packages: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@typescript-eslint/visitor-keys@8.0.1': - resolution: {integrity: sha512-W5E+o0UfUcK5EgchLZsyVWqARmsM7v54/qEq6PY3YI5arkgmCzHiuk0zKSJJbm71V0xdRna4BGomkCTXz2/LkQ==} + '@typescript-eslint/visitor-keys@8.1.0': + resolution: {integrity: sha512-ba0lNI19awqZ5ZNKh6wCModMwoZs457StTebQ0q1NP58zSi2F6MOZRXwfKZy+jB78JNJ/WH8GSh2IQNzXX8Nag==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@ungap/structured-clone@1.2.0': @@ -2817,8 +2817,8 @@ packages: highcharts: '>=6.0.0' react: '>=16.8.0' - highcharts@11.4.6: - resolution: {integrity: sha512-ntFZ053giEEquAxza+HlOWiLQyCLOjQ3M3EV4r6LoSNKS/fz2S0EKGl8G7Jls9EaYmdAHecB/vL4hGI2J1Ud9g==} + highcharts@11.4.7: + resolution: {integrity: sha512-4FQTaV/9DtYal6U8rCgGeFWzzoL5QoKowpzyGlG0sp+UJKjm9G9t4bvyz+odvXt+YcqUvK9GEspdLoBnKSWGVA==} history@4.10.1: resolution: {integrity: sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==} @@ -3161,8 +3161,8 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lint-staged@15.2.8: - resolution: {integrity: sha512-PUWFf2zQzsd9EFU+kM1d7UP+AZDbKFKuj+9JNVTBkhUFhbg4MAt6WfyMMwBfM4lYqd4D2Jwac5iuTu9rVj4zCQ==} + lint-staged@15.2.9: + resolution: {integrity: sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==} engines: {node: '>=18.12.0'} hasBin: true @@ -4121,8 +4121,8 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} - typescript-eslint@8.0.1: - resolution: {integrity: sha512-V3Y+MdfhawxEjE16dWpb7/IOgeXnLwAEEkS7v8oDqNcR1oYlqWhGH/iHqHdKVdpWme1VPZ0SoywXAkCqawj2eQ==} + typescript-eslint@8.1.0: + resolution: {integrity: sha512-prB2U3jXPJLpo1iVLN338Lvolh6OrcCZO+9Yv6AR+tvegPPptYCDBIHiEEUdqRi8gAv2bXNKfMUrgAd2ejn/ow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -4242,8 +4242,8 @@ packages: vite: optional: true - vite@5.4.0: - resolution: {integrity: sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==} + vite@5.4.1: + resolution: {integrity: sha512-1oE6yuNXssjrZdblI9AfBbHCC41nnyoVoEZxQnID6yvQZAFBzxxkqoFLtHUMkYunL8hwOLEjgTuxpkRxvba3kA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -5893,11 +5893,11 @@ snapshots: '@lingui/core': 4.11.3 react: 18.3.1 - '@lingui/vite-plugin@4.11.3(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0))': + '@lingui/vite-plugin@4.11.3(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0))': dependencies: '@lingui/cli': 4.11.3(typescript@5.5.4) '@lingui/conf': 4.11.3(typescript@5.5.4) - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) transitivePeerDependencies: - supports-color - typescript @@ -6020,13 +6020,13 @@ snapshots: optionalDependencies: '@types/react': 18.3.3 - '@mui/x-data-grid@7.12.1(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@mui/x-data-grid@7.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.25.0 '@mui/material': 5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mui/system': 5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1) '@mui/utils': 5.16.6(@types/react@18.3.3)(react@18.3.1) - '@mui/x-internals': 7.12.0(@types/react@18.3.3)(react@18.3.1) + '@mui/x-internals': 7.13.0(@types/react@18.3.3)(react@18.3.1) clsx: 2.1.1 prop-types: 15.8.1 react: 18.3.1 @@ -6038,7 +6038,7 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@mui/x-date-pickers@7.12.1(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(date-fns@3.6.0)(dayjs@1.11.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@mui/x-date-pickers@7.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@mui/material@5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@types/react@18.3.3)(date-fns@3.6.0)(dayjs@1.11.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.25.0 '@mui/material': 5.16.7(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -6058,7 +6058,7 @@ snapshots: transitivePeerDependencies: - '@types/react' - '@mui/x-internals@7.12.0(@types/react@18.3.3)(react@18.3.1)': + '@mui/x-internals@7.13.0(@types/react@18.3.3)(react@18.3.1)': dependencies: '@babel/runtime': 7.25.0 '@mui/utils': 5.16.6(@types/react@18.3.3)(react@18.3.1) @@ -6312,14 +6312,14 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.0.1(@typescript-eslint/parser@8.0.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@8.1.0(@typescript-eslint/parser@8.1.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 8.0.1(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/type-utils': 8.0.1(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/parser': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/type-utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.1.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -6330,12 +6330,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.0.1(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/parser@8.1.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) + '@typescript-eslint/visitor-keys': 8.1.0 debug: 4.3.6 eslint: 8.57.0 optionalDependencies: @@ -6348,15 +6348,15 @@ snapshots: '@typescript-eslint/types': 5.62.0 '@typescript-eslint/visitor-keys': 5.62.0 - '@typescript-eslint/scope-manager@8.0.1': + '@typescript-eslint/scope-manager@8.1.0': dependencies: - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/visitor-keys': 8.1.0 - '@typescript-eslint/type-utils@8.0.1(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@8.1.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) debug: 4.3.6 ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: @@ -6367,7 +6367,7 @@ snapshots: '@typescript-eslint/types@5.62.0': {} - '@typescript-eslint/types@8.0.1': {} + '@typescript-eslint/types@8.1.0': {} '@typescript-eslint/typescript-estree@5.62.0(typescript@5.5.4)': dependencies: @@ -6383,10 +6383,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.0.1(typescript@5.5.4)': + '@typescript-eslint/typescript-estree@8.1.0(typescript@5.5.4)': dependencies: - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/visitor-keys': 8.0.1 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/visitor-keys': 8.1.0 debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 @@ -6413,12 +6413,12 @@ snapshots: - supports-color - typescript - '@typescript-eslint/utils@8.0.1(eslint@8.57.0)(typescript@5.5.4)': + '@typescript-eslint/utils@8.1.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 8.0.1 - '@typescript-eslint/types': 8.0.1 - '@typescript-eslint/typescript-estree': 8.0.1(typescript@5.5.4) + '@typescript-eslint/scope-manager': 8.1.0 + '@typescript-eslint/types': 8.1.0 + '@typescript-eslint/typescript-estree': 8.1.0(typescript@5.5.4) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -6429,25 +6429,25 @@ snapshots: '@typescript-eslint/types': 5.62.0 eslint-visitor-keys: 3.4.3 - '@typescript-eslint/visitor-keys@8.0.1': + '@typescript-eslint/visitor-keys@8.1.0': dependencies: - '@typescript-eslint/types': 8.0.1 + '@typescript-eslint/types': 8.1.0 eslint-visitor-keys: 3.4.3 '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.0(@types/node@20.13.0))': + '@vitejs/plugin-basic-ssl@1.1.0(vite@5.4.1(@types/node@20.13.0))': dependencies: - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) - '@vitejs/plugin-react@4.3.1(vite@5.4.0(@types/node@20.13.0))': + '@vitejs/plugin-react@4.3.1(vite@5.4.1(@types/node@20.13.0))': dependencies: '@babel/core': 7.24.6 '@babel/plugin-transform-react-jsx-self': 7.24.6(@babel/core@7.24.6) '@babel/plugin-transform-react-jsx-source': 7.24.6(@babel/core@7.24.6) '@types/babel__core': 7.20.5 react-refresh: 0.14.2 - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) transitivePeerDependencies: - supports-color @@ -7672,12 +7672,12 @@ snapshots: capital-case: 1.0.4 tslib: 2.6.2 - highcharts-react-official@3.2.1(highcharts@11.4.6)(react@18.3.1): + highcharts-react-official@3.2.1(highcharts@11.4.7)(react@18.3.1): dependencies: - highcharts: 11.4.6 + highcharts: 11.4.7 react: 18.3.1 - highcharts@11.4.6: {} + highcharts@11.4.7: {} history@4.10.1: dependencies: @@ -8030,7 +8030,7 @@ snapshots: lines-and-columns@1.2.4: {} - lint-staged@15.2.8: + lint-staged@15.2.9: dependencies: chalk: 5.3.0 commander: 12.1.0 @@ -8998,11 +8998,11 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript-eslint@8.0.1(eslint@8.57.0)(typescript@5.5.4): + typescript-eslint@8.1.0(eslint@8.57.0)(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 8.0.1(@typescript-eslint/parser@8.0.1(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/parser': 8.0.1(eslint@8.57.0)(typescript@5.5.4) - '@typescript-eslint/utils': 8.0.1(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/eslint-plugin': 8.1.0(@typescript-eslint/parser@8.1.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.1.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/utils': 8.1.0(eslint@8.57.0)(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -9070,7 +9070,7 @@ snapshots: debug: 4.3.6 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) transitivePeerDependencies: - '@types/node' - less @@ -9082,7 +9082,7 @@ snapshots: - supports-color - terser - vite-plugin-checker@0.7.2(eslint@8.57.0)(optionator@0.9.4)(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0)): + vite-plugin-checker@0.7.2(eslint@8.57.0)(optionator@0.9.4)(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0)): dependencies: '@babel/code-frame': 7.24.6 ansi-escapes: 4.3.2 @@ -9094,7 +9094,7 @@ snapshots: npm-run-path: 4.0.1 strip-ansi: 6.0.1 tiny-invariant: 1.3.3 - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.11 @@ -9104,18 +9104,18 @@ snapshots: optionator: 0.9.4 typescript: 5.5.4 - vite-tsconfig-paths@5.0.1(typescript@5.5.4)(vite@5.4.0(@types/node@20.13.0)): + vite-tsconfig-paths@5.0.1(typescript@5.5.4)(vite@5.4.1(@types/node@20.13.0)): dependencies: debug: 4.3.6 globrex: 0.1.2 tsconfck: 3.1.0(typescript@5.5.4) optionalDependencies: - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) transitivePeerDependencies: - supports-color - typescript - vite@5.4.0(@types/node@20.13.0): + vite@5.4.1(@types/node@20.13.0): dependencies: esbuild: 0.21.5 postcss: 8.4.41 @@ -9142,7 +9142,7 @@ snapshots: tinybench: 2.8.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.4.0(@types/node@20.13.0) + vite: 5.4.1(@types/node@20.13.0) vite-node: 2.0.5(@types/node@20.13.0) why-is-node-running: 2.3.0 optionalDependencies: diff --git a/src/checkout/hooks/useCreatePaymentSession.ts b/src/checkout/hooks/useCreatePaymentSession.ts index 46bbb91ee..57d017694 100644 --- a/src/checkout/hooks/useCreatePaymentSession.ts +++ b/src/checkout/hooks/useCreatePaymentSession.ts @@ -3,24 +3,28 @@ import { useCallback, useState } from "react"; import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { useHistory } from "react-router-dom"; import { t } from "@lingui/macro"; +import { PaymentType } from "@/graphql-client/graphql"; export function useCreatePaymentSession() { const [loading, setLoading] = useState(false); const history = useHistory(); const { advertiser } = useAdvertiser(); - const replaceSession = useCallback(async (campaignId: string) => { - setLoading(true); - await createPaymentSession(advertiser.id, campaignId ?? "") - .then((url) => { - window.location.replace(url); - }) - .catch(() => { - alert(t`Unable to create payment session. Please try again.`); - setLoading(false); - history.push(`/user/main/adsmanager/advanced/${campaignId}/review`); - }); - }, []); + const replaceSession = useCallback( + async (campaignId: string, paymentMethod?: PaymentType) => { + setLoading(true); + await createPaymentSession(advertiser.id, campaignId ?? "", paymentMethod) + .then((url) => { + window.location.replace(url); + }) + .catch(() => { + alert(t`Unable to create payment session. Please try again.`); + setLoading(false); + history.push(`/user/main/adsmanager/advanced/${campaignId}/review`); + }); + }, + [], + ); return { createPaymentSession: replaceSession, loading }; } diff --git a/src/checkout/lib/index.ts b/src/checkout/lib/index.ts index 2217ebe73..dfb3f3530 100644 --- a/src/checkout/lib/index.ts +++ b/src/checkout/lib/index.ts @@ -1,9 +1,11 @@ import { buildAdServerEndpoint } from "@/util/environment"; import { t } from "@lingui/macro"; +import { PaymentType } from "@/graphql-client/graphql"; export async function createPaymentSession( advertiserId: string, campaignId: string, + paymentMethod?: PaymentType, ): Promise { const res = await fetch(buildAdServerEndpoint("/payments/checkout-session"), { method: "POST", @@ -12,7 +14,11 @@ export async function createPaymentSession( headers: { "Content-Type": "application/json", }, - body: JSON.stringify({ advertiserId, campaignId }), + body: JSON.stringify({ + advertiserId, + campaignId, + paymentMethod: paymentMethod ? paymentMethod.toLowerCase() : undefined, + }), }); if (res.status !== 200) { diff --git a/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx b/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx index 08664c2ee..9c44b5d3f 100644 --- a/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx +++ b/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx @@ -14,8 +14,10 @@ import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { + AdsManagerUpdateCampaignInput, AdvertiserCampaignsDocument, LoadCampaignDocument, + PaymentType, } from "@/graphql-client/graphql"; import { useMutation, useQuery } from "@apollo/client"; import { graphql } from "@/graphql-client/index"; @@ -57,31 +59,7 @@ export function EditCampaign() { }); const hasPaymentIntent = initialData?.campaign?.hasPaymentIntent; - const [mutation] = useMutation(UpdateCampaign, { - onCompleted(data) { - trackMatomoEvent("campaign", "update-success"); - if (hasPaymentIntent) { - history.push( - `/user/main/complete/edit?referenceId=${data.adsManagerUpdateCampaign.id}`, - ); - } else { - void createPaymentSession(data.adsManagerUpdateCampaign.id); - } - }, - onError() { - trackMatomoEvent("campaign", "update-failed"); - alert(_(msg`Unable to Update Campaign.`)); - }, - refetchQueries: [ - { - query: AdvertiserCampaignsDocument, - variables: { - id: data.id, - filter: { from: fromDate?.toISOString() }, - }, - }, - ], - }); + const [mutation] = useMutation(UpdateCampaign); if (error || priceError) { return ( @@ -102,6 +80,38 @@ export function EditCampaign() { return ; } + const doSubmitEdit = async ( + input: AdsManagerUpdateCampaignInput, + payment: PaymentType, + ) => { + return await mutation({ + variables: { input }, + onCompleted(data) { + trackMatomoEvent("campaign", "update-success"); + if (hasPaymentIntent) { + history.push( + `/user/main/complete/edit?referenceId=${data.adsManagerUpdateCampaign.id}`, + ); + } else { + void createPaymentSession(data.adsManagerUpdateCampaign.id, payment); + } + }, + onError() { + trackMatomoEvent("campaign", "update-failed"); + alert(_(msg`Unable to Update Campaign.`)); + }, + refetchQueries: [ + { + query: AdvertiserCampaignsDocument, + variables: { + id: data.id, + filter: { from: fromDate?.toISOString() }, + }, + }, + ], + }); + }; + const initialValues = editCampaignValues(initialData.campaign, data.id); return ( @@ -110,7 +120,7 @@ export function EditCampaign() { onSubmit={async (v: CampaignForm, { setSubmitting }) => { setSubmitting(true); const input = transformEditForm(v, initialValues, params.campaignId); - await mutation({ variables: { input } }); + await doSubmitEdit(input, v.paymentType); setSubmitting(false); }} validationSchema={CampaignSchema(data.prices)}