Skip to content
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

Call publishPost(true) when confirmation dialog is accepted #9655

Closed

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Apr 17, 2019

Fixes #9652

The problem being reported in #9652 was due to not having the PENDING status of Posts into account when moving the code to change status to PUBLISHED in #9544 (thanks for narrowing down the occurrence and opening an issue @hypest @malinajirka ).

This PR just changes the meaning of the publishPost(boolean isDraftToPublish) parameter from isDraftToPublish to isPublishConfirmed. The reality is all checks for Post statuses should have been made before the publish confirmation dialog appears, hence this is all we need to know (whether the user was shown the publish confirmation dialog and they pressed OK). This way, we'll cover both the DRAFT and PENDING statuses (or any other "future" statues that make the transition to PUBLISHED possible).

To test:

  1. start a draft post, enter some title and body
  2. tap on the overflow menu icon and tap Settings
  3. set the status to Pending review
  4. tap back twice (once to go back to editing, another one to exit the editor)
  5. observe the Post gets saved and reflects on the Posts list as Pending review
  6. open it again
  7. open the menu and tap on Publish Now
  8. accept the confirmation dialog
  9. observe the Post gets published.

Also, test that a new Draft still gets published:

  1. start a draft post, enter some title and body
  2. tap PUBLISH on the action bar
  3. accept the confirmation dialog
  4. observe the Post gets published.

And finally, a saved Draft:

  1. start a draft post, enter some title and body
  2. exit the editor so it gets saved as a Draft
  3. open it again
  4. tap on the overflow menu icon and tap Publish Now
  5. accept the confirmation dialog
  6. observe the Post gets published.

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

cc @jtreanor @jkmassel

@mzorz mzorz added this to the 12.2 ❄️ milestone Apr 17, 2019
@mzorz mzorz requested review from hypest and malinajirka April 17, 2019 13:06
@mzorz mzorz removed the request for review from hypest April 17, 2019 13:34
@mzorz
Copy link
Contributor Author

mzorz commented Apr 17, 2019

Full list of tests (I've run them) done with this PR includes:

@malinajirka
Copy link
Contributor

Thanks @mzorz for the quick fix;). I've just quickly checked the code and it LGTM.

However, I've encountered a couple of issues, but I'm not sure if they are related. I'll list them and we can create separate issues if they are not related.

  • The "publish confirmation" dialog is shown even when I click on "Save" and if I click on "Publish now" the post gets published.
  1. Clear app data
  2. Blog Posts
  3. Click on FAB
  4. type something into title
  5. overflow menu - post settings
  6. change status to Pending review
  7. click on "Save" and notice publish confirmation dialog is shown

first-save

  • The "Publish Now" button doesn't work for Scheduled posts
  1. Blog Posts
  2. Schedule a post for next week
  3. Notice "Scheduled" label is shown in the post list
  4. Open the post and make some changes to it (eg. change title)
  5. Click on "Publish now" in the overflow menu
  6. Notice the publish confirmation dialog is not shown and the post isn't published
  7. Go back to post list and notice "local changes" label on the post

publish-now-for-scheduled

@daniloercoli
Copy link
Contributor

I was able to make a post marked as "pending review" published on the site.
Steps to repro:

  • Install a clean app from scratch
  • Insert username/password and go to posts list after the login
  • Tap on a draft post, and open settings
  • Set the post status to "Pending Review"
  • Tap Update
  • Boom!

As you can see in the picture attached below the post has the status = "pending review" and the top right button says Update (sorry if it's in IT lang).

  • The Publish with confidence dialog is shown on the screen when I hit Update
  • The dialog says Keep writing / Publish now
  • I tapped on Publish now since it seemed to me to option I wanted? 🤔 and then the post went live on the site

Screen Shot 2019-04-17 at 17 40 24

@mzorz
Copy link
Contributor Author

mzorz commented Apr 17, 2019

Thanks for the review both of you!!

@malinajirka yes indeed I think those 2 issues are unrelated to this PR, but good catch on both. I'll open new issues as suggested 👍

@daniloercoli Ok that one is worse, I think we'll have to just add the pending status explicitly as we did with draft in the previous PR instead of trying to infer the status from a UI state (the dialog being shown) as I incorrectly thought would work here. Will close this one and open a new PR.
Thanks again both! :Bow:

@mzorz mzorz closed this Apr 17, 2019
@mzorz mzorz deleted the issue/9652-fix-publish-post-pending-review branch April 17, 2019 17:39
@mzorz
Copy link
Contributor Author

mzorz commented Apr 17, 2019

Opened new issues as agreed here:
#9658
#9659

Also found this other one and filed here
#9660

@mzorz mzorz restored the issue/9652-fix-publish-post-pending-review branch April 17, 2019 18:39
@mzorz
Copy link
Contributor Author

mzorz commented Apr 17, 2019

Opened WIP draft PR #9661 to address these issues

@mzorz mzorz mentioned this pull request Apr 18, 2019
5 tasks
@mzorz mzorz deleted the issue/9652-fix-publish-post-pending-review branch April 25, 2019 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants