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 2021/03/18 09:36:22 UTC

[GitHub] [superset] simcha90 opened a new pull request #13687: feat(cross-filter): Cross filter badge

simcha90 opened a new pull request #13687:
URL: https://github.com/apache/superset/pull/13687


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   This PR :
   1. Add cross filters applied to filter badge
   2. Remove current chart from cross filter scoping
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   https://user-images.githubusercontent.com/56388545/111604238-cfdfb980-87dd-11eb-8aa6-5dbd7cc7e2c5.mov
   
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] codecov[bot] commented on pull request #13687: feat(cross-filter): Cross filter badge

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #13687:
URL: https://github.com/apache/superset/pull/13687#issuecomment-802033449


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=h1) Report
   > Merging [#13687](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=desc) (e6a259d) into [master](https://codecov.io/gh/apache/superset/commit/64785c20bd466699112413ba61750b04cf03b6eb?el=desc) (64785c2) will **increase** coverage by `0.08%`.
   > The diff coverage is `64.18%`.
   
   > :exclamation: Current head e6a259d differs from pull request most recent head 270ecfb. Consider uploading reports for the commit 270ecfb to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13687/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13687      +/-   ##
   ==========================================
   + Coverage   72.77%   72.86%   +0.08%     
   ==========================================
     Files         923      613     -310     
     Lines       46824    21922   -24902     
     Branches     5746     5843      +97     
   ==========================================
   - Hits        34077    15973   -18104     
   + Misses      12531     5805    -6726     
   + Partials      216      144      -72     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `56.53% <52.41%> (?)` | |
   | hive | `?` | |
   | javascript | `63.12% <62.16%> (-0.03%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...CrossFilterScopingModal/CrossFilterScopingForm.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Nyb3NzRmlsdGVyU2NvcGluZ01vZGFsL0Nyb3NzRmlsdGVyU2NvcGluZ0Zvcm0udHN4) | `46.15% <ø> (ø)` | |
   | [...rossFilterScopingModal/CrossFilterScopingModal.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Nyb3NzRmlsdGVyU2NvcGluZ01vZGFsL0Nyb3NzRmlsdGVyU2NvcGluZ01vZGFsLnRzeA==) | `90.47% <ø> (ø)` | |
   | [...perset-frontend/src/dashboard/containers/Chart.jsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb250YWluZXJzL0NoYXJ0LmpzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/dashboard/reducers/types.ts](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9yZWR1Y2Vycy90eXBlcy50cw==) | `0.00% <ø> (ø)` | |
   | [...hboard/components/FiltersBadge/FilterIndicator.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlcnNCYWRnZS9GaWx0ZXJJbmRpY2F0b3IudHN4) | `46.15% <46.15%> (ø)` | |
   | [...-frontend/src/dashboard/components/SliceHeader.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL1NsaWNlSGVhZGVyLnRzeA==) | `58.00% <58.00%> (ø)` | |
   | [...src/dashboard/components/FiltersBadge/selectors.ts](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlcnNCYWRnZS9zZWxlY3RvcnMudHM=) | `80.58% <59.37%> (-7.08%)` | :arrow_down: |
   | [...dashboard/components/FiltersBadge/DetailsPanel.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlcnNCYWRnZS9EZXRhaWxzUGFuZWwudHN4) | `64.81% <62.50%> (+10.64%)` | :arrow_up: |
   | [...d/src/dashboard/components/FiltersBadge/Styles.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0ZpbHRlcnNCYWRnZS9TdHlsZXMudHN4) | `67.56% <66.66%> (+3.46%)` | :arrow_up: |
   | [...odal/FiltersConfigForm/FilterScope/FilterScope.tsx](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyc0NvbmZpZ01vZGFsL0ZpbHRlcnNDb25maWdGb3JtL0ZpbHRlclNjb3BlL0ZpbHRlclNjb3BlLnRzeA==) | `86.20% <66.66%> (-3.08%)` | :arrow_down: |
   | ... and [540 more](https://codecov.io/gh/apache/superset/pull/13687/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=footer). Last update [64785c2...270ecfb](https://codecov.io/gh/apache/superset/pull/13687?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] villebro commented on a change in pull request #13687: feat(cross-filter): Cross filter badge

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13687:
URL: https://github.com/apache/superset/pull/13687#discussion_r596719257



##########
File path: superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx
##########
@@ -29,29 +29,36 @@ type ScopingTreeProps = {
   updateFormValues: (values: any) => void;
   formScope?: Scope;
   initialScope: Scope;
+  chartId?: number;

Review comment:
       Should we rather make this `excludedChartIds?: number[]`? Now it's unclear what the component needs the `chartId` for, and it might well be that we want to exclude some other charts other than the caller.

##########
File path: superset-frontend/src/dashboard/components/SliceHeader.tsx
##########
@@ -0,0 +1,184 @@
+/**
+ * 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 React, { FC } from 'react';
+import { styled, t } from '@superset-ui/core';
+import { Tooltip } from 'src/common/components/Tooltip';
+import { useSelector } from 'react-redux';
+import EditableTitle from '../../components/EditableTitle';
+import SliceHeaderControls from './SliceHeaderControls';
+import FiltersBadge from '../containers/FiltersBadge';
+import Icon from '../../components/Icon';
+import { RootState } from '../types';
+import { Slice } from '../../types/Chart';
+import FilterIndicator from './FiltersBadge/FilterIndicator';
+
+type SliceHeaderProps = {
+  innerRef?: string;
+  slice: Slice;
+  isExpanded?: boolean;
+  isCached?: boolean[];
+  cachedDttm?: string[];
+  updatedDttm?: number;
+  updateSliceName?: (arg0: string) => void;
+  toggleExpandSlice?: Function;
+  forceRefresh?: Function;
+  exploreChart?: Function;
+  exportCSV?: Function;
+  editMode?: boolean;
+  isFullSize?: boolean;
+  annotationQuery?: object;
+  annotationError?: object;
+  sliceName?: string;
+  supersetCanExplore?: boolean;
+  supersetCanCSV?: boolean;
+  sliceCanEdit?: boolean;
+  componentId: string;
+  dashboardId: number;
+  filters: object;
+  addSuccessToast: Function;
+  addDangerToast: Function;
+  handleToggleFullSize: Function;
+  chartStatus: string;
+};

Review comment:
       Nice, thanks for converting this file to TS!




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] villebro merged pull request #13687: feat(cross-filter): Cross filter badge

Posted by GitBox <gi...@apache.org>.
villebro merged pull request #13687:
URL: https://github.com/apache/superset/pull/13687


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [superset] simcha90 commented on a change in pull request #13687: feat(cross-filter): Cross filter badge

Posted by GitBox <gi...@apache.org>.
simcha90 commented on a change in pull request #13687:
URL: https://github.com/apache/superset/pull/13687#discussion_r596836540



##########
File path: superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FilterScope/ScopingTree.tsx
##########
@@ -54,10 +54,11 @@ const ScopingTree: FC<ScopingTreeProps> = ({
   const handleCheck = (checkedKeys: string[]) => {
     forceUpdate();
     const scope = findFilterScope(checkedKeys, layout);
+    const excluded = new Set([...scope.excluded, chartId]);
     updateFormValues({
       scope: {
         ...scope,
-        excluded: [...scope.excluded, chartId],
+        excluded: [...excluded].filter(id => id !== undefined),

Review comment:
       ```
   if (chartId !== undefined) {
      scope.excluded = new Set([...scope.excluded, chartId]);
   }
   ```
   may be better like this




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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