Offline Pages : Added Support for unpublished revision to Page List #11228
Offline Pages : Added Support for unpublished revision to Page List #11228malinajirka merged 32 commits intofeature/master-pages-offline-supportfrom
Conversation
so that the fragment could have point of communication with the PageListDialogHelper
|
You can test the changes on this Pull Request by downloading the APK here. |
malinajirka
left a comment
There was a problem hiding this comment.
Great job @jd-alexander! I haven't found any major issues. I've left a couple of minor comments with some possible improvements. Let me know what you think ;)
To reuse logic that allows the Post List to support this functionality. Most of this logic lives within the PostListDialogHelper. Since it has way more responsibilities than required in this PR, a PageListDialogHelper was created to extract only the functionality needed.
We might want to consider extracting each dialog into its own class. That'd allow us to share the logic between the screens. But let's consider this during the cleanup phase of the project.
While adding this feature, I noticed that the Delete Page Confirmation Dialog was utilizing the BasicFragmentDialog and mixing both implementations would reduce code quality so I opted to migrate the Delete Confirmation Dialog to the PageListDialogHelper for consistency.
Good call ;)! It might be even better to separate it into a different PR, but it doesn't matter since this PR is pretty straightforward. Thanks!
I reused the tracking events from the PostListDialogHelper but I am wondering if pages need to be tracked separately from posts.
Hmm, we might want to consider adding something like "type:post/page" attribute to the event. Wdyt?
For the "You've made unsaved changes to this page" label, I didn't add it since @malinajirka will be working on a PR to refactor how labels are generated and that would cause a conflict.
👍
Btw I noticed branch names on your PRs don't follow the issue/[issue_number]_more_details pattern. AFAIK our CI doesn't count on the pattern, but I think it'd be good to follow it for consistency with other branch names.
WordPress/src/main/java/org/wordpress/android/ui/posts/PostUtils.java
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PagesViewModel.kt
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PagesViewModel.kt
Show resolved
Hide resolved
…unhandled_autosave
WordPress/src/main/java/org/wordpress/android/viewmodel/pages/PageListDialogHelper.kt
Outdated
Show resolved
Hide resolved
Awesome. Thanks again for another thoughtful review
Indeed! I created an issue to track this #11272
Thanks for the comment 😄
Makes sense! I added it ac2129b So I should create an issue to add this to the
Thanks! I sometimes create a quick branch when I start playing around, renamed it locally and didn't realize I didn't push the new name. I will make sure all new PRs adhere to this from the start for sure 👍 |
|
We're freezing |
Thanks! Yeah, please create a ticket and link this usage there. I think we'll want share POST_TYPE to make sure no-one changes one place but forgets about the other. Thank you for all the changes! It all LGTM. I'm merging this PR even though the connect tests are failing, since they are failing on a lot of the PRs. The issue is not related to this PR. |
Fixes #11131
Findings
The
Page Listdidn't support loading an unpublished revision when changes were made on other devices.Solution
To reuse logic that allows the
Post Listto support this functionality. Most of this logic lives within thePostListDialogHelper. Since it has way more responsibilities than required in this PR, aPageListDialogHelperwas created to extract only the functionality needed.While adding this feature, I noticed that the
Delete Page Confirmation Dialogwas utilizing theBasicFragmentDialogand mixing both implementations would reduce code quality so I opted to migrate theDelete Confirmation Dialogto thePageListDialogHelperfor consistency.For the "You've made unsaved changes to this page" label, I didn't add it since @malinajirka will be working on a PR to refactor how labels are generated and that would cause a conflict.
I reused the tracking events from the
PostListDialogHelperbut I am wondering if pages need to be tracked separately from posts.Testing
Page Auto Revision Testing
autosaverequest is made since this implementation doesn't contain a label.The Version From Another Deviceshows the contents that exist in Calypso.The Version From This Appis accurate.Page Deletion Testing
Trashtab and click theMoreicon.Delete PermanentlyReviewing
Only 1 reviewer is needed but anyone can review.
Submitter Checklist
RELEASE-NOTES.txtif necessary.