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

Extract sidebar markup into helper #3801

Closed
wants to merge 1 commit into from
Closed

Extract sidebar markup into helper #3801

wants to merge 1 commit into from

Conversation

Benabik
Copy link
Collaborator

@Benabik Benabik commented Jul 30, 2023

Description

The markup for the sidebar was copy/pasted many many times. This
PR adds the following helpers:

  • sidebar - simply adds the appropriate ul wrapper for the sidebar
    to its block, which should have the other two helpers.
  • sidebar_item - Ensures that whenever the current page is the
    linked path, the item is active. Has an optional argument to be
    active for any path on the controller.
  • sidebar_group - Takes a list of items and ensures the group is
    open whenever any item under it is active. Can also take a
    controller similar to the item, useful if the sub-items are only
    some actions on a controller.

Notably, this fixes:

  • Several instances where the path checked was not the path linked
  • Several places where an item would be active in a group that wasn't
  • The active checks in the admin sidebar all missing the admin/ prefix

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manually clicking on all the sidebar links and verifying they go to the correct place and highlight afterwards

The markup for the sidebar was copy/pasted many many times.  This
commit adds the following helpers:

* `sidebar` - simply adds the appropriate ul wrapper for the sidebar
  to its block, which should have the other two helpers.
* `sidebar_item` - Ensures that whenever the current page is the
  linked path, the item is active.  Has an optional argument to be
  active for any path on the controller.
* `sidebar_group` - Takes a list of items and ensures the group is
  open whenever any item under it is active.  Can also take a
  controller similar to the item, useful if the sub-items are only
  some actions on a controller.

Notably, this fixes:

* Several instances where the path checked was not the path linked
* Several places where an item would be active in a group that wasn't
* The active checks in the admin sidebar all missing the admin/ prefix
@awwaiid awwaiid added the Ruby for Good 2023 DC Created for Ruby for Good 2023 DC label Jul 30, 2023
@awwaiid
Copy link
Collaborator

awwaiid commented Nov 12, 2023

I'd like to hold off on this refactor until after / separate from the dashboard update.

@awwaiid awwaiid added the BLOCKED This issue is blocked by another label Nov 12, 2023
@awwaiid awwaiid marked this pull request as draft November 12, 2023 04:38
Base automatically changed from dashboard to main May 12, 2024 16:47
@dorner
Copy link
Collaborator

dorner commented Jun 9, 2024

This has been sitting for a long time. Dashboard has been merged now. I'm going to close this for now - I'm fine with reopening if there's desire to.

@dorner dorner closed this Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKED This issue is blocked by another Ruby for Good 2023 DC Created for Ruby for Good 2023 DC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants