phac-nml / irida-next

IRIDA Next
https://phac-nml.github.io/irida-next/
Apache License 2.0
8 stars 2 forks source link

Multi level menu component #529

Closed deepsidhu85 closed 3 months ago

deepsidhu85 commented 3 months ago

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR adds in a multi level menu component to the sidebar component to display multi level menus. NOTE: Currently just working on click of the multi level menu button/label

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

image

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Open up `layouts/prpjects.html.erb
  2. Replace the render section.with_item for the Settings link with the below
<%= render section.with_multi_level_menu(title: "Settings") do |mm| %>
            <% if allowed_to?(:update?, @project) %>
              <% mm.with_menu_item(
                url: project_edit_path(@project),
                icon: "cog_6_tooth",
                label: "General",
                selected: @current_page == t(:"projects.sidebar.settings").downcase
              ) %>
            <% end %>
            <% mm.with_menu_item(
              url: project_edit_path(@project),
              icon: "cog_6_tooth",
              label: "Bot Accounts",
              selected: @current_page == t(:"projects.sidebar.settings").downcase
            ) %>
          <% end %>
        <% end %>
  1. You should see the Settings sidebar menu item has a downward facing caret
  2. Click the Settings item and you should see a menu expand below it to show the General and Bot Accounts links

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

github-actions[bot] commented 3 months ago

Simplecov Report

Covered Threshold
91.92% 90%