Problem/Motivation

The component library in UI Patterns breaks when this module is installed.
The menu-tree has required props menus and exclude, but UI Patterns Library doesn't provide a default for them, and ComponentValidator->validateProps() throws an error.

Steps to reproduce

Enable Menu Trees and UI Patterns Library.
Go to the component library.
See whitescreen errors.

Proposed resolution

Add default values of empty array/string.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork menu_tree-3616164

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mortona2k created an issue. See original summary.

mortona2k’s picture

Status: Active » Needs review

I see that an example has been added for those props, but that doesn't work with the component library.

peter törnstrand made their first commit to this issue’s fork.

peter törnstrand’s picture

Try it out now @mortona2k

mortona2k’s picture

UI Patterns Library is working. It only renders the Main menu label, since there are no default links specified.

SDC Styleguide isn't working, but that's due to an error in how it handles complex properties. It's trying to put them in a text area.
I added a related issue for that.

This is a case where the UI Patterns Library can't really provide a better demo from default values because we don't want to provide irrelevant dummy content as the default. It makes more sense to do that as a story.

In the patch, you have main:standard.front_page as an example link. This is only in the standard install profile and may not exist. Maybe use links from system instead?

SDC Styleguide can create demos with a drush command. That sounds a lot closer to what is needed to set up realistic styleguides

mortona2k’s picture

I think it should be examples, not example?

Looks like some modules like SDC Styleguide, SDC Component Library are using examples.

peter törnstrand’s picture

StatusFileSize
new59.85 KB

I'm not sure what you mean by:

SDC Styleguide isn't working

I have never used the module and I'm not sure what to expect. It does not crash the site at least :-)

mortona2k’s picture

Now it doesn't work in SDC Styleguide... Looks like a bug on their end though.

peter törnstrand’s picture

Ok, I will review the fix. Can we consider this done then?

mortona2k’s picture

Yes sounds good.

peter törnstrand’s picture

Status: Needs review » Fixed

Thank you. Included in release 2.1.2.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.