Ghost/core/client/app/validators/setup.js
Austin Burdine d0c151be70 adds inline errors to validation
closes #5336
- creates gh-form-group component to handle form group status
- refactors current validation methods to work on a per-property basis
- adds gh-error-message component to render error message
- removes (comments out) tests that pertain to the old notifications until the new inline validation is added
2015-07-05 14:02:06 -04:00

17 lines
462 B
JavaScript

import NewUserValidator from 'ghost/validators/new-user';
var SetupValidator = NewUserValidator.create({
properties: ['name', 'email', 'password', 'blogTitle'],
blogTitle: function (model) {
var blogTitle = model.get('blogTitle');
if (!validator.isLength(blogTitle, 1)) {
model.get('errors').add('blogTitle', 'Please enter a blog title.');
this.invalidate();
}
}
});
export default SetupValidator;