Skip to content

Conversation

@pablinos
Copy link
Contributor

We had to revert #29910 in #30101 because the review prompt state was stamping on the rest of the initial state object that's used by Social/Publicize.

Proposed changes:

This change adds the Post Publish panel with the review prompt to the publicize-components package and merges the required state in the Social plugin, so that if both plugins are active the review prompt is still shown in Jetpack.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

1198218726984184-as-1204393860935466/f

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

  • The testing is the same as Add review prompt for social plugin #27917 but for both Jetpack and Social plugins
  • Check that you see the review prompt with Social active, but not with just Jetpack active
  • Check that the prompt can be dismissed
  • Check that the link takes you to review Social.

We had to revert #29910 in #30101 because the review prompt state was
stamping on the rest of the initial state object that's used by
Social/Publicize.

This change adds the Post Publish panel with the review prompt to the
publicize-components package and merges the required state in the Social
plugin, so that if both plugins are active the review prompt is still
shown in Jetpack.
@pablinos pablinos added [Feature] Publicize Now Jetpack Social, auto-sharing [Status] Needs Team Review Obsolete. Use Needs Review instead. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin [JS Package] Publicize Components labels Jun 20, 2023
@pablinos pablinos requested a review from jboland88 June 20, 2023 11:22
@pablinos pablinos self-assigned this Jun 20, 2023
@github-actions github-actions bot added [Extension] Publicize Block editor plugin RNA labels Jun 20, 2023
@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

  • Next scheduled release: July 5, 2023.
  • Scheduled code freeze: June 26, 2023.

Social plugin:

  • Next scheduled release: July 5, 2023.
  • Scheduled code freeze: June 28, 2023.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 20, 2023

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack plugin. Once the plugin is active, go to Jetpack > Jetpack Beta > Jetpack and enable the fix/social-review-prompt branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack fix/social-review-prompt
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/social-review-prompt
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

@pablinos
Copy link
Contributor Author

It seems the tests are failing at the moment:

Yes, I didn't manage to solve the conflicts properly and it was some package version problem. I think it should be ok now, if you'd like to take another look @jeherve?

jboland88
jboland88 previously approved these changes Jun 21, 2023
Copy link
Contributor

@jboland88 jboland88 left a comment

Choose a reason for hiding this comment

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

This tested well and LGTM, nice solution.

I had one nitpick about registering the scripts with unique handle names, but it's not a blocker.


Assets::register_script(
'jetpack-social-editor',
'jetpack-blocks-editor',
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I assume this name jetpack-blocks-editor is the same as the main blocks editor script so that the extra data can be appended without needing to differentiate which one was loaded. AFAIK, it's good to have these handles be unique. I think it works in this case, but could be good to use a different handle.

It took me a while to remember that we check to see if Jetpack is loaded above, so I was confused how the name was the same with no conflict at first :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's so the inline script will get attached to the editor script whether we're loading the Social version or the Jetpack one.

Perhaps I can change the handle that we add the inline script to based on whether Jetpack is enabled.

Copy link
Contributor

@jboland88 jboland88 left a comment

Choose a reason for hiding this comment

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

Thanks for the update,
I did not re-run the full test plan with the latest change, but I specifically tested to make sure that the additional properties for the review request were added to the initial state for social in the editor with and without the Jetpack plugin active 👍

LGTM!

@pablinos pablinos dismissed jeherve’s stale review June 21, 2023 19:39

The tests have been fixed

@pablinos pablinos merged commit 199afea into trunk Jun 21, 2023
@pablinos pablinos deleted the fix/social-review-prompt branch June 21, 2023 19:40
@github-actions github-actions bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Extension] Publicize Block editor plugin [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Publicize Components [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Social Issues about the Jetpack Social plugin RNA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants