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

fix(donate): default value not below minimum donation #1248

Merged
merged 3 commits into from
Aug 25, 2022

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Aug 19, 2022

All Submissions:

Changes proposed in this Pull Request:

This PR sets the default value rendered on the block to never be below the configured minimum. It would be unintuitive for the donor not to be able to donate with the proposed value on the form.

Although the settings can be saved with a lower value, the displayed warning should be enough to let the user know that it may not behave as expected.

How to test the changes in this Pull Request:

  1. On the master branch, configure Reader Revenue Donations settings with a minimum donation to 5 and tiers below that value
  2. Visit the page with the block and confirm these values are rendered and you are unable to donate with the default values
  3. Check out this branch and confirm the values are never rendered below 5 even though you are still able to store it that way and prompted with the warning

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@miguelpeixe miguelpeixe self-assigned this Aug 19, 2022
@miguelpeixe miguelpeixe requested a review from a team as a code owner August 19, 2022 17:43
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

This is a good enhancement! We should also apply the same check to the "tiered" inputs and their labels.

@miguelpeixe
Copy link
Member Author

Done in adcc731

Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

The same max comparison also needs to be applied on lines 443 and 451 (input values and labels for the tiered suggested amounts).

@miguelpeixe
Copy link
Member Author

Whoops! Sorry about the back and forth! Should be fixed by a4a3e6b

@miguelpeixe miguelpeixe requested a review from dkoo August 23, 2022 13:51
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

Works well with both tiered and untiered options, now!

@dkoo dkoo merged commit 368e856 into master Aug 25, 2022
@dkoo dkoo deleted the fix/donate-minimum-donation-default-value branch August 25, 2022 17:22
matticbot pushed a commit that referenced this pull request Aug 26, 2022
# [1.57.0-alpha.1](v1.56.0...v1.57.0-alpha.1) (2022-08-26)

### Bug Fixes

* add button block class to the Homepage Posts more button ([#1252](#1252)) ([c4d565c](c4d565c))
* disambiguate users and guest authors in Author List exclusions ([#1154](#1154)) ([c59056b](c59056b))
* **donate:** default value not below minimum donation ([#1248](#1248)) ([368e856](368e856))
* **donate:** use first & last name as default name ([#1255](#1255)) ([105d95b](105d95b))
* re-add excerpt length preview in editor ([#1247](#1247)) ([bdbe86e](bdbe86e))

### Features

* handle minimum donation option in Donate block ([#1239](#1239)) ([10dfefe](10dfefe))
* if donation via a prompt, add prompt ID to Stripe payment metadata ([#1253](#1253)) ([b8cb0e9](b8cb0e9))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.57.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Sep 14, 2022
# [1.57.0](v1.56.0...v1.57.0) (2022-09-14)

### Bug Fixes

* add button block class to the Homepage Posts more button ([#1252](#1252)) ([c4d565c](c4d565c))
* correct Donate thank you message alignment ([#1258](#1258)) ([e838e61](e838e61))
* disambiguate users and guest authors in Author List exclusions ([#1154](#1154)) ([c59056b](c59056b))
* **donate:** default value not below minimum donation ([#1248](#1248)) ([368e856](368e856))
* **donate:** use first & last name as default name ([#1255](#1255)) ([105d95b](105d95b))
* re-add excerpt length preview in editor ([#1247](#1247)) ([bdbe86e](bdbe86e))
* update Homepage Posts grid spacing and add control  ([#1245](#1245)) ([9fa6972](9fa6972))

### Features

* handle minimum donation option in Donate block ([#1239](#1239)) ([10dfefe](10dfefe))
* if donation via a prompt, add prompt ID to Stripe payment metadata ([#1253](#1253)) ([b8cb0e9](b8cb0e9))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 1.57.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants