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

Support Article Dialog: add support to scroll to anchor and refactor to functional component #40937

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

gwwar
Copy link
Contributor

@gwwar gwwar commented Apr 8, 2020

This PR updates the Support Article Dialog to a functional component and also adds support to scroll to an anchor point if specified in the postUrl.

So for example:

Without Anchor Support Page with Anchor
Apr-08-2020 14-45-20 Apr-08-2020 14-42-48

Testing Instructions

  • Spin up the branch
  • In console dispatch( { type: 'SUPPORT_ARTICLE_DIALOG_OPEN', postId: 145498, postUrl: 'https://support.wordpress.com/free-photo-library/' } ) opens the support dialog to the top of the page content.
  • In console dispatch( { type: 'SUPPORT_ARTICLE_DIALOG_OPEN', postId: 145498, postUrl: 'https://support.wordpress.com/free-photo-library/#add-images-from-a-post-or-page' } ) scrolls to the correct anchor point
  • In console dispatch( { type: 'SUPPORT_ARTICLE_DIALOG_OPEN', postId: 147594, postUrl: 'https://wordpress.com/support/wordpress-editor/#blocks' } ) scrolls to the correct anchor point
  • In console dispatch( { type: 'SUPPORT_ARTICLE_DIALOG_OPEN', postId: 147594, postUrl: 'https://wordpress.com/support/wordpress-editor/#configuring-a-block' } ) scrolls to the correct anchor point
  • No regressions with existing inline help (?) or the free photo library card in My Home

@gwwar gwwar added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 8, 2020
@gwwar gwwar requested a review from a team April 8, 2020 21:49
@gwwar gwwar self-assigned this Apr 8, 2020
@matticbot
Copy link
Contributor

@gwwar
Copy link
Contributor Author

gwwar commented Apr 9, 2020

@mmtr feel free to land this for me if changes look good 👍

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Nice work @gwwar!

@mmtr mmtr added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 9, 2020
@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Async-loaded Components (~24 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-blocks-support-article-dialog-dialog       -212 B  (-0.3%)      +24 B  (+0.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@mmtr
Copy link
Member

mmtr commented Apr 9, 2020

Tests are quite flakey in all PRs. I'm not being able to get a clean build, so I'm going to land this in order to unblock #39617 (double checked in p1586431438072700-slack-e2e-testing-discuss @Automattic/e2e-test-reviewers are aware of the Timed out waiting for element with css selector of '#loginAsAnotherUser' to be clickable errors and are working on them, so this should be safe to land in the meantime).

@mmtr mmtr added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 9, 2020
@mmtr mmtr merged commit e491332 into master Apr 9, 2020
@mmtr mmtr deleted the add/support-anchor-link branch April 9, 2020 11:56
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 9, 2020
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