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

refactor: Boostrap to AntD - Tabs #14048

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented Apr 9, 2021

SUMMARY

  • Migrates remaining TabContainer, TabPanel and TabContent components from Bootstrap to AntD
  • Improves the storybook to support interactive controls

See: #10254

@rusackas @junlincc @pkdotson

@villebro I'm tagging you also because of the changes in DashboardContainer. Can you help with the review? I'll add some comments to the code to provide more context.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2021-04-08 at 4 35 51 PM

Screen Shot 2021-04-08 at 4 37 03 PM

Screen Shot 2021-04-08 at 4 40 06 PM

Screen Shot 2021-04-08 at 4 36 15 PM

Screen Shot 2021-04-09 at 9 06 00 AM

These are the impacted screens. No perceived difference after the changes.

TEST PLAN

1 - Access different dashboard layouts, with different tab levels
2 - Check that all layouts are working

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

};

const DashboardContainer: FC<DashboardContainerProps> = ({
topLevelTabs,
handleChangeTab,
Copy link
Member Author

@michael-s-molina michael-s-molina Apr 9, 2021

Choose a reason for hiding this comment

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

handleChangeTab was never called during runtime and the function interfaces were not compatible:
TabContainer.onSelect does not provide pathToTabIndex to (event: SyntheticEvent<TabContainer, Event>) => void

// lets us keep the same React component tree when !!topLevelTabs changes.
// This avoids expensive mounts/unmounts of the entire dashboard.
<Tabs.TabPane
key={index === 0 ? DASHBOARD_GRID_ID : index.toString()}
Copy link
Member Author

Choose a reason for hiding this comment

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

Tabs.TabPane uses the key as the eventKey

@@ -58,6 +54,9 @@ const DashboardContainer: FC<DashboardContainerProps> = ({
? topLevelTabs.children
: [DASHBOARD_GRID_ID];

const min = Math.min(tabIndex, childIds.length - 1);
const activeKey = min === 0 ? DASHBOARD_GRID_ID : min.toString();
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensures that the key of the first element is always DASHBOARD_GRID_ID to avoid expensive mounts/unmounts of the entire dashboard.

@codecov
Copy link

codecov bot commented Apr 9, 2021

Codecov Report

Merging #14048 (ec7c42d) into master (20ab086) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

❗ Current head ec7c42d differs from pull request most recent head 2480a50. Consider uploading reports for the commit 2480a50 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14048      +/-   ##
==========================================
- Coverage   77.15%   77.04%   -0.11%     
==========================================
  Files         954      946       -8     
  Lines       48189    47987     -202     
  Branches     6002     5963      -39     
==========================================
- Hits        37180    36972     -208     
- Misses      10812    10814       +2     
- Partials      197      201       +4     
Flag Coverage Δ
javascript 72.15% <100.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
...d/components/DashboardBuilder/DashboardBuilder.tsx 88.37% <ø> (ø)
...erset-frontend/src/common/components/Tabs/Tabs.tsx 96.87% <100.00%> (ø)
...components/DashboardBuilder/DashboardContainer.tsx 100.00% <100.00%> (ø)
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/utils/hashing.py 75.00% <0.00%> (-25.00%) ⬇️
superset/cli.py 33.66% <0.00%> (-17.33%) ⬇️
...nts/controls/DateFilterControl/DateFilterLabel.tsx 73.94% <0.00%> (-9.11%) ⬇️
...nd/src/dashboard/components/FiltersBadge/index.tsx 96.00% <0.00%> (-4.00%) ⬇️
superset/models/dashboard.py 74.42% <0.00%> (-3.10%) ⬇️
...ontrols/FilterControl/AdhocFilterControl/index.jsx 54.61% <0.00%> (-3.08%) ⬇️
... and 108 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 20ab086...2480a50. Read the comment docs.

@junlincc junlincc added the frontend:refactor Related to refactoring the frontend label Apr 15, 2021
@michael-s-molina michael-s-molina force-pushed the bootstrap-to-antd-tabs branch 3 times, most recently from e64b4fa to f5e1f00 Compare April 20, 2021 14:44
@pkdotson
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

@pkdotson pkdotson requested a review from villebro April 27, 2021 04:34
Copy link
Member

@pkdotson pkdotson left a comment

Choose a reason for hiding this comment

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

LGTM, left a comment in the discussion that's already open but should not be blocker.

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.

LGTM and tested locally to work very well - love the new top level tab transition effect!

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.

LGTM too. 🚀

@rusackas rusackas merged commit 1d6a746 into apache:master Apr 29, 2021
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

amitmiran137 pushed a commit to nielsen-oss/superset that referenced this pull request May 3, 2021
* master: (38 commits)
  refactor(native-filters): allow cascading only for filter_select (apache#14441)
  test(maximize-chart): Add tests to maximize chart action (apache#14371)
  fix: fixing mysql error message (apache#14416)
  feat: Logic added to limiting factor column in Query model (apache#13521)
  change relationship (apache#14435)
  fix: bootstrap data permissions (apache#14348)
  fix: parse simple string error message values (apache#14360)
  chore: add stack trace to all calls of logger.error (apache#14382)
  update README with new docs and recordings (apache#14432)
  Renamed impyla from implya in impala.mdx and Renamed PIP package impyla from impala in index.mdx (apache#14425)
  fix(native-filters): fix filter scope error (apache#14426)
  feat: Adding limiting_factor column to Query model (apache#14234)
  feat: Add etag caching to dashboard APIs (apache#14357)
  chore: Moves Card to the components folder (apache#14139)
  feat: Dynamic imports for the Icons component (apache#14318)
  feat: Support env vars configuration for WebSocket server (apache#14398)
  fix: SQLLab role permissions (apache#14372)
  fix(native-filters): always show filters without dataset (apache#14409)
  fix error getting partitionQuery from table.partition (apache#14369)
  refactor: Boostrap to AntD - Tabs (apache#14048)
  ...
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.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 frontend:refactor Related to refactoring the frontend size/L 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants