Skip to content

Comments

[dashboard filter scope] force show filter_box as unchecked#8587

Merged
graceguo-supercat merged 1 commit intoapache:feature--dashboard-scoped-filterfrom
graceguo-supercat:gg-FilterBoxChecked
Nov 15, 2019
Merged

[dashboard filter scope] force show filter_box as unchecked#8587
graceguo-supercat merged 1 commit intoapache:feature--dashboard-scoped-filterfrom
graceguo-supercat:gg-FilterBoxChecked

Conversation

@graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Nov 15, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

We do not apply filter on filter_box itself, so in the scope selector modal, the filter_box's checkbox is disabled. But when user clicks on tab or other parent level node's checkbox, react-checkbox-tree framework still set the value for disabled nodes. So sometimes this will cause confusing. For example: in the UI no chart is selected but the root show half-checked:
image

This PR will add an extra logic that enforce filter_box's state is unchecked, but still show as disabled. This is still not perfect, because when user checked parent's checkbox, they are expected to see all children nodes are also checked. In this case, filter_box's state is still unchecked.

There is a proposal that to compare all the nodes under the parent, and ignore the filter_box's state. The data structure for all nodes state are in the tree structure. In order to igore the filter_box's state, I need to have a filter_box chartId, then find its parent, and find other siblings in the tree. This computation is not cheap, and will be triggered very frequent.

Given the performance impact is big and UI in-consistency is small, I propose this cheaper solution.

TEST PLAN

manual test.

ADDITIONAL INFORMATION

  • 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

REVIEWERS

@etr2460 @kristw

@codecov-io
Copy link

codecov-io commented Nov 15, 2019

Codecov Report

Merging #8587 into feature--dashboard-scoped-filter will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@                         Coverage Diff                          @@
##           feature--dashboard-scoped-filter    #8587      +/-   ##
====================================================================
- Coverage                             65.99%   65.97%   -0.02%     
====================================================================
  Files                                   474      474              
  Lines                                 23193    23200       +7     
  Branches                               2484     2487       +3     
====================================================================
  Hits                                  15307    15307              
- Misses                                 7728     7735       +7     
  Partials                                158      158
Impacted Files Coverage Δ
...ard/components/filterscope/FilterScopeSelector.jsx 1.42% <0%> (-0.04%) ⬇️
...ssets/src/dashboard/util/getRevertedFilterScope.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26e6b6f...48f7d46. Read the comment docs.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the bug fix!

@graceguo-supercat graceguo-supercat merged commit 9b34327 into apache:feature--dashboard-scoped-filter Nov 15, 2019
graceguo-supercat pushed a commit that referenced this pull request Nov 18, 2019
* [WIP][dashboard scoped filter] part 1: scope selector modal (#8557)

* filter scope selector modal

* add single-field-edit in multi-edit mode switch

* fix code review comments (round 1)

* refactory after design review

* fix a few props initial value

* [WIP][dashboard scoped filter] part 2: add algorithm to convert checked ids to scope object (#8564)

* convert ids to scope object

* use lodash helpers to make code readable

* [WIP][dashboard scoped filter] part 3: merge filter scope settings into dashboard redux state (#8522)

* merge filter scope settings into dashboard redux state

* fix/add unit tests

* minor bug fixes

* fix save filter Scopes behavior

* resolve review comments

* fix save filter scope settings

* minor comments

* [dashboard scoped filter] Improve scrollbar inside modal (#8553)

* improve scroll inside modal

* make left pane and right pane scroll separately

* fix review comments

* force show filter_box as unchecked (#8587)
@graceguo-supercat graceguo-supercat deleted the gg-FilterBoxChecked branch February 10, 2020 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants