mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(explore): Incorrect conversion from simple bool filter to custom sql (#21293)
This commit is contained in:
committed by
GitHub
parent
eb805682e2
commit
076af6003a
@@ -66,10 +66,10 @@ export function optionLabel(opt) {
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
if (opt === true) {
|
||||
return '<true>';
|
||||
return TRUE_STRING;
|
||||
}
|
||||
if (opt === false) {
|
||||
return '<false>';
|
||||
return FALSE_STRING;
|
||||
}
|
||||
if (typeof opt !== 'string' && opt.toString) {
|
||||
return opt.toString();
|
||||
|
||||
@@ -21,6 +21,8 @@ import {
|
||||
optionFromValue,
|
||||
prepareCopyToClipboardTabularData,
|
||||
NULL_STRING,
|
||||
TRUE_STRING,
|
||||
FALSE_STRING,
|
||||
} from 'src/utils/common';
|
||||
|
||||
describe('utils/common', () => {
|
||||
@@ -28,9 +30,12 @@ describe('utils/common', () => {
|
||||
it('converts values as expected', () => {
|
||||
expect(optionFromValue(false)).toEqual({
|
||||
value: false,
|
||||
label: '<false>',
|
||||
label: FALSE_STRING,
|
||||
});
|
||||
expect(optionFromValue(true)).toEqual({
|
||||
value: true,
|
||||
label: TRUE_STRING,
|
||||
});
|
||||
expect(optionFromValue(true)).toEqual({ value: true, label: '<true>' });
|
||||
expect(optionFromValue(null)).toEqual({
|
||||
value: NULL_STRING,
|
||||
label: NULL_STRING,
|
||||
|
||||
Reference in New Issue
Block a user