michael-s-molina commented on a change in pull request #16992:
URL: https://github.com/apache/superset/pull/16992#discussion_r737751821



##########
File path: superset-frontend/src/dashboard/util/filterboxMigrationHelper.test.ts
##########
@@ -0,0 +1,150 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import getNativeFilterConfig from './filterboxMigrationHelper';
+
+const regionFilter = {
+  cache_timeout: null,
+  changed_on: '2021-10-07 11:57:48.355047',
+  description: null,
+  description_markeddown: '',
+  form_data: {
+    compare_lag: '10',
+    compare_suffix: 'o10Y',
+    country_fieldtype: 'cca3',
+    datasource: '1__table',
+    date_filter: false,
+    entity: 'country_code',
+    filter_configs: [
+      {
+        asc: false,
+        clearable: true,
+        column: 'region',
+        key: '2s98dfu',
+        metric: 'sum__SP_POP_TOTL',
+        multiple: false,
+      },
+      {
+        asc: false,
+        clearable: true,
+        column: 'country_name',
+        key: 'li3j2lk',
+        metric: 'sum__SP_POP_TOTL',
+        multiple: true,
+      },
+    ],
+    granularity_sqla: 'year',
+    groupby: [],
+    limit: '25',
+    markup_type: 'markdown',
+    row_limit: 50000,
+    show_bubbles: true,
+    slice_id: 32,
+    time_range: '2014-01-01 : 2014-01-02',
+    time_range_endpoints: ['inclusive', 'exclusive'],
+    viz_type: 'filter_box',
+  },
+  modified: '<bound method AuditMixinNullable.modified of Region Filter>',
+  slice_name: 'Region Filter',
+  slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%2032%7D',
+  slice_id: 32,
+};
+const chart1 = {
+  cache_timeout: null,
+  changed_on: '2021-09-07 18:05:18.896212',
+  description: null,
+  description_markeddown: '',
+  form_data: {
+    compare_lag: '10',
+    compare_suffix: 'over 10Y',
+    country_fieldtype: 'cca3',
+    datasource: '1__table',
+    entity: 'country_code',
+    granularity_sqla: 'year',
+    groupby: [],
+    limit: '25',
+    markup_type: 'markdown',
+    metric: 'sum__SP_POP_TOTL',
+    row_limit: 50000,
+    show_bubbles: true,
+    slice_id: 33,
+    time_range: '2000 : 2014-01-02',
+    time_range_endpoints: ['inclusive', 'exclusive'],
+    viz_type: 'big_number',
+  },
+  modified: "<bound method AuditMixinNullable.modified of World's Population>",
+  slice_name: "World's Population",
+  slice_url: '/superset/explore/?form_data=%7B%22slice_id%22%3A%2033%7D',
+  slice_id: 33,
+};
+const chartData = [regionFilter, chart1];
+const preselectedFilters = {
+  '32': {
+    region: ['East Asia & Pacific'],
+  },
+};
+
+describe('getNativeFilterConfig', () => {

Review comment:
       Can you avoid `describe` blocks? You can check 
[this](https://github.com/apache/superset/wiki/Testing-Guidelines-and-Best-Practices#avoid-nesting-when-youre-testing)
 section of our Testing Guidelines for more information about it.

##########
File path: superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
##########
@@ -19,7 +19,7 @@
 import cx from 'classnames';
 import React from 'react';
 import PropTypes from 'prop-types';
-import { styled } from '@superset-ui/core';
+import { styled, supersetTheme } from '@superset-ui/core';

Review comment:
       ```suggestion
   import { styled } from '@superset-ui/core';
   ```

##########
File path: superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
##########
@@ -95,12 +97,18 @@ const SHOULD_UPDATE_ON_PROP_CHANGES = 
Object.keys(propTypes).filter(
 );
 const OVERFLOWABLE_VIZ_TYPES = new Set(['filter_box']);
 const DEFAULT_HEADER_HEIGHT = 22;
+const { colors } = supersetTheme;

Review comment:
       ```suggestion
   ```

##########
File path: superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
##########
@@ -19,7 +19,7 @@
 import cx from 'classnames';
 import React from 'react';
 import PropTypes from 'prop-types';
-import { styled } from '@superset-ui/core';
+import { styled, supersetTheme } from '@superset-ui/core';

Review comment:
       We shouldn't access the `theme` directly. `styled` already provides the 
theme object for you.

##########
File path: superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
##########
@@ -95,12 +97,18 @@ const SHOULD_UPDATE_ON_PROP_CHANGES = 
Object.keys(propTypes).filter(
 );
 const OVERFLOWABLE_VIZ_TYPES = new Set(['filter_box']);
 const DEFAULT_HEADER_HEIGHT = 22;
+const { colors } = supersetTheme;
 
 const ChartOverlay = styled.div`
   position: absolute;
   top: 0;
   left: 0;
   z-index: 5;
+
+  &.is-deactivated {
+    opacity: 0.5;
+    background-color: ${colors.grayscale.light1};

Review comment:
       ```suggestion
       background-color: ${({ theme }) => theme.colors.grayscale.light1};
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to