Skip to content

Conversation

icaroryan
Copy link
Contributor

Description

Populate self.query for standalone actions defined on self.index_controls.

When an action is defined within an index_control in Avo, and this action is triggered with records selected, the query variable (expected to contain the IDs of the selected records) is empty ([]) when accessed via self.message within the action's execution context. However, the query variable is correctly populated with the selected record IDs if accessed within the def handle method of the same action.

Fixes #3855

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

2025-05-16.15-54-32.mov

QA Scenarios

  1. Trigger action with no selected records on Index Page => 0 count
  2. Trigger action with selected records on Index Page => n counts
  3. Trigger action on Show page => 0 count but 1 when executed
  4. Trigger action from Has Many Association with/without selections => 0/n count
  5. Trigger action on Show page with selections from the Has Many Associations => 0 count but 1 when executed

@github-actions github-actions bot added the Fix label May 16, 2025
Copy link

qlty-cloud-legacy bot commented May 16, 2025

Code Climate has analyzed commit 577ee88 and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@Paul-Bob Paul-Bob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thank you @icaroryan for this contribution!

@Paul-Bob Paul-Bob merged commit daa7a76 into avo-hq:main May 18, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

self.query is empty for standalone actions due to missing fields param, unlike dropdown actions
2 participants