dcasia / resource-navigation-tab

Organize your resource fields into tabs.
MIT License
77 stars 9 forks source link

Show Panels #82

Open omastroberti opened 1 month ago

omastroberti commented 1 month ago

Hey, while implementing this addon, we see that Nova paneling feature are not shown. Is this a bug or a day design? I had envisioned that inside your Tabs, we would be able to view nova panels to organize fields inside too. Thanks

omastroberti commented 1 month ago

Something like this image

milewski commented 1 month ago

Can you share some code? it is shown for me, look the readme there is a screenshoot which also shows a panel:

image

omastroberti commented 1 month ago

Yes, one panel is shown. But not more than one. Have you checked?

rricardo26 commented 1 month ago

I'm working with @omastroberti . This is the code

ResourceNavigationField::make('Details')->fields([
      new Panel('Details', $this->srpDetailFields($srp_inventory)),
      new Panel('Dealer Activity', $this->dealerActivityFields($srp_inventory))
])
public function srpDetailFields($srp_inventory)
    {
        return [
            Text::make('Dealer', function () use ($srp_inventory) {
                $account = $srp_inventory->Account;
                if ($account) {
                    return "<a href='/resources/accounts/$account->id_account' class='link-default'>$account->name_account</a>";
                } else {
                    return "<p>-</p>";
                }
            })->asHtml(),
            Text::make('Listing Link', function ()  use ($srp_inventory) {
                if ($srp_inventory->url_listing) {
                    return "<a href='$srp_inventory->url_listing' target='_blank' class='link-default'>$srp_inventory->url_listing</a>";
                } else {
                    return "<p>-</p>";
                }
            })
                ->asHtml(),
            Text::make('VAN Link', function () use ($srp_inventory) {
                $link = env('PLATFORM_URL') . "listings/listing/$srp_inventory->id_listing";
                return "<a href='$link' target='_blank' class='link-default'>$link</a>";
            })
                ->asHtml(),
            Boolean::make('Status', 'status_listing'),
            Text::make('Stage', function () use ($srp_inventory) {
                return $this->getListingStage($srp_inventory->status_comunication);
            }),
        ];
}
public function dealerActivityFields($srp_inventory)
    {        
        $fields = [
            Text::make('Main User Assigned', function () use ($srp_inventory) {
                return $srp_inventory->assigned_main;
            }),
            Text::make('Secondary User Assigned', function () use ($srp_inventory) {
                return $srp_inventory->assigned_secondary;
            }),
            Number::make('Price Offer', function () use ($srp_inventory) {
                return $srp_inventory->price_offer;
            }),
            Number::make('Price Acquisition', function () use ($srp_inventory) {
                return $srp_inventory->price_acquisition;
            })
        ];
}

The result view is the next

Screenshot 2024-08-08 at 8 34 09 AM
omastroberti commented 1 month ago

Hi @milewski , were you able to check? thanks in advance

omastroberti commented 1 month ago

Anyone was able to check if this works?

omastroberti commented 2 weeks ago

@milewski I don't lose fate! I still hope you can check this thread 🤓