fix: NavbarItem is active only for the specific route #1326

Closed
opened 2026-04-05 16:26:54 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @soknaly on 12/8/2023

NavbarItem is active only for the specific route

If you look at the navigation bar (header) of the dashboard and you navigate around pages. Example: Monitors page, there are 4 levels: All, Inoperational, Disabled, and Monitor Detail View. You will notice that NavBarItem is only in active state if it's in All Page which is a props route pass to the component.

The NavBarItem should be in the active state even if we navigate around the monitors page.

  • ../monitors
  • ../monitors/:id
  • ../monitors/inoperational
  • ../monitors/disabled

Conceptually, any route starts with ../minitors, the NavbarItem should be in the active state.

Pull Request Checklist:

  • Please make sure all jobs pass before requesting a review.
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
  • Have you lint your code locally before submission?
  • Did you write tests where appropriate?

Screenshots (if appropriate):

Before:

https://github.com/OneUptime/oneuptime/assets/20983608/3cf85d87-3d45-4a58-8879-ad471d50292a

After:

https://github.com/OneUptime/oneuptime/assets/20983608/6ad08b05-e5a2-4c12-bb92-f45ba57c71ae

*Originally created by @soknaly on 12/8/2023* ### NavbarItem is active only for the specific route If you look at the navigation bar (header) of the dashboard and you navigate around pages. Example: Monitors page, there are 4 levels: All, Inoperational, Disabled, and Monitor Detail View. You will notice that NavBarItem is only in active state if it's in All Page which is a props `route` pass to the component. The NavBarItem should be in the active state even if we navigate around the `monitors` page. - `../monitors` - `../monitors/:id` - `../monitors/inoperational` - `../monitors/disabled` Conceptually, any route starts with `../minitors`, the NavbarItem should be in the active state. ### Pull Request Checklist: - [ ] Please make sure all jobs pass before requesting a review. - [ ] Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). - [x] Have you lint your code locally before submission? - [ ] Did you write tests where appropriate? ### Related Issue? ### Screenshots (if appropriate): #### Before: https://github.com/OneUptime/oneuptime/assets/20983608/3cf85d87-3d45-4a58-8879-ad471d50292a #### After: https://github.com/OneUptime/oneuptime/assets/20983608/6ad08b05-e5a2-4c12-bb92-f45ba57c71ae
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#1326