heath-freenome Github contribution chart
heath-freenome Github Stats
heath-freenome Most Used Languages

Activity

05 Oct 2022

Heath-freenome

Adding properties should work when `additionalProperties` is `true`

Fixes #3179

Conversion of ObjectField to TypeScript caused a regression where additionalProperties: true was not properly evaluated when adding a property.

  • Change ObjectField logic to handle additionalProperties: true.
  • Add tests to validate some of the logic in handleAddClick, including the regression

Merged On 05 Oct 2022 at 07:51:33

Heath-freenome

Commented On 05 Oct 2022 at 07:51:33

Heath-freenome

Adding properties should work when `additionalProperties` is `true`

Fixes #3179

Conversion of ObjectField to TypeScript caused a regression where additionalProperties: true was not properly evaluated when adding a property.

  • Change ObjectField logic to handle additionalProperties: true.
  • Add tests to validate some of the logic in handleAddClick, including the regression

Forked On 05 Oct 2022 at 07:51:32

Heath-freenome

```suggestion - Extended `Form.onChange` to optionally return the `id` of the field that caused the change, fixing [#2768](https://github.com/rjsf-team/react-jsonschema-form/issues/2768) ```
On 05 Oct 2022 at 07:51:32

Heath-freenome

ButtonTemplates: differentiate between array and object AddButton

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

v5 adds ButtonTemplates.AddButton, but in my case we want to use different icons between adding items to an array vs adding additionalProperties to an object

Describe the solution you'd like

  • Different button templates for the add to array and add to object
  • OK to have one fall back to the other if needed to avoid a breaking change or to keep the interface simple

Describe alternatives you've considered

No response

Forked On 05 Oct 2022 at 04:47:05

Heath-freenome

@nickgros Maybe also consider doing the Remove button the same way?

Commented On 05 Oct 2022 at 04:47:05

Heath-freenome

fix(utils): omit computedDefault of empty objects

Reasons for making this change

Fixes #2150 and #2708. See this playground

If there are no defaults, computedDefault will still create an empty object here. As a result, ajv assumes that the field should exist and is failing the validation if it has any required fields.

Forked On 05 Oct 2022 at 04:44:31

Heath-freenome

@heath-freenome to make sure we're on the same page: you are suggesting to run this.ajv.validate(schema, formData); on formData instead of newFormData and only use the newFormData for the custom validation? Am I right?

I wonder if we should call getDefaultFormState twice - once with includeUndefinedValues = false for the regular validation and once with true for the custom validation

There is some sense to that as well... Go with that.

