GithubHelp home page GithubHelp logo

redux-form-validation's People

Contributors

costicapuntaru avatar davidcurras avatar joernroeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

redux-form-validation's Issues

Validating nested form fields

I have the following JSON tree:

{
"name": "test",
"weekSchedule": {
"mon": "09:00",
"di": "09:00"
}
}

Now I would like to put a validator on the "mon" field in "weekSchedule".
i have tried "weekSchedule.mon" in the tree or same tree as the JSON.
But with neither the validator is working, how need this to be done?

Used Validator JSON file:
{
weekSchedule: {
mon: {
required: true,
pattern: /^([01]\d|2[0-3]):([0-5]\d)-([01]\d|2[0-3]):([0-5]\d)$/,
validateOnBlur: true
}
}
}

thanx for you help in advantage.

Errors on install

I just found your project and did the npm i -d && npm start in the main directory and in the example directory. This is from the terminal
screenshot 2016-10-20 05 39 09

Digits and optional

I'm setting a validation requirement that should be digits if there is any value but also optional.

My rules looks like:

{
  myProp: {
    required: false,
    digits: true,
    validateOnBlur: true
  }
}

This validates correctly for digits, but if the textbox is empty, the digits validation is still triggered. Is this a bug?

compatibility with react 16

Hello,
first I want to say thank you for this great tool,
I work on with the last version of React wich is decoupled from PropTypes, so I get this error:

_react.PropTypes is undefined

Allow use without non finalized ES syntax

This project looks very appealing, but uses stage1 EcmaScript proposals (decorators, object spread). Those are subject to change (regardless of how likely it is), and using them for production goes against our company policy.
Is there any chance you can alter the syntax used in this module so that it relies only on the latest official EcmaScript standard (ES6)?

Implement unit tests

Running npm run lint produces the following error:

/projects/redux-form-validation/src/basic-validations.js
  1:2  error  Parsing error: Illegal export declaration

/projects/redux-form-validation/src/form-messages/index.js
  1:2  error  Parsing error: Illegal import declaration

/projects/redux-form-validation/src/index.js
  1:2  error  Parsing error: Illegal import declaration

/projects/redux-form-validation/src/validation.js
  1:2  error  Parsing error: Illegal import declaration

โœ– 4 problems (4 errors, 0 warnings)

This also means that running npm run test fails.

Once this is fixed, some unit tests can be written:

  • required
  • minLength
  • maxLength
  • email
  • min
  • max
  • pattern
  • equalTo
  • oneOf
  • url
  • promise
  • digits
  • creditcard

Unable to resolve path to module 'redux-form-validation'

Hi.
I use ESlint. And ESlint displayed this error
error Unable to resolve path to module 'redux-form-validation' import/no-unresolved

I did import of redux-form-validation
import FormMessages, { generateValidation } from 'redux-form-validation';

For example
import { reduxForm } from 'redux-form'; works fine.

P.S. Validation works fine, but ESlint displayed that error.

How to resolve this issue?

Conditional validation

I'm trying to create a form to either create or edit a user account. The form content and onSubmit functions all check on this.props.params.id to see if it's an update or create. I also have an initialValues filed in the state i can check.

But for the password field, i'm having some issues. I would like to make it required on create, and not required on update.

@connect(({ forminitialstates }) => ({ initialValues: forminitialstates.adminUserEdit }))
@withStyles(BootstrapSass, s)
@reduxForm({
  form: 'useraddedit',
  fields: ['username', 'password', 'firstname', 'lastname', 'role'],
  ...generateValidation({
    username: { validateOnBlur: true, required: true, email: true },
    password: { validateOnBlur: true, required: true, minLength: 8 },
    firstname: { validateOnBlur: true, required: true },
    lastname: { validateOnBlur: true, required: true },
    role: { validateOnBlur: true, required: true },
  }),
}
)
class UserForm extends Component {
...

Is there any way i can get access to either the props or the state in the validation?

Peer Dependency error with redux-form

I have [email protected] installed, when I try to install the latest redux-form-validation (v0.0.7), I am getting an unmet peer dependency.

I have tried this on npm 2.x and 3.x.

package:

{
  "name": "temp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react": "^15.2.0",
    "react-redux": "^4.4.5",
    "redux": "^3.5.2",
    "redux-form": "^5.3.1",
    "redux-form-validation": "0.0.7"
  }
}

error:

+-- UNMET PEER DEPENDENCY [email protected]
`-- [email protected]
  `-- [email protected]

npm WARN [email protected] requires a peer of redux-form@^4.1.8 but none was installed.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

Is this an issue with this library? I have other libraries specifying a dependency and I have a higher version installed and it throws no error.

Server side validation

Is it possible to use redux-form-validation with server-side validation? I mean the case, when server return some codes of errors, that correspond with the validation rules on client side, such as required, minlength, etc.

Validation messages

It could be useful to be able to store validation messages inside module.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.