diff --git a/coral/package.json b/coral/package.json index 39bf0db3a6..9ddddaa411 100644 --- a/coral/package.json +++ b/coral/package.json @@ -41,7 +41,7 @@ "dependencies": { "@aivenio/aquarium": "^1.48.1", "@hookform/resolvers": "^2.9.10", - "@monaco-editor/react": "^4.5.2", + "@monaco-editor/react": "^4.6.0", "@tanstack/react-query": "^4.29.5", "@types/react-syntax-highlighter": "^15.5.9", "monaco-editor": "^0.44.0", @@ -49,7 +49,7 @@ "react-dom": "^18.2.0", "react-hook-form": "^7.48.2", "react-markdown": "^8.0.7", - "react-router-dom": "^6.10.0", + "react-router-dom": "^6.20.1", "react-syntax-highlighter": "^15.5.0", "rehype-parse": "^9.0.0", "rehype-remark": "^10.0.0", @@ -75,7 +75,7 @@ "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", - "@vitejs/plugin-react": "^4.1.0", + "@vitejs/plugin-react": "^4.2.1", "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.6.1", @@ -87,10 +87,10 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "jest-transform-stub": "^2.0.0", - "lint-staged": "^15.1.0", + "lint-staged": "^15.2.0", "lodash": "^4.17.21", "msw": "^2.0.9", - "openapi-typescript": "^6.7.0", + "openapi-typescript": "^6.7.2", "prettier": "^3.1.0", "prop-types": "^15.8.1", "react-aria": "^3.30.0", diff --git a/coral/pnpm-lock.yaml b/coral/pnpm-lock.yaml index 2a9224fe51..bd55ceabd5 100644 --- a/coral/pnpm-lock.yaml +++ b/coral/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: ^2.9.10 version: 2.9.10(react-hook-form@7.48.2) '@monaco-editor/react': - specifier: ^4.5.2 - version: 4.5.2(monaco-editor@0.44.0)(react-dom@18.2.0)(react@18.2.0) + specifier: ^4.6.0 + version: 4.6.0(monaco-editor@0.44.0)(react-dom@18.2.0)(react@18.2.0) '@tanstack/react-query': specifier: ^4.29.5 version: 4.29.5(react-dom@18.2.0)(react@18.2.0) @@ -39,8 +39,8 @@ dependencies: specifier: ^8.0.7 version: 8.0.7(@types/react@18.2.35)(react@18.2.0) react-router-dom: - specifier: ^6.10.0 - version: 6.10.0(react-dom@18.2.0)(react@18.2.0) + specifier: ^6.20.1 + version: 6.20.1(react-dom@18.2.0)(react@18.2.0) react-syntax-highlighter: specifier: ^15.5.0 version: 15.5.0(react@18.2.0) @@ -116,8 +116,8 @@ devDependencies: specifier: ^5.62.0 version: 5.62.0(eslint@8.54.0)(typescript@5.0.4) '@vitejs/plugin-react': - specifier: ^4.1.0 - version: 4.1.0(vite@4.5.1) + specifier: ^4.2.1 + version: 4.2.1(vite@4.5.1) eslint: specifier: ^8.54.0 version: 8.54.0 @@ -152,8 +152,8 @@ devDependencies: specifier: ^2.0.0 version: 2.0.0 lint-staged: - specifier: ^15.1.0 - version: 15.1.0 + specifier: ^15.2.0 + version: 15.2.0 lodash: specifier: ^4.17.21 version: 4.17.21 @@ -161,8 +161,8 @@ devDependencies: specifier: ^2.0.9 version: 2.0.9(typescript@5.0.4) openapi-typescript: - specifier: ^6.7.0 - version: 6.7.0 + specifier: ^6.7.2 + version: 6.7.2 prettier: specifier: ^3.1.0 version: 3.1.0 @@ -259,6 +259,13 @@ packages: '@babel/highlight': 7.22.13 chalk: 2.4.2 + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 + /@babel/compat-data@7.22.9: resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} @@ -270,14 +277,14 @@ packages: dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.13 - '@babel/generator': 7.22.15 + '@babel/generator': 7.23.0 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-module-transforms': 7.22.20(@babel/core@7.22.20) '@babel/helpers': 7.22.15 - '@babel/parser': 7.22.16 + '@babel/parser': 7.23.0 '@babel/template': 7.22.15 '@babel/traverse': 7.23.2 - '@babel/types': 7.22.19 + '@babel/types': 7.23.0 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -287,8 +294,31 @@ packages: - supports-color dev: true - /@babel/generator@7.22.15: - resolution: {integrity: sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==} + /@babel/core@7.23.5: + resolution: {integrity: sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-compilation-targets': 7.22.15 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.23.5) + '@babel/helpers': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 + convert-source-map: 2.0.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator@7.23.0: + resolution: {integrity: sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.23.0 @@ -297,11 +327,11 @@ packages: jsesc: 2.5.2 dev: true - /@babel/generator@7.23.0: - resolution: {integrity: sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==} + /@babel/generator@7.23.5: + resolution: {integrity: sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 @@ -328,21 +358,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-module-imports@7.22.15: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-module-transforms@7.22.20(@babel/core@7.22.20): @@ -359,6 +389,20 @@ packages: '@babel/helper-validator-identifier': 7.22.20 dev: true + /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-validator-identifier': 7.22.20 + dev: true + /@babel/helper-plugin-utils@7.22.5: resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} @@ -368,20 +412,24 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.23.5 dev: true /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + engines: {node: '>=6.9.0'} + /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} @@ -402,6 +450,17 @@ packages: - supports-color dev: true + /@babel/helpers@7.23.5: + resolution: {integrity: sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.22.15 + '@babel/traverse': 7.23.5 + '@babel/types': 7.23.5 + transitivePeerDependencies: + - supports-color + dev: true + /@babel/highlight@7.22.13: resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} engines: {node: '>=6.9.0'} @@ -410,12 +469,13 @@ packages: chalk: 2.4.2 js-tokens: 4.0.0 - /@babel/parser@7.22.16: - resolution: {integrity: sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==} - engines: {node: '>=6.0.0'} - hasBin: true + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.0 + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 /@babel/parser@7.23.0: resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} @@ -424,6 +484,13 @@ packages: dependencies: '@babel/types': 7.23.0 + /@babel/parser@7.23.5: + resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.23.5 + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.20): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -553,23 +620,23 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-react-jsx-self@7.22.5(@babel/core@7.22.20): - resolution: {integrity: sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==} + /@babel/plugin-transform-react-jsx-self@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.20 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-transform-react-jsx-source@7.22.5(@babel/core@7.22.20): - resolution: {integrity: sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==} + /@babel/plugin-transform-react-jsx-source@7.23.3(@babel/core@7.23.5): + resolution: {integrity: sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.20 + '@babel/core': 7.23.5 '@babel/helper-plugin-utils': 7.22.5 dev: true @@ -583,9 +650,9 @@ packages: resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 + '@babel/code-frame': 7.23.5 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 /@babel/traverse@7.23.2: resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} @@ -605,13 +672,23 @@ packages: - supports-color dev: true - /@babel/types@7.22.19: - resolution: {integrity: sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==} + /@babel/traverse@7.23.5: + resolution: {integrity: sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 + '@babel/code-frame': 7.23.5 + '@babel/generator': 7.23.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.23.5 + '@babel/types': 7.23.5 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true /@babel/types@7.23.0: resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} @@ -621,6 +698,14 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 + /@babel/types@7.23.5: + resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.23.4 + '@babel/helper-validator-identifier': 7.22.20 + to-fast-properties: 2.0.0 + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true @@ -1279,8 +1364,8 @@ packages: resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} dev: false - /@monaco-editor/loader@1.3.3(monaco-editor@0.44.0): - resolution: {integrity: sha512-6KKF4CTzcJiS8BJwtxtfyYt9shBiEv32ateQ9T4UVogwn4HM/uPo9iJd2Dmbkpz8CM6Y0PDUpjnZzCwC+eYo2Q==} + /@monaco-editor/loader@1.4.0(monaco-editor@0.44.0): + resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==} peerDependencies: monaco-editor: '>= 0.21.0 < 1' dependencies: @@ -1288,14 +1373,14 @@ packages: state-local: 1.0.7 dev: false - /@monaco-editor/react@4.5.2(monaco-editor@0.44.0)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-emcWu6vg1OpXPiYll4aPOaXe8bwYB4UaaNTwtArFLgMoNGBzRZb2Xn0Bra2HMIFM7QLgs7fCGunHO5LkfT2LBA==} + /@monaco-editor/react@4.6.0(monaco-editor@0.44.0)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==} peerDependencies: monaco-editor: '>= 0.25.0 < 1' react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: - '@monaco-editor/loader': 1.3.3(monaco-editor@0.44.0) + '@monaco-editor/loader': 1.4.0(monaco-editor@0.44.0) monaco-editor: 0.44.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -3103,9 +3188,9 @@ packages: '@react-types/shared': 3.22.0(react@18.2.0) react: 18.2.0 - /@remix-run/router@1.5.0: - resolution: {integrity: sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==} - engines: {node: '>=14'} + /@remix-run/router@1.13.1: + resolution: {integrity: sha512-so+DHzZKsoOcoXrILB4rqDkMDy7NLMErRdOxvzvOKb507YINKUP4Di+shbTZDhSE/pBZ+vr7XGIpcOO0VLSA+Q==} + engines: {node: '>=14.0.0'} dev: false /@rollup/pluginutils@5.0.5: @@ -3685,12 +3770,22 @@ packages: /@types/babel__core@7.20.2: resolution: {integrity: sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==} dependencies: - '@babel/parser': 7.22.16 - '@babel/types': 7.22.19 + '@babel/parser': 7.23.0 + '@babel/types': 7.23.0 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.20.1 + /@types/babel__core@7.20.5: + resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} + dependencies: + '@babel/parser': 7.23.0 + '@babel/types': 7.23.0 + '@types/babel__generator': 7.6.4 + '@types/babel__template': 7.4.1 + '@types/babel__traverse': 7.20.1 + dev: true + /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: @@ -4131,16 +4226,16 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@vitejs/plugin-react@4.1.0(vite@4.5.1): - resolution: {integrity: sha512-rM0SqazU9iqPUraQ2JlIvReeaxOoRj6n+PzB1C0cBzIbd8qP336nC39/R9yPi3wVcah7E7j/kdU1uCUqMEU4OQ==} + /@vitejs/plugin-react@4.2.1(vite@4.5.1): + resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - vite: ^4.2.0 + vite: ^4.2.0 || ^5.0.0 dependencies: - '@babel/core': 7.22.20 - '@babel/plugin-transform-react-jsx-self': 7.22.5(@babel/core@7.22.20) - '@babel/plugin-transform-react-jsx-source': 7.22.5(@babel/core@7.22.20) - '@types/babel__core': 7.20.2 + '@babel/core': 7.23.5 + '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.5) + '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.5) + '@types/babel__core': 7.20.5 react-refresh: 0.14.0 vite: 4.5.1(@types/node@18.17.14)(less@4.2.0) transitivePeerDependencies: @@ -4348,11 +4443,11 @@ packages: type-fest: 0.21.3 dev: true - /ansi-escapes@5.0.0: - resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} - engines: {node: '>=12'} + /ansi-escapes@6.2.0: + resolution: {integrity: sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==} + engines: {node: '>=14.16'} dependencies: - type-fest: 1.4.0 + type-fest: 3.13.1 dev: true /ansi-regex@5.0.1: @@ -4806,12 +4901,12 @@ packages: engines: {node: '>=6'} dev: true - /cli-truncate@3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} dependencies: slice-ansi: 5.0.0 - string-width: 5.1.2 + string-width: 7.0.0 dev: true /cli-width@3.0.0: @@ -5311,6 +5406,7 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + dev: false /electron-to-chromium@1.4.508: resolution: {integrity: sha512-FFa8QKjQK/A5QuFr2167myhMesGrhlOBD+3cYNxO9/S4XzHEXesyTD/1/xF644gC8buFPz3ca6G1LOQD0tZrrg==} @@ -5320,11 +5416,16 @@ packages: engines: {node: '>=12'} dev: true + /emoji-regex@10.3.0: + resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + dev: true + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: false /emojis-list@3.0.0: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} @@ -6044,6 +6145,11 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + dev: true + /get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: @@ -6712,6 +6818,13 @@ packages: engines: {node: '>=12'} dev: true + /is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + dependencies: + get-east-asian-width: 1.2.0 + dev: true + /is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} @@ -7292,7 +7405,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.22.20 - '@babel/generator': 7.22.15 + '@babel/generator': 7.23.0 '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.20) '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.20) '@babel/types': 7.23.0 @@ -7579,16 +7692,16 @@ packages: type-check: 0.4.0 dev: true - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} + /lilconfig@3.0.0: + resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} + engines: {node: '>=14'} dev: true /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - /lint-staged@15.1.0: - resolution: {integrity: sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==} + /lint-staged@15.2.0: + resolution: {integrity: sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==} engines: {node: '>=18.12.0'} hasBin: true dependencies: @@ -7596,8 +7709,8 @@ packages: commander: 11.1.0 debug: 4.3.4 execa: 8.0.1 - lilconfig: 2.1.0 - listr2: 7.0.2 + lilconfig: 3.0.0 + listr2: 8.0.0 micromatch: 4.0.5 pidtree: 0.6.0 string-argv: 0.3.2 @@ -7606,16 +7719,16 @@ packages: - supports-color dev: true - /listr2@7.0.2: - resolution: {integrity: sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==} - engines: {node: '>=16.0.0'} + /listr2@8.0.0: + resolution: {integrity: sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==} + engines: {node: '>=18.0.0'} dependencies: - cli-truncate: 3.1.0 + cli-truncate: 4.0.0 colorette: 2.0.20 eventemitter3: 5.0.1 - log-update: 5.0.1 + log-update: 6.0.0 rfdc: 1.3.0 - wrap-ansi: 8.1.0 + wrap-ansi: 9.0.0 dev: true /loader-runner@4.3.0: @@ -7663,15 +7776,15 @@ packages: is-unicode-supported: 0.1.0 dev: true - /log-update@5.0.1: - resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /log-update@6.0.0: + resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} + engines: {node: '>=18'} dependencies: - ansi-escapes: 5.0.0 + ansi-escapes: 6.2.0 cli-cursor: 4.0.0 - slice-ansi: 5.0.0 - strip-ansi: 7.0.1 - wrap-ansi: 8.1.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 dev: true /longest-streak@3.1.0: @@ -8524,15 +8637,15 @@ packages: is-wsl: 2.2.0 dev: true - /openapi-typescript@6.7.0: - resolution: {integrity: sha512-eoUfJwhnMEug7euZ1dATG7iRiDVsEROwdPkhLUDiaFjcClV4lzft9F0Ii0fYjULCPNIiWiFi0BqMpSxipuvAgQ==} + /openapi-typescript@6.7.2: + resolution: {integrity: sha512-7rsUArlMBqmSaRd6EzPl2nGKzPFNRicsRGrxf6W+/HLEDZoOxghR3B53YlyGjcqak8YDZMBNzZQ3o93Bp3qY9Q==} hasBin: true dependencies: ansi-colors: 4.1.3 fast-glob: 3.3.1 js-yaml: 4.1.0 supports-color: 9.4.0 - undici: 5.26.3 + undici: 5.28.2 yargs-parser: 21.1.1 dev: true @@ -9085,26 +9198,26 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /react-router-dom@6.10.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==} - engines: {node: '>=14'} + /react-router-dom@6.20.1(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-npzfPWcxfQN35psS7rJgi/EW0Gx6EsNjfdJSAk73U/HqMEJZ2k/8puxfwHFgDQhBGmS3+sjnGbMdMSV45axPQw==} + engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' dependencies: - '@remix-run/router': 1.5.0 + '@remix-run/router': 1.13.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-router: 6.10.0(react@18.2.0) + react-router: 6.20.1(react@18.2.0) dev: false - /react-router@6.10.0(react@18.2.0): - resolution: {integrity: sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==} - engines: {node: '>=14'} + /react-router@6.20.1(react@18.2.0): + resolution: {integrity: sha512-ccvLrB4QeT5DlaxSFFYi/KR8UMQ4fcD8zBcR71Zp1kaYTC5oJKYAp1cbavzGrogwxca+ubjkd7XjFZKBW8CxPA==} + engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' dependencies: - '@remix-run/router': 1.5.0 + '@remix-run/router': 1.13.1 react: 18.2.0 dev: false @@ -9690,6 +9803,14 @@ packages: is-fullwidth-code-point: 4.0.0 dev: true + /slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + dev: true + /snake-case@3.0.4: resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==} dependencies: @@ -9795,6 +9916,16 @@ packages: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.0.1 + dev: false + + /string-width@7.0.0: + resolution: {integrity: sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==} + engines: {node: '>=18'} + dependencies: + emoji-regex: 10.3.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + dev: true /string.prototype.matchall@4.0.8: resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} @@ -9858,6 +9989,14 @@ packages: engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 + dev: false + + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} @@ -10201,15 +10340,15 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@1.4.0: - resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} - engines: {node: '>=10'} - dev: true - /type-fest@2.19.0: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} + /type-fest@3.13.1: + resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} + engines: {node: '>=14.16'} + dev: true + /typed-array-buffer@1.0.0: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} @@ -10270,8 +10409,8 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /undici@5.26.3: - resolution: {integrity: sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==} + /undici@5.28.2: + resolution: {integrity: sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==} engines: {node: '>=14.0'} dependencies: '@fastify/busboy': 2.0.0 @@ -10790,6 +10929,16 @@ packages: ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.0.1 + dev: false + + /wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + dependencies: + ansi-styles: 6.2.1 + string-width: 7.0.0 + strip-ansi: 7.1.0 + dev: true /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} diff --git a/coral/src/app/features/topics/schema-request/TopicSchemaRequest.test.tsx b/coral/src/app/features/topics/schema-request/TopicSchemaRequest.test.tsx index 81f5b77f33..90d470078f 100644 --- a/coral/src/app/features/topics/schema-request/TopicSchemaRequest.test.tsx +++ b/coral/src/app/features/topics/schema-request/TopicSchemaRequest.test.tsx @@ -97,7 +97,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -121,7 +121,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -153,7 +153,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -192,7 +192,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -231,7 +231,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -252,7 +252,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -278,7 +278,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -318,7 +318,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -458,7 +458,7 @@ describe("TopicSchemaRequest", () => { customRender( - + , { queryClient: true, @@ -536,7 +536,7 @@ describe("TopicSchemaRequest", () => { customRender( , { @@ -655,7 +655,7 @@ describe("TopicSchemaRequest", () => { customRender( , { @@ -760,7 +760,7 @@ describe("TopicSchemaRequest", () => { customRender( , { @@ -947,7 +947,7 @@ describe("TopicSchemaRequest", () => { customRender( , { @@ -1026,7 +1026,7 @@ describe("TopicSchemaRequest", () => { customRender( , { diff --git a/coral/src/app/features/topics/schema-request/TopicSchemaRequest.tsx b/coral/src/app/features/topics/schema-request/TopicSchemaRequest.tsx index 64baf29f1a..82fc32275c 100644 --- a/coral/src/app/features/topics/schema-request/TopicSchemaRequest.tsx +++ b/coral/src/app/features/topics/schema-request/TopicSchemaRequest.tsx @@ -1,15 +1,15 @@ import { Alert, Box, Button, useToast } from "@aivenio/aquarium"; import { useMutation, useQuery } from "@tanstack/react-query"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useNavigate, useSearchParams } from "react-router-dom"; import { Dialog } from "src/app/components/Dialog"; import { + Checkbox, Form, NativeSelect, SubmitButton, Textarea, useForm, - Checkbox, } from "src/app/components/Form"; import { TopicSchema } from "src/app/features/topics/schema-request/components/TopicSchema"; import { @@ -22,11 +22,11 @@ import { } from "src/domain/environment"; import { requestSchemaCreation } from "src/domain/schema-request"; import { TopicNames, getTopicNames } from "src/domain/topic"; -import { parseErrorMsg } from "src/services/mutation-utils"; import { KlawApiError } from "src/services/api"; +import { parseErrorMsg } from "src/services/mutation-utils"; type TopicSchemaRequestProps = { - topicName?: string; + presetTopicName?: string; // ‼️this property is ONLY for testing purpose! schemafullValueForTest?: string; }; @@ -39,9 +39,9 @@ type TopicSchemaRequestProps = { // Since that is are important test cases, I opted for the bad practice rather in order to // be able to add this tests. I created na issue in GitHub related to MonacoEditor testing already. function TopicSchemaRequest(props: TopicSchemaRequestProps) { - const { topicName } = props; + const { presetTopicName } = props; const [searchParams] = useSearchParams(); - const presetEnvironment = searchParams.get("env"); + const presetEnvironment = searchParams.get("env") || undefined; const [cancelDialogVisible, setCancelDialogVisible] = useState(false); const [isValidationError, setIsValidationError] = useState(false); @@ -49,7 +49,7 @@ function TopicSchemaRequest(props: TopicSchemaRequestProps) { const navigate = useNavigate(); const toast = useToast(); - const hasPresetTopicName = topicName !== undefined; + const hasPresetTopicName = presetTopicName !== undefined; const hasPresetEnvironment = presetEnvironment !== null && presetEnvironment !== undefined && @@ -58,9 +58,9 @@ function TopicSchemaRequest(props: TopicSchemaRequestProps) { const form = useForm({ schema: topicRequestFormSchema, defaultValues: { - topicname: topicName, + topicname: presetTopicName, schemafull: props.schemafullValueForTest || undefined, - environment: presetEnvironment || undefined, + environment: presetEnvironment, }, }); @@ -72,20 +72,19 @@ function TopicSchemaRequest(props: TopicSchemaRequestProps) { getTopicNames({ onlyMyTeamTopics: true, }), - keepPreviousData: true, - refetchOnWindowFocus: true, - onSuccess: (data) => { - if (topicName === undefined) { - return; - } - - const topicExists = data?.includes(topicName); - if (!topicExists) { - navigate(-1); - } - }, }); + useEffect(() => { + if (presetTopicName === undefined || topicNames === undefined) { + return; + } + + const topicExists = topicNames.includes(presetTopicName); + if (!topicExists) { + navigate(-1); + } + }, [topicNames, presetTopicName]); + const { data: environments, isLoading: environmentsIsLoading } = useQuery< Environment[], Error @@ -97,25 +96,25 @@ function TopicSchemaRequest(props: TopicSchemaRequestProps) { // We use name and ID related to the Kafka Environment in form and mutation. select: (kafkaEnvironments) => kafkaEnvironments.filter((env) => env.associatedEnv), - onSuccess: (environments) => { - if (presetEnvironment) { - const validEnv = environments.find( - (env) => - presetEnvironment === env.id || presetEnvironment === env.name - ); + }); - // Allows to pass environment name as well as environment id as search param - if (validEnv && isNaN(Number(presetEnvironment))) { - form.setValue("environment", validEnv.id); - return; - } + useEffect(() => { + if (presetEnvironment !== undefined && environments !== undefined) { + const validEnv = environments.find( + (env) => presetEnvironment === env.id || presetEnvironment === env.name + ); - if (validEnv === undefined) { - navigate(-1); - } + // Allows to pass environment name as well as environment id as search param + if (validEnv && isNaN(Number(presetEnvironment))) { + form.setValue("environment", validEnv.id); + return; } - }, - }); + + if (validEnv === undefined) { + navigate(-1); + } + } + }, [environments, presetEnvironment, form]); const schemaRequestMutation = useMutation(requestSchemaCreation, { onSuccess: () => { diff --git a/coral/src/app/pages/topics/schema-request.tsx b/coral/src/app/pages/topics/schema-request.tsx index 1f41f8c523..d7d7c77869 100644 --- a/coral/src/app/pages/topics/schema-request.tsx +++ b/coral/src/app/pages/topics/schema-request.tsx @@ -22,7 +22,7 @@ const SchemaRequest = () => { : `Request new schema for topic "${topicName}"` } /> - + ); };