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

v3 - Full Page Table Component Options #1430

Closed

Conversation

amshehzad
Copy link
Contributor

This PR adds different configuration options for setting up a full-page component for livewire
https://livewire.laravel.com/docs/components#full-page-components

The following methods have been added:

@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #1430 (77c28e0) into v3-develop (ba322d3) will increase coverage by 0.01%.
The diff coverage is 90.69%.

@@               Coverage Diff                @@
##             v3-develop    #1430      +/-   ##
================================================
+ Coverage         88.08%   88.09%   +0.01%     
- Complexity         1251     1267      +16     
================================================
  Files                88       88              
  Lines              3013     3050      +37     
================================================
+ Hits               2654     2687      +33     
- Misses              359      363       +4     
Files Coverage Δ
src/Traits/ComponentUtilities.php 90.00% <ø> (ø)
...rc/Traits/Configuration/ComponentConfiguration.php 100.00% <100.00%> (ø)
src/Traits/Helpers/ComponentHelpers.php 99.18% <100.00%> (+0.12%) ⬆️
src/DataTableComponent.php 87.17% <73.33%> (-9.49%) ⬇️

@lrljoe
Copy link
Collaborator

lrljoe commented Oct 25, 2023

Two other items that may be really useful to add for enabling full page components is perhaps a:

->setHeaders(array $headers)

As Livewire 3 offers this now:

    public function render()
    {
        return view('livewire.show-post')
            ->response(function(Response $response) {
                $response->header('X-Custom-Header', true);
            });
    }

So a full page component should offer the ability to add in headers.

And a page title method:

->setTitle('Page Title')

which should match up with:

public function render()
{
    return view('livewire.create-post')
         ->title('Create Post'); 
}

Ultimately, plan is to expose render(), but I'm 99% that's a v4 thing.

@amshehzad amshehzad force-pushed the full-page-component-configuration branch from 0e96d7b to 71c2602 Compare November 2, 2023 20:27
@amshehzad
Copy link
Contributor Author

@lrljoe I've added the helper methods as you suggested, but havn't added the title and headers method, will do them in a new pr

@lrljoe
Copy link
Collaborator

lrljoe commented Nov 3, 2023

Sounds good, I'll review this weekend as have a few PRs to review and merge.

Thank you!

@lrljoe lrljoe changed the base branch from v3-develop to develop November 3, 2023 21:40
@lrljoe lrljoe changed the title Added configuration options for full page component v3 - Full Page Table Component Options Nov 3, 2023
@lrljoe
Copy link
Collaborator

lrljoe commented Nov 3, 2023

Few conflicts, but that's due to other changes that have happened since you first forked, and are very recent (such as adding hook methods, moving bits out of rendering etc).

At this point, I imagine I'll end up moving your code into a trait of its own for a "WithFullPageComponentMethods" or similar.

Sadly this PR has come in right when I'm moving bits around, but it definitely won't go to waste!

@lrljoe lrljoe mentioned this pull request Nov 3, 2023
9 tasks
Copy link

stale bot commented Dec 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 3, 2023
@lrljoe
Copy link
Collaborator

lrljoe commented Dec 6, 2023

Replaced by #1580

@lrljoe lrljoe closed this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Support for using a DataTableComponent as a Full Page Component
2 participants