-
Notifications
You must be signed in to change notification settings - Fork 803
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
Launchpad: "first_post_published" task links to first post if you have one #39259
Conversation
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
The logic for looking up existing draft posts is shifted to wpcom_launchpad_get_latest_draft_id(). This allows the get_title() function to also use it to determine which button label to present to the user.
The first_post_published task was using the calypso_path returned by the server, expect for `starting-writing` and `design-first` flows, which wanted to always open the wp-admin editor. In Automattic/jetpack#39259 the server now always returns a wp-admin path for these flows, so the special casing is no longer required.
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.
…ve one (#94259) * Use API url * All flows using first_post_published path returned by server The first_post_published task was using the calypso_path returned by the server, expect for `starting-writing` and `design-first` flows, which wanted to always open the wp-admin editor. In Automattic/jetpack#39259 the server now always returns a wp-admin path for these flows, so the special casing is no longer required. * Adjust tests to match new first_post_published behaviour --------- Co-authored-by: Philip Jackson <philip@Philips-MacBook-Pro.local>
…e one (#39259) * Check if draft post exist and return * changelog * first_post_published copy depends on existence of existing draft The logic for looking up existing draft posts is shifted to wpcom_launchpad_get_latest_draft_id(). This allows the get_title() function to also use it to determine which button label to present to the user. --------- Co-authored-by: Philip Jackson <philip@Philips-MacBook-Pro.local>
Fixes Automattic/wp-calypso#94086
Proposed changes:
Some flows allow the user to start writing before they reach the Launchpad, if that is the case, users can have a Draft post when they arrive at the Launchpad. As reported in Automattic/wp-calypso#94086, the user can find themselves in an onboarding flow loop: they draft a first post, head back to the launchpad, click "write your first post", draft a new post, head back to the launchpad, etc. etc.
The user should be more successful completing the task if they don't end up in a loop.
This PR adds checks on the Launchpad API and to return the correct task URL:
wp-admin
or Calypso editors depending on flow and site optionsThis PR works in concert with Automattic/wp-calypso#94259 which updates the client logic so that it respects the URL returned by the server. That's why extra logic for
start-writing
anddesign-first
flows have been added to the server, because it replicates logic that used to be present in Calypso.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
The same testing instructions as the Calypso PR Automattic/wp-calypso#94259 replicated below for convenience.
Extra things to test for this PR are to using logging or some other mechanism to confirm the caching in the new
wpcom_launchpad_get_latest_draft_id
function works as expected.