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

[Gutenberg] Integrate validator with Gutenberg blocks #1009

Closed
1 task done
postphotos opened this issue Mar 9, 2018 · 6 comments
Closed
1 task done

[Gutenberg] Integrate validator with Gutenberg blocks #1009

postphotos opened this issue Mar 9, 2018 · 6 comments

Comments

@postphotos
Copy link
Contributor

postphotos commented Mar 9, 2018

As a WordPress site running Gutenberg, my core blocks' AMP-HTML markup should be validated and results should appear in the Compatibility Tool.

  • AC1: Integrate block validation results with the UI to reveal when a validation error does occur. Normally such errors will not happen for core blocks, but for the Custom HTML block in particular it is a distinct possibility. It is also key for plugins which introduce blocks so that their AMP validity can also be reported.
@westonruter
Copy link
Member

See #902 (comment)

@westonruter
Copy link
Member

I have some code for validation that is pending pushing.

@westonruter
Copy link
Member

@kienstra See #1019. Next step is to communicate back the validation errors when saving a post in the Gutenberg editor, and then showing the validation error notice in the same way we're doing for the classic editor.

@postphotos
Copy link
Contributor Author

The main issue description has been updated with a formal Story and Acceptance Criteria.

@kienstra
Copy link
Contributor

Request For Testing

Hi @csossi,
Could you please test this when you can? It's not as important as the 0.7.1 regression testing, though.

  1. Go to the editor of a post, like this. Your login details should be the same as the other testing sites.
  2. Add a Custom HTML block
  3. Enter invalid AMP, like:
<script>doSomething()</script>
<button onclick="doThis()">Click me</button>
  1. Click "Save draft"
    Expected:
  • A notice appears at the top of the editor, and at the top of the block
  • The "Details" link in the top notice leads to a page that highlights where the error is

errors-editor

  1. Add other blocks
    Expected:
  • There aren't notices above those blocks, like there are above that Custom HTML block above
  • The notice at the top of the page still appears

@csossi
Copy link

csossi commented Jun 8, 2018

verified in QA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants