Skip to content

Fix AMP Story editor compatibility with code editor#3007

Merged
swissspidy merged 10 commits intodevelopfrom
fix/story-code-editor
Aug 12, 2019
Merged

Fix AMP Story editor compatibility with code editor#3007
swissspidy merged 10 commits intodevelopfrom
fix/story-code-editor

Conversation

@westonruter
Copy link
Copy Markdown
Member

@westonruter westonruter commented Aug 11, 2019

I encountered a couple bugs when attempting the story editor after having been in code editor mode. First of all:

Screen Shot 2019-08-11 at 14 50 04

There was an apparent missing check for whether the .block-editor-writing-flow__click-redirect element exists before removing it. So this is fixed in ad8e115.

After fixing this, the editor was able to load without causing an error, but when switching to visual editor I saw duplicated controls:

Screen Shot 2019-08-11 at 14 52 02

This is due to not checking if the #amp-story-editor element already exists in the page. Fixed by 4c67fbf.

Also fixes #3010.

@westonruter westonruter added Bug Something isn't working AMP Stories labels Aug 11, 2019
@westonruter westonruter requested a review from swissspidy August 11, 2019 22:01
@googlebot googlebot added the cla: yes Signed the Google CLA label Aug 11, 2019
@swissspidy swissspidy added this to the v1.2.1 milestone Aug 12, 2019
@swissspidy
Copy link
Copy Markdown
Collaborator

Looks good! Might be a nice thing to add a small e2e test for. Will have a look.

@swissspidy swissspidy self-assigned this Aug 12, 2019
@swissspidy swissspidy requested a review from miina August 12, 2019 12:15
Copy link
Copy Markdown
Contributor

@miina miina left a comment

Choose a reason for hiding this comment

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

LGTM!

await expect( page ).not.toMatchElement( '.block-editor-writing-flow__click-redirect' );

await switchEditorModeTo( 'Code' );
await page.click( '.edit-post-more-menu [aria-label="More tools & options"]' );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could also use clickButtonByLabel here which also waits until the selector becomes available, although its availability is not really an issue here.

@swissspidy swissspidy merged commit 1cc5cf9 into develop Aug 12, 2019
@swissspidy swissspidy deleted the fix/story-code-editor branch August 12, 2019 13:36
westonruter added a commit that referenced this pull request Aug 12, 2019
…p-bind-syntax

* 'develop' of github.com:ampproject/amp-wp:
  RTLCSS all the things (#2977)
  Fix AMP Story editor compatibility with code editor (#3007)
  Update dependency core-js to v3.2.1 (#3011)
  Update amphtml validator spec to v1907301630320 (#3003)
  Improve handling of unlisted Vimeo videos (#2986)
  Always hide AMP admin menu item and compatibility tool menu ite… (#3005)
  Update dependency dom-scroll-into-view to v2.0.1 (#3008)
  Hide tooltips that should be hidden (#2988)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable toolbar options in code editor

4 participants