Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show label for filters in filter box in explore #10412

Merged
merged 7 commits into from
Aug 5, 2020

Conversation

simcha90
Copy link
Contributor

Bug: Doesn't show label in filters for FilterBox

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:
Screen Shot 2020-07-23 at 15 56 59

After:
Screen Shot 2020-07-23 at 15 57 07

TEST PLAN

Added test for Filter box label

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

@simcha90 simcha90 closed this Jul 23, 2020
@simcha90 simcha90 reopened this Jul 23, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2020

Codecov Report

Merging #10412 into master will decrease coverage by 4.83%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10412      +/-   ##
==========================================
- Coverage   70.26%   65.42%   -4.84%     
==========================================
  Files         605      605              
  Lines       32425    32424       -1     
  Branches     3295     3295              
==========================================
- Hits        22784    21214    -1570     
- Misses       9532    11025    +1493     
- Partials      109      185      +76     
Flag Coverage Δ
#cypress ?
#javascript 59.27% <ø> (ø)
#python 69.76% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...plore/components/controls/FilterBoxItemControl.jsx 74.07% <ø> (ø)
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/dashboard/index.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupColors.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/chart/ChartContainer.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/setup/setupFormatters.js 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/reducers/index.js 0.00% <0.00%> (-100.00%) ⬇️
... and 144 more

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 ea3c3bb...9426ed0. Read the comment docs.

Copy link
Member

@rusackas rusackas left a comment

Choose a reason for hiding this comment

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

In the case of a bugfix, adding an assertion to the test would be ideal. But this looks simple enough to me to approve.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

I quickly tested this, and it appears that the change adds Filters as the default label for new filters. It appears to be passed down from the FilterBox control panel, where label actually refers to label of the filter section. So I don't believe this is intended behavior. I'd also propose to add an assertion to the test like @rusackas hinted at.

Comment on lines 29 to 31
const TEST_LABEL = 'some label';
const defaultProps = {
label: TEST_LABEL,
Copy link
Member

Choose a reason for hiding this comment

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

As TEST_LABEL isn't being used anywhere else, I don't see a reason create a const for it.

Suggested change
const TEST_LABEL = 'some label';
const defaultProps = {
label: TEST_LABEL,
const defaultProps = {
label: 'some label',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@pull-request-size pull-request-size bot added size/M and removed size/XS labels Aug 2, 2020
@simcha90
Copy link
Contributor Author

simcha90 commented Aug 2, 2020

@villebro Hi, fixed bug that you mentioned, @rusackas added assertion as proposed, it just was removed somehow in previous commit :)

@simcha90 simcha90 requested a review from villebro August 2, 2020 13:55
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

The propTypes for label needs to be added, apart from that LGTM.

@simcha90
Copy link
Contributor Author

simcha90 commented Aug 5, 2020

@villebro added

@simcha90 simcha90 requested a review from villebro August 5, 2020 05:24
@villebro villebro merged commit 57dc762 into apache:master Aug 5, 2020
Ofeknielsen pushed a commit to ofekisr/incubator-superset that referenced this pull request Oct 5, 2020
* fix: show label for filters in filter box in explore

* test: add test for label in filter box

* test: add test / fix lint

* fix: fix CR notes

* refactor: add label propType to FilterBoxItemControl.jsx
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* fix: show label for filters in filter box in explore

* test: add test for label in filter box

* test: add test / fix lint

* fix: fix CR notes

* refactor: add label propType to FilterBoxItemControl.jsx
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.38.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.38.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants