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

ComponentColumn Added #827

Merged
merged 1 commit into from
Dec 22, 2022
Merged

Conversation

CristhoferMF
Copy link
Contributor

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests and did you add any new tests needed for your feature?
  2. Did you update all templates (if applicable)?
  3. Did you add the relevant documentation (if applicable)?
  4. Did you test locally to make sure your feature works as intended?

Explain

Added a new Column type for projec blade component (anonimous).
This is better than create a cell for that component or return a view with an instance of ComponentAttributeBag.
Until now if you want to render a blade component, you had to create a new cell and place the component there or 'hack' it like this.

Column::make("Email", "email")
->format(function ($value) {
    return view('components.alert')
        ->with('attributes', new ComponentAttributeBag([
            'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger',
            'dismissible' => true,
        ]))
        ->with('slot', $value);
}),

After this PR it will be like that:

ComponentColumn::make("Email", "email")
->component('alert')
->attributes(fn ($value, $row, Column $column) => [
    'type' => Str::endsWith($value, 'example.org') ? 'success' : 'danger',
    'dismissible' => true,
]),

@stale
Copy link

stale bot commented Jul 26, 2022

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 Jul 26, 2022
@stale stale bot closed this Aug 3, 2022
@rappasoft rappasoft reopened this Aug 3, 2022
@stale stale bot removed the wontfix This will not be worked on label Aug 3, 2022
@stale
Copy link

stale bot commented Sep 2, 2022

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 Sep 2, 2022
@stale stale bot closed this Sep 9, 2022
@rappasoft rappasoft reopened this Sep 12, 2022
@stale stale bot closed this Sep 19, 2022
@rappasoft rappasoft reopened this Sep 19, 2022
@stale stale bot closed this Sep 27, 2022
@rappasoft rappasoft reopened this Sep 27, 2022
@stale stale bot removed the wontfix This will not be worked on label Sep 27, 2022
@stale
Copy link

stale bot commented Oct 28, 2022

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 Oct 28, 2022
@stale stale bot closed this Nov 4, 2022
@rappasoft rappasoft reopened this Nov 4, 2022
@stale stale bot closed this Nov 11, 2022
@rappasoft rappasoft reopened this Nov 11, 2022
@stale stale bot removed the wontfix This will not be worked on label Nov 11, 2022
@stale
Copy link

stale bot commented Dec 12, 2022

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 12, 2022
@stale stale bot closed this Dec 19, 2022
@rappasoft rappasoft reopened this Dec 19, 2022
@stale stale bot removed the wontfix This will not be worked on label Dec 19, 2022
rappasoft added a commit that referenced this pull request Dec 21, 2022
@rappasoft rappasoft added the Awaiting Next Release Currently merged into development awaiting a release to master label Dec 21, 2022
@rappasoft rappasoft mentioned this pull request Dec 22, 2022
@rappasoft rappasoft merged commit 9a65ba5 into rappasoft:master Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants