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

[MBL-1755] Pledge Summary Table Total Amount Text #2163

Merged
merged 15 commits into from
Oct 7, 2024

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Sep 26, 2024

📲 What

We also should be showing “Pledge without a reward” when a user pledges without a reward, instead of “Bonus support” and the total “Pledge amount”

🛠 How

This section of the pledge summary is managed by NoShippingPledgeRewardsSummaryTotalViewController for crowdfunding checkout and PostCampaignPledgeRewardsSummaryTotalViewController for late pledge checkout.

We need these classes to know if the backer is pledging without a reward so they can display either “Pledge without a reward” or “Pledge amount” so, I'm passing the baseReward, which has a handy isNoReward helper, from the view model through to these classes.

The designs also show that, when pledging without a reward, the bonus support and reward table view rows should be hidden.

👀 See

Designs for reference

Simulator Screen Recording - iPhone 15 Pro 17 5 - 2024-09-25 at 13 31 36

✅ Acceptance criteria

  • When pledging without a reward, the checkout screen's pledge summary table only shows the total summary row with the label text, "Pledge without a reward".
  • Pledges with any other reward type are shown in the table as normal

@scottkicks scottkicks self-assigned this Sep 26, 2024
@scottkicks scottkicks marked this pull request as ready for review September 26, 2024 17:18
@scottkicks scottkicks requested review from a team, jovaniks, ifosli and stevestreza-ksr and removed request for a team and jovaniks September 26, 2024 17:18
ifosli
ifosli previously requested changes Oct 1, 2024
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Added a couple comments; I'm confused by why the "no reward" bool is separate from the rest of the config data and I'm missing a snapshot test for crowdfunding checkout. Would you please fix/explain?

Also, since this string is longer, would you mind double-checking what the UI looks like for large font sizes or maybe in german? UI doesn't need to be perfect but it should be usable.

@@ -10,7 +10,7 @@ public typealias PledgeSummaryViewData = (
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add the pledgeHasNoReward bool here instead of passing it in separately?

Copy link
Contributor

Choose a reason for hiding this comment

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

Kind of outside the scope of this pr, but do we still need separate post campaign and crowdfunding versions of this table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm refactoring this table in my current ticket. This should make it easier for these classes to use one version of this table.

Copy link
Contributor

Choose a reason for hiding this comment

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

These snapshots look great! Will you also add snapshot tests for the no rewards case for crowdfunding (assuming we don't have one already; if we do, will you look into what's going on and fix it)?

@kickstarter kickstarter deleted a comment from nativeksr Oct 2, 2024
@scottkicks scottkicks requested a review from ifosli October 3, 2024 18:17
Copy link
Contributor

@stevestreza-ksr stevestreza-ksr left a comment

Choose a reason for hiding this comment

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

A few minor comments but overall good to go 👍

.map { project, confirmationLabelHidden, total in (project, total, confirmationLabelHidden) }
.map { projectAndConfirmationLabelHidden, pledgeTotal, rewards in
let (project, confirmationLabelHidden) = projectAndConfirmationLabelHidden
let pledgeHasNoReward = rewards.count == 1 && rewards.first?.isNoReward == true
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Could use pledgeHasNoRewards(rewards:) here

.map { project, confirmationLabelHidden, total in (project, total, confirmationLabelHidden) }
.map { projectAndConfirmationLabelHidden, pledgeTotal, rewards in
let (project, confirmationLabelHidden) = projectAndConfirmationLabelHidden
let pledgeHasNoReward = rewards.count == 1 && rewards.first?.isNoReward == true
Copy link
Contributor

Choose a reason for hiding this comment

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

Same nit: Could use pledgeHasNoRewards(rewards:) here

@@ -211,7 +211,7 @@ private func items(

// MARK: Bonus

if let bonus = bonusAmount, bonus > 0 {
if let bonus = bonusAmount, bonus > 0, rewardItems.isEmpty == false {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sanity checking this shouldn't be doing that same isNoReward check here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

either or would work here actually.

@scottkicks scottkicks dismissed ifosli’s stale review October 7, 2024 21:13

Need to get this merged in and Ingerid is OOO

@scottkicks scottkicks removed the request for review from ifosli October 7, 2024 21:13
@stevestreza-ksr stevestreza-ksr merged commit a0ce7c9 into main Oct 7, 2024
5 checks passed
@stevestreza-ksr stevestreza-ksr deleted the pledgeWithoutRewardTableText branch October 7, 2024 21:22
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