Skip to content

Fix batch action with partial and no confirm doesn't submit the form on click #8442

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

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

ryoung
Copy link
Contributor

@ryoung ryoung commented Aug 22, 2024

A batch action rendered with a partial is automatically being submitted when the batch action is clicked as a result of #8389. The form is being submitted automatically if there is no confirm dataset attribute.

The batch action feature test was incorrectly passing because it was not re-rendering the page unless inputs["starred"] was present.

Fixes #8440

@ryoung ryoung force-pushed the fix-batch-actions-partials branch from 8f1eee7 to e8f8d42 Compare August 22, 2024 12:57
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (8bee931) to head (fea3696).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8442   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files         141      141           
  Lines        4064     4064           
=======================================
  Hits         4028     4028           
  Misses         36       36           

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

@javierjulio javierjulio changed the title Bug fix: Clicking a batch action with a partial automatically submits the form Fix batch action with partial and no confirm doesn't submit the form on click Aug 23, 2024
@javierjulio javierjulio self-requested a review August 23, 2024 04:09
Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Thanks! I'm not sure how I came up with that logic in the test case since it's clear that it won't do anything outside the condition and isn't right. Just one correction here and we'll get this out in a release this weekend.

@ryoung ryoung force-pushed the fix-batch-actions-partials branch from e8f8d42 to 7f47d94 Compare August 23, 2024 11:50
@javierjulio javierjulio force-pushed the fix-batch-actions-partials branch from 7f47d94 to fea3696 Compare August 23, 2024 13:42
@javierjulio javierjulio merged commit b2de8d6 into activeadmin:master Aug 23, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch action automatically submits form even though a partial is being rendered
2 participants