-
Notifications
You must be signed in to change notification settings - Fork 991
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-1916: Display payment plan in Manage Pledge Flow if available #2195
Conversation
- render payment schedule
- created companion object to map raw value from enum
Return the matched state or UNKNOWN for unrecognized values
@@ -235,6 +241,20 @@ class BackingFragment : Fragment() { | |||
|
|||
val boldPortionLength = text.toString().split(".").first().length | |||
setBoldSpanOnTextView(boldPortionLength, this, resources.getColor(R.color.kds_support_400, null)) | |||
|
|||
binding?.paymentScheduleComposeView?.setContent { |
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.
My inkling here is that this will appear on all manage pledge screens, regardless of if they are a PLOT pledge. We should probably gate this with the condition that it only shows if the pledge is PLOT.
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.
Agre with @leighdouglas
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun PaymentRow(paymentIncrement: PaymentIncrement) { | ||
val formattedAmount = String.format(Locale.US, "%.2f", paymentIncrement.amount.amount.parseToDouble()) | ||
val formattedAmount = |
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.
For formatting ammounts I will suggest to taking a look at KSCurrency
, we want currency string appropriate to the user's locale
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.
The backend is going to provide the formatted amounts for us, we are just waiting for this piece to be finished. We actually don't show these amounts in the users currency, but in the project currency.
@@ -249,6 +254,12 @@ interface BackingFragmentViewModel { | |||
} | |||
.map { it.second.userIsCreator(it.first.getValue()) } | |||
|
|||
backing |
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.
For the bussines logic, I will check if the project is enabled or not for plot. And do not forget to cover any new logic with tests
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2195 +/- ##
============================================
- Coverage 68.42% 68.38% -0.04%
- Complexity 2188 2193 +5
============================================
Files 351 352 +1
Lines 23554 23547 -7
Branches 3455 3456 +1
============================================
- Hits 16117 16103 -14
- Misses 5611 5616 +5
- Partials 1826 1828 +2 ☔ View full report in Codecov by Sentry. |
📲 What
Changes on the UI of Manage Your Pledge Screen to show the PLOT selection on the pledge changin the banner of the text an adding the Payment Schedule component.
🤔 Why
For the PLOT UI
🛠 How
Added the PaymentIncrement value to the backin object, modify GraphQLTransformer, changing the UI of the Manage your pledge screen to render the PaymentSchedule component, modifying the State enum class on PaymentIncrements to accept raw values in lowercase (cause that how we recibe it from the BE)
👀 See
📋 QA
If you don't have a PLOT pledged project do it and then check it on the Manage Your Pledge Screen. The banner should say something about plot and the PaymentSchedule component should be rendered correctly
Story 📖
MBL-1916: API | Display payment plan in Manage Pledge Flow if available