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

Edit/Delete buttons in paneled detail view not on top #1265

Closed
jakobfdev opened this issue Jan 23, 2019 · 5 comments
Closed

Edit/Delete buttons in paneled detail view not on top #1265

jakobfdev opened this issue Jan 23, 2019 · 5 comments
Milestone

Comments

@jakobfdev
Copy link

  • Laravel Version: 5.7.15
  • Nova Version: 1.3.1
  • PHP Version: 7.2
  • Operating System and Version: docker php-fpm:7.2

Description:

In detail view of a nova resource, say you have two Panel classes with a few fields, following a few unpaneled fields. Then in the detail view, we get two Panels follow by a "generic" panel named "Resource Name Details".

Now the Bug: In this scenario the edit and delete buttons will be floating right of the generic panels headline, meaning in the middle of the detail page, instead of right of the first (custom made) panel.

Expected behavior: Probably that the buttons are shown on top of the whole page, i.e. right of the first panel that is shown.

Steps To Reproduce:

Use Resource config like this:

    public function fields(Request $request)
    {
        return [
            new Panel('Panel 1', [Text::make('Panel 1 Field 1'), Text::make('Panel 1 Field 2')]),
            new Panel('Panel 2', [Text::make('Panel 2 Field 1'),
            Text::make('Generic Field'), // buttons end up here
        ];
    }

Related

Might be related to this
#219

@dkulyk
Copy link

dkulyk commented Jan 23, 2019

@davidhemphill I think need to show toolbar on the first panel instead using ->showToolbar()

@jakobfdev
Copy link
Author

jakobfdev commented Jan 23, 2019

@dkulyk That sounds reasonable. The showToolbar also leads to multiple toolbars across panels, which is a little misleading, because it suggests the editing of only the specific panel's data.

@davidhemphill
Copy link
Contributor

The intention is to have the toolbar next to the "generic" details panel. In this scenario I would just shift that panel to always be first as sticking it on the first panel just doesn't make sense.

In other words, unless it's a resource tool or card, the generic details panel should be the first one shown which would keep the toolbar at the top.

@jakobfdev
Copy link
Author

@davidhemphill Although, to me the toolbar (haven't explored it yet) at first glance looks like a resource related UI element. So attaching it to a specific panel would an unnatural approach, if it references the editing of the resource.
Unless the toolbar has a defined, more general usage (apart from delete/edit resource), it should be something that is positioned relativ to the resource, not to a specific panel (wether generic or not), because it's functionality is not panel-related at all.

What do you think?

@jbrooksuk
Copy link
Member

This issue relates to an unsupported version of Nova. If you're still experiencing this in the latest version of Nova, please open a new ticket, thanks!

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