-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[MBL-1899] Checkout screen PLOT Badge #2223
base: main
Are you sure you want to change the base?
Conversation
…jluna/MBL-1816/plot-ineligible-state # Conflicts: # Kickstarter-iOS/Features/PledgeOverTime/Views/PledgePaymentPlanOptionView.swift # Library/ViewModels/NoShippingPledgeViewModel.swift # Library/ViewModels/PledgePaymentPlansViewModel.swift
…jluna/MBL-1816/plot-ineligible-state # Conflicts: # Library/ViewModels/NoShippingPledgeViewModel.swift
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.
Overall, good start! Left a couple comments where it looks like behavior might be broken when the flag is off (please check!) and what we're trying to do with late pledges.
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.
please add a snapshot test here. It looks like this class doesn't have snapshot test coverage yet (and neither do the main view controllers), so it'd be nice to add both a test where PLOT ui shows and one where it doesn't. We really can't keep pushing off adding test coverage.
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.
Absolutely! I’ll add snapshot tests for both cases: when the PLOT UI shows and when it doesn’t. I’ll make sure to include those as part of this PR.
additionalPledgeAmount, | ||
shippingSummaryViewData, | ||
rewards, | ||
self.pledgeOverTimeConfigData |
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.
it looks like this signal will only emit if the PLOT ui is visible. (If one signal from combineLatest
never emits, the input will never all exist and the signal won't do anything.) You'll want to make sure this emits nil
when the UI doesn't show.
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.
Confirmed! I ensured that the signal emits even when the input is nil, and I verified it works as expected. Let me know if there’s anything else you’d like me to double-check.
@@ -238,7 +238,8 @@ public class NoShippingPostCampaignCheckoutViewModel: NoShippingPostCampaignChec | |||
project: data.project, | |||
total: pledgeTotal, | |||
confirmationLabelHidden: true, | |||
pledgeHasNoReward: pledgeHasNoRewards(rewards: rewardsData.rewards) | |||
pledgeHasNoReward: pledgeHasNoRewards(rewards: rewardsData.rewards), | |||
pledgeOverTimeData: nil |
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.
Is pledge over time an option for late pledges? If it is, why is this hardcoded to nil? If it's not, why are the PostCampaignPledgeRewardsSummaryTotalViewController
changes required?
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.
In this version (v1), we won’t support late pledges, but we will in V2. For now, it’s hardcoded to nil
because we don’t need it here at the moment.
Regarding your last question, the changes in PostCampaignPledgeRewardsSummaryTotalViewController
are required because this controller is used on the checkout screen to display the Pledge Amount
, just below the Your Pledge
table.
# Conflicts: # Kickstarter-iOS/Features/PledgeOverTime/Controller/PledgePaymentPlansViewController.swift # Kickstarter-iOS/Features/PledgeOverTime/Controller/PledgePaymentPlansViewControllerTest.swift # Kickstarter-iOS/Features/PledgeOverTime/Views/PledgePaymentPlanOptionView.swift # Library/ViewModels/NoShippingPledgeViewModel.swift # Library/ViewModels/PledgePaymentPlansOptionViewModel.swift # Library/ViewModels/PledgePaymentPlansOptionViewModelTest.swift # Library/ViewModels/PledgePaymentPlansViewModel.swift # Library/ViewModels/PledgePaymentPlansViewModelTest.swift
…99/checkout-plot-badge # Conflicts: # Library/ViewModels/NoShippingPledgeViewModel.swift
📲 What
This PR adds a Pledge Over Time (PLOT) badge under the "Your pledge" section when PLOT is selected in the collection plan. It also updates the payment label and status label copy for PLOT-enabled pledges.
🤔 Why
Some background context on why the change is needed.
🛠 How
Added a Pledge Over Time badge to be displayed under the "Your pledge" section.
Updated the payments label to show "charged as 4 payments."
Updated the status label copy to display dynamic text:
👀 See
✅ Acceptance criteria
⏰ TODO