diff --git a/package.json b/package.json index fd9fdde13..4e01b865d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "date-fns": "^1.29.0", "easy-peasy": "^3.2.3", "events": "^3.0.0", - "formik": "^1.5.7", + "formik": "^2.1.4", "i18next": "^19.0.0", "i18next-chained-backend": "^2.0.0", "i18next-localstorage-backend": "^3.0.0", diff --git a/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx b/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx index f3c3e1cbe..6cadc595b 100644 --- a/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx +++ b/resources/scripts/components/dashboard/forms/DisableTwoFactorModal.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Modal, { RequiredModalProps } from '@/components/elements/Modal'; import FlashMessageRender from '@/components/FlashMessageRender'; import Field from '@/components/elements/Field'; @@ -17,7 +17,7 @@ export default ({ ...props }: RequiredModalProps) => { const { addError, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); const updateUserData = useStoreActions((actions: Actions) => actions.user.updateUserData); - const submit = ({ password }: Values, { setSubmitting }: FormikActions) => { + const submit = ({ password }: Values, { setSubmitting }: FormikHelpers) => { clearFlashes('account:two-factor'); disableAccountTwoFactor(password) .then(() => { diff --git a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx index 8e1034a09..028b2b361 100644 --- a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx +++ b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import Modal, { RequiredModalProps } from '@/components/elements/Modal'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import { object, string } from 'yup'; import Field from '@/components/elements/Field'; import getTwoFactorTokenUrl from '@/api/account/getTwoFactorTokenUrl'; @@ -30,7 +30,7 @@ export default ({ ...props }: RequiredModalProps) => { }); }, []); - const submit = ({ code }: Values, { setSubmitting }: FormikActions) => { + const submit = ({ code }: Values, { setSubmitting }: FormikHelpers) => { clearFlashes('account:two-factor'); enableAccountTwoFactor(code) .then(() => { diff --git a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx index 41f8bcac6..2563e1386 100644 --- a/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdateEmailAddressForm.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Actions, State, useStoreActions, useStoreState } from 'easy-peasy'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import * as Yup from 'yup'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; import Field from '@/components/elements/Field'; @@ -23,7 +23,7 @@ export default () => { const { clearFlashes, addFlash } = useStoreActions((actions: Actions) => actions.flashes); - const submit = (values: Values, { resetForm, setSubmitting }: FormikActions) => { + const submit = (values: Values, { resetForm, setSubmitting }: FormikHelpers) => { clearFlashes('account:email'); updateEmail({ ...values }) diff --git a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx index 1df37bc44..17809b496 100644 --- a/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx +++ b/resources/scripts/components/dashboard/forms/UpdatePasswordForm.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Actions, State, useStoreActions, useStoreState } from 'easy-peasy'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Field from '@/components/elements/Field'; import * as Yup from 'yup'; import SpinnerOverlay from '@/components/elements/SpinnerOverlay'; @@ -30,7 +30,7 @@ export default () => { return null; } - const submit = (values: Values, { resetForm, setSubmitting }: FormikActions) => { + const submit = (values: Values, { resetForm, setSubmitting }: FormikHelpers) => { clearFlashes('account:password'); updateAccountPassword({ ...values }) .then(() => { diff --git a/resources/scripts/components/server/databases/CreateDatabaseButton.tsx b/resources/scripts/components/server/databases/CreateDatabaseButton.tsx index 54261605d..25b488e08 100644 --- a/resources/scripts/components/server/databases/CreateDatabaseButton.tsx +++ b/resources/scripts/components/server/databases/CreateDatabaseButton.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { ServerDatabase } from '@/api/server/getServerDatabases'; import Modal from '@/components/elements/Modal'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Field from '@/components/elements/Field'; import { object, string } from 'yup'; import createServerDatabase from '@/api/server/createServerDatabase'; @@ -32,7 +32,7 @@ export default ({ onCreated }: { onCreated: (database: ServerDatabase) => void } const { addFlash, clearFlashes } = useStoreActions((actions: Actions) => actions.flashes); const server = ServerContext.useStoreState(state => state.server.data!); - const submit = (values: Values, { setSubmitting }: FormikActions) => { + const submit = (values: Values, { setSubmitting }: FormikHelpers) => { clearFlashes(); createServerDatabase(server.uuid, { ...values }) .then(database => { diff --git a/resources/scripts/components/server/databases/DatabaseRow.tsx b/resources/scripts/components/server/databases/DatabaseRow.tsx index 3de2e9f06..7a16202a2 100644 --- a/resources/scripts/components/server/databases/DatabaseRow.tsx +++ b/resources/scripts/components/server/databases/DatabaseRow.tsx @@ -6,7 +6,7 @@ import { faTrashAlt } from '@fortawesome/free-solid-svg-icons/faTrashAlt'; import { faEye } from '@fortawesome/free-solid-svg-icons/faEye'; import classNames from 'classnames'; import Modal from '@/components/elements/Modal'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Field from '@/components/elements/Field'; import { object, string } from 'yup'; import FlashMessageRender from '@/components/FlashMessageRender'; @@ -41,7 +41,7 @@ export default ({ databaseId, className, onDelete }: Props) => { .oneOf([database.name.split('_', 2)[1], database.name], 'The database name must be provided.'), }); - const submit = (values: { confirm: string }, { setSubmitting }: FormikActions<{ confirm: string }>) => { + const submit = (values: { confirm: string }, { setSubmitting }: FormikHelpers<{ confirm: string }>) => { clearFlashes(); deleteServerDatabase(server.uuid, database.id) .then(() => { diff --git a/resources/scripts/components/server/files/FileNameModal.tsx b/resources/scripts/components/server/files/FileNameModal.tsx index 98cdd49fa..9ce60086e 100644 --- a/resources/scripts/components/server/files/FileNameModal.tsx +++ b/resources/scripts/components/server/files/FileNameModal.tsx @@ -1,6 +1,6 @@ import React from 'react'; import Modal, { RequiredModalProps } from '@/components/elements/Modal'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import { object, string } from 'yup'; import Field from '@/components/elements/Field'; import { ServerContext } from '@/state/server'; @@ -17,7 +17,7 @@ interface Values { export default ({ onFileNamed, onDismissed, ...props }: Props) => { const directory = ServerContext.useStoreState(state => state.files.directory); - const submit = (values: Values, { setSubmitting }: FormikActions) => { + const submit = (values: Values, { setSubmitting }: FormikHelpers) => { onFileNamed(join(directory, values.fileName)); setSubmitting(false); }; diff --git a/resources/scripts/components/server/files/NewDirectoryButton.tsx b/resources/scripts/components/server/files/NewDirectoryButton.tsx index dfd2bde1f..86141d213 100644 --- a/resources/scripts/components/server/files/NewDirectoryButton.tsx +++ b/resources/scripts/components/server/files/NewDirectoryButton.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import Modal from '@/components/elements/Modal'; import { ServerContext } from '@/state/server'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Field from '@/components/elements/Field'; import { join } from 'path'; import { object, string } from 'yup'; @@ -22,7 +22,7 @@ export default () => { const directory = ServerContext.useStoreState(state => state.files.directory); const pushFile = ServerContext.useStoreActions(actions => actions.files.pushFile); - const submit = (values: Values, { setSubmitting }: FormikActions) => { + const submit = (values: Values, { setSubmitting }: FormikHelpers) => { createDirectory(uuid, directory, values.directoryName) .then(() => { pushFile({ diff --git a/resources/scripts/components/server/files/RenameFileModal.tsx b/resources/scripts/components/server/files/RenameFileModal.tsx index a94b91034..41a0a0fdc 100644 --- a/resources/scripts/components/server/files/RenameFileModal.tsx +++ b/resources/scripts/components/server/files/RenameFileModal.tsx @@ -1,6 +1,6 @@ import React from 'react'; import Modal, { RequiredModalProps } from '@/components/elements/Modal'; -import { Form, Formik, FormikActions } from 'formik'; +import { Form, Formik, FormikHelpers } from 'formik'; import Field from '@/components/elements/Field'; import { join } from 'path'; import renameFile from '@/api/server/files/renameFile'; @@ -19,7 +19,7 @@ export default ({ file, useMoveTerminology, ...props }: Props) => { const directory = ServerContext.useStoreState(state => state.files.directory); const { pushFile, removeFile } = ServerContext.useStoreActions(actions => actions.files); - const submit = (values: FormikValues, { setSubmitting }: FormikActions) => { + const submit = (values: FormikValues, { setSubmitting }: FormikHelpers) => { const renameFrom = join(directory, file.name); const renameTo = join(directory, values.name); diff --git a/yarn.lock b/yarn.lock index 89603521c..030630e9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1227,10 +1227,6 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -1974,10 +1970,6 @@ core-js-compat@^3.4.7: browserslist "^4.8.0" semver "^6.3.0" -core-js@^1.0.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" - core-js@^2.4.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -2032,13 +2024,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -create-react-context@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3" - dependencies: - fbjs "^0.8.0" - gud "^1.0.0" - cross-spawn@6.0.5, cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2574,12 +2559,6 @@ encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - dependencies: - iconv-lite "~0.4.13" - end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" @@ -2977,18 +2956,6 @@ faye-websocket@~0.11.1: dependencies: websocket-driver ">=0.5.1" -fbjs@^0.8.0: - version "0.8.17" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" - dependencies: - core-js "^1.0.0" - isomorphic-fetch "^2.1.1" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.18" - figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -3121,19 +3088,19 @@ fork-ts-checker-webpack-plugin@^1.5.0: tapable "^1.0.0" worker-rpc "^0.1.0" -formik@^1.5.7: - version "1.5.8" - resolved "https://registry.yarnpkg.com/formik/-/formik-1.5.8.tgz#eee8cd345effe46839bc748c7f920486f12f14b0" +formik@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/formik/-/formik-2.1.4.tgz#8deef07ec845ea98f75e03da4aad7aab4ac46570" + integrity sha512-oKz8S+yQBzuQVSEoxkqqJrKQS5XJASWGVn6mrs+oTWrBoHgByVwwI1qHiVc9GKDpZBU9vAxXYAKz2BvujlwunA== dependencies: - create-react-context "^0.2.2" deepmerge "^2.1.1" hoist-non-react-statics "^3.3.0" lodash "^4.17.14" lodash-es "^4.17.14" - prop-types "^15.6.1" react-fast-compare "^2.0.1" + scheduler "^0.18.0" tiny-warning "^1.0.2" - tslib "^1.9.3" + tslib "^1.10.0" forwarded@~0.1.2: version "0.1.2" @@ -3606,7 +3573,7 @@ i18next@^19.0.0: dependencies: "@babel/runtime" "^7.3.1" -iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" dependencies: @@ -3972,7 +3939,7 @@ is-resolvable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -4026,13 +3993,6 @@ isobject@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - jquery@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" @@ -4681,13 +4641,6 @@ node-emoji@^1.8.1: dependencies: lodash.toarray "^4.4.0" -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - node-forge@0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.0.tgz#d624050edbb44874adca12bb9a52ec63cb782579" @@ -5887,12 +5840,6 @@ promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" -promise@^7.1.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - dependencies: - asap "~2.0.3" - prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" @@ -6492,6 +6439,14 @@ scheduler@^0.17.0: loose-envify "^1.1.0" object-assign "^4.1.1" +scheduler@^0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.18.0.tgz#5901ad6659bc1d8f3fdaf36eb7a67b0d6746b1c4" + integrity sha512-agTSHR1Nbfi6ulI0kYNK0203joW2Y5W4po4l+v03tOoiJKpTBbxpNhWDvqc/4IcOw+KLmSiQLTasZ4cab2/UWQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + schema-utils@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" @@ -6590,7 +6545,7 @@ set-value@^2.0.0: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4, setimmediate@^1.0.5: +setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" @@ -7204,7 +7159,12 @@ ts-toolbelt@^4.10.0: version "4.12.13" resolved "https://registry.yarnpkg.com/ts-toolbelt/-/ts-toolbelt-4.12.13.tgz#a2fb92f16ef6e5828c16a8f403e1eaf87703160b" -tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: +tslib@^1.10.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" + integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== + +tslib@^1.8.1, tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" @@ -7239,10 +7199,6 @@ typescript@^3.7.5: version "3.7.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.5.tgz#0692e21f65fd4108b9330238aac11dd2e177a1ae" -ua-parser-js@^0.7.18: - version "0.7.20" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098" - uglify-js@3.3.x: version "3.3.28" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.28.tgz#0efb9a13850e11303361c1051f64d2ec68d9be06" @@ -7592,10 +7548,6 @@ websocket-extensions@>=0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29" -whatwg-fetch@>=0.10.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"