-
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
[Issue 3885] product variation delete confirmation dialog to a dialog fragment #10664
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 #10664 +/- ##
============================================
+ Coverage 41.47% 41.56% +0.09%
+ Complexity 5016 5009 -7
============================================
Files 1015 1011 -4
Lines 58299 58075 -224
Branches 7793 7735 -58
============================================
- Hits 24178 24140 -38
+ Misses 31977 31790 -187
- Partials 2144 2145 +1 ☔ View full report in Codecov by Sentry. |
Generated by 🚫 dangerJS |
Hi @AnirudhBhat I've reviewed the PR requirements regarding Tracks-related updates. I want to clarify that my changes only involved moving existing Tracks logic to a new function, without altering its behavior or the events it triggers. Given this, I'm unsure if the full validation process in the Tracks system and updating the internal spreadsheet is necessary. Could you advise if these steps are still needed for such changes? Thanks for your guidance! |
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 working on this @jd-alexander. Works as expected!
Sorry, I missed your comment. This PR does not require any modifications to the spreadsheet since it only involves reorganizing existing events, without adding or removing any. |
No problem! Thanks for chiming in. I appreciate it @AnirudhBhat |
Closes: #3885
Description
This PR was created to address the issue where the confirmation dialog is dismissed upon device rotation in the
VariationDetailFragment
, some notable changes:Reattaching the Listener: A method named
reattachDialogInteractionListener
was added to the VariationDetailFragment. This method is called withinonViewCreated
to re-establish the connection between theVariationDetailFragment
and theWooDialogFragment
. It checks if the dialog is currently displayed and, if so, sets the current instance ofVariationDetailFragment
as the listener to the dialog. This ensures that the dialog can continue to communicate with the active instance of the fragment after a configuration change.Event Handling: The ViewModel was updated to handle the delete action through a
ShowDialogFragment
event. This event encapsulates all necessary information to display the dialog, including message IDs and button texts. When the event is triggered, the dialog is shown with the current context, and any actions taken in the dialog are communicated back to the ViewModel through the established listener interface.Observing Lifecycle Events: The
VariationDetailFragment
observes theShowDialogFragment
event. If the fragment is recreated due to an orientation change, the observer ensures that the dialog is shown again with the correct listener attached.Testing instructions
Images/gif
Screen_Recording_20240131_175116_WooCommerce.Dev.mp4
RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.