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(navbar): migrate Bootstrap navbar to AntD menus #14184

Merged
merged 34 commits into from
May 8, 2021

Conversation

pkdotson
Copy link
Member

@pkdotson pkdotson commented Apr 16, 2021

SUMMARY

This pr will migrate the old react-bootstraps navbar into ant-d menus. This pr will also update smaller screen navbar views to more user friendly views.

Changes affect the main menu and submenu components

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

before
https://user-images.githubusercontent.com/17326228/115632043-cbfef580-a2bb-11eb-8a49-e75b422bec85.mov

after

Screen.Recording.2021-04-21.at.3.45.50.PM.mov

TEST PLAN

Will update test and manually check that each submenu looks similar to existing specs.

ADDITIONAL INFORMATION

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

@pkdotson pkdotson changed the title WIP refactor(navbar): migrate bootstraps nabar to ant-d menus [WIP] refactor(navbar): migrate bootstraps nabar to ant-d menus Apr 16, 2021
@pkdotson
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

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

@pkdotson pkdotson changed the title [WIP] refactor(navbar): migrate bootstraps nabar to ant-d menus refactor(navbar): migrate bootstraps nabar to ant-d menus Apr 21, 2021
@rusackas
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

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

@rusackas
Copy link
Member

image

A few little visual details remaining:

  1. The padding to the right of the caret got smaller, and does not match the padding on the left of the text
  2. There's still like 1px of space between the menu trigger, and the dropdown itself, which is easy to see with the little blue line.
  3. The corners of the dropdown list are rounded. I don't mind it on the bottom corners, but the top corners again show the blue a little bit more than I think they should, so maybe we should un-round just those top ones.
  4. The list items in the dropdown use do have a faint blue background and gray text... now they stay white, but the text color changes to blue. I don't mind it, but I want @Steejay and/or @mihir174 to take a look, so I'll tag this PR with a need for design input.

... there also seem to be an issues with linting that're holding up CI.

@codecov
Copy link

codecov bot commented Apr 23, 2021

Codecov Report

Merging #14184 (7bbea48) into master (6871ad1) will increase coverage by 0.02%.
The diff coverage is 93.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #14184      +/-   ##
==========================================
+ Coverage   77.09%   77.12%   +0.02%     
==========================================
  Files         959      958       -1     
  Lines       48309    48344      +35     
  Branches     5661     5676      +15     
==========================================
+ Hits        37243    37283      +40     
+ Misses      10866    10861       -5     
  Partials      200      200              
Flag Coverage Δ
javascript 72.46% <93.08%> (+0.06%) ⬆️

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

Impacted Files Coverage Δ
...ews/CRUD/annotationlayers/AnnotationLayersList.tsx 77.35% <ø> (ø)
...d/src/views/CRUD/csstemplates/CssTemplatesList.tsx 78.26% <ø> (ø)
superset-frontend/src/components/Menu/Menu.tsx 63.63% <88.63%> (-5.84%) ⬇️
...uperset-frontend/src/components/Menu/MenuRight.tsx 92.85% <92.85%> (ø)
superset-frontend/src/components/Menu/SubMenu.tsx 95.71% <93.61%> (-4.29%) ⬇️
superset-frontend/src/common/components/index.tsx 100.00% <100.00%> (ø)
...-frontend/src/views/CRUD/welcome/ActivityTable.tsx 85.05% <100.00%> (ø)
...perset-frontend/src/views/CRUD/welcome/Welcome.tsx 84.44% <100.00%> (-0.18%) ⬇️

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 6871ad1...7bbea48. Read the comment docs.

@pkdotson
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

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

Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

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

thank you for the PR. im seeing below

  • Nav bar jumpiness
  • Inconsistent caret style and position
    are those intentional?
Screen.Recording.2021-04-23.at.11.28.21.AM.mov

@Steejay
Copy link

Steejay commented Apr 23, 2021

  1. The list items in the dropdown use do have a faint blue background and gray text... now they stay white, but the text color changes to blue. I don't mind it, but I want @Steejay and/or @mihir174 to take a look, so I'll tag this PR with a need for design input.

im okay with the change here. @rusackas

@Steejay
Copy link

Steejay commented Apr 23, 2021

Screen Shot 2021-04-23 at 12 11 05 PM

wondering if we can have the selected underline and the hover underline at the same weight so when they are side by side there isnt a jog

@Steejay
Copy link

Steejay commented Apr 23, 2021

  • Inconsistent caret style and position
    are those intentional?

looks like a bug. caret style and position shouldnt be switching locations

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.

Looking much better with new changes. Adding some styling questions just to make sure the approach makes sense.

font-weight: ${({ theme }) => theme.typography.weights.bold};
margin-right: ${({ theme }) => theme.gridUnit * 3}px;
text-align: left;
font-size: 18px;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
font-size: 18px;
font-size: 18px;

Ask @mihir174 about this - the design system includes 16px (l) and 21px (xl) font sizes... perhaps we should use one of these?

