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

Add submenu items to custom menu items in backend #7252

Merged
merged 1 commit into from Dec 31, 2017

Conversation

Projects
None yet
3 participants
@fabani
Contributor

fabani commented Dec 12, 2017

If a custom backend menu item has children menu items this adds a submenu with those children items.

Example usage in a extension:

protected function registerMenuEntries()
    {
        $menu = new MenuEntry('koala-menu', 'koala');
        $menu->setLabel('Koala Catcher')
            ->setIcon('fa:leaf')
            ->setPermission('settings')
        ;
        
        $submenuItemOne = new MenuEntry('koala-submenu-one', 'koala-tree');
        $submenuItemOne->setLabel('Koala One')
            ->setIcon('fa:leaf')
            ->setPermission('settings');

        $submenuItemTwo = new MenuEntry('koala-submenu-two', 'koala-food');
        $submenuItemTwo->setLabel('Koala Two')
            ->setIcon('fa:leaf')
            ->setPermission('settings');
        $menu->add($submenuItemOne);
        $menu->add($submenuItemTwo);

        return [
            $menu,
        ];
    }
@bobdenotter

This comment has been minimized.

Member

bobdenotter commented Dec 13, 2017

Thanks @fabani,

This looks like an interesting change. We'll have to carefully test it though, because we are careful not to introduce regressions.

@GawainLynch Could you rebase this, so tests pass?

@GawainLynch

This comment has been minimized.

Contributor

GawainLynch commented Dec 14, 2017

I can, but this will need tests first.

@fabani

This comment has been minimized.

Contributor

fabani commented Dec 15, 2017

@bobdenotter I would write tests if i know how, maybe you can point me in the right direction? How do you write tests for a twig template?

@GawainLynch

This comment has been minimized.

Contributor

GawainLynch commented Dec 15, 2017

OH, my apologies @fabani that specifically wasn't aimed at throwing the job on you … you are welcome to do it, but we'll handle it … the blocker is just it changes sensitive functionality that has caused us problems, so I am being a grumpy 👸 and forcing one of the team (probably me) to do it first so that we can be confident that the change and future changes work properly 😸

If you are curious though, have a look at the tests in here … and jump on Slack if you have more questions. If it is too much, just sit tight and we'll get to it soon-ish 😸

@bobdenotter

This comment has been minimized.

Member

bobdenotter commented Dec 31, 2017

@GawainLynch This change works well, in my tests (🐵 ). As discussed, let's merge it in and roll with it!
Can you merge it into 3.5?

@GawainLynch GawainLynch changed the base branch from 3.4 to 3.5 Dec 31, 2017

@bobdenotter

This comment has been minimized.

Member

bobdenotter commented Dec 31, 2017

Thank you for your contribution, @fabani 👍

@bobdenotter bobdenotter merged commit b487703 into bolt:3.5 Dec 31, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment