Commit 774898ee authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '574-booleanarrfilter-component' into 'master'

Fix: Updated BooleanArrFilter UI for default value

Closes #574

See merge request genesys-pgr/genesys-ui!594
parents 3291bc4d ae6d0b98
...@@ -63,7 +63,7 @@ class BooleanArrCheckbox extends React.Component<IBooleanArrCheckbox> { ...@@ -63,7 +63,7 @@ class BooleanArrCheckbox extends React.Component<IBooleanArrCheckbox> {
return option === 'NULL'; return option === 'NULL';
} }
return input.value === option; return input.value === option || typeof input.value === 'string';
} }
} }
......
...@@ -75,7 +75,7 @@ class BooleanArrFilter extends React.Component<IBooleanArrFilter, any> { ...@@ -75,7 +75,7 @@ class BooleanArrFilter extends React.Component<IBooleanArrFilter, any> {
} }
private handleChange = (input, value) => { private handleChange = (input, value) => {
const { isNotNull, notNull } = this.props; const { isNotNull, notNull, isNull } = this.props;
if (notNull) { if (notNull) {
// notNull case // notNull case
...@@ -90,7 +90,25 @@ class BooleanArrFilter extends React.Component<IBooleanArrFilter, any> { ...@@ -90,7 +90,25 @@ class BooleanArrFilter extends React.Component<IBooleanArrFilter, any> {
} }
} else { } else {
// notNull === false case // notNull === false case
if (value === 'NULL') { if (value === input.value) {
this.setState({nullChecked: false, notNullChecked: false});
input.onChange('');
return;
}
if (value === 'NULL' && input.value === '') {
if (isNotNull) {
this.setState({nullChecked: false, notNullChecked: false});
input.onChange('');
return;
}
this.setState({nullChecked: false, notNullChecked: true});
input.onChange('');
return;
}
if (value === 'NULL' && !isNull) {
this.setState({nullChecked: true, notNullChecked: false}); this.setState({nullChecked: true, notNullChecked: false});
input.onChange(''); input.onChange('');
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment