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

Fix iframe error when accessing Add new Page on post command palette #94114

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

epeicher
Copy link
Contributor

@epeicher epeicher commented Sep 2, 2024

Related to #93979

Proposed Changes

  • Add two new handlers to post messages for Add new post and Add new page to the calypsoify-iframe to avoid iframe errors
  • The new handler will handle the Add new page and Add new post commands in the Command palette

Why are these changes being made?

Testing Instructions

  • Execute cd apps/wpcom-block-editor/ && yarn dev --sync
  • Sandbox your simple site and widgets.wp.com
  • Apply this patch and navigate to your local edit post page, http://calypso.localhost:3000/post/<your simple site>, e.g. http://calypso.localhost:3000/post/mytestsimplesite.wordpress.com
  • Open Command Palette by clicking on the top bar or pressing Cmd+K
  • Select Add new page or Add new post
  • Check you are correctly redirected and no iframe errors are displayed

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Sep 2, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/new-page-command-calypsoify on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Sep 2, 2024

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@epeicher epeicher marked this pull request as ready for review September 3, 2024 10:26
@epeicher epeicher requested a review from xavier-lc September 3, 2024 10:26
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 3, 2024
@xavier-lc
Copy link
Contributor

@epeicher I've extracted the duplicated code into handleWpAdminRedirect.

Copy link
Contributor

@xavier-lc xavier-lc left a comment

Choose a reason for hiding this comment

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

Works as described 👌

@epeicher
Copy link
Contributor Author

epeicher commented Sep 3, 2024

@epeicher I've extracted the duplicated code into handleWpAdminRedirect.

Thanks @xavier-lc , great refactoring, much more generic

@epeicher epeicher merged commit e10ff3f into trunk Sep 3, 2024
11 checks passed
@epeicher epeicher deleted the add/new-page-command-calypsoify branch September 3, 2024 11:19
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 3, 2024
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