768 Commits

Author SHA1 Message Date
Ashwin Ramaswami
d836b6879f fix more vulnerabilities (#1556) 2019-12-23 21:06:46 +01:00
Ashwin Ramaswami
53ee91f95d Fix id of anyof select (#1212)
* fix: fix id of anyof select

* test: add tests for oneof and anyof ids

* test fix: change oneof to anyof in test

* properly use __anyof_select or __oneof_select based on schema

* prettier
2019-12-23 17:01:55 +05:30
Jimmy Callin
71949f06bf More test refactoring to move away from internal component state assertion (#1535)
* refactor validation tests to not use internal state

* fix key warning

* more refactoring

* refactored uischema to use event assertion

* refactored arrayfield tests to use event assertion

* refactored form tests to use event assertion

* Update packages/core/test/Form_test.js

Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>

* rename tests

* added test case for liveValidate true with custom validate function

* refactored stringfield tests to use change event assertions

* added test case for invalid date

* removed compontentWillReceiveProps test assertion

* removed performance tests

* revert adding schema to validation function

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2019-12-21 16:21:31 +05:30
Ashwin Ramaswami
30b1700f80 move allof test to the right place (#1546) 2019-12-16 07:07:22 +01:00
Ashwin Ramaswami
55c86b6db4 Run precommit in each package (#1531) 2019-12-08 09:43:25 +01:00
Ashwin Ramaswami
2a9cb7f4a7 fix vulnerabilities (#1530) 2019-12-08 09:42:52 +01:00
Ashwin Ramaswami
6b486eff2c Move allOf.js to the right place 2019-12-07 20:03:43 +00:00
likexin
e673a9097e fix: schema of type string shows defaults when cleared (#1505)
* fix: schema of type string shows defaults when cleared

* feat: add unit test

* Update test/StringField_test.js

Co-Authored-By: Ashwin Ramaswami <aramaswamis@gmail.com>
2019-12-07 10:58:32 -08:00
Mark Mullins
4f02482f0f Capitalized Yes and No defaults (#1395)
* Capitalized default Yes and No values in BooleanField

* Capitalized expected default Yes and No values

* Capitalized expected default Yes and No values in uiSchema_test
2019-12-07 10:33:42 -08:00
Erik Lothe
83645ceb55 Support for "examples" keyword (#1517)
* Adds support for the "examples" keyword

* Adds example in playground for "examples" keyword

* runs cs-format on examples.js

* Includes default in examples

* Examples overlapping with default does not duplicate default

* Adds tests for examples keyword

* Test default value with no examples
2019-12-07 10:26:20 -08:00
Ashwin Ramaswami
4524376deb Add allOf support (#1380)
* feat: add allOf support

* use patch version of json-schema-merge-allof

* fix: publicPath for netlify builds

* fix typo

* fix: pass around shouldMergeAllOf a bit

* fix: remove shouldMergeAllOf

* fix: resolve allOf when calculating idSchema and pathSchema

* Revert "Fix dependency defaults for uncontrolled components (#1371)"

This reverts commit 6728977b00.

* Revert "Revert "Fix dependency defaults for uncontrolled components (#1371)""

This reverts commit ad2bd6841b9218622a2a4bc92a07f4e8b88ce636.

* test: start writing some basic tests

* add doc on allOf

* add allOf playground sample

* handle merging errors by removing allOf

* add test for nested allOf's

* clarify that allOf keyword is dropped

* don't use merge allof fork

* remove change to package-lock.json

* prettier format
2019-12-06 22:29:27 -08:00
Jimmy Callin
58f4e074c9 Refactor some tests to assert on change events instead of internal state (#1525)
* refactored a few test fields to assert on change events instead of internal state

* remove unnecessary async await

* update test description

* fix broken performance test

* updated sinon + changed test assertions

* refactored anyOf tests to onChange

* refactored oneOf tests to use onChange event

* refactored ObjectField tests to use onChange event

* remove .only
2019-12-06 19:09:44 -08:00
nhducit
6733cc617a Reduce bundle size (#1523) 2019-11-28 11:43:54 -05:00
Chancellor Clark
561dff16f0 fix: form to accept react component (#1511) 2019-11-19 20:21:28 -08:00
aliserin
6d385e3545 Remove ui:order console warning about extraneous properties (#1508)
* isDebugMode property is added for ObjectField and order list warning about extraneous property can hide if it is needed

* uiSchema order list contains extraneous warning is completely removed
2019-11-12 08:45:13 -08:00
Jason Ritchie
ef8b7fce19 Monorepo with Lerna (#1501)
Use Lerna to maintain core and themes as a monorepo. This should streamline creation of new themes and maintenance of existing theme(s).
2019-11-10 08:26:01 -08:00
Ashwin Ramaswami
0791e42548 fix: explicitly add react-app-polyfill to package.json 2019-11-09 23:09:48 +00:00
Marton Bodonyi
e421444464 Fix IE11 not able to submit (#1432)
* Fix #1431 - ie11 not able to submit

* Fix code formatting

* Add react-app-polyfill/ie11 for playground
2019-11-08 18:39:03 -08:00
Ashwin Ramaswami
1202e226a0 fix vulnerabilities 2019-11-09 02:26:41 +00:00
Ashwin Ramaswami
2322b77ac8 Bump version to 2.0.0-alpha.1 v2.0.0-alpha.1 2019-11-09 02:15:40 +00:00
Ashwin Ramaswami
b8276c17ad Inject defaults in arrays (2) (#1499)
* Inject defaults in arrays

When using dependencies in array items, defaults are now injected.
This adjusts injecting arrays into the form data from defaults to be
in line with the previous behaviour. So the defaults are injected when
there is either no value defined in the form data or when an array is
already set in the form data, injects only into existing entries.
This makes sure that we don't change any existing behaviour by creating
array entries where we did not create them before.

For example for following schema:
{
  "type": "array",
  "minItems": 2,
  "items": {
    "title": "asd",
    "type": "object",
    "properties": {
      "item": {
        "type": "string",
        "default": "foo"
      }
    }
  }
}

and following form data:
[{}]

The result will be (note how it did not full up the array to min items)
[{ "item": "foo" }]

* Remove redundant comment

* Add documentation and example

* Merge arrays defined in parent schema by overwriting same level arrays

* fix typo

* fix typos

* wording changes

Co-Authored-By: Dominik del Bondio <dominik.del.bondio@bitextender.com>
2019-11-08 17:39:06 -08:00
Surinder Gill
70c3a03392 fix: update schema to re-render when idschema changes (#1493)
* fix: update arrays correctly when changing index

* fix: Update anyOf schema to correctly update items in an array

* fix: update schema to re-render when idschema changes
2019-11-08 17:33:26 -08:00
Surinder Gill
29c704e533 fix: Update anyOf schema to correctly update items in an array (#1491) 2019-11-08 17:25:56 -08:00
Surinder Gill
a6eff3f17a fix: update arrays correctly when changing index (#1485) 2019-11-08 17:12:04 -08:00
Miraj Patel
635df885f3 Removed setState from util, setImmediate, safeRenderCompletion (#1454)
* Removed setState from util

Fixed typo

* Removed 'setImmediate' prop usages
2019-10-31 20:56:54 -07:00
Ashwin Ramaswami
f85fe94e1d Rewrite mergeSchemas to fix schema dependencies merging (#1476)
* rewrite mergeSchemas to fix duplicate error

* fix: don't include duplicate values when merging "required" fields

* fix: merge required attribute only for object types

* fix logic for calculating required keyword
2019-10-23 21:18:29 +02:00
steelt
e130b85d75 Add extraErrors prop for async validation (#1444)
* implement errorSchema

* add an example to the playground

* improve playground for errorschema

* fix jumpy state changes when typing

* add documentation

* fix typo

* definately fixed documentation this time

* some tests for the async errors

* conform to style

* add an extra test to make sure async errors do not block submission

* change errorSchema prop to extraErrors
2019-10-22 17:01:04 -07:00
Łukasz
13ceea765e Introduce Form autoComplete attribute and deprecate autocomplete (#1483)
* Introduce Form autoComplete attribute and deprecate autocomplete

* Update documentation

* limit warnings

* fix tests for autocomplete
2019-10-22 16:40:51 -07:00
Alexandre Silva
5d167ac44f Memo components in custom widgets and fields. (#1447)
* Allow memo components on custom widgets/fields. ref #1309

* Revert accidental deletion of required prop fields in types.

* Add tests to memo components as widgets.

* Update prop-types to version 15.7.2
2019-09-25 13:03:30 -07:00
Agustin N. R. Ramirez
761ef57eda Add material-ui theme (#1420)
* Add material-ui theme

Related to issue #1222

* Delete LICENSE and update README

This is according to PR conversation

* Move material-ui theme into themes folder and delete example folder
2019-09-19 18:39:10 -07:00
dependabot[bot]
d8b8039a7a chore(deps): bump mixin-deep from 1.3.1 to 1.3.2 (#1458)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-11 19:48:53 -07:00
dependabot[bot]
2237e2a8fc chore(deps): bump extend from 3.0.1 to 3.0.2 (#1459)
Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](https://github.com/justmoon/node-extend/compare/v3.0.1...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-11 19:48:32 -07:00
Chancellor Clark
8a73870687 chore: remove node version < 8 from ci (#1462) 2019-09-11 12:19:27 -07:00
Ashwin Ramaswami
1874c94bb4 Fix typos 2019-09-10 04:33:27 +00:00
Ashwin Ramaswami
18b2ec42c9 [V2] Upgrade to react 16 (#1408)
* upgrade to react 16

* bump react peer dependency to 16

* remove react-lifecycles polyfill

* unskip react 16 test

* Fix array tests, fixes #1427

componentWillReceiveProps is not called after setState, but
getDerivedStateFromProps is called after setState. This caused the array
key tests to fail, because when onAddIndexClick is called, it sets the
state first to update keyedFormData. Only afterwards is the onChange
handler called with the new form data. And, getDerivedStateFromProps is
called in between, so it ends up being called with the old form data
instead of the new one.

Used the technique in https://stackoverflow.com/a/57208053 to work
around this, by not calculating derived state in
getDerivedStateFromProps when keyed form data is
updated.

* Remove console.error stub to fix tests

* Fix getWidget behavior for forwarded refs

* Replace componentWillReceiveProps with UNSAFE_componentWillReceiveProps
2019-09-09 20:23:32 +00:00
Chancellor Clark
e78ab11408 fix: playground links directing to old playground (#1449) 2019-09-05 07:33:19 -07:00
Chancellor Clark
59857c7fe5 fix: issue with false as formData on radio components (#1438) 2019-08-29 12:13:22 -07:00
Chancellor Clark
2cf7a382f2 fix: test suite running one test (#1437) 2019-08-28 12:54:40 -07:00
Ethan Glasser-Camp
ff3de9b514 Bump version 1.8.0 v1.8.0 2019-08-26 15:12:18 -04:00
Tony
4251a2cbcd Fix omitExtraData bugs for nested empties and nonspecified objects (#1419)
* Fixed disappearing empty objects and arrays

* Fixed some tests

* Fixed bugs

* Updated toPathSchema tests

* Added tests from #1418

* Uncommented test cases

* Remove unecessary or

* Update usage of toPathSchema

* Revert back to old period separation style in toPathSchema

* Converted change props with liveOmit test to only test for liveOmit

* Revert one other case of period positioning

* Changed according to review suggestions
2019-08-22 08:08:26 -07:00
Jon Ursenbach
d2112d3988 Adding support for $ref pointers to additionalProperties. (#1402)
* Adding support for $ref pointers to additionalProperties.

* Adding a form test for `$ref` support on `additionalProperties`.

* Inlining a definitions retireval from the registry.

* Prioritizing an additionalProperties $ref over set property types.
2019-08-21 21:20:37 -07:00
Ashwin Ramaswami
642ad5699f Fix: apply netlify badge settings to all builds, not just deploy previews 2019-08-18 10:01:44 -07:00
Tony
1c856b9bf8 Fix omitData for top level array (#1406)
* Fixes omitData converting root array to object

* Fixed conditional

* Little bit of cleanup

* Added test of getUsedFormData with top level array
2019-08-18 09:59:07 -07:00
Sabesh Rajendran
df8499c8e5 Encode checkbox settings in playground (#1403) 2019-08-18 09:54:29 -07:00
Jon Ursenbach
21976bcbd3 Key changes on additionalProperties items no longer suffer data loss. (#1401)
* Key changes on additionalProperties items no longer suffer data loss.

Resolves https://github.com/mozilla-services/react-jsonschema-form/issues/1382

* Adding a unit test.
2019-08-15 18:41:08 -07:00
Ashwin Ramaswami
90f50c32d6 fix publicPath for netlify deploy previews (#1413) 2019-08-15 18:28:30 +02:00
Ashwin Ramaswami
20ff3b97a1 Allow "0." to be typed in to a text widget (#1360)
* fix: allow "0." to be typed in

* Fix expected value of input in test for NumberField (#1361)

* test: add tests
2019-08-10 08:21:56 -07:00
Matteo
ab5623f5ed Issue1362 (#1386)
* add missing space in paragraph

* add Bootstrap version used in the example
2019-08-09 22:47:12 -07:00
Matteo
d7b26fb9d9 add missing space in paragraph (#1384) 2019-08-02 07:45:22 -07:00
Ashwin Ramaswami
63c6127547 fix: fix webpack public path for playground (#1379) 2019-07-31 07:45:57 +02:00