diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f9b580a5a8..e4fb99e158 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -61,7 +61,7 @@ "timeago.js": "4.0.2", "use-debounce": "9.0.4", "worker-loader": "3.0.8", - "yup": "^0.32.11" + "yup": "^1.2.0" }, "devDependencies": { "@jest/globals": "29.5.0", @@ -16169,11 +16169,6 @@ "thenify-all": "^1.0.0" } }, - "node_modules/nanoclone": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/nanoclone/-/nanoclone-0.2.1.tgz", - "integrity": "sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==" - }, "node_modules/nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", @@ -23135,6 +23130,11 @@ "integrity": "sha512-IjZc9KIotudix8bMaBW6QvMuq64BrJWFs1+4V0lXwWGQZwH+LnX87doAYhem4caOEusRP9/g6jVDQmZ8XOk1nw==", "dev": true }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==" + }, "node_modules/tiny-warning": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", @@ -24924,20 +24924,25 @@ } }, "node_modules/yup": { - "version": "0.32.11", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.32.11.tgz", - "integrity": "sha512-Z2Fe1bn+eLstG8DRR6FTavGD+MeAwyfmouhHsIUgaADz8jvFKbO/fXc2trJKZg+5EBjh4gGm3iU/t3onKlXHIg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.2.0.tgz", + "integrity": "sha512-PPqYKSAXjpRCgLgLKVGPA33v5c/WgEx3wi6NFjIiegz90zSwyMpvTFp/uGcVnnbx6to28pgnzp/q8ih3QRjLMQ==", "dependencies": { - "@babel/runtime": "^7.15.4", - "@types/lodash": "^4.14.175", - "lodash": "^4.17.21", - "lodash-es": "^4.17.21", - "nanoclone": "^0.2.1", - "property-expr": "^2.0.4", - "toposort": "^2.0.2" - }, + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "engines": { - "node": ">=10" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } } diff --git a/frontend/package.json b/frontend/package.json index 81b7c7e67e..d1e40437a0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -81,7 +81,7 @@ "timeago.js": "4.0.2", "use-debounce": "9.0.4", "worker-loader": "3.0.8", - "yup": "^0.32.11" + "yup": "^1.2.0" }, "devDependencies": { "@jest/globals": "29.5.0", diff --git a/frontend/src/features/SideWindow/MissionForm/ActionForm/schemas.ts b/frontend/src/features/SideWindow/MissionForm/ActionForm/schemas.ts index 376856e500..406b579877 100644 --- a/frontend/src/features/SideWindow/MissionForm/ActionForm/schemas.ts +++ b/frontend/src/features/SideWindow/MissionForm/ActionForm/schemas.ts @@ -138,6 +138,6 @@ export const InfractionFormLiveSchema = object({ .required('Le type d’infraction est un champ obligatoire.'), natinf: number().when('infractionType', { is: (infractionType?: MissionAction.InfractionType) => infractionType !== MissionAction.InfractionType.PENDING, - then: number().required('Le NATINF est un champ obligatoire.') + then: schema => schema.required('Le NATINF est un champ obligatoire.') }) })