Skip to content

Commit bd6d384

Browse files
Merge pull request #23 from gokulakannant/issue-fixes
v2.0.3 Release
2 parents 4a8afaf + 4085192 commit bd6d384

34 files changed

+7268
-1818
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ All notable changes to React Form Input Validation APIs will be documented in th
88

99
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010

11+
## [2.0.3] - 07/08/2020
12+
13+
### Fixed
14+
15+
- Fixed Confirm password not working issue - [#19](https://github.com/gokulakannant/react-form-input-validation/issues/19)
16+
17+
### Modified
18+
19+
- Reduced the package size with webpack configurations.
20+
- Performance optimization
21+
1122
## [2.0.1] - 25/11/2019
1223

1324
### Fixed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ A customized [validatorjs](https://www.npmjs.com/package/validatorjs) library to
1717
* Compatible with libraries like [Material UI](https://material-ui.com/), and etc.
1818
* Readable and declarative validation rules which is inspired by laravel framework.
1919
* Error messages with multilingual support.
20+
* Handy to manage multiple forms in same page.
2021

2122
## Installation
2223

@@ -170,7 +171,7 @@ The input types button, submit, reset, hidden are exceptional from the above lis
170171

171172
## Versions
172173

173-
Latest Version: 2.0.2. For more versions refer [VERSIONS.md](VERSIONS.md).
174+
Latest Version: 2.0.3. For more versions refer [VERSIONS.md](VERSIONS.md).
174175

175176
## Changelog
176177

demo/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.DS_Store
3+
dist
File renamed without changes.

example/src/Form.js renamed to demo/app/Form.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class ValidationForm extends React.Component {
99
fields: {
1010
customer_name: "",
1111
email_address: "",
12+
password: "",
13+
password_confirmation: "",
1214
phone_number: "",
1315
pickup_time: "",
1416
taxi: "",
@@ -23,6 +25,8 @@ class ValidationForm extends React.Component {
2325
this.form.useRules({
2426
customer_name: "required|username_available",
2527
email_address: "required|email",
28+
password: "required|confirmed",
29+
password_confirmation: "required|same:password",
2630
phone_number: "required|numeric|digits_between:10,12",
2731
pickup_time: "required|date",
2832
taxi: "required",
@@ -119,6 +123,42 @@ class ValidationForm extends React.Component {
119123
</label>
120124
</p>
121125

126+
<p>
127+
<label>
128+
Password
129+
<input
130+
type="text"
131+
name="password"
132+
onBlur={this.form.handleBlurEvent}
133+
onChange={this.form.handleChangeEvent}
134+
value={this.state.fields.password}
135+
/>
136+
</label>
137+
<label className="error">
138+
{this.state.errors.password
139+
? this.state.errors.password
140+
: ""}
141+
</label>
142+
</p>
143+
144+
<p>
145+
<label>
146+
Confirm Password
147+
<input
148+
type="text"
149+
name="password_confirmation"
150+
onBlur={this.form.handleBlurEvent}
151+
onChange={this.form.handleChangeEvent}
152+
value={this.state.fields.password_confirmation}
153+
/>
154+
</label>
155+
<label className="error">
156+
{this.state.errors.password_confirmation
157+
? this.state.errors.password_confirmation
158+
: ""}
159+
</label>
160+
</p>
161+
122162
<fieldset>
123163
<legend>Which taxi do you require?</legend>
124164
<p>
@@ -216,7 +256,7 @@ class ValidationForm extends React.Component {
216256
type="date"
217257
name="pickup_time"
218258
onChange={this.form.handleChangeEvent}
219-
onBlur={this.form.handleBlurEvent}
259+
// onBlur={this.form.handleBlurEvent}
220260
value={this.state.fields.pickup_time}
221261
/>
222262
</label>

demo/app/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head><title>
4+
React Form Input Validation
5+
</title></head>
6+
<body>
7+
<div id="app"></div>
8+
</body>
9+
</html>

demo/app/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
import React from 'react';
3+
import ReactDOM from 'react-dom';
4+
import Form from "./Form";
5+
6+
ReactDOM.render(<Form />, document.getElementById('app'))
File renamed without changes.

demo/cypress/fixtures/example.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

example/cypress/integration/form.spec.js renamed to demo/cypress/integration/integration/form.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
describe('The Home Page', function() {
22
it('Successfull rendering', function() {
3-
cy.visit('http://localhost:3000/')
3+
cy.visit('http://localhost:8080/')
44
})
55

66
it('Check Submit Button', function() {
7-
cy.visit('http://localhost:3000/')
7+
cy.visit('http://localhost:8080/')
88
cy.contains('Submit Booking').click()
99
});
1010
});
1111

1212
describe("Test blur events", () => {
1313
it('Successfull rendering', function() {
14-
cy.visit('http://localhost:3000/')
14+
cy.visit('http://localhost:8080/')
1515
})
1616

1717
it("Customer Name blur (Text field)", () => {
@@ -52,7 +52,7 @@ describe("Test blur events", () => {
5252

5353
describe("Test change event", () => {
5454
it('Successfull rendering', function() {
55-
cy.visit('http://localhost:3000/')
55+
cy.visit('http://localhost:8080/')
5656
});
5757

5858
it("Customer Name change event (Text field)", () => {
@@ -100,7 +100,7 @@ describe("Test change event", () => {
100100

101101
describe("Fill form fields", () => {
102102
it('Successfull rendering', function() {
103-
cy.visit('http://localhost:3000/')
103+
cy.visit('http://localhost:8080/')
104104
});
105105

106106
it("Type customer name (Text field)", () => {
@@ -143,7 +143,7 @@ describe("Fill form fields", () => {
143143

144144
describe("Test validation rules in form fields", () => {
145145
beforeEach("Render home page", () => {
146-
cy.visit('http://localhost:3000/');
146+
cy.visit('http://localhost:8080/');
147147
})
148148
describe("Customer name (required)", () => {
149149
it("Empty fields should display error message", () => {

0 commit comments

Comments
 (0)