Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2186

When there is 1 sub-nav item under a primary nav link, go directly there

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-b1
    • Fix Version/s: 4.0.0-b1
    • Component/s: Staff Interface
    • Labels:
      None

      Description

      It's a bit silly to have a drop down with 1 menu item in it, as it requires 2 clicks (Click Primary Nav, click Sub-Nav item).

      Previously, clicking on a primary nav item would take you directly to an index page under that section. For example, clicking "Home" would take you to the Dashboard. Clicking "Clients" would show a listing of clients.

      With a fresh install of Blesta there are 2 nav links that should contain only 1 item:

      • Home
      • Clients

      I include Home in this because the "Calendar" sub-nav item should be removed, as it can be accessed through the mini calendar on the Dashboard. Clicking "Home" should take you directly to the Dashboard. (Unless, it actually has more than 1 sub-nav item, because a plugin registered one, as with other links)

        Activity

        admin Paul Phillips created issue -
        admin Paul Phillips made changes -
        Field Original Value New Value
        Assignee Cody Phillips [ cody ]
        admin Paul Phillips made changes -
        Rank Ranked higher
        admin Paul Phillips made changes -
        Rank Ranked lower
        Hide
        cody Cody Phillips (Inactive) added a comment -

        The solution here is super simple:

        • If subnav contains 1 element, don't render subnav

        The primary nav already has a link, so not rending the subnav will cause the primary nav link to be triggered.

        Show
        cody Cody Phillips (Inactive) added a comment - The solution here is super simple: If subnav contains 1 element, don't render subnav The primary nav already has a link, so not rending the subnav will cause the primary nav link to be triggered.
        Hide
        admin Paul Phillips added a comment -

        Sounds good to me!

        Show
        admin Paul Phillips added a comment - Sounds good to me!
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        If you do it that way, you should note it in the docs for plugins because the first subnav item may not be the same item/link as the primary nav.

        Show
        tyson Tyson Phillips (Inactive) added a comment - If you do it that way, you should note it in the docs for plugins because the first subnav item may not be the same item/link as the primary nav.
        Hide
        cody Cody Phillips (Inactive) added a comment -

        Good point. Paul Phillips do we want this to only apply to core nav items?

        Show
        cody Cody Phillips (Inactive) added a comment - Good point. Paul Phillips do we want this to only apply to core nav items?
        Hide
        admin Paul Phillips added a comment -

        It should apply to all primary nav items, including those of plugins. Please update the documentation as Tyson suggests as well.

        Show
        admin Paul Phillips added a comment - It should apply to all primary nav items, including those of plugins. Please update the documentation as Tyson suggests as well.
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        How about:

        • if the subnav contains 1 element AND the subnav URI matches the primary nav URI, don't render it

        The primary nav link will only work if there are no subnav items, or if there is 1 subnav item that links to the same place.

        Show
        tyson Tyson Phillips (Inactive) added a comment - How about: if the subnav contains 1 element AND the subnav URI matches the primary nav URI, don't render it The primary nav link will only work if there are no subnav items, or if there is 1 subnav item that links to the same place.
        Hide
        admin Paul Phillips added a comment -

        That seems reasonable

        Show
        admin Paul Phillips added a comment - That seems reasonable
        Hide
        cody Cody Phillips (Inactive) added a comment -

        The primary nav link will only work if there are no subnav items, or if there is 1 subnav item that links to the same place.

        If by that you mean only render the subnav if there is a non-empty set of subnav items that do no match the primary nav URI, then yes.

        I don't want JavaScript figuring out to trigger a click or not. If there's no rendered subnav then the primary nav will become clickable automatically.

        Show
        cody Cody Phillips (Inactive) added a comment - The primary nav link will only work if there are no subnav items, or if there is 1 subnav item that links to the same place. If by that you mean only render the subnav if there is a non-empty set of subnav items that do no match the primary nav URI, then yes. I don't want JavaScript figuring out to trigger a click or not. If there's no rendered subnav then the primary nav will become clickable automatically.
        Hide
        tyson Tyson Phillips (Inactive) added a comment -

        If by that you mean only render the subnav if there is a non-empty set of subnav items that do no match the primary nav URI, then yes.

        That is what I mean, yes.

        I don't want JavaScript figuring out to trigger a click or not. If there's no rendered subnav then the primary nav will become clickable automatically.

        My previous statement was simply summarizing the end behavior. Obviously, there will be no JavaScript changes. The subnav would just not be rendered at all if there is a subnav with a matching URI to the parent nav item.

        Show
        tyson Tyson Phillips (Inactive) added a comment - If by that you mean only render the subnav if there is a non-empty set of subnav items that do no match the primary nav URI, then yes. That is what I mean, yes. I don't want JavaScript figuring out to trigger a click or not. If there's no rendered subnav then the primary nav will become clickable automatically. My previous statement was simply summarizing the end behavior. Obviously, there will be no JavaScript changes. The subnav would just not be rendered at all if there is a subnav with a matching URI to the parent nav item.
        Hide
        cody Cody Phillips (Inactive) added a comment -

        Perfect!

        Show
        cody Cody Phillips (Inactive) added a comment - Perfect!
        tyson Tyson Phillips (Inactive) made changes -
        Assignee Tyson Phillips [ tyson ]
        Automated transition triggered when Tyson Phillips (Inactive) created a branch in Stash -
        Status Open [ 1 ] In Progress [ 3 ]
        Automated transition triggered when Tyson Phillips (Inactive) created pull request #141 in Stash -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        Automated transition triggered when Cody Phillips (Inactive) merged pull request #141 in Stash -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/Sep/16