-
Notifications
You must be signed in to change notification settings - Fork 131
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 target languages #10641
Blaze: Ad target languages #10641
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.
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## trunk #10641 +/- ##
============================================
- Coverage 41.41% 41.37% -0.05%
Complexity 4979 4979
============================================
Files 1007 1009 +2
Lines 57720 57780 +60
Branches 7678 7683 +5
============================================
Hits 23904 23904
- Misses 31698 31758 +60
Partials 2118 2118 ☔ View full report in Codecov by Sentry. |
languages, | ||
selectedLanguages |
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 np, Wdyt about having a single flow for languages and add a new boolean field to the Language
model to save the isSelected
state. I feel with this approach of 2 different flows one for all the values and one for the selected ones we are going to have an explosion of flows once we add the rest of the campaign details.
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.
Hm.. 🤔 I'm not convinced this would be cleaner, in the end. We'd save 4 flows overall but updating the selection and returning results would result in copying the entire lists and mapping, like this:
languages.update { items -> items.map { it.copy(isSelected = it.language.code in selectedIds) } } }
instead of selectedLanguages.update { selectedIds }
.
Let's discuss this further, I don't feel too strongly about this.. 🙂
Great work @0nko, code looks good and works as expected. I left a minor suggestion, but there's no need to apply it in this PR or at all. So feel free to merge whenever you prefer. |
Adresses #10589. The PR implements the target language selection in the ad preview screen.
Screen_recording_20240127_150953.webm
To test:
Note: Please merge #10638 before merging this.