From 581f17ed4b2566e3fa0e8b3b7b5625d5f531c2c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:42:09 -0600 Subject: [PATCH] Bump the rjsf group with 4 updates (#3333) * Bump the rjsf group with 4 updates Bumps the rjsf group with 4 updates: [@rjsf/bootstrap-4](https://github.com/rjsf-team/react-jsonschema-form), [@rjsf/core](https://github.com/rjsf-team/react-jsonschema-form), [@rjsf/utils](https://github.com/rjsf-team/react-jsonschema-form) and [@rjsf/validator-ajv8](https://github.com/rjsf-team/react-jsonschema-form). Updates `@rjsf/bootstrap-4` from 5.18.5 to 5.21.1 - [Release notes](https://github.com/rjsf-team/react-jsonschema-form/releases) - [Changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md) - [Commits](https://github.com/rjsf-team/react-jsonschema-form/compare/5.18.5...5.21.1) Updates `@rjsf/core` from 5.18.4 to 5.21.1 - [Release notes](https://github.com/rjsf-team/react-jsonschema-form/releases) - [Changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md) - [Commits](https://github.com/rjsf-team/react-jsonschema-form/compare/5.18.4...5.21.1) Updates `@rjsf/utils` from 5.20.1 to 5.21.1 - [Release notes](https://github.com/rjsf-team/react-jsonschema-form/releases) - [Changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md) - [Commits](https://github.com/rjsf-team/react-jsonschema-form/compare/5.20.1...5.21.1) Updates `@rjsf/validator-ajv8` from 5.20.1 to 5.21.1 - [Release notes](https://github.com/rjsf-team/react-jsonschema-form/releases) - [Changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md) - [Commits](https://github.com/rjsf-team/react-jsonschema-form/compare/5.20.1...5.21.1) --- updated-dependencies: - dependency-name: "@rjsf/bootstrap-4" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rjsf - dependency-name: "@rjsf/core" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rjsf - dependency-name: "@rjsf/utils" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rjsf - dependency-name: "@rjsf/validator-ajv8" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: rjsf ... Signed-off-by: dependabot[bot] * Adjusting RecordForm disabled logic based on upstream rjsf changes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Cottner --- package-lock.json | 38 ++++++++++++++-------------- package.json | 8 +++--- src/components/record/RecordForm.tsx | 6 +---- test/components/BaseForm_test.tsx | 1 - 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b6a3bbda..8470cf3d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "license": "Apache-2.0", "dependencies": { "@reduxjs/toolkit": "^2.2.1", - "@rjsf/bootstrap-4": "^5.18.4", - "@rjsf/core": "^5.18.4", - "@rjsf/utils": "^5.18.4", - "@rjsf/validator-ajv8": "^5.18.4", + "@rjsf/bootstrap-4": "^5.21.1", + "@rjsf/core": "^5.21.1", + "@rjsf/utils": "^5.21.1", + "@rjsf/validator-ajv8": "^5.21.1", "@uiw/codemirror-extensions-langs": "^4.21.24", "@uiw/react-codemirror": "^4.21.24", "bootstrap": "^4.6.2", @@ -1709,9 +1709,9 @@ } }, "node_modules/@rjsf/bootstrap-4": { - "version": "5.18.5", - "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.18.5.tgz", - "integrity": "sha512-Yloz8LwH4VeU0DGziau/0IXk3IXWPT+Yu4UnZk70Mi9HnlXLlwP5RPEkrAgeynPqJEVsxr9++P6YNcoZCp8NyA==", + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/bootstrap-4/-/bootstrap-4-5.21.1.tgz", + "integrity": "sha512-9dshQQFfjcKwAYEvb3L8MKM5YOrPEN0b/9uirFp8z9qQKNgK520T+v8kfeV69f8pBo6YgX/T2j24IyM19/KEAw==", "dependencies": { "@react-icons/all-files": "^4.1.0" }, @@ -1719,16 +1719,16 @@ "node": ">=14" }, "peerDependencies": { - "@rjsf/core": "^5.18.x", - "@rjsf/utils": "^5.18.x", + "@rjsf/core": "^5.20.x", + "@rjsf/utils": "^5.20.x", "react": "^16.14.0 || >=17", "react-bootstrap": "^1.6.5" } }, "node_modules/@rjsf/core": { - "version": "5.18.4", - "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.18.4.tgz", - "integrity": "sha512-OUPC+l44X1geYT9sSsmQC2pakvFWCQB+5Iy/ITfLMJq3MIjJn0gakCwYHXMMBGUAKM1SSMIyKWyCazt3kY9fhg==", + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.21.1.tgz", + "integrity": "sha512-qURYyhL5RO8S8mkBKFL506mzc20ywJiIQbByozUYudAc25TL7ebxskwscdwhMnuzqQbMjBBimvHJGjcwzfIVxQ==", "dependencies": { "lodash": "^4.17.21", "lodash-es": "^4.17.21", @@ -1740,14 +1740,14 @@ "node": ">=14" }, "peerDependencies": { - "@rjsf/utils": "^5.18.x", + "@rjsf/utils": "^5.20.x", "react": "^16.14.0 || >=17" } }, "node_modules/@rjsf/utils": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.20.1.tgz", - "integrity": "sha512-bQrJt5lsAHbdmivIDDVJPXPCkkXJZvXBx8MrjA5umGO2+tykPcphZx/75+1AY5WhUECSgwBeZe2DEWhPbX46oQ==", + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.21.1.tgz", + "integrity": "sha512-KEwEtIswzKE2WTLRxvh5vwMwvNMTHnRSxwaRlz3QKz5/iQr9XGJTWcmArjIN3y0ypfLk+X6qZsboamQBIhTV3w==", "dependencies": { "json-schema-merge-allof": "^0.8.1", "jsonpointer": "^5.0.1", @@ -1763,9 +1763,9 @@ } }, "node_modules/@rjsf/validator-ajv8": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.20.1.tgz", - "integrity": "sha512-8uzN3ncMk2G2EQq0bAig2zU2LC482B6KDmDtWlFytlU4GEzczHFTcpjoWU0iT7S+E8LoQiunTv5SBBxAnxSoOw==", + "version": "5.21.1", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.21.1.tgz", + "integrity": "sha512-wR8sSQCnHQT51JzGZMsJfYednOKs3nahnpInkkZmJrK+FvlWkfMfB2QOl8ZgTrKX3egde3362QtBp9QCKEXYxg==", "dependencies": { "ajv": "^8.12.0", "ajv-formats": "^2.1.1", diff --git a/package.json b/package.json index 66b847d2d..edfe1873a 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ }, "dependencies": { "@reduxjs/toolkit": "^2.2.1", - "@rjsf/bootstrap-4": "^5.18.4", - "@rjsf/core": "^5.18.4", - "@rjsf/utils": "^5.18.4", - "@rjsf/validator-ajv8": "^5.18.4", + "@rjsf/bootstrap-4": "^5.21.1", + "@rjsf/core": "^5.21.1", + "@rjsf/utils": "^5.21.1", + "@rjsf/validator-ajv8": "^5.21.1", "@uiw/codemirror-extensions-langs": "^4.21.24", "@uiw/react-codemirror": "^4.21.24", "bootstrap": "^4.6.2", diff --git a/src/components/record/RecordForm.tsx b/src/components/record/RecordForm.tsx index e75890d0f..98c44bd00 100644 --- a/src/components/record/RecordForm.tsx +++ b/src/components/record/RecordForm.tsx @@ -42,10 +42,6 @@ export function extendUIWithKintoFields(uiSchema: any, isCreate: boolean): any { }; } -export function extendUiSchemaWhenDisabled(uiSchema: any, disabled: boolean) { - return { ...uiSchema, "ui:disabled": disabled }; -} - type Props = { bid: string; bucket: BucketState; @@ -190,7 +186,6 @@ export default function RecordForm(props: Props) { ); let _uiSchema = extendUIWithKintoFields(uiSchema, !record); _uiSchema = extendUiSchemaWithAttachment(_uiSchema, attachmentConfig); - _uiSchema = extendUiSchemaWhenDisabled(_uiSchema, !allowEditing); const formCrashMsg = (
@@ -209,6 +204,7 @@ export default function RecordForm(props: Props) { formData={recordData} onSubmit={handleOnSubmit} formCrashMsg={formCrashMsg} + disabled={!allowEditing} > {buttons} diff --git a/test/components/BaseForm_test.tsx b/test/components/BaseForm_test.tsx index eb8cb2020..a3ee9a762 100644 --- a/test/components/BaseForm_test.tsx +++ b/test/components/BaseForm_test.tsx @@ -35,7 +35,6 @@ const testUiSchema = { "ui:widget": "hidden", "ui:disabled": true, }, - "ui:disabled": false, }; describe("BaseForm component", () => {