Skip to content

Update SwapAmounts to support Next Suggested Gift on a frequency basis#404

Merged
fernanDOTdo merged 1 commit into
mainfrom
swap-amounts-nsg
Jun 23, 2026
Merged

Update SwapAmounts to support Next Suggested Gift on a frequency basis#404
fernanDOTdo merged 1 commit into
mainfrom
swap-amounts-nsg

Conversation

@StoneMoney

Copy link
Copy Markdown
Member

Updates to the swap-amounts component

  • Checks if the page has a NSG for onetime and monthly frequencies
  • Adds config overrideNSG to be set for each frequency
  • If one-time NSG is available, do not swap list for one-time amounts unless config.onetime.overrideNSG is true
  • If monthly NSG is available, do not swap list for monthly amounts unless config.monthly.overrideNSG is true
  • Swapping between a NSG list and a EngridAmounts list retains their respective values (ie. if NSG has values for onetime, it will use those values when swapping back from monthly to onetime)

Allows for swap-amounts to still function on monthly for swapping if NSG only suggests amounts for one-time, or vice-versa. Previously, if NSG was detected at all, swap-amounts would not run.

Test pages

NSG for monthly and one-time flow: https://act.amnestyusa.org/page/193997/data/1?mode=DEMO
NSG for one-time only flow: https://act.amnestyusa.org/page/194210/data/1?mode=DEMO

Edit page for monthly and one-time: https://ca.engagingnetworks.app/index.html#pages/194211/edit
Edit page for one-time only: https://ca.engagingnetworks.app/index.html#pages/194211/edit

One-time only flow:

  1. Enter the email of a supporter that has a NSG staged (omitted from this publicly viewable PR)
  2. Submit the form, donation page opens with data autofilled
  3. Swapping from One-Time to Monthly should display the amounts set in window.EngridAmounts.monthly.amounts
  4. Swapping back to One-Time should display the amounts set in window.EngagingNetworks.suggestedGift.single and have the sticky-default of the entry with nextSuggestedGift = true

Monthly and one-time flow:

  1. Enter the email of a supporter that has a NSG staged (omitted from this publicly viewable PR)
  2. Submit the form, donation page opens with data autofilled
  3. Swapping from One-Time to Monthly should display the amounts set in window.EngagingNetworks.suggestedGift.recurring and have the sticky-default of the entry with nextSuggestedGift = true
  4. Swapping back to One-Time should display the amounts set in window.EngagingNetworks.suggestedGift.single and have the sticky-default of the entry with nextSuggestedGift = true

Update "Amount Swap" codeblock for both edit page links (client: AIUSA)

  1. In the "onetime" config area, set overrideNSG: true
  2. Re-test one time and monthy and one-time flows, noting that the one-time amounts are those set in the EngridAmounts config, and not the NSG values.

@fernanDOTdo
fernanDOTdo merged commit 6e5e8b4 into main Jun 23, 2026
2 checks passed
@fernanDOTdo
fernanDOTdo deleted the swap-amounts-nsg branch June 23, 2026 13:51
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.

2 participants