-
Notifications
You must be signed in to change notification settings - Fork 194
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
Format donation count output in progress bar component #7209
Conversation
This commit changes the return type of the getDonationCount function from int to string. It also introduces formatting, specifically disabling sanitization, decimal, and currency formatting options for the returned count, using the give_format_amount function.
The getDonationCount method now returns a formatted donation count string, instead of an int. A new method, getFormattedDonationCount, has been introduced to apply the give_format_amount function, turning off sanitization, decimal, and currency formatting. This results in a cleaner display of donation counts in the progress bar.
This PR is stale because it has been open 45 days with no activity. Stale PRs will NOT be automatically closed. |
This PR is stale because it has been open 45 days with no activity. Stale PRs will NOT be automatically closed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we would format these numbers using the browser's locale (as opposed to the currency of the site), but given that this is legacy functionality (and is updated to match the rest of the page) this is good enough to re-use the currency formatting functions for this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed QA tests
Resolves #7208 GIVE-2050
Description
This resolves the issue with the "Donation" count total not being formatted properly.
I'm using
give_format_amount()
for this, even though it's a total, not an amount because I didn't see any other generic non-currency-based way to do it. This seems to work fine, though.Affects
Progress bar component with donation counts.
Visuals
Before
After
Pre-review Checklist
@unreleased
tags included in DocBlocks