display: flex;
align-items: center;
padding: 8px 0;
padding: 14px 0;
Copy link
Member

Choose a reason for hiding this comment

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

There are a few of these specific-pixel paddings in here. They're probably fine, but maybe @mihir174 would like to see what the next grid unit up or down looks like, particularly in combination with the font size adjustment mentioned above.

}
.navbar-nav {

.ant-menu-horizontal:not(.ant-menu-dark) > .ant-menu-item {
Copy link
Member

Choose a reason for hiding this comment

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

Just curious why we need the not(.ant-menu-dark) bit here... should this not be spaced the same if we did use the dark menu option?

Copy link
Member Author

Choose a reason for hiding this comment

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

Another override, because the default on the items were to large

superset-frontend/stylesheets/superset.less Outdated Show resolved Hide resolved
top: 51px !important;
border-radius: 0px !important;
@media (max-width: 767px) {
top: 269px !important;
Copy link
Member

Choose a reason for hiding this comment

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

This whole block of new styles contains a lot of highly specific pixel measurements. Is this introducing fragility by pinning things in particular locations? I just want to make sure that this doesn't look all broken if something else changes, like the height of a logo or something.

@rusackas
Copy link
Member

rusackas commented May 5, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2021

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

Copy link
Member

@junlincc junlincc left a comment

Choose a reason for hiding this comment

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

approving as product sign-off

@rusackas
Copy link
Member

rusackas commented May 5, 2021

Fixes #13492

@mistercrunch
Copy link
Member

What do we need to do to get this through?

@pkdotson
Copy link
Member Author

pkdotson commented May 7, 2021

What do we need to do to get this through?

@mistercrunch Evan and I were trying to figure out how to fix the overrides that we have to put in the less file. This will most likely end up as a follow up as this is not really a blocker.

@rusackas
Copy link
Member

rusackas commented May 8, 2021

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2021

@rusackas Ephemeral environment spinning up at http://52.11.103.208: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.

What do we need to do to get this through?

@mistercrunch Evan and I were trying to figure out how to fix the overrides that we have to put in the less file. This will most likely end up as a follow up as this is not really a blocker.

Indeed @mistercrunch and @pkdotson I've been holding this up over some concerns about styling:

  1. There are some aspects of this layout that don't quite line up with our design system (font sizes/paddings) and don't use the theme variables from there
  2. There are a lot of !important styles added to superset.less that seem antithetical to our attempts to move away from LESS and into Emotion.
  3. There are some oddly specific pixel values in the styles to nudge things around, which look a bit fragile to me, and would be better served by rethinking how the layout styles flow.

That said, while I see the above concerns as some degree of tech debt, the net benefit of this PR outweighs these concerns. I think this can be merged as is, and we can follow up on these concerns later.

@rusackas rusackas merged commit e16c4d8 into apache:master May 8, 2021
@rusackas rusackas deleted the migrate-navbar branch May 8, 2021 21:58
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2021

Ephemeral environment shutdown and build artifacts deleted.

@rusackas rusackas added need:qa-review Requires QA review need:followup Requires followup labels May 8, 2021
@rusackas rusackas added the bash! label May 12, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* initial commit

* more polish

* fix types and remove tests

* fix tests, update menu css, add oetc

* fix lint and precommit

* fix test

* update css, address comments

* fix lint

* update submenu for extra buttons

* remove block and lint

* fix lint

* remove block

* adjust margin

* test round 2

* test round 3

* about section

* src/components/Menu/Menu.test.tsx

* remove redundant test

* fmore pointed test

* fix lint

* remove unused css

* fix dashboard nav view

* update comments

* use suggestion

* lint-fix

* move css, fix dropdown and text

* lint

* rearchitect main nav component

* run lint fix

* nit
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* initial commit

* more polish

* fix types and remove tests

* fix tests, update menu css, add oetc

* fix lint and precommit

* fix test

* update css, address comments

* fix lint

* update submenu for extra buttons

* remove block and lint

* fix lint

* remove block

* adjust margin

* test round 2

* test round 3

* about section

* src/components/Menu/Menu.test.tsx

* remove redundant test

* fmore pointed test

* fix lint

* remove unused css

* fix dashboard nav view

* update comments

* use suggestion

* lint-fix

* move css, fix dropdown and text

* lint

* rearchitect main nav component

* run lint fix

* nit
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* initial commit

* more polish

* fix types and remove tests

* fix tests, update menu css, add oetc

* fix lint and precommit

* fix test

* update css, address comments

* fix lint

* update submenu for extra buttons

* remove block and lint

* fix lint

* remove block

* adjust margin

* test round 2

* test round 3

* about section

* src/components/Menu/Menu.test.tsx

* remove redundant test

* fmore pointed test

* fix lint

* remove unused css

* fix dashboard nav view

* update comments

* use suggestion

* lint-fix

* move css, fix dropdown and text

* lint

* rearchitect main nav component

* run lint fix

* nit
@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 need:followup Requires followup need:qa-review Requires QA review preset-io size/XXL 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants