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 2022/11/30 15:16:56 UTC

[GitHub] [superset] geido opened a new pull request, #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

geido opened a new pull request, #22276:
URL: https://github.com/apache/superset/pull/22276

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   This PR adds the ability to open the "more filters" dropdown in the horizontal filter bar while refactoring the code to better differentiate between focus and hover actions on native filters.
   
   ### AFTER
   
   https://user-images.githubusercontent.com/60598000/204836413-190dc840-a2b3-4c1f-8385-86e31837947f.mp4
   
   ### TESTING INSTRUCTIONS
   1. Enable HORIZONTAL_FILTER_BAR feature flag
   2. Open a dashboard
   3. Set the filter bar to horizontal
   4. Click on a filter that is currently within the "more filters" dropdown
   5. The dropdown should open and focus the filter
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [x] Required feature flags: HORIZONTAL_FILTER_BAR
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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] michael-s-molina commented on pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on PR #22276:
URL: https://github.com/apache/superset/pull/22276#issuecomment-1334082077

   @geido Can you rebase 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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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 #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

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

   # [Codecov](https://codecov.io/gh/apache/superset/pull/22276?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#22276](https://codecov.io/gh/apache/superset/pull/22276?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c1b9d88) into [master](https://codecov.io/gh/apache/superset/commit/d1e576cbd14a0fcc9d5a0a6e6c01e19ac52c44bb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d1e576c) will **decrease** coverage by `11.45%`.
   > The diff coverage is `39.73%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #22276       +/-   ##
   ===========================================
   - Coverage   66.91%   55.46%   -11.46%     
   ===========================================
     Files        1839     1841        +2     
     Lines       70083    70220      +137     
     Branches     7638     7670       +32     
   ===========================================
   - Hits        46897    38947     -7950     
   - Misses      21219    29291     +8072     
   - Partials     1967     1982       +15     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `52.45% <35.00%> (-0.02%)` | :arrow_down: |
   | python | `57.44% <80.00%> (-23.90%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `50.87% <70.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/22276?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ages/superset-ui-core/src/query/types/Dashboard.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvRGFzaGJvYXJkLnRz) | `100.00% <ø> (ø)` | |
   | [...superset-ui-core/src/query/types/PostProcessing.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGFja2FnZXMvc3VwZXJzZXQtdWktY29yZS9zcmMvcXVlcnkvdHlwZXMvUG9zdFByb2Nlc3NpbmcudHM=) | `100.00% <ø> (ø)` | |
   | [...ins/plugin-chart-echarts/src/BoxPlot/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvQm94UGxvdC9idWlsZFF1ZXJ5LnRz) | `66.66% <ø> (ø)` | |
   | [...s/plugin-chart-echarts/src/BoxPlot/controlPanel.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvQm94UGxvdC9jb250cm9sUGFuZWwudHM=) | `5.55% <ø> (ø)` | |
   | [...charts/src/Timeseries/Regular/Bar/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy9SZWd1bGFyL0Jhci9jb250cm9sUGFuZWwudHN4) | `35.71% <ø> (+4.46%)` | :arrow_up: |
   | [.../plugin-chart-echarts/src/Timeseries/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtZWNoYXJ0cy9zcmMvVGltZXNlcmllcy9idWlsZFF1ZXJ5LnRz) | `71.42% <ø> (ø)` | |
   | [.../plugin-chart-pivot-table/src/plugin/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtcGl2b3QtdGFibGUvc3JjL3BsdWdpbi9idWlsZFF1ZXJ5LnRz) | `42.85% <ø> (ø)` | |
   | [...ugin-chart-pivot-table/src/plugin/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtcGl2b3QtdGFibGUvc3JjL3BsdWdpbi9jb250cm9sUGFuZWwudHN4) | `4.16% <0.00%> (ø)` | |
   | [...ntend/plugins/plugin-chart-table/src/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL2J1aWxkUXVlcnkudHM=) | `56.25% <ø> (ø)` | |
   | [...nd/plugins/plugin-chart-table/src/controlPanel.tsx](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtdGFibGUvc3JjL2NvbnRyb2xQYW5lbC50c3g=) | `53.12% <0.00%> (ø)` | |
   | ... and [361 more](https://codecov.io/gh/apache/superset/pull/22276/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@superset.apache.org

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] github-actions[bot] commented on pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22276:
URL: https://github.com/apache/superset/pull/22276#issuecomment-1333650467

   @kgabryje Container image not yet published for this PR. Please try again when build is complete.


-- 
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: notifications-unsubscribe@superset.apache.org

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] kgabryje commented on pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
kgabryje commented on PR #22276:
URL: https://github.com/apache/superset/pull/22276#issuecomment-1333649611

   /testenv up FEATURE_HORIZONTAL_FILTER_BAR=true


-- 
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: notifications-unsubscribe@superset.apache.org

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] geido merged pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
geido merged PR #22276:
URL: https://github.com/apache/superset/pull/22276


-- 
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: notifications-unsubscribe@superset.apache.org

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] github-actions[bot] commented on pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #22276:
URL: https://github.com/apache/superset/pull/22276#issuecomment-1333650475

   @kgabryje Ephemeral environment creation failed. Please check the Actions logs for details.


-- 
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: notifications-unsubscribe@superset.apache.org

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] michael-s-molina commented on a diff in pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on code in PR #22276:
URL: https://github.com/apache/superset/pull/22276#discussion_r1036480447


##########
superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts:
##########
@@ -67,9 +68,9 @@ const useFilterFocusHighlightStyles = (chartId: number) => {
     pointerEvents: 'auto',
   };
 
-  if (focusedNativeFilterId) {
+  if (highlighterFilterId) {
     if (
-      nativeFilters.filters[focusedNativeFilterId]?.chartsInScope?.includes(
+      nativeFilters.filters[highlighterFilterId]?.chartsInScope?.includes(

Review Comment:
   ```suggestion
         nativeFilters.filters[highlightedFilterId]?.chartsInScope?.includes(
   ```



##########
superset-frontend/src/dashboard/components/gridComponents/Tabs.jsx:
##########
@@ -340,9 +340,10 @@ export class Tabs extends React.PureComponent {
     const { tabIndex: selectedTabIndex, activeKey } = this.state;
 
     let tabsToHighlight;
-    if (nativeFilters?.focusedFilterId) {
-      tabsToHighlight =
-        nativeFilters.filters[nativeFilters.focusedFilterId].tabsInScope;
+    const highlighterFilterId =
+      nativeFilters?.focusedFilterId || nativeFilters?.hoveredFilterId;
+    if (highlighterFilterId) {
+      tabsToHighlight = nativeFilters.filters[highlighterFilterId]?.tabsInScope;

Review Comment:
   ```suggestion
       const highlightedFilterId =
         nativeFilters?.focusedFilterId || nativeFilters?.hoveredFilterId;
       if (highlightedFilterId) {
         tabsToHighlight = nativeFilters.filters[highlightedFilterId]?.tabsInScope;
   ```



##########
superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts:
##########
@@ -49,8 +49,9 @@ const useFilterFocusHighlightStyles = (chartId: number) => {
     dashboardFilters,
   );
 
-  const focusedNativeFilterId = nativeFilters.focusedFilterId;
-  if (!(focusedFilterScope || focusedNativeFilterId)) {
+  const highlighterFilterId =
+    nativeFilters?.focusedFilterId || nativeFilters?.hoveredFilterId;
+  if (!(focusedFilterScope || highlighterFilterId)) {

Review Comment:
   ```suggestion
     const highlightedFilterId =
       nativeFilters?.focusedFilterId || nativeFilters?.hoveredFilterId;
     if (!(focusedFilterScope || highlightedFilterId)) {
   ```



##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/utils.ts:
##########
@@ -21,8 +21,21 @@ import { Dispatch } from 'react';
 import {
   setFocusedNativeFilter,
   unsetFocusedNativeFilter,
+  setHoveredNativeFilter,
+  unsetHoveredNativeFilter,
 } from 'src/dashboard/actions/nativeFilters';
 
+export const dispatchHoverAction = debounce(
+  (dispatch: Dispatch<any>, id?: string) => {
+    if (id) {
+      dispatch(setHoveredNativeFilter(id));
+    } else {
+      dispatch(unsetHoveredNativeFilter());
+    }
+  },
+  300,

Review Comment:
   There's a `FAST_DEBOUNCE` in `src/constants.ts`



##########
superset-frontend/src/dashboard/util/useFilterFocusHighlightStyles.ts:
##########
@@ -67,9 +68,9 @@ const useFilterFocusHighlightStyles = (chartId: number) => {
     pointerEvents: 'auto',
   };
 
-  if (focusedNativeFilterId) {
+  if (highlighterFilterId) {

Review Comment:
   ```suggestion
     if (highlightedFilterId) {
   ```



-- 
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: notifications-unsubscribe@superset.apache.org

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] geido closed pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
geido closed pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar
URL: https://github.com/apache/superset/pull/22276


-- 
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: notifications-unsubscribe@superset.apache.org

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] geido commented on pull request #22276: feat: Programmatically open "more filters" dropdown in Horizontal Filter Bar

Posted by GitBox <gi...@apache.org>.
geido commented on PR #22276:
URL: https://github.com/apache/superset/pull/22276#issuecomment-1334110242

   > I noticed 1 regression. In filter cards we have "Dependent on" section, with links to filters that given filter is dependent on. Previously clicking on that link would highlight the parent filter and currently nothing happens <img alt="image" width="575" src="https://user-images.githubusercontent.com/15073128/205119177-573aca03-9609-47a2-91f7-f66b9c4cb218.png">
   
   Thanks for catching this! I am having a look


-- 
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: notifications-unsubscribe@superset.apache.org

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