dcasia / collapsible-resource-manager

A custom sidebar menu with collapsible groups
MIT License
196 stars 44 forks source link

Incorrect path MenuSection #104

Closed scramatte closed 1 year ago

scramatte commented 1 year ago

Hi,

When you set path to a MenuSection "app" is appended twice to the URL resulting incorrect path

   MenuSection::make('tool')
            ->path('/csv-import')
            ->icon('upload');

create path

/app/app/csv-import

imagen

I've test with a fresh Nova Install and the issue is related to your package.

Regards

milewski commented 1 year ago

Is /app your Nova Path ?

milewski commented 1 year ago

Fixed and released here v2.0.3

scramatte commented 1 year ago

Section link works but I've got more errors

imagen

Moreover If you click on Dashboards icon it doesn't works as expected. It open collapsed menu (that is empty) and doesn't show dashboards

imagen

milewski commented 1 year ago

Can you paste your Nova::mainMenu(function (Request $request) {}) config

scramatte commented 1 year ago

Hi,

My app has various module that construct their own menu But It occurs with default menu too or with a very simple as bellow:

        Nova::mainMenu(function (Request $request, Menu $menu) {
            $menu->items->forget(1); // remove Resources MenuSection
             return $menu;
        });

I'm practically sure that is a regression as in the previous version it was ok. I'm going to try with previous one and I come back to you.

Regards

milewski commented 1 year ago

I think I found the issue, it was due that if you had a MenuSection and did not specify an icon it had a chance to crash.. fixed it on the latest version