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

Add "more" actions to Gutenberg editor #10509

Merged
merged 6 commits into from
Nov 23, 2018

Conversation

pinarol
Copy link
Contributor

@pinarol pinarol commented Nov 21, 2018

Fixes a part of wordpress-mobile/gutenberg-mobile#182

This change includes below "more" actions which can be reached tapping top right ... button on the navigation bar:

  • Save as draft
  • Preview
  • Post settings

screen shot 2018-11-21 at 20 59 58

Implementation Details

I have created a new PR against this PR's branch which contains the follow up work of this PR. This PR was about to become huge so I divided it into 2.

I recommend following way for reviewing the PR:

  1. Review the code on this PR first but do not yet test it
  2. Review and test child PR
  3. After we are done on child PR let's merge it to this PR
  4. Test this PR

If merging the 2 PRs into 1 before starting the review sounds like a better idea please let me know and we can do that too.

To test:

Prerequisites:

  • clean pods folder
  • run "rake dependencies"
  • run yarn start on your mobile-gutenberg path
  • open XCode and Option+Click Play(a.k.a Run) button
  • Select "Run" option on the left
  • Select Arguments on right and then check gutenberg option
  • Click Run

Save as Draft Tests

1. Test "Save as draft" - Success

  • Open "Blog Posts" and tap (+) to create a new post
  • Add an arbitrary block
  • Tap (...) on right of the navigation bar
  • Tap "Save as Draft"
  • Verify that site picker in the navigation bar updated as site name
  • Verify that Publish button name is updated as Update
  • Tap close button
  • Verify that new draft is placed under Drafts tab

2. Test "Save as draft" - No Change

  • Open "Blog Posts" and tap (+) to create a new post
  • Don't change anything in post
  • Tap (...) on right of the navigation bar
  • Verify that there's no option for "Save as Draft"
  • Tap Keep editing
  • Tap close button
  • Verify that no draft is saved

3. Test "Save as draft" - Make a change and tap cancel - Save Draft

  • Open "Blog Posts" and tap (+) to create a new post
  • Add an arbitrary block
  • Tap Close
  • Verify that "Save Draft/Discard" prompt appears
  • Tap Save Draft
  • Verify that new draft is placed under Drafts tab

4. Test "Save as draft" - Make a change and tap cancel - Discard

  • Open "Blog Posts" and tap (+) to create a new post
  • Add an arbitrary block
  • Tap Close
  • Verify that "Save Draft/Discard" prompt appears
  • Tap Discard
  • Verify that no draft is saved

Preview Tests

1. Preview new post

  • Open "Blog Posts" and tap (+) to create a new post
  • Add an arbitrary block
  • Tap (...) on right of the navigation bar
  • Tap Preview
  • Verify that Preview is displayed

2. Preview draft post

  • Open "Blog Posts"
  • Choose a draft post
  • Tap (...) on right of the navigation bar
  • Tap Preview
  • Verify that Preview is displayed

3. Preview published post

  • Open "Blog Posts"
  • Choose a published post
  • Tap (...) on right of the navigation bar
  • Tap Preview
  • Verify that Preview is displayed

Post settings Tests

1. Post settings - new post

  • Open "Blog Posts" and tap (+) to create a new post
  • Add an arbitrary block
  • Tap (...) on right of the navigation bar
  • Tap Post Settings
  • Verify that Post Settings is displayed

2. Post settings - draft post

  • Open "Blog Posts"
  • Choose a draft post
  • Tap (...) on right of the navigation bar
  • Tap Post Settings
  • Verify that Post Settings is displayed

3. Post settings - published post

  • Open "Blog Posts"
  • Choose a published post
  • Tap (...) on right of the navigation bar
  • Tap Post Settings
  • Verify that Post Settings is displayed

Aztec tests

Uncheck the gutenberg flag in program arguments and repeat the above tests

@wpmobilebot
Copy link
Contributor

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

# Conflicts:
#	WordPress/Classes/ViewRelated/Post/PostEditor.swift
#	WordPress/WordPress.xcodeproj/project.pbxproj
Copy link
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pinarol - this is super good!
Tested in Aztec and Gutenberg and it was flawless in both 🎉
Code looks good too.
Let's :shipit:

@pinarol pinarol merged commit 8c5898f into try/gutenberg-merge Nov 23, 2018
@pinarol pinarol deleted the try/gutenberg-save-draft branch November 23, 2018 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants