From 701e2308a4670fb1c188660c74b8c9710e6c8e6f Mon Sep 17 00:00:00 2001 From: Gregory Ostermayr Date: Mon, 6 Jul 2015 17:09:48 -0400 Subject: [PATCH 01/10] fix typo --- API.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/API.md b/API.md index c356e15..6561eab 100644 --- a/API.md +++ b/API.md @@ -210,7 +210,7 @@ You should always use the [**getValue()**](#getvalue) method inside your formsy } }}/> ``` -An comma seperated list with validation rules. Take a look at [**Validators**](#validators) to see default rules. Use ":" to separate argument passed to the validator. The argument will go through a **JSON.parse** converting them into correct JavaScript types. Meaning: +An comma separated list with validation rules. Take a look at [**Validators**](#validators) to see default rules. Use ":" to separate argument passed to the validator. The argument will go through a **JSON.parse** converting them into correct JavaScript types. Meaning: ```html From b86cca70b34c66c8e34b3b24d322669bfa653f3e Mon Sep 17 00:00:00 2001 From: Dmitry Semigradsky Date: Tue, 7 Jul 2015 22:26:24 +0300 Subject: [PATCH 02/10] Edited build badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfb203b..2e7729d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -formsy-react [![GitHub release](https://img.shields.io/github/release/christianalfoni/formsy-react.svg)](https://github.com/christianalfoni/formsy-react/releases) ![build](https://travis-ci.org/christianalfoni/formsy-react.svg) +formsy-react [![GitHub release](https://img.shields.io/github/release/christianalfoni/formsy-react.svg)](https://github.com/christianalfoni/formsy-react/releases) [![Build Status](https://travis-ci.org/christianalfoni/formsy-react.svg?branch=master)](https://travis-ci.org/christianalfoni/formsy-react) ============ A form input builder and validator for React JS From 8691866c0dd3c8d956931e186f43c73e1aa8aafa Mon Sep 17 00:00:00 2001 From: Reinier Guerra Date: Thu, 9 Jul 2015 23:32:23 -0400 Subject: [PATCH 03/10] Update main.js --- src/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 7689b99..ff14fc6 100644 --- a/src/main.js +++ b/src/main.js @@ -365,17 +365,18 @@ Formsy.Form = React.createClass({ // Validate the form by going through all child input components // and check their state validateForm: function () { - var allIsValid = true; + var allIsValid; var inputs = this.inputs; var inputKeys = Object.keys(inputs); // We need a callback as we are validating all inputs again. This will // run when the last component has set its state var onValidationComplete = function () { - inputKeys.forEach(function (name) { + allIsValid = inputKeys.every(function (name) { if (!inputs[name].state._isValid) { - allIsValid = false; + return false; } + return true; }.bind(this)); this.setState({ From 31e959017228f934548df14378aab8b3bee77fec Mon Sep 17 00:00:00 2001 From: Reinier Guerra Date: Fri, 10 Jul 2015 11:18:44 -0400 Subject: [PATCH 04/10] Update main.js --- src/main.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.js b/src/main.js index ff14fc6..729d3f5 100644 --- a/src/main.js +++ b/src/main.js @@ -373,10 +373,7 @@ Formsy.Form = React.createClass({ // run when the last component has set its state var onValidationComplete = function () { allIsValid = inputKeys.every(function (name) { - if (!inputs[name].state._isValid) { - return false; - } - return true; + return inputs[name].state._isValid; }.bind(this)); this.setState({ From 4da58c12d792618de370d15bf0fad311f4af616b Mon Sep 17 00:00:00 2001 From: Michael Contento Date: Fri, 24 Jul 2015 17:23:49 +0200 Subject: [PATCH 05/10] any bugfix release of react 0.13 is fine for us --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ecf2a93..344fe77 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,6 @@ "webpack-dev-server": "^1.7.0" }, "peerDependencies": { - "react": "^0.13.1" + "react": "0.13.x" } } From 977bf7caaf326ed155c1f5d200c544a020178840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Marohni=C4=87?= Date: Fri, 24 Jul 2015 18:23:24 +0200 Subject: [PATCH 06/10] Fix React warnings in tests --- specs/Element-spec.jsx | 17 ++++++++++------- specs/Formsy-spec.jsx | 14 +++++++------- specs/Validation-spec.jsx | 8 ++++---- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/specs/Element-spec.jsx b/specs/Element-spec.jsx index d517f37..20f3ea5 100644 --- a/specs/Element-spec.jsx +++ b/specs/Element-spec.jsx @@ -198,8 +198,11 @@ describe('Element', function() { it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], + changeValue: function (event) { + this.setValue(event.target.value); + }, render: function () { - return + return } }); var TestForm = React.createClass({ @@ -237,7 +240,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -264,7 +267,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -368,7 +371,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -394,7 +397,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -428,7 +431,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -459,7 +462,7 @@ it('should allow an undefined value to be updated to a value', function (done) { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ diff --git a/specs/Formsy-spec.jsx b/specs/Formsy-spec.jsx index 5f74041..34d3250 100755 --- a/specs/Formsy-spec.jsx +++ b/specs/Formsy-spec.jsx @@ -84,7 +84,7 @@ describe('Formsy', function () { // Wait before adding the input setTimeout(function () { - inputs.push(); + inputs.push(); forceUpdate(function () { // Wait for next event loop, as that does the form @@ -135,7 +135,7 @@ describe('Formsy', function () { // Wait before adding the input setTimeout(function () { - inputs.push(); + inputs.push(); forceUpdate(function () { @@ -377,7 +377,7 @@ describe('Formsy', function () { ); // Wait before adding the input - inputs.push(); + inputs.push(); forceUpdate(function () { @@ -400,7 +400,7 @@ describe('Formsy', function () { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -438,7 +438,7 @@ describe('Formsy', function () { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return ; + return ; } }); var TestForm = React.createClass({ @@ -493,7 +493,7 @@ describe('Formsy', function () { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return ; + return ; } }); var TestForm = React.createClass({ @@ -523,7 +523,7 @@ describe('Formsy', function () { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return ; + return ; } }); var TestForm = React.createClass({ diff --git a/specs/Validation-spec.jsx b/specs/Validation-spec.jsx index cf92542..fd6fabe 100644 --- a/specs/Validation-spec.jsx +++ b/specs/Validation-spec.jsx @@ -160,7 +160,7 @@ describe('Validation', function() { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -191,7 +191,7 @@ describe('Validation', function() { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -223,7 +223,7 @@ describe('Validation', function() { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ @@ -253,7 +253,7 @@ describe('Validation', function() { var TestInput = React.createClass({ mixins: [Formsy.Mixin], render: function () { - return + return } }); var TestForm = React.createClass({ From d623d9ddf1619440641d81493517a1e3ad151e9c Mon Sep 17 00:00:00 2001 From: David Blurton Date: Mon, 31 Aug 2015 11:22:11 +0000 Subject: [PATCH 07/10] Depend on beta version of React --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 344fe77..907493d 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,6 @@ "webpack-dev-server": "^1.7.0" }, "peerDependencies": { - "react": "0.13.x" + "react": "^0.14.0-beta3" } } From 3258545a5500b11fb37f8e8d9c0fbb587b376606 Mon Sep 17 00:00:00 2001 From: David Blurton Date: Mon, 31 Aug 2015 13:17:34 +0000 Subject: [PATCH 08/10] Fix package.json --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 703ad46..2094847 100644 --- a/package.json +++ b/package.json @@ -25,16 +25,13 @@ "dependencies": { "form-data-to-object": "^0.1.0" }, - "peerDependencies": { - "react": "^0.14.0-beta1" - }, "devDependencies": { "babel": "^5.6.4", "babel-core": "^5.1.11", "babel-loader": "^5.0.0", "jasmine-node": "^1.14.5", "jsdom": "^3.1.2", - "react": "^0.14.0-beta3" + "react": "^0.14.0-beta3", "react-dom": "^0.14.0-beta3", "webpack": "^1.7.3", "webpack-dev-server": "^1.7.0" From 712f38883b7018ed806374bfc020ad3f123b7661 Mon Sep 17 00:00:00 2001 From: David Blurton Date: Mon, 31 Aug 2015 13:17:58 +0000 Subject: [PATCH 09/10] Use react-dom --- examples/custom-validation/app.js | 3 ++- examples/login/app.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/custom-validation/app.js b/examples/custom-validation/app.js index bd5fd32..03a5b9a 100644 --- a/examples/custom-validation/app.js +++ b/examples/custom-validation/app.js @@ -1,4 +1,5 @@ var React = require('react'); +var ReactDOM = require('react-dom'); var Formsy = require('formsy-react'); var currentYear = new Date().getFullYear(); @@ -120,4 +121,4 @@ var Validations = React.createClass({ } }); -React.render(, document.getElementById('example')); +ReactDOM.render(, document.getElementById('example')); diff --git a/examples/login/app.js b/examples/login/app.js index 24439c2..d6e0da8 100644 --- a/examples/login/app.js +++ b/examples/login/app.js @@ -1,4 +1,5 @@ var React = require('react'); +var ReactDOM = require('react-dom'); var Formsy = require('formsy-react'); var App = React.createClass({ @@ -62,4 +63,4 @@ var MyOwnInput = React.createClass({ } }); -React.render(, document.getElementById('example')); +ReactDOM.render(, document.getElementById('example')); From 87f14ae418ad0226eeae599c97ac52132cb10f86 Mon Sep 17 00:00:00 2001 From: David Blurton Date: Mon, 31 Aug 2015 13:18:12 +0000 Subject: [PATCH 10/10] Fix warnings --- examples/custom-validation/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/custom-validation/app.js b/examples/custom-validation/app.js index 03a5b9a..beef629 100644 --- a/examples/custom-validation/app.js +++ b/examples/custom-validation/app.js @@ -108,13 +108,13 @@ var Validations = React.createClass({
Validation Type
- Time + Time
- Decimal + Decimal
- Binary + Binary
);