-
Notifications
You must be signed in to change notification settings - Fork 136
POS Product Migration Step 7 #14590
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
POS Product Migration Step 7 #14590
Conversation
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
| on { events }.thenReturn(parentToChildrenMutableSharedFlow) | ||
| } | ||
|
|
||
| private val mockedEventForTracking: WooPosAnalyticsEvent.Event.ItemAddedToCart = |
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 curious, why do we need this one? And if we do, why is it called “mocked” when it seems to be the real object?
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.
Detekt wouldn't let me keep the mocked data object - there is a relatively new rule, that data classes can't be mocked. I kept the word mocked in the name to highlight, the object is kind of random - isn't actually testing which event we are passing/getting, just that it's a WooPosAnalyticsEvent.
kidinov
left a comment
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.
LGTM! I made a comment about the changes in the test
| ) : Parcelable { | ||
|
|
||
| val variationEnabledAttributes | ||
| get() = attributes.filter { it.isVariation } |
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.
It's an immutable data class, so do we need to refilter the list every time when it's accessed, or maybe it will be more efficient to have it as a field?
@IgnoredOnParcel
val variationEnabledAttributes = attributes.filter { it.isVariation }
?
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.
Good point, I'll create a lazily calculated property - that gives us the best of both worlds.
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.
Done in 4bb389f
…ific-product-model-step-6' into issue/woomob-1280-woo-poslocal-catalog-use-new-pos-specific-product-model-step-7
07ee3f6
into
feature-branch-for-pos-product-migration
Step 6 needs to be merged first.
Failing CI is expected here since this is a partial migration.
Description
This is part of the migration to POS specific Product Model. There will be many changes and I want to avoid huge PRs. Therefore I created a feature branch - I'll create a PR for each set of changes. The CI won't be able to build this PR, but I personally wouldn't worry about it -> we can ensure everything is green and working as expected when we are merging the feature branch back to trunk.
The
Version2in the name WooPosProductModelVersion2 will eventually be removed.This PR migrates WooPosCartViewModel, WooPosVariationMapper, WooPosProductSearchPredicate, WooPosSearchProductsDataSource,WooPosSearchResultsIndex
Images/gif
N/A
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.