Commented On 05 Oct 2022 at 04:44:31

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler (#3173)

  • In @rjsf/utils, updated the FieldProps type for onChange to add an optional id: string parameter, making onChange for FieldTemplateProps use FieldProps definition
  • In @rjsf/core, updated the library to support returning an optional second parameter, id: string, to the onChange() prop on Form as follows:
    • Updated the Form.onChange() callback handler passed to all fields to take an optional third parameter, id: string, passing it out to the onChange() prop call
    • Updated ArrayField to make the callback returned from the onChangeForIndex() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated MultiSchemaField to make the onOptionChange() method pass along the this.getFieldId() value to the props.onChange() handler
      • Refactored the id logic for the select widget used in the MultiSchemaField into the getFieldId() method
    • Updated ObjectField to make the callback returned from the onPropertyChange() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated SchemaField to add a new handleFieldComponentChange() callback that ensures that an id is passed up the onChange callback chain
      • Updated the render of the FieldComponent to pass the handleFieldComponentChange() as the onChange handler
    • Updated all of the tests to check for the id in those situations when it is passed back
  • In @rjsf/playground, updated the onFormDataChange handler to log the id of the changed field if it is provided
  • Updated the form-props.md documentation to describe the new id parameter that may be returned
  • Updated the CHANGELOG.md accordingly

Pushed On 05 Oct 2022 at 04:43:02

Heath-freenome

Adding properties should work when `additionalProperties` is `true`

Fixes #3719

Conversion of ObjectField to TypeScript caused a regression where additionalProperties: true was not properly evaluated when adding a property.

  • Change ObjectField logic to handle additionalProperties: true.
  • Add tests to validate some of the logic in handleAddClick, including the regression

Merged On 05 Oct 2022 at 04:04:09

Heath-freenome

Commented On 05 Oct 2022 at 04:04:09

Heath-freenome

Importing JSON files in TS config reports error but it still works

🐛 bug report

Description of the problem

In a project that uses typescript but without a tsconfig file you can do:

import jsonDoc from "./data.json"; 

This works and you can access the content is loaded from the json file (I assume because the react template actually uses babel/webpack to parse and build ts files instead of the typescript compiler).

However the typescript type checker suggests that there is an error on that line, stating:

Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension

Should that option be added to the default compilerOptions that are used in typescript projects so that false error is stops being reported?

How has this issue affected you? What are you trying to accomplish?

This reduces confidence as it reports an error for something that isn't actually an issue.

Link to sandbox: https://codesandbox.io/s/testing-json-imports-in-typescript-j62fp

Forked On 04 Oct 2022 at 06:15:32

Heath-freenome

I also see this... Maybe adding something into a tsconfig.json will fix things?

Commented On 04 Oct 2022 at 06:15:32

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler (#3173)

  • In @rjsf/utils, updated the FieldProps type for onChange to add an optional id: string parameter, making onChange for FieldTemplateProps use FieldProps definition
  • In @rjsf/core, updated the library to support returning an optional second parameter, id: string, to the onChange() prop on Form as follows:
    • Updated the Form.onChange() callback handler passed to all fields to take an optional third parameter, id: string, passing it out to the onChange() prop call
    • Updated ArrayField to make the callback returned from the onChangeForIndex() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated MultiSchemaField to make the onOptionChange() method pass along the this.getFieldId() value to the props.onChange() handler
      • Refactored the id logic for the select widget used in the MultiSchemaField into the getFieldId() method
    • Updated ObjectField to make the callback returned from the onPropertyChange() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated SchemaField to add a new handleFieldComponentChange() callback that ensures that an id is passed up the onChange callback chain
      • Updated the render of the FieldComponent to pass the handleFieldComponentChange() as the onChange handler
    • Updated all of the tests to check for the id in those situations when it is passed back
  • In @rjsf/playground, updated the onFormDataChange handler to log the id of the changed field if it is provided
  • Updated the form-props.md documentation to describe the new id parameter that may be returned
  • Updated the CHANGELOG.md accordingly

Pushed On 03 Oct 2022 at 09:09:29

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler

Created On 03 Oct 2022 at 09:09:29

Heath-freenome

chore(deps-dev): bump cross-env from 2.0.1 to 7.0.3

Bumps cross-env from 2.0.1 to 7.0.3.


updated-dependencies:

  • dependency-name: cross-env dependency-type: direct:development update-type: version-update:semver-major ...

Signed-off-by: dependabot[bot] support@github.com

Pushed On 03 Oct 2022 at 08:42:55

Heath-freenome

fix(@rjsf/chakra-ui) add support for chakra-react-select v4 (#3172)

  • @rjsf/chakra-ui: support chakra-react-select v4; In particular move from to and add to peerDependencies

  • Correct rjsf version

  • Add chakra-react-select to pre-requisites in chakra-ui README

Co-authored-by: dorofel lisa.dorofeeva@lightsource.ca

Pushed On 03 Oct 2022 at 08:42:55

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler

  • In @rjsf/utils, updated the FieldProps type for onChange to add an optional id: string parameter, making onChange for FieldTemplateProps use FieldProps definition
  • In @rjsf/core, updated the library to support returning an optional second parameter, id: string, to the onChange() prop on Form as follows:
    • Updated the Form.onChange() callback handler passed to all fields to take an optional third parameter, id: string, passing it out to the onChange() prop call
    • Updated ArrayField to make the callback returned from the onChangeForIndex() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated MultiSchemaField to make the onOptionChange() method pass along the this.getFieldId() value to the props.onChange() handler
      • Refactored the id logic for the select widget used in the MultiSchemaField into the getFieldId() method
    • Updated ObjectField to make the callback returned from the onPropertyChange() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated SchemaField to add a new handleFieldComponentChange() callback that ensures that an id is passed up the onChange callback chain
      • Updated the render of the FieldComponent to pass the handleFieldComponentChange() as the onChange handler
    • Updated all of the tests to check for the id in those situations when it is passed back
  • In @rjsf/playground, updated the onFormDataChange handler to log the id of the changed field if it is provided
  • Updated the form-props.md documentation to describe the new id parameter that may be returned
  • Updated the CHANGELOG.md accordingly

Pushed On 03 Oct 2022 at 08:42:55

Heath-freenome

chore(deps-dev): bump cross-env from 2.0.1 to 7.0.3

Bumps cross-env from 2.0.1 to 7.0.3.


updated-dependencies:

  • dependency-name: cross-env dependency-type: direct:development update-type: version-update:semver-major ...

Signed-off-by: dependabot[bot] support@github.com

Pushed On 03 Oct 2022 at 08:10:48

Heath-freenome

fix(@rjsf/chakra-ui) add support for chakra-react-select v4 (#3172)

  • @rjsf/chakra-ui: support chakra-react-select v4; In particular move from to and add to peerDependencies

  • Correct rjsf version

  • Add chakra-react-select to pre-requisites in chakra-ui README

Co-authored-by: dorofel lisa.dorofeeva@lightsource.ca

Pushed On 03 Oct 2022 at 08:10:48

Heath-freenome

fix(@rjsf/chakra-ui) add support for chakra-react-select v4 (#3172)

  • @rjsf/chakra-ui: support chakra-react-select v4; In particular move from to and add to peerDependencies

  • Correct rjsf version

  • Add chakra-react-select to pre-requisites in chakra-ui README

Co-authored-by: dorofel lisa.dorofeeva@lightsource.ca

Pushed On 03 Oct 2022 at 08:10:40

Heath-freenome

fix(@rjsf/chakra-ui) add support for chakra-react-select v4

Created On 03 Oct 2022 at 08:10:38

Heath-freenome

fix(@rjsf/chakra-ui) add support for chakra-react-select v4

Reasons for making this change

fixes #3152

  • moved "chakra-react-select": "^3.3.8" from dependencies to devDependencies;
  • added "chakra-react-select": ">=3.3.8" to peerDependencies / pre-requisites in order to support either of combinations @chakra-ui/react v1 + chakra-react-select v3 or @chakra-ui/react v2 + chakra-react-select v4.

Checklist

  • [ ] I'm updating documentation
  • [x] I'm adding or updating code
    • [ ] I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • [x] I've updated docs if needed
    • [x] I've updated the changelog with a description of the PR
  • [ ] I'm adding a new feature
    • [ ] I've updated the playground with an example use of the feature

Merged On 03 Oct 2022 at 08:10:08

Heath-freenome

Commented On 03 Oct 2022 at 08:10:08

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler

Created On 03 Oct 2022 at 07:05:14

Heath-freenome

fix: #2768 by returning id on the Form.onChange handler

  • In @rjsf/utils, updated the FieldProps type for onChange to add an optional id: string parameter, making onChange for FieldTemplateProps use FieldProps definition
  • In @rjsf/core, updated the library to support returning an optional second parameter, id: string, to the onChange() prop on Form as follows:
    • Updated the Form.onChange() callback handler passed to all fields to take an optional third parameter, id: string, passing it out to the onChange() prop call
    • Updated ArrayField to make the callback returned from the onChangeForIndex() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated MultiSchemaField to make the onOptionChange() method pass along the this.getFieldId() value to the props.onChange() handler
      • Refactored the id logic for the select widget used in the MultiSchemaField into the getFieldId() method
    • Updated ObjectField to make the callback returned from the onPropertyChange() method take the additional id parameter and pass it along to the props.onChange() handler
    • Updated SchemaField to add a new handleFieldComponentChange() callback that ensures that an id is passed up the onChange callback chain
      • Updated the render of the FieldComponent to pass the handleFieldComponentChange() as the onChange handler
    • Updated all of the tests to check for the id in those situations when it is passed back
  • In @rjsf/playground, updated the onFormDataChange handler to log the id of the changed field if it is provided
  • Updated the form-props.md documentation to describe the new id parameter that may be returned
  • Updated the CHANGELOG.md accordingly

Pushed On 03 Oct 2022 at 07:04:27
Create Branch
Heath-freenome In heath-freenome/react-jsonschema-form Create Branchfix-2768-adding-id-to-onChange

Heath-freenome

A React component for building Web forms from JSON Schema.

On 03 Oct 2022 at 06:06:05

Heath-freenome

chore(deps-dev): bump cross-env from 2.0.1 to 7.0.3

Bumps cross-env from 2.0.1 to 7.0.3.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Merged On 03 Oct 2022 at 04:41:00

Heath-freenome

@dependabot merge

Commented On 03 Oct 2022 at 04:41:00

Heath-freenome

Update issue templates to be assigned to @rjsf-team/reviewers (#3162)

  • Update issue templates to be assigned to @rjsf-team/reviewers

See https://github.com/orgs/rjsf-team/teams/reviewers/

this makes it easier to add / remove people and also set up granular notifications for rjsf-specific reviews.

  • Update bug_report.yml

  • Update feature_request.yml

  • Update question_issue.yml

  • Update bug_report.yml

  • Update feature_request.yml

Pushed On 03 Oct 2022 at 04:32:34

Heath-freenome

fix: Prevent the Playground from crashing on a form error. (#3164)

Co-authored-by: Heath C 51679588+heath-freenome@users.noreply.github.com

Pushed On 03 Oct 2022 at 04:32:34

Heath-freenome

fix: Prevent the Playground from crashing on a form error.

Fixes #3132, fixes #3095, fixes #2787, fixes #2277 fixes #2179, fixes #2163, fixes #1762, fixes #1002;

Potentially fixes other issues that I couldn't find.

Merged On 03 Oct 2022 at 04:03:46

Heath-freenome

Commented On 03 Oct 2022 at 04:03:46
Issue Comment

Heath-freenome

v2 changes

it won't happen soon, just want to list all the possible things:

  • Drop Node 12 support (end-of-life 2022-04-30)
  • Drop Node 17 support (end-of-life 2022-06-01)
  • Convert to esm (ts v4.7)
  • jest v28 https://jestjs.io/blog/2022/04/25/jest-28
  • ...

Forked On 01 Oct 2022 at 12:02:16

Heath-freenome

Consider Node 18 as well since it goes active in November 2022

Commented On 01 Oct 2022 at 12:02:16

Heath-freenome

fix: Prevent the Playground from crashing on a form error.

Fixes #3132 #3095 #2787 #2163 #1762 #1002 , potentially others

Forked On 30 Sep 2022 at 09:34:15

Heath-freenome

@nickgros Have you verified that this will handle all the uses cases you've indicated will be fixed?

Commented On 30 Sep 2022 at 09:34:15

Heath-freenome

Prevent the Playground from crashing on a form error.

Closes #3132 #3095 #2787 #2163 #1762 #1002 , potentially others

Forked On 30 Sep 2022 at 09:25:11

Heath-freenome

Reorder this so all external imports are first ```suggestion import localValidator from "@rjsf/validator-ajv6"; import DemoFrame from "./DemoFrame"; ```
On 30 Sep 2022 at 09:25:11

Heath-freenome

Prevent the Playground from crashing on a form error.

Closes #3132 #3095 #2787 #2163 #1762 #1002 , potentially others

Forked On 30 Sep 2022 at 09:24:17

Heath-freenome

If you turn this into a fat-arrow function then you don't need the bind above ```suggestion resetErrorBoundary = () => { this.setState({ hasError: false, error: null }); } ```
On 30 Sep 2022 at 09:24:17

Heath-freenome

Prevent the Playground from crashing on a form error.

Closes #3132 #3095 #2787 #2163 #1762 #1002 , potentially others

Merged On 30 Sep 2022 at 09:26:32

Heath-freenome

Commented On 30 Sep 2022 at 09:26:32

Heath-freenome

Prevent the Playground from crashing on a form error.

Closes #3132 #3095 #2787 #2163 #1762 #1002 , potentially others

Merged On 30 Sep 2022 at 09:26:32

Heath-freenome

Commented On 30 Sep 2022 at 09:26:32