-
Notifications
You must be signed in to change notification settings - Fork 50
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
PaywallData validation #1273
PaywallData validation #1273
Conversation
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/helpers/OfferingToStateMapper.kt
Show resolved
Hide resolved
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## paywalls #1273 +/- ##
=========================================
Coverage 85.46% 85.46%
=========================================
Files 190 190
Lines 6385 6385
Branches 930 930
=========================================
Hits 5457 5457
Misses 568 568
Partials 360 360 ☔ View full report in Codecov by Sentry. |
This is looking good 👍🏻 |
2d44608
to
bb02408
Compare
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/helpers/OfferingToStateMapper.kt
Show resolved
Hide resolved
bf8bb92
to
a899d61
Compare
ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/utils/Result.kt
Outdated
Show resolved
Hide resolved
@@ -63,6 +64,7 @@ private fun getPaywallViewModel(offering: Offering?, listener: PaywallViewListen | |||
LocalContext.current.applicationContext.toAndroidContext(), | |||
offering, | |||
listener, | |||
MaterialTheme.colors, |
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.
We should check if light/dark theme colors get automatically updated in the default paywall. My strong bet is that no. In that case, we should maybe store the last state in the view model so we can update the state when it changes, but we can do that in another PR.
...venuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/data/PaywallViewModel.kt
Outdated
Show resolved
Hide resolved
) | ||
} catch (e: Exception) { |
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.
Since we're not doing this anymore, it may crash in the TemplateConfigurationFactory.create
since we require
a that there is at least some packages. Should we perform that validation before to avoid the crash?
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.
Right, I missed those require
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.
c6d5e40
to
1f821dd
Compare
a13c1f4
to
2f424c7
Compare
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.
Just a few minor things left, but this is perfect 🎉
...venuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/data/PaywallViewModel.kt
Show resolved
Hide resolved
ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/data/TestData.kt
Outdated
Show resolved
Hide resolved
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/helpers/OfferingToStateMapper.kt
Outdated
Show resolved
Hide resolved
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/helpers/OfferingToStateMapper.kt
Outdated
Show resolved
Hide resolved
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/helpers/OfferingToStateMapper.kt
Show resolved
Hide resolved
ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/utils/Result.kt
Outdated
Show resolved
Hide resolved
…dation-2 # Conflicts: # ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/data/PaywallViewModel.kt
Fixed the light/dark colors. We will default to the current color scheme now, when it changes, and we react to the change |
@tonidero I will do the icons validation in another PR so we can merge this one. Do you mind taking a look? |
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.
Looks great!
@@ -10,37 +10,35 @@ internal object TemplateConfigurationFactory { | |||
fun create( | |||
variableDataProvider: VariableDataProvider, | |||
mode: PaywallViewMode, | |||
paywallData: PaywallData, | |||
validatedPaywallData: PaywallData, |
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'm wondering if this should keep being paywallData
to not be confused with ValidatedPaywallResult
... I think it's ok though.
Add validation to paywall data and creates default template if validation fails