avo-hq / avo

Build Ruby on Rails apps 10x faster
https://avohq.io
Other
1.53k stars 256 forks source link

Blank menu section is visible without any groups or resources #3119

Closed SahSantoshh closed 3 months ago

SahSantoshh commented 3 months ago

Describe the bug

A menu section has lot's of groups and each group have multiple resources with their respective permissions. Groups are not visible as their resources are not permitted but the section is still visible. It is only working if resources are child the section or groups. But not if resource is child of group and groups are child of section

Steps to Reproduce

Steps to reproduce the behavior: Create menu sections similar to

section 'Cources', icon: 'banknotes', collapsable: true do
  group 'Art', collapsable: true do
    resource :xyz, visible: -> { false}
  end

 group 'Games', collapsable: true do
    resource :pqr, visible: -> { false }
  end
end

Expected behavior & Actual behavior

In this case, the groups are hidden but the section is still visible. Expected behaviour would be to hide the section as well

Models and resource files

System configuration

Avo version: 11.4

Rails version: 7.2.0

Ruby version: 3.3.0

License type:

Are you using Avo monkey patches, overriding views or view components?

Screenshots or screen recordings

Screenshot 2024-08-11 at 12 45 09 PM

Additional context

Impact

Urgency

Paul-Bob commented 3 months ago

@SahSantoshh this is fixed in Avo 3.11.7