-
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-1604] Show bonus in add-ons #2129
Conversation
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.
This is mainly just copied from our current tests - take a look commit by commit to just see the changes
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.
LGTM 👍 Just a couple of minor comments
public let selectedShippingRule: ShippingRule? | ||
public let selectedQuantities: SelectedRewardQuantities | ||
public let selectedLocationId: Int? | ||
public let refTag: RefTag? | ||
public let context: PledgeViewContext | ||
|
||
// Convenience initializer to allow `bonusSupport` to default to `nil`. | ||
// TODO: Delete this when cleaning up the noShippingAtCheckout feature. |
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.
If you haven't done so, let's log this in a ticket. Gotta keep track of the tech debt.
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.
Done, good call!
guard userIsBackingProject(project) else { return minValue } | ||
|
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.
Why don't we need this guard here anymore?
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.
I don't think we ever needed this guard. It looks like it's here to protect against developer error more than anything. (If the user isn't backing the project, we always set bonus support to 0
to start.)
The reason I removed it is because the thing it's saying ("if the user isn't already backing the project, change the bonus support to start at the min value") is wrong in a world where the confirm details screen uses the bonus support set on the add-ons screen as its initial value. Keeping it would reset the bonus support we see on the confirm details page. Deleting this guard means that the confirm details page, while not actually providing value to the UI, isn't doing anything silly either.
I'm okay with reverting this change and keeping the guard if you'd rather! But note that if we do that, then getting rid of bonus support on the confirm details page (or getting rid of the entire confirm details page) is definitely launch blocking.
📲 What
Show bonus support selection on the add-ons screen. Note that the continue button is only enabled if the amount is valid. The confirm details screen uses the bonus support passed in as its initial selection.
👀 See
Jira
✅ Acceptance criteria
⏰ TODO