-
Notifications
You must be signed in to change notification settings - Fork 994
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
[π³] NT-1122 Initial card selection #824
Conversation
val defaultIndex = 0 | ||
val backingPaymentSourceIndex = storedCards.indexOfFirst { it.id() == project.backing()?.paymentSource()?.id() } | ||
return when { | ||
backingPaymentSourceIndex != -1 -> Pair(storedCards[backingPaymentSourceIndex], backingPaymentSourceIndex) |
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 the backingPaymentSourceIndex
set to -1 if indexOfFirst
doesn't find something?
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.
Yeah, that's what indexOfFirst
returns https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/index-of-first.html
* [π¦ΆπΎ] NT-1104 Add Pledge screen footer (#817) * [β¬] NT-1120 Vertical payment methods in Pledge screen (#821) * [π¨] NT-1121 Stored cards redesign (#822) * [π] NT-1105 Kickstarter is not a store redesign (#823) * [π³] NT-1122 Initial card selection (#824) * [β³] NT-1124 Loading state for payment methods (#825) * [β] NT-1125 New card CTA (#828) * [π³] NT-1123 Last four digits copy (#826) * [π³] NT-1123 Card not allowed copy (#827) * [π¨] NT-1111 Adding 2 buttons in the new pledge footer (#830) * [π] NT-1129 Adding progress state for pledging (#831) * [π£] NT-1126 Payment methods a11y (#829) * [π·πΎββοΈ] NT-1128 Moved continue button in Pledge screen to footer (#833) * [β οΈ ] NT-1131 Pledge error Toasts (#832) * [β‘] NT-1127 Removing Update pledge button (#834) * [π] NT-1130 Pledge button CTA (#835) * [β ] NT-1133 Enabling pledge button only when all fields are valid (#836)
π² What
Automatically selecting a logged in user's first card or the card used to pledge.
π€ Why
To make it easier for users to pledge.
π How
pledge_footer_pledge_button
now accepts clicks (meaning you can actually pledge and update your payment method with it)Update Pledge
button will be removed in another PR to keep this one small)RewardCardUnselectedViewHolder
Delegate.selectCardButtonClicked
tocardSelected
that takes in theStoredCard
along with itsposition
notifyDelegateCardSelected
that emits a<Pair<StoredCard, Int>>
of the selected card and its positionPledgeFragmentViewModel
pledgeButtonClicked
no longer takes in the card IDString
selectCardButtonClicked
is nowcardSelected
that takes in aStoredCard
and its positioninitialCardSelection
method to figure out what the initial selected card should beTestData
data class to help set up situations like updating a pledge with or without shippingsetUpBackedShippableRewardTestData
andsetUpBackedNoRewardTestData
and used them to clean up a few testsDeletions
BaseRewardCardViewHolderViewModel
id
output since it's no longer usedRewardLoadingCardViewHolderViewModel
π See
π QA
Smash that pledge button.
Story π
NT-1122