-
Notifications
You must be signed in to change notification settings - Fork 130
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
Blaze: Ad destination parameters #10762
Conversation
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
item(key = "footer") { | ||
Column( | ||
modifier = Modifier | ||
.animateItemPlacement() | ||
.fillMaxWidth() | ||
) { |
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.
Out of curiosity why did you add the footer inside the lazy column? Why not just below it?
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.
Because of the animation. When I put it outside, the lazy column items are animated but the footer jumps.
savedStateHandle: SavedStateHandle | ||
) : ScopedViewModel(savedStateHandle) { | ||
companion object { | ||
// The maximum number of characters allowed in a URL by Chrome |
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.
Are we following the Chrome restrictions in the end or the Calypso web restrictions? Just double checking after seeing this convo: p1707498869846739-slack-C03L1NF1EA3
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.
Yes, I've updated the behavior to match the web/iOS.
private fun getParameters(url: String): String { | ||
return url.split("?") | ||
.getOrNull(1) | ||
?.replace("&", "\n") | ||
?: return resourceProvider.getString(R.string.blaze_campaign_edit_ad_destination_empty_parameters_message) | ||
} |
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.
Minor suggestion, you can maybe reuse the parseParameters()
function to make it slightly "more readable"?
private fun getParameters(url: String): String {
return url.parseParameters().entries.joinToString(separator = "\n")
.ifBlank { resourceProvider.getString(R.string.blaze_campaign_edit_ad_destination_empty_parameters_message) }
}
It's more of a personal taste thing, so feel free to ignore this.
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.
Thanks for the suggestion, I updated the code.
Great work @0nko. Everything works as expected and code looks good! I just left a couple questions, but aside from that this si ready to be merged. |
Generated by 🚫 dangerJS |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## trunk #10762 +/- ##
============================================
- Coverage 41.44% 41.41% -0.04%
Complexity 5017 5017
============================================
Files 1016 1017 +1
Lines 58364 58407 +43
Branches 7803 7806 +3
============================================
Hits 24190 24190
- Misses 32030 32073 +43
Partials 2144 2144 ☔ View full report in Codecov by Sentry. |
@JorgeMucientes Thanks for the review. I've addressed your feedback. |
Implements #10737, a subtask of #10665.
Screen_recording_20240209_213359.webm
To test:
Patch: