mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fixing LIKE constant name (#5110)
This commit is contained in:
committed by
Maxime Beauchemin
parent
cefc206a36
commit
f3778c3c81
@@ -113,13 +113,13 @@ describe('AdhocFilterEditPopoverSimpleTabContent', () => {
|
||||
it('will filter operators for table datasources', () => {
|
||||
const { wrapper } = setup({ datasource: { type: 'table' } });
|
||||
expect(wrapper.instance().isOperatorRelevant('regex')).to.be.false;
|
||||
expect(wrapper.instance().isOperatorRelevant('like')).to.be.true;
|
||||
expect(wrapper.instance().isOperatorRelevant('LIKE')).to.be.true;
|
||||
});
|
||||
|
||||
it('will filter operators for druid datasources', () => {
|
||||
const { wrapper } = setup({ datasource: { type: 'druid' } });
|
||||
expect(wrapper.instance().isOperatorRelevant('regex')).to.be.true;
|
||||
expect(wrapper.instance().isOperatorRelevant('like')).to.be.false;
|
||||
expect(wrapper.instance().isOperatorRelevant('LIKE')).to.be.false;
|
||||
});
|
||||
|
||||
it('expands when its multi comparator input field expands', () => {
|
||||
|
||||
@@ -19,7 +19,7 @@ const OPERATORS_TO_SQL = {
|
||||
'<=': '<=',
|
||||
in: 'in',
|
||||
'not in': 'not in',
|
||||
like: 'like',
|
||||
LIKE: 'like',
|
||||
};
|
||||
|
||||
function translateToSql(adhocMetric, { useSimple } = {}) {
|
||||
|
||||
@@ -42,6 +42,8 @@ function translateOperator(operator) {
|
||||
return 'equals';
|
||||
} else if (operator === OPERATORS['!=']) {
|
||||
return 'not equal to';
|
||||
} else if (operator === OPERATORS.LIKE) {
|
||||
return 'like';
|
||||
}
|
||||
return operator;
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ export const OPERATORS = {
|
||||
'<=': '<=',
|
||||
in: 'in',
|
||||
'not in': 'not in',
|
||||
like: 'like',
|
||||
LIKE: 'LIKE',
|
||||
regex: 'regex',
|
||||
};
|
||||
|
||||
export const TABLE_ONLY_OPERATORS = [OPERATORS.like];
|
||||
export const TABLE_ONLY_OPERATORS = [OPERATORS.LIKE];
|
||||
export const DRUID_ONLY_OPERATORS = [OPERATORS.regex];
|
||||
export const HAVING_OPERATORS = [
|
||||
OPERATORS['=='],
|
||||
|
||||
Reference in New Issue
Block a user