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

Customise Bulk Actions - Select All Behaviours #1810

Conversation

lrljoe
Copy link
Collaborator

@lrljoe lrljoe commented Aug 1, 2024

This adds a new feature to disable the default "Select All" behaviour, useful when working with large result sets:

setDelaySelectAllEnabled

By default, using the "Select All", immediately makes a call to the backend to populate the "selected" array with the primary key of all resultant rows (based on Filter/Search). This can be slow with large result sets, but gives a good user experience with smaller results, as it allows them to "Select All" and then deselect some rows.

public function configure(): void
{
    $this->setDelaySelectAllEnabled();
}

This prevents the default behaviour from firing, which improves performance when working with very large sets of data. With this feature enabled, the backend update will not fire, however an indication that all result rows have been selected will be passed to the backend, and the frontend will behave as if all rows are selected.

When running your Bulk Action, having used "Select All", you may then access the array of "all rows" based on your most recent search/filter results:

$rows = $this->getSelectedRows();

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?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 23.52941% with 13 lines in your changes missing coverage. Please review.

Project coverage is 87.79%. Comparing base (40485a0) to head (6a5c265).
Report is 17 commits behind head on development.

Files Patch % Lines
.../Traits/Configuration/BulkActionsConfiguration.php 0.00% 9 Missing ⚠️
src/Traits/Helpers/BulkActionsHelpers.php 50.00% 4 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             development    #1810      +/-   ##
=================================================
+ Coverage          87.14%   87.79%   +0.65%     
- Complexity          1495     1541      +46     
=================================================
  Files                139      141       +2     
  Lines               3484     3588     +104     
=================================================
+ Hits                3036     3150     +114     
+ Misses               448      438      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lrljoe lrljoe merged commit 907b3fd into rappasoft:development Aug 1, 2024
lrljoe added a commit that referenced this pull request Aug 4, 2024
## [v3.4.0] - 2024-08-04
### New Features
- Add Helpers for TextFilters by @lrljoe in #1812
- Change method names for TextFilters handler by @lrljoe in #1814
- Capability to set Reorder Column TH Attributes by @lrljoe in #1811
- Bulk Actions - Customise Select All Behaviours by @lrljoe in #1810

### Bug Fixes
- Fix loading spinner for dark tailwind theme by @lrljoe in #1809

### Tweaks
- Blade Minimisation & ColumnSelect Cleanup by @lrljoe in #1806
- Adjust DateColumn with Missing Tests and Coping with DateTime Casts by @lrljoe in #1813

### Docs
- Add reference to Bulk Actions TH styling in main styling by @lrljoe in #1808
- Update docs for setPillsLocale by @lrljoe in #1800
- Add note on label method for setAdditionalSelects by @lrljoe in #1816
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

Successfully merging this pull request may close these issues.

1 participant