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

Site Editor: dashboard link compat for Gutenberg 14.5 #27601

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

mattwiebe
Copy link
Contributor

@mattwiebe mattwiebe commented Nov 24, 2022

Gutenberg 14.5 has removed the slotfill we formerly used for the dashboard link override, instead introducing a __experimentalDashboardLink setting.

This replaces Automattic/wp-calypso#69929

Fixes Automattic/wp-calypso#70074

Changes proposed in this Pull Request:

  • Change the Site Editor < Dashboard link to WP.com Home

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?

Jetpack product discussion

n/a

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

no

Testing instructions:

Screenshot 2022-11-24 at 14 55 16

WPCom Simple
  1. On your sandbox, run run bin/jetpack-downloader test add/site-editor-dashboard-compat
  2. Apply to a sandboxed wp.com site
  3. Ensure that your Site Editor's < Dashboard link points to wordpress.com/home/SITE_SLUG rather than SITE_SLUG.wordpress.com/wp-admin/site-editor.php
WoA
  1. Use your favourite method to get this branch running on an WoA Developer blog
  2. In the Site Editor, same as point 3 above.
  3. Disable Editing Toolkit Plugin
  4. Verify dashboard link again

NOTE: given that this supersedes Automattic/wp-calypso#70074 it will not necessarily appear to change anything on WP.com Simple, since both filters will be simultaneously operable. We get a truer test on Atomic by disabling the ETK plugin.

@mattwiebe mattwiebe requested a review from a team November 24, 2022 21:03
@mattwiebe mattwiebe self-assigned this Nov 24, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2022

Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack add/site-editor-dashboard-compat to get started. More details: p9dueE-5Nn-p2

@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations labels Nov 24, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 24, 2022

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 you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: January 3, 2023.
  • Scheduled code freeze: December 26, 2022.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Nov 24, 2022
@mattwiebe mattwiebe added [Status] Needs Team Review and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Nov 24, 2022
@agrullon95
Copy link
Contributor

agrullon95 commented Nov 29, 2022

Tests

I commented out the dashboard link logic inside of ETK WPCOM_Block_Editor_Nav_Sidebar class and synced this PR jetpack to WPCOM.

  • Simple Site - Verify Site Editor Dashboard link redirects user to wordpress.com/home/[SITE_SLUG] instead of [SITE_SLUG]/wp-admin/index.php

I disabled ETK plugin and switched to this Jetpack PR using Jetpack Beta tester.

  • Atomic Site - Verify Site Editor Dashboard link redirects user to wordpress.com/home/[SITE_SLUG] instead of [SITE_SLUG]/wp-admin/index.php

agrullon95
agrullon95 previously approved these changes Nov 29, 2022
@mattwiebe mattwiebe added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Team Review labels Nov 29, 2022
@brbrr brbrr removed the request for review from jeherve November 30, 2022 10:51
@anomiex
Copy link
Contributor

anomiex commented Nov 30, 2022

I don't know how this works post-Fusion. Excited to find out.

Once the build is complete, you run bin/jetpack-downloader test <branch> on your sandbox.

There's an automated comment that reminds you, in case you forget.

@mattwiebe
Copy link
Contributor Author

@anomiex thank you!

anomiex
anomiex previously approved these changes Nov 30, 2022
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

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

Looks like this will only affect wpcom Simple and Atomic, and I see someone has already tested those cases.

Left an inline comment, but it probably should not actually be applied in this PR for the reason given therein.

* @return array Updated Editor settings.
*/
public function site_editor_dashboard_link( $settings ) {
$settings['__experimentalDashboardLink'] = 'https://wordpress.com/home/' . $this->domain;
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally I'd suggest doing something like this here, just in case the value contains something weird.

Suggested change
$settings['__experimentalDashboardLink'] = 'https://wordpress.com/home/' . $this->domain;
$settings['__experimentalDashboardLink'] = 'https://wordpress.com/home/' . rawurlencode( $this->domain );

But it looks like there's a ton of other code in this file already not doing that, and the value is even being munged to replace / characters (probably for exactly that lack), so doing it only here would be inconsistent and might even break something depending on the unencoded behavior.

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 keeping consistent is usually better than being "right", but good to notice 👍

@mattwiebe mattwiebe enabled auto-merge (squash) November 30, 2022 20:41
Gutenberg 14.5 has removed the slotfill we formerly used for the dashboard link override, instead introducing a __experimentalDashboardLink setting.

This replaces Automattic/wp-calypso#69929
@mattwiebe mattwiebe dismissed stale reviews from anomiex and agrullon95 via 433740a December 1, 2022 17:36
@mattwiebe mattwiebe force-pushed the add/site-editor-dashboard-compat branch from 9c419c6 to 433740a Compare December 1, 2022 17:36
@mattwiebe
Copy link
Contributor Author

@anomiex the "PR is up to date" job was stuck in a weird state (it said here that it failed but clicking the Details link led to results from another PR) so I just did a rebase and pushed the branch back up and of course that dismisses your approving review!

And now after that, the continuous-integration/a8c-teamcity job is also failing, but clicking through to the job shows a passing job. Very confusing!

Anyway, need another quick 👍 or you can just merge this yourself.

@anomiex
Copy link
Contributor

anomiex commented Dec 1, 2022

The "PR is up-to-date" check runs in two different contexts. When the PR itself is updated it runs to check the PR, and when the tags it checks against are updated it runs to check every open PR. Probably the weird state was the latter case.

I think the continuous-integration/a8c-teamcity check is still being developed. You might ask in the jetpack-quality channel with questions.

@anomiex
Copy link
Contributor

anomiex commented Dec 1, 2022

BTW, a rebase will always dismiss existing reviews, while if you do a trunk merge instead it often keeps them.

@anomiex anomiex enabled auto-merge (squash) December 1, 2022 18:18
@anomiex anomiex merged commit 3f30b7a into trunk Dec 1, 2022
@anomiex anomiex deleted the add/site-editor-dashboard-compat branch December 1, 2022 18:19
@github-actions github-actions bot removed the [Status] Needs Review To request a review from Crew. Label will be renamed soon. label Dec 1, 2022
@github-actions github-actions bot added this to the jetpack/11.6 milestone Dec 1, 2022
@mattwiebe
Copy link
Contributor Author

Thanks again @anomiex !

* @return array Updated Editor settings.
*/
public function site_editor_dashboard_link( $settings ) {
$settings['__experimentalDashboardLink'] = 'https://wordpress.com/home/' . $this->domain;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this may be causing this issue Automattic/wp-calypso#71760 .

In short in testing flows on horizon, leaving the site editor on horizon now bumps you into the production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Site Editor close button setting - investigate adding via Jetpack
4 participants