### [Задача в Jira](https://%YOUR_TASK_MANAGEMENT_TOOL_URL%/browse/FN-)
**Суть:**
**Решение:**
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SignupForm = forms.Form.extend({ | |
username: forms.CharField(), | |
email: forms.EmailField(), | |
password: forms.CharField({widget: forms.PasswordInput}), | |
confirmPassword: forms.CharField({widget: forms.PasswordInput}), | |
acceptTerms: forms.BooleanField({required: true}) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clean: function() { | |
if (this.cleanedData.password && | |
this.cleanedData.confirmPassword && | |
this.cleanedData.password != this.cleanedData.confirmPassword) { | |
throw forms.ValidationError('Passwords do not match.') | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var Formsy = require('formsy-react'); | |
var MyOwnInput = React.createClass({ | |
// Add the Formsy Mixin | |
mixins: [Formsy.Mixin], | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validators={[ | |
{ | |
validator(value, params) { | |
if (value) { | |
return Promise.resolve(); | |
} | |
return Promise.reject(params.message); | |
}, | |
params: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var less = require('gulp-less'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var browserSync = require('browser-sync').create(); | |
gulp.task('css', function () { | |
return gulp.src('less/main.less') | |
.pipe(less()) | |
// THIS FCKING SOLUTION! FCK YEAH! |
Инстанс должен иметь не только список в виде массива невалидных полей, но и объект, где каждое поле представлено объектов, там есть:
- fieldName
- хэндлеры для редактирования состояния
- список ошибок
- текст подсказки
- в каждом поле можно перезаписать тип валидации
import React, { Component } from 'react';
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ------------------ The Life-Cycle of a Composite Component ------------------ | |
* | |
* - constructor: Initialization of state. The instance is now retained. | |
* - componentWillMount | |
* - render | |
* - [children's constructors] | |
* - [children's componentWillMount and render] | |
* - [children's componentDidMount] | |
* - componentDidMount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PropTypes } from 'react'; | |
import Popover from 'react-popover'; | |
// Components | |
import { EditQuantity } from '../dropdowns'; | |
export class FullNormalTable extends Component { | |
static contextTypes = { | |
store: PropTypes.object.isRequired | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"auto_indent": true, | |
"bold_folder_labels": true, | |
"caret_extra_width": 2, | |
"color_scheme": "Packages/Colorcoder/Material-Theme (Colorcoded).tmTheme", | |
"draw_white_space": "selection", | |
"ensure_newline_at_eof_on_save": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", |