PLT-3344 Set Localization config to always have by default all languages available (#3339)

Этот коммит содержится в:
enahum
2016-06-15 09:10:38 -03:00
коммит произвёл Joram Wilander
родитель c7e9f3cb1b
Коммит 3f4d38f58a
7 изменённых файлов: 16 добавлений и 31 удалений

Просмотреть файл

@@ -19,9 +19,7 @@ export default class MultiSelectSetting extends React.Component {
return n.value;
});
if (!newValue || newValue.length === 0) {
this.setState({error: this.props.errorText});
} else if (this.props.mustBePresent && values.join(',').indexOf(this.props.mustBePresent) === -1) {
if (this.props.selected.length > 0 && this.props.mustBePresent && values.join(',').indexOf(this.props.mustBePresent) === -1) {
this.setState({error: this.props.notPresent});
} else {
this.props.onChange(this.props.id, values);
@@ -30,7 +28,7 @@ export default class MultiSelectSetting extends React.Component {
}
componentWillReceiveProps(newProps) {
if (newProps.mustBePresent && newProps.selected.join(',').indexOf(newProps.mustBePresent) === -1) {
if (newProps.selected.length > 0 && newProps.mustBePresent && newProps.selected.join(',').indexOf(newProps.mustBePresent) === -1) {
this.setState({error: this.props.notPresent});
} else {
this.setState({error: false});