Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Try: Register plugins under separate navigation menu #5513

Merged
merged 13 commits into from
Nov 5, 2020
Merged

Conversation

joshuatf
Copy link
Contributor

@joshuatf joshuatf commented Oct 30, 2020

Update the nav to the "Plugins" approach.

Fixes #5530

  • Locks core menu items, creating dependency on WCA features within the navigation.
  • Adds methods to register plugin categories and items.
  • Adds extensions group to client.
  • Updates the example plugin.

Note: this PR does not update the styling to the group title "Extensions." The group title styling is different than that shown in #5530. I think this is something we may want to tackle upstream.

Screenshots

Screen Shot 2020-11-04 at 10 45 41 AM

Detailed test instructions:

  1. Run the extension npm run example -- --ext=add-navigation-items and activate.
  2. Note the extensions group and items/categories.
  3. Make sure you can't register items in the main menu.
  4. Make sure all relevant nav items still exist in the core nav menu.

@joshuatf joshuatf requested a review from a team November 4, 2020 15:59
@octaedro octaedro requested review from octaedro and removed request for a team November 4, 2020 20:16
Copy link
Contributor

@octaedro octaedro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @joshuatf for the great work! This is testing well here and code LGTM :shipit:

@elizaan36
Copy link
Contributor

hey @joshuatf I think the styling for the extensions header is fine here, and as you mentioned we can consider updating that in the near future.

Wanted to confirm, when there are no extensions installed the extensions section won't appear in the nav?

@joshuatf
Copy link
Contributor Author

joshuatf commented Nov 5, 2020

Wanted to confirm, when there are no extensions installed the extensions section won't appear in the nav?

That's correct, @elizaan36 - the Extensions section will be hidden if no plugins have registered there 🙂

'path' => '/analytics/overview',
'nav_args' => array(
'order' => 10,
'parent' => 'analytics',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joshuatf, this is a nice addition with nav_args. Small change, but I'm thinking id could also go under nav_args since its used only for matching a slot with the client's fill.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation: Extensions section for plugin items
4 participants