From 92880679589ec527885a0e0aa022934745750b08 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Thu, 5 Jan 2017 18:22:36 -0300 Subject: [PATCH] Ivan - Add language list validation [skip ci] --- .../settings/admin-panel-system-preferences.js | 10 +++++----- client/src/core-components/checkbox-group.js | 15 ++++++++++++++- client/src/core-components/checkbox-group.scss | 5 +++++ client/src/data/languages/en.js | 2 ++ client/src/lib-app/validations/list-validator.js | 10 ++++++++++ .../lib-app/validations/validations-factory.js | 5 ++++- 6 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 client/src/lib-app/validations/list-validator.js diff --git a/client/src/app/admin/panel/settings/admin-panel-system-preferences.js b/client/src/app/admin/panel/settings/admin-panel-system-preferences.js index cdab72ec..dac728dc 100644 --- a/client/src/app/admin/panel/settings/admin-panel-system-preferences.js +++ b/client/src/app/admin/panel/settings/admin-panel-system-preferences.js @@ -51,11 +51,11 @@ class AdminPanelSystemPreferences extends React.Component {
- - + +
- +
@@ -89,11 +89,11 @@ class AdminPanelSystemPreferences extends React.Component {
{i18n('ALLOWED_LANGUAGES')}
- +
{i18n('SUPPORTED_LANGUAGES')}
- +
diff --git a/client/src/core-components/checkbox-group.js b/client/src/core-components/checkbox-group.js index 76f6eb5c..bbe229a7 100644 --- a/client/src/core-components/checkbox-group.js +++ b/client/src/core-components/checkbox-group.js @@ -1,4 +1,5 @@ import React from 'react'; +import classNames from 'classnames'; import _ from 'lodash'; import Checkbox from 'core-components/checkbox'; @@ -6,6 +7,7 @@ import Checkbox from 'core-components/checkbox'; class CheckboxGroup extends React.Component { static propTypes = { items: React.PropTypes.array.isRequired, + errored: React.PropTypes.bool, value: React.PropTypes.arrayOf(React.PropTypes.number), onChange: React.PropTypes.func }; @@ -16,7 +18,7 @@ class CheckboxGroup extends React.Component { render() { return ( -