activeadmin icon indicating copy to clipboard operation
activeadmin copied to clipboard

v4: nesting in menus

Open henrikbjorn opened this issue 1 year ago • 7 comments

Trying the new beta on a larger Rails project with many admin resources with nesting in menus.

Expected behavior

Previously a dropdown menu would appear on hover and clicking on it, would take you to that resources index page.

Actual behavior

This does not happen in v4. It will just toggle the nested menu and no navigation will happen.

How to reproduce

  1. Create an Blogs resource
  2. Create BlogPost resource and set menu parent: 'Blogs'
  3. It is now impossible to navigate to Blogs admin index page via the menu

henrikbjorn avatar Jan 29 '24 11:01 henrikbjorn

Hello, is this the same issue described at https://github.com/activeadmin/activeadmin/discussions/8239#discussioncomment-8156426?

tagliala avatar Jan 29 '24 14:01 tagliala

Hello, is this the same issue described at #8239 (reply in thread)?

Not sure. They are discussing belongs_to and navigation_menu which we don't use.

I tried with master and the demo app bin/rake local server.

To see what I mean add the following to app/admin/tags.rb menu parent: 'KitchenSink'. Now it is impossible to get to the KitchenSink page.

In previous releases it would just show the dropdown for the menu but still allow clicking KitchenSink and be navigated to that page.

henrikbjorn avatar Jan 29 '24 14:01 henrikbjorn

Skærmbillede 2024-01-29 kl  15 25 18

See the bottom left corner of the window, where it shows the link href,

henrikbjorn avatar Jan 29 '24 14:01 henrikbjorn

@henrikbjorn thanks for opening the issue. PR #8225 fixes this.

mgrunberg avatar Jan 29 '24 15:01 mgrunberg

@henrikbjorn thank you. I'd fine with reporting this as a breaking change for the v4 release as I don't have any plans to resolve this. Perhaps though, we can consider what's necessary to allow others to implement this behavior themselves but I don't think the library should support it by default with the new collapsible menu. Sorry.

javierjulio avatar Jan 29 '24 15:01 javierjulio

@javierjulio I think this should be supported since it is a nice way of grouping related admin resources (Which we do a lot).

I also think it is a logical thing to think is supported. Like with a Blogs admin resource have Tags and Categories with Blogs as the parent (without belongs_to)

henrikbjorn avatar Jan 30 '24 06:01 henrikbjorn