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

Show Panels #82

Open
omastroberti opened this issue Aug 7, 2024 · 7 comments
Open

Show Panels #82

omastroberti opened this issue Aug 7, 2024 · 7 comments

Comments

@omastroberti
Copy link

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
Copy link
Author

Something like this
image

@milewski
Copy link
Member

milewski commented Aug 8, 2024

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

image

@omastroberti
Copy link
Author

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

@rricardo26
Copy link

rricardo26 commented Aug 8, 2024

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
Copy link
Author

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

@omastroberti
Copy link
Author

Anyone was able to check if this works?

@omastroberti
Copy link
Author

omastroberti commented Aug 27, 2024

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

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

3 participants