-
Notifications
You must be signed in to change notification settings - Fork 137
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
Issue/2630 display grouped products #2731
Conversation
…led when fetching grouped products
…eProductIds are available
Generated by 🚫 dangerJS |
You can test the changes on this Pull Request by downloading the APK here. |
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.
@anitaa1990 Tried to test, but am getting this crash:
2020-08-17 16:57:01.147 30517-30517/com.woocommerce.android.dev E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.woocommerce.android.dev, PID: 30517
java.lang.IllegalStateException: Gson().fromJson(groupedP… JsonElement::class.java) must not be null
at org.wordpress.android.fluxc.model.WCProductModel.getGroupedProductIds(WCProductModel.kt:245)
at com.woocommerce.android.model.ProductKt.toAppModel(Product.kt:548)
at com.woocommerce.android.ui.products.ProductListRepository.getProductList(ProductListRepository.kt:141)
at com.woocommerce.android.ui.products.ProductListViewModel$loadProducts$2.invokeSuspend(ProductListViewModel.kt:195)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Hey @AmandaRiu!
I'm not actually able to reproduce the crash. I tested with a branch new grouped product as well as existing product. But looking at the error, it seems to be that Ready for another round 👍 Let me know if you are able to reproduce the crash. I would also like to reproduce, if possible so any testing steps would be helpful as well. |
fun onProductChanged(event: OnProductChanged) { | ||
if (event.causeOfChange == FETCH_PRODUCTS) { | ||
if (event.isError) { | ||
// TODO: add tracking event |
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 noting there is a TODO here for tracks events. Will that be handled in a separate PR? Same with a couple lines down.
resources.getString(groupedProductResourceId, groupedProductsSize), | ||
R.drawable.ic_widgets | ||
) { | ||
// TODO: add click event |
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.
Note: tracks event TODO.
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.
Tested and looks good! 👍 Nice job Anitaa!
Part 1/3 of #2630. This PR adds logic to display products associated with grouped products.
Changes
ProductListViewHolder
andProductListDiffUtil
to separate classes so that they can be reused byGroupedProductListAdapter
as well asProductListAdapter
Screenshots
. . .
Testing
delete
icon for one of the items and verify:Notes
This PR is in draft till this FluxC PR can be reviewed and merged.Update release notes:
RELEASE-NOTES.txt
if necessary.