From 05183f2028f77262f6c7a1c7def0f74ed466922c Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Tue, 2 Mar 2021 14:22:43 +0100 Subject: [PATCH] Fix incompatility of the catalog-import plugin with the react-hook-form v6.15.4 Signed-off-by: Dominik Henneke --- .changeset/polite-ads-press.md | 5 +++++ plugins/catalog-import/package.json | 2 +- .../StepPrepareCreatePullRequest/AutocompleteTextField.tsx | 4 ++-- .../PreparePullRequestForm.test.tsx | 6 +++--- yarn.lock | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 .changeset/polite-ads-press.md diff --git a/.changeset/polite-ads-press.md b/.changeset/polite-ads-press.md new file mode 100644 index 0000000000..6e9ba2f5c3 --- /dev/null +++ b/.changeset/polite-ads-press.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-import': patch +--- + +Bump react-hook-form version constraint to "^6.15.4" diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 83c9a0394e..517584b9d6 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -44,7 +44,7 @@ "git-url-parse": "^11.4.4", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-hook-form": "^6.6.0", + "react-hook-form": "^6.15.4", "react-router": "6.0.0-beta.0", "react-router-dom": "6.0.0-beta.0", "react-use": "^15.3.3", diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx index 3231c3c6a1..a3743dc580 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/AutocompleteTextField.tsx @@ -22,7 +22,7 @@ import { Control, Controller, FieldErrors, - ValidationRules, + UseControllerOptions, } from 'react-hook-form'; type Props = { @@ -32,7 +32,7 @@ type Props = { control?: Control>; errors?: FieldErrors>; - rules?: ValidationRules; + rules?: UseControllerOptions>['rules']; loading?: boolean; loadingText?: string; diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx index 0bf7746e6a..4693535d24 100644 --- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx +++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreparePullRequestForm.test.tsx @@ -25,7 +25,7 @@ describe('', () => { const onSubmitFn = jest.fn(); const { getByRole } = render( - defaultValues={{ main: 'default' }} render={({ register }) => ( <> @@ -49,7 +49,7 @@ describe('', () => { const onSubmitFn = jest.fn(); const { getByRole, getByLabelText } = render( - defaultValues={{ main: 'default' }} render={({ register }) => ( <> @@ -80,7 +80,7 @@ describe('', () => { const onSubmitFn = jest.fn(); const { queryByText, getByRole } = render( - defaultValues={{}} render={({ errors, register }) => ( <> diff --git a/yarn.lock b/yarn.lock index fb78a92355..41a2ba3934 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21324,7 +21324,7 @@ react-helmet@6.1.0: react-fast-compare "^3.1.1" react-side-effect "^2.1.0" -react-hook-form@^6.6.0: +react-hook-form@^6.15.4, react-hook-form@^6.6.0: version "6.15.4" resolved "https://registry.npmjs.org/react-hook-form/-/react-hook-form-6.15.4.tgz#328003e1ccc096cd158899ffe7e3b33735a9b024" integrity sha512-K+Sw33DtTMengs8OdqFJI3glzNl1wBzSefD/ksQw/hJf9CnOHQAU6qy82eOrh0IRNt2G53sjr7qnnw1JDjvx1w==