You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/05/31 18:34:53 UTC

[GitHub] mistercrunch closed pull request #5110: [Explore][Adhoc Filters] fixing LIKE constant name

mistercrunch closed pull request #5110: [Explore][Adhoc Filters] fixing LIKE constant name
URL: https://github.com/apache/incubator-superset/pull/5110
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx b/superset/assets/spec/javascripts/explore/components/AdhocFilterEditPopoverSimpleTabContent_spec.jsx
index 74ac96701e..2014bbc7c9 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 ba9651528c..675cc27f61 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 b35da71012..bf8fa1d3e6 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 7b57cbaa76..9a8acc8041 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['=='],


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org