You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/05/31 18:34:58 UTC

[incubator-superset] branch master updated: fixing LIKE constant name (#5110)

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new f3778c3  fixing LIKE constant name (#5110)
f3778c3 is described below

commit f3778c3c81b1e9a04869708b8206daf7734a0fa7
Author: Gabe Lyons <ga...@airbnb.com>
AuthorDate: Thu May 31 11:34:51 2018 -0700

    fixing LIKE constant name (#5110)
---
 .../components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx        | 4 ++--
 superset/assets/src/explore/AdhocFilter.js                            | 2 +-
 .../src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx | 2 ++
 superset/assets/src/explore/constants.js                              | 4 ++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx b/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx
index 74ac967..2014bbc 100644
--- a/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx
+++ b/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx
@@ -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', () => {
diff --git a/superset/assets/src/explore/AdhocFilter.js b/superset/assets/src/explore/AdhocFilter.js
index ba96515..675cc27 100644
--- a/superset/assets/src/explore/AdhocFilter.js
+++ b/superset/assets/src/explore/AdhocFilter.js
@@ -19,7 +19,7 @@ const OPERATORS_TO_SQL = {
   '<=': '<=',
   in: 'in',
   'not in': 'not in',
-  like: 'like',
+  LIKE: 'like',
 };
 
 function translateToSql(adhocMetric, { useSimple } = {}) {
diff --git a/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx b/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx
index b35da71..bf8fa1d 100644
--- a/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx
+++ b/superset/assets/src/explore/components/AdhocFilterEditPopoverSimpleTabContent.jsx
@@ -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;
 }
diff --git a/superset/assets/src/explore/constants.js b/superset/assets/src/explore/constants.js
index 7b57cba..9a8acc8 100644
--- a/superset/assets/src/explore/constants.js
+++ b/superset/assets/src/explore/constants.js
@@ -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['=='],

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.