Skip to content

Fix Export Donations button staying on 'Please wait...' (Resolves #5744) - #5769

Open
WPTK wants to merge 1 commit into
rubyforgood:mainfrom
WPTK:5744-export-donations-button
Open

WPTK wants to merge 1 commit into
rubyforgood:mainfrom
WPTK:5744-export-donations-button

Conversation

@WPTK

@WPTK WPTK commented Nov 21, 2026

Copy link
Copy Markdown

Resolves #5744

Description

After downloading from the "All Donations" page, the "Export Donations" button stays on "Please wait...".

download_button_to only uses the background download Stimulus controller when remote: true is passed (added in #5725). rails-ujs only re-enables a disabled link on the next page load, which a file download never triggers. The donations index called the helper without remote: true, so the button was never re-enabled.

This opts the Export Donations button in with remote: true, the same way the annual report views do. The helper's default is unchanged. Diff: 1 line in the view, plus one request spec.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added a request spec in spec/requests/donations_requests_spec.rb asserting the export link renders with data-controller="download" and data-action="download#download". It fails without the view change (data-controller is nil) and passes with it.

Ran bundle exec rspec spec/requests/donations_requests_spec.rb spec/helpers/ui_helper_spec.rb: 57 examples, 0 failures. RuboCop/erb_lint run on the changed files (results in the session report).

I did not click through the download in a real browser.

AI assistance disclosure

This change was prepared with AI assistance (Claude Code). I reviewed the diff and test results before submitting.

This branch has not been deployed

No deployments
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.

[BUG]: Export Donations button state not updating

1 participant