-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adds Duplicate/Copy post functionality #13521
Conversation
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APK here. |
d318090
to
aa66603
Compare
Hey @osullivanchris 👋 |
@antonis Thanks for looking at this, and sharing the build! I tried it out and everything works as expected 😄 Just one note, per the discussion here we should change the label to 'duplicate' rather than 'copy' for consistency, as it sounds like we can't use 'copy' on iOS. |
Thank you for the prompt response @osullivanchris 👍 I really appreciate this 🙇
Oh, I missed this 🤷 I'll change the label in the next build. |
Thanks @antonis! I run out of time today and I haven't finish the review yet. But I think I found an issue and I have one question. Idea: Have you considered createing a copy of the post outside of the EditPostActivity (EPA). The EPA has quite a lot of responsibilities already. I'm wondering if we could create the copy of the post before we actually open the post in the EPA. It feels like creating the copy of the post isn't related to the editor anyway. We could write tests for what we want to and what we don't want to copy from the post (how to handle PostStatus etc). Wdyt? Issue I encountered:
|
Thank you for the prompt response on this @malinajirka 🙇
That's a good idea 👍 |
Hey @malinajirka 👋
I changed the implementation based on your suggestion. It avoids adding even more complexity in the EPA and doesn't trigger the debug crash 👍 |
This is in good shape Antonis. I've tested the flows described, and it's mostly working as expected. I also ran the unit tests for
I've found that I could create conflicts by simultaneously editing a published post on both the web and the app, but the same "trick" did not work for a draft. The one issue I noticed is that when a post is duplicated and closed without changes, the post list does not reflect the addition of the new post until the list is manually refreshed. |
Thank you for taking the time to review this @mkevins 🙇
That's really helpful for testing. Thank you :)
Nice catch 👍 |
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.
The new (unedited) duplicate post now shows up without manual refreshing. Nice work Antonis! LGTM!
Thank you both! I have just quickly scanned through the changes and it looks great overall. One thing we might want to consider is invoking something like this: |
Thank you both for taking the time to review this @malinajirka and @mkevins 🙇♂️ I agree with your suggestion @malinajirka and moved the list refresh to the |
This reverts commit f0147aa.
Fixes #7954
Depends on: wordpress-mobile/WordPress-FluxC-Android#1794
Description
This PR implements the "Duplicate post" functionality (already exists on Calypso)
Design
Note: for post with conflicts or autosave versions I chose to redirect to the edit flow. It is debatable if this is the right approach but duplicating the edit flow conflict handling for the copy functionality seemed to add unnecessary complexity in my view
To test
Duplicate published post
Duplicate draft post
Note: For the steps below I'm not sure how to consistently create conflicts for testing. Any input on this is welcome.
Duplicate post with conflict
Edit post with conflict
Duplicate local post
Screenshots
PR submission checklist:
RELEASE-NOTES.txt
if necessary.