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: Empty tab component in Dashboard cannot be deleted #14878

Merged
merged 1 commit into from
Jun 8, 2021
Merged

fix: Empty tab component in Dashboard cannot be deleted #14878

merged 1 commit into from
Jun 8, 2021

Conversation

geido
Copy link
Member

@geido geido commented May 27, 2021

SUMMARY

Adds a min-height to the tabs component so that when empty the user can still reach the trash icon to delete the component from the dashboard

BEFORE

Video.Game.Sales.mp4

AFTER

Video.Game.Sales.1.mp4

TESTING INSTRUCTIONS

  1. Open a dashboard
  2. Add a tab component
  3. Delete all the tabs
  4. Make sure you can reach the trash icon far left when hovering the tab component

ADDITIONAL INFORMATION

  • Has associated issue: Fixes [Tab]sub-level tabs can not be removed #14820
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@geido
Copy link
Member Author

geido commented May 27, 2021

@junlincc @rusackas

@codecov
Copy link

codecov bot commented May 27, 2021

Codecov Report

Merging #14878 (6935412) into master (281d637) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #14878   +/-   ##
=======================================
  Coverage   77.57%   77.57%           
=======================================
  Files         963      963           
  Lines       49290    49291    +1     
  Branches     6205     6205           
=======================================
+ Hits        38235    38236    +1     
  Misses      10854    10854           
  Partials      201      201           
Flag Coverage Δ
javascript 72.43% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...d/src/dashboard/components/gridComponents/Tabs.jsx 87.50% <100.00%> (+0.13%) ⬆️

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 281d637...6935412. Read the comment docs.

@pkdotson
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@pkdotson Ephemeral environment spinning up at http://34.219.157.222:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@@ -89,6 +89,10 @@ const StyledTabsContainer = styled.div`
.ant-tabs {
overflow: visible;

.ant-tabs-nav-wrap {
min-height: ${({ theme }) => theme.gridUnit * 12.5}px;
Copy link
Member

@suddjian suddjian Jun 1, 2021

Choose a reason for hiding this comment

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

Nit, non-blocking: Why this 12.5 value here? Could we round it to a whole value or else add a comment noting the reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hello @suddjian. Thanks for your feedback. This is to make it exactly 50px which should be the default height of the tabs component.

Copy link
Member

Choose a reason for hiding this comment

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

If this is meant to match the tabs component, it would be nice to have them both reference the same constant value instead of magic numbers that happen to match up.

@junlincc
Copy link
Member

junlincc commented Jun 7, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2021

@junlincc Ephemeral environment spinning up at http://54.70.95.188:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

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.

Agree with @suddjian's comments... I'm not a fan of fractional gridUnits or "magic numbers" so I'm supportive of a follow-up PR t either add a constant that both refer to. It could potentially be exported by the tab component (open to suggestions there). It could export the pixel height, but it would be better, I think, to export a number of gridUnits, which could then be used here, and by the Tab component itself. 12 or 13 gridUnits for both should do nicely, whichever looks better. Tagging this PR for a revisit.

@rusackas rusackas merged commit a1ca0b2 into apache:master Jun 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2021

Ephemeral environment shutdown and build artifacts deleted.

amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request Jun 8, 2021
* upstream/master:
  fix(explore): Datepicker glitch on hover outside the modal (apache#15033)
  Add ming-height to empty tab (apache#14878)
  Remove nowrap (apache#14954)
  display all metric results in editor (apache#15031)
  feat: Add "is_select_query" method to base engine spec to make it possible to override it (apache#15013)
  fix(dashboard): custom css should be removed on unmount (apache#15025)
  feat(filter-box): hide druid options if druid not enabled (apache#14921)
  fix: adding additional configs and colors for queryHistory (apache#14995)
  chore: rename 'Source' to 'Database' for consistency (apache#15021)
  chore(ci): fix ci conflict (apache#15016)
  fix(native-filters): avoid double load on initialization (apache#15012)
  feat(native-filters): Support default to first value in select filter (apache#14869)
  docs: required information for OAuth2 configuration (apache#15010)
  Update index.mdx (apache#14990)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.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/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tab]sub-level tabs can not be removed
7 participants