mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
b1ecc53cfc
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
17 lines
462 B
JavaScript
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;
|