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

Update deprecated antd <Menu> #6860

Merged
merged 13 commits into from
Feb 22, 2023
Merged

Update deprecated antd <Menu> #6860

merged 13 commits into from
Feb 22, 2023

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Feb 20, 2023

We regularly have depreacation warning in the browser dev tools that antd's <Menu>{children}</Menu> HOC has been replaced with an items prop: <Menu items={...}>.

The recommend upgrade path from antd v4 to v5 is to fix all these deprecation warnings. In this pull request I fixed the <Navbar> and <FolderTree> menus.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Click on all navbar menu items. to make sure that they still work
  • Consider styling changes (menu should look the same)

Issues:


(Please delete unneeded items, merge only when none are left open)

@hotzenklotz hotzenklotz self-assigned this Feb 20, 2023
@hotzenklotz hotzenklotz marked this pull request as ready for review February 20, 2023 15:33
@hotzenklotz
Copy link
Member Author

Mhm, I just realized that this CI error did not occur locally since I already upgrade to the latest antd v4.28.x locally. It seems like the menu prop was introduced in the meantime:

https://app.circleci.com/pipelines/github/scalableminds/webknossos/10348/workflows/6838ef9d-90ac-4362-95fa-73319c4572ae/jobs/21737

…bar-menu

* 'master' of github.com:scalableminds/webknossos:
  Fix exploring datasets via http (without s) (#6863)
@hotzenklotz hotzenklotz mentioned this pull request Feb 21, 2023
8 tasks
Copy link
Member

@philippotto philippotto 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 taking care of the deprecations 🥇

The code looks good mostly and testing went well, too. However, when making the browser window quite small, there is an unnecessary large margin here:

image

icon: any;
}) {
if (collapse) {
return <span title={title}>{icon}</span>;
Copy link
Member

Choose a reason for hiding this comment

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

no title anymore? the title makes sure a tooltip is shown when only an icon is visible due to collapsing.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is still missing? There are no tooltips in the tracing view with a small screen (see screenshot):
image

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a . Should be fixed now.

frontend/javascripts/navbar.tsx Outdated Show resolved Hide resolved
frontend/javascripts/navbar.tsx Outdated Show resolved Hide resolved
@hotzenklotz
Copy link
Member Author

Thanks for the review. I applied your feedback.

…bar-menu

* 'master' of github.com:scalableminds/webknossos:
  Fix style of connectome tab by restricting directory tree style (#6864)
  Remove legacy datasets tab and use new compact route (#6834)
  Fix basicauth for exploring remote http datasets (#6866)
…bar-menu

* 'master' of github.com:scalableminds/webknossos:
  Add functions to get and set segment colors to the frontend API (#6853)
  Ensure that segments are added to segment list when using quick select... (#6867)
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Great 👍

@hotzenklotz hotzenklotz merged commit fa47f73 into master Feb 22, 2023
@hotzenklotz hotzenklotz deleted the navbar-menu branch February 22, 2023 15:51
hotzenklotz added a commit that referenced this pull request Feb 22, 2023
…d-v4.24

* 'master' of github.com:scalableminds/webknossos:
  Update deprecated antd <Menu> (#6860)
hotzenklotz added a commit that referenced this pull request Mar 6, 2023
…come_header_UI

* 'master' of github.com:scalableminds/webknossos: (34 commits)
  Slim down view mode dropdown by using icons (#6900)
  Logging on password reset/change (#6901)
  When merging volume tracings, also merge segment lists (#6882)
  avoid spinner when switching tabs in dashboard (#6894)
  Upgrade Antd to v4.24 (#6865)
  Support n5 end-chunks with chunksize differing from metadata chunksize (#6890)
  Implement http range requests for HttpsSeekableByteChannel (#6869)
  new GH action for adding issues to project board
  Fix links in Changelog (#6881)
  adds dedicated explore method for zarr datasets with a datasource-properties.json (#6879)
  Release 23.03.0 (#6880)
  Fix superUser being wrongly marked as organization owners (#6876)
  Followups for OME-TIFF export (#6874)
  Fix reload-precomputed-mesh functionality (#6875)
  Adds OME-TIFF export (#6838)
  Add evolutions 99,100 to migration guide (#6871)
  Add link to imprint and privacy to help menu (#6870)
  Annotation Locking Mechanism (#6819)
  Update deprecated antd <Menu> (#6860)
  Add functions to get and set segment colors to the frontend API (#6853)
  ...
@hotzenklotz hotzenklotz mentioned this pull request Jul 10, 2023
12 tasks
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.

Do not use deprecated 'children' property of antd's menu component
2 participants