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

Added Create Post button to empty results view displayed on no connectivity from post list #12023

Merged
merged 7 commits into from Jul 2, 2019

Conversation

@yaelirub
Copy link
Contributor

commented Jun 28, 2019

When displaying NoResultsView due to no connection from post lists
we want to display a specific copy and a create post button.

Fixes #11997

Before:
2019-04-10 13 39 31

After:
Screen Shot 2019-06-27 at 5 36 03 PM

To test:

  1. Be offline
  2. Go to Published or Drafts tab
  3. See the "no results view" with the right copy
  4. See the "Create Post" button
  5. Tap create post button
  6. See that when exiting the editor or from the menu you have save as draft option
  7. Tap save as draft
  8. See the post was created as draft but fails to upload.

Update release notes:

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

yaelirub added some commits Jun 28, 2019

Adding Create Post button
When displaying  NoResultsView due to no connection from post lists
we want to display a specific copy and a create post button.

@yaelirub yaelirub added this to the 12.9 milestone Jun 28, 2019

@yaelirub yaelirub added this to In Review in Offline Support: Posting [iOS] via automation Jun 28, 2019

@yaelirub yaelirub changed the title Adding Create Post button Added Create Post button to empty results view displayed on no connectivity from post list Jun 28, 2019

@yaelirub yaelirub requested review from diegoreymendez and jklausa Jun 28, 2019

@diegoreymendez

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

@yaelirub - Remember to tick the "Update release notes" checkbox.

@jklausa
Copy link
Member

left a comment

There's one whitespace issue, but other than that - it's good to go!

@@ -542,6 +550,9 @@ private extension NoResultsViewController {
struct NoConnection {
static let title: String = NSLocalizedString("Unable to load this page right now.", comment: "Title for No results full page screen displayed when there is no connection")
static let subTitle: String = NSLocalizedString("Check your network connection and try again.", comment: "Subtitle for No results full page screen displayed when there is no connection")
static let titlePostList: String = NSLocalizedString("Unable to load posts right now.", comment: "Title for No results full page screen displayedfrom post list when there is no connection")
static let subTitlePostList: String = NSLocalizedString("Check your network connection and try again. Or draft a post.", comment: "Subtitle for No results full page screen displayed from post list when there is no connection")
static let buttonTitlePostList: String = NSLocalizedString("Create Post", comment: "Button title, encourages users to create a post.")

This comment has been minimized.

Copy link
@jklausa

jklausa Jul 1, 2019

Member

The whitespace on this line is off.

@diegoreymendez
Copy link
Contributor

left a comment

This is working great.

I've added two notes for code-related improvements, and one question for @osullivanchris.

Also one final note: this doesn't add the button for the pages list. Is this known?

Updated according to code review
Added parameters in main configure method in NoResultsViewController.

Now the caller can define the no connection title and subtile amongst other things. If there is no connection and the caller did not define,
we use the "default" texts that we defined as constants under NoResultsViewController
@yaelirub

This comment has been minimized.

Copy link
Contributor Author

commented Jul 2, 2019

@diegoreymendez , @jklausa updated according to code review.
Now not specifying for post list view controller so had to update caller methods in obj-c

@diegoreymendez

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

I opened a separate issue for my observation that this needs to be done for the pages list too.

@diegoreymendez
Copy link
Contributor

left a comment

I added a comment about something I think could be improved code-wise.

@@ -661,5 +660,8 @@ private extension PostListViewController {
static let noScheduledTitle = NSLocalizedString("You don't have any scheduled posts", comment: "Displayed when the user views scheduled posts in the posts list and there are no posts")
static let noTrashedTitle = NSLocalizedString("You don't have any trashed posts", comment: "Displayed when the user views trashed in the posts list and there are no posts")
static let noPublishedTitle = NSLocalizedString("You haven't published any posts yet", comment: "Displayed when the user views published posts in the posts list and there are no posts")
static let noConnectionTitle: String = NSLocalizedString("Unable to load posts right now.", comment: "Title for No results full page screen displayedfrom post list when there is no connection")
static let noConnectionSubtitle: String = NSLocalizedString("Check your network connection and try again. Or draft a post.", comment: "Subtitle for No results full page screen displayed from post list when there is no connection")
static let noConnectionButtonTitle: String = NSLocalizedString("Create Post", comment: "Button title, encourages users to create a post.")

This comment has been minimized.

Copy link
@shiki

shiki Jul 2, 2019

Member

Should we reuse and change the message in buttonTitle instead?

This comment has been minimized.

Copy link
@yaelirub

yaelirub Jul 2, 2019

Author Contributor

Yeah we can

@diegoreymendez
Copy link
Contributor

left a comment

Approved!

@yaelirub yaelirub merged commit ab305bf into develop Jul 2, 2019

3 checks passed

Hound No violations found. Woof!
Peril All green. Yay.
Details
ci/circleci: build_and_test Your tests passed on CircleCI!
Details

Offline Support: Posting [iOS] automation moved this from In Review to Done (PRs) Jul 2, 2019

@yaelirub yaelirub referenced this pull request Jul 13, 2019
1 of 1 task complete
@designsimply

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

Tested and confirmed with 12.9 beta that I can create a draft while offline, that it fails to upload while offline, and that it does upload after going back online. (53s)

Tested with WP Internal 12.9.0.20190717 on iPhone 6S iOS 12.3.1 on a WordPress 5.2.2 Jetpack 7.5.3 site past-gull.jurassic.ninja

@yaelirub yaelirub deleted the issue/11997_add_create_post_button branch Aug 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.