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

enhancement: add @index_query access in actions #3699

Merged
merged 6 commits into from
Mar 4, 2025

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Feb 27, 2025

Description

This PR introduces access to the @index_query variable within the handle method. This variable represents the index query of the resource, making it easier to work with the full dataset under various conditions:

  • When "select all" is enabled, @index_query == @query.
  • When "select all" is not enabled, @query reflects only the selected records, whereas @index_query always returns the full index query with all filters and scopes applied.

This is particularly useful for standalone actions that need to operate on the entire dataset as defined by the current index query. For example, if a user applies filters and scopes, then selects "Export All", the action can directly access the fully filtered query via @index_query without relying on manual selection handling.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

Sorry, something went wrong.

@Paul-Bob Paul-Bob added the Enhancement Not necessarily a feature, but something has improved label Feb 27, 2025
@Paul-Bob Paul-Bob self-assigned this Feb 27, 2025
Copy link

codeclimate bot commented Feb 27, 2025

Code Climate has analyzed commit 5ace370 and detected 0 issues on this pull request.

View more on Code Climate.

@Paul-Bob Paul-Bob mentioned this pull request Mar 4, 2025
3 tasks
@Paul-Bob Paul-Bob merged commit 362689c into main Mar 4, 2025
20 checks passed
@Paul-Bob Paul-Bob deleted the enhancement/action_access_to_index_query branch March 4, 2025 07:22
Copy link
Contributor

github-actions bot commented Mar 4, 2025

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not necessarily a feature, but something has improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant