From 00cd528a892a658956e36dca91f2dfec6f1ab341 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 06:37:45 +0000 Subject: [PATCH 1/2] Bump yup from 0.32.9 to 1.3.3 in /ui Bumps [yup](https://github.com/jquense/yup) from 0.32.9 to 1.3.3. - [Release notes](https://github.com/jquense/yup/releases) - [Changelog](https://github.com/jquense/yup/blob/master/CHANGELOG.md) - [Commits](https://github.com/jquense/yup/compare/v0.32.9...v1.3.3) --- updated-dependencies: - dependency-name: yup dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- ui/package.json | 2 +- ui/yarn.lock | 50 +++++++++++++++++++++++++------------------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/ui/package.json b/ui/package.json index cd2939d6f..b2292b13e 100644 --- a/ui/package.json +++ b/ui/package.json @@ -39,7 +39,7 @@ "react-router-dom": "^6.14.1", "react-spinners": "^0.13.8", "use-clipboard-copy": "^0.2.0", - "yup": "^0.32.9" + "yup": "^1.3.3" }, "devDependencies": { "@stackrox/tailwind-config": "^0.2.0", diff --git a/ui/yarn.lock b/ui/yarn.lock index a8cc671f1..ecd9230b7 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -1339,7 +1339,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.10.5", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.14.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6" integrity sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA== @@ -2207,7 +2207,7 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.165", "@types/lodash@^4.14.195": +"@types/lodash@^4.14.195": version "4.14.195" resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.195.tgz#bafc975b252eb6cea78882ce8a7b6bf22a6de632" integrity sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg== @@ -7934,7 +7934,7 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" -lodash-es@^4.17.15, lodash-es@^4.17.21: +lodash-es@^4.17.21: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee" integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw== @@ -7999,7 +7999,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.7.0: +"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.5, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -8671,11 +8671,6 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== -nanoclone@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4" - integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA== - nanoid@^3.3.6: version "3.3.6" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" @@ -10336,10 +10331,10 @@ prop-types@^15.0.0, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" -property-expr@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.4.tgz#37b925478e58965031bb612ec5b3260f8241e910" - integrity sha512-sFPkHQjVKheDNnPvotjQmm3KD3uk1fWKUN7CrpdbwmUx3CrG3QiM8QpTSimvig5vTXmTvjz7+TDvXOI9+4rkcg== +property-expr@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.6.tgz#f77bc00d5928a6c748414ad12882e83f24aec1e8" + integrity sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA== property-information@^6.0.0: version "6.4.0" @@ -12268,6 +12263,11 @@ timsort@^0.3.0: resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= +tiny-case@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-case/-/tiny-case-1.0.3.tgz#d980d66bc72b5d5a9ca86fb7c9ffdb9c898ddd03" + integrity sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q== + tiny-warning@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" @@ -12457,6 +12457,11 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-fest@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b" + integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA== + type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" @@ -13450,15 +13455,12 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yup@^0.32.9: - version "0.32.9" - resolved "https://registry.yarnpkg.com/yup/-/yup-0.32.9.tgz#9367bec6b1b0e39211ecbca598702e106019d872" - integrity sha512-Ci1qN+i2H0XpY7syDQ0k5zKQ/DoxO0LzPg8PAR/X4Mpj6DqaeCoIYEEjDJwhArh3Fa7GWbQQVDZKeXYlSH4JMg== - dependencies: - "@babel/runtime" "^7.10.5" - "@types/lodash" "^4.14.165" - lodash "^4.17.20" - lodash-es "^4.17.15" - nanoclone "^0.2.1" - property-expr "^2.0.4" +yup@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/yup/-/yup-1.3.3.tgz#d2f6020ad1679754c5f8178a29243d5447dead04" + integrity sha512-v8QwZSsHH2K3/G9WSkp6mZKO+hugKT1EmnMqLNUcfu51HU9MDyhlETT/JgtzprnrnQHPWsjc6MUDMBp/l9fNnw== + dependencies: + property-expr "^2.0.5" + tiny-case "^1.0.3" toposort "^2.0.2" + type-fest "^2.19.0" From b9e1e0ef58aa9578743930d805482e53759a4d2e Mon Sep 17 00:00:00 2001 From: Tom Martensen Date: Wed, 20 Dec 2023 14:35:34 +0100 Subject: [PATCH 2/2] fix name of Schema --- .../LaunchClusterPage/ClusterForm.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ui/src/containers/LaunchClusterPage/ClusterForm.tsx b/ui/src/containers/LaunchClusterPage/ClusterForm.tsx index 3e186d548..8925891b5 100644 --- a/ui/src/containers/LaunchClusterPage/ClusterForm.tsx +++ b/ui/src/containers/LaunchClusterPage/ClusterForm.tsx @@ -38,7 +38,7 @@ function helpByParameterName(name?: string): string { return ''; } -const schemasByParameterName: { [key: string]: yup.BaseSchema } = { +const schemasByParameterName: { [key: string]: yup.Schema } = { // name length is restricted by certificate generation name: yup .string() @@ -57,18 +57,18 @@ const schemasByParameterName: { [key: string]: yup.BaseSchema } = { }; type FlavorParameters = { [key: string]: V1Parameter }; -type ParameterSchemas = { [key: string]: yup.BaseSchema }; +type ParameterSchemas = { [key: string]: yup.Schema }; function createParameterSchemas(parameters: FlavorParameters): ParameterSchemas { return Object.keys(parameters).reduce>((fields, param) => { - let thisParamSchema: yup.BaseSchema; + let thisParamSchema: yup.Schema; if (schemasByParameterName[param]) { thisParamSchema = schemasByParameterName[param]; } else { thisParamSchema = yup.string(); } if (!parameters[param].Optional) { - thisParamSchema = thisParamSchema.required('Required') as yup.BaseSchema; + thisParamSchema = thisParamSchema.required('Required') as yup.Schema; } return { ...fields, @@ -98,12 +98,12 @@ function adjustParametersBeforeSubmit(parameterValues: FormikValues): { [key: st * * @template T type the schema describes * @template V test param value type - * @param {yup.BaseSchema} schema Yup schema + * @param {yup.Schema} schema Yup schema * @param {string} testName name of the test in the schema * @param {string} [testParamName=testName] name of the test parameter to return value of */ function getSchemaTestParamValue( - schema: yup.BaseSchema, + schema: yup.Schema, testName: string, testParamName: string = testName ): V | undefined { @@ -116,10 +116,7 @@ function getFormLabelFromParameter(parameter: V1Parameter): string { return parameter.Description || parameter.Name || ''; } -function ParameterFormField(props: { - parameter: V1Parameter; - schema: yup.BaseSchema; -}): ReactElement { +function ParameterFormField(props: { parameter: V1Parameter; schema: yup.Schema }): ReactElement { const { parameter, schema } = props; assertDefined(parameter.Name); // swagger def is too permissive, it must be defined @@ -173,7 +170,7 @@ function getOrderFromParameter(parameter: V1Parameter): number { function getSchemaForParameter( parameterSchemas: ParameterSchemas, parameter: V1Parameter -): yup.BaseSchema { +): yup.Schema { if (parameter.Name && parameter.Name in parameterSchemas) { return parameterSchemas[parameter.Name]; }