From 701e2308a4670fb1c188660c74b8c9710e6c8e6f Mon Sep 17 00:00:00 2001 From: Gregory Ostermayr Date: Mon, 6 Jul 2015 17:09:48 -0400 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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" } }