Skip to content
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

Navigation state doesn't update #76

Open
nickstewart95 opened this issue Feb 5, 2024 · 5 comments
Open

Navigation state doesn't update #76

nickstewart95 opened this issue Feb 5, 2024 · 5 comments

Comments

@nickstewart95
Copy link

For my Nova menu, I have a section called Reports with two dashboards inside of it

MenuSection::make('Reports', [
    MenuItem::dashboard(Demographics::class),
    MenuItem::dashboard(Statistics::class),
])->icon('document-report'),

Anytime I click from one of those dashboards links to any other item in the menu, the menu state doesn't change. This is limited to just these two dashboards... If I remove the NovaDashboard card from each dashboard, the issue resolves itself, so I figured it something to do with NovaDashboard,

Ex dashboard

class Demographics extends Dashboard
{
    public function name()
    {
        return 'Demographics';
    }

    public function cards()
    {
        return [
            NovaDashboard::make()
                ->addView('Demographics Filters', function (View $view) {
                    $view->static();

                    return $view
                        ->icon('window')
                        ->addWidgets([
                            GenderWidget::make()->layout(4, 2, 9, 0),
                        ])
                        ->addFilters([
                            Gender::make(),
                            Status::make(),
                            Year::make(),
                        ]);
                }),
        ];
    }

    public function uriKey()
    {
        return 'demographics';
    }
}

Demo

Screen.Recording.2024-02-05.at.2.45.25.PM.mov

It doesn't show in the demo, but the new page loads with no issues after each click

@mlordi
Copy link

mlordi commented Feb 8, 2024

Same in addition to the menu not working on mobile. It will not pull out the menu to click on any links.

@milewski
Copy link
Member

milewski commented Feb 9, 2024

I tracked the issue down to these 2 lines:

this.$store.registerModule(view.key, resourceStore)
this.$store.commit(`${ view.key }/storeFilters`, view.filters)

If feels like it is a bug in nova itself not on this package...

@davidbankes
Copy link

davidbankes commented Feb 9, 2024

@milewski

It does not appear to me to be a bug in nova itself.

To test, I created an app with four dashboards. Two vanilla nova dashboard, and two DigitalCreative dashboards. I can navigate back and forth between the two vanilla ones just fine, but as soon as I navigate to a digital creative one, navigation ceases to update when navigating between any of the dashboards.

I don't know that that is conclusive. There could be something funny going on with my Dashboards that I can't figure out, but it seems to me it is most likely an issue with this package.

@milewski
Copy link
Member

milewski commented Feb 9, 2024

Yeah, but what I meant was as soon as I register some new items into the nova store, it bugs out the menu.. It makes no sense by modifying the store it affects the menu that's why I said it probably an nova issue, they might be doing something that brakes when the manipulating the store manually

@mlordi
Copy link

mlordi commented Feb 9, 2024

Is this possibly the same issue that is causing the mobile menu not to work? I would love to deploy all the hard work I put into using your widgets but without the mobile menu I can't. A lot of my users are accessing the project that way. Thanks milewski for your help and the PR for adding the canSee feature is working excellent btw!

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

No branches or pull requests

4 participants