-
Notifications
You must be signed in to change notification settings - Fork 847
Error Notice: removing HTML code, adjusting maximum width. #16690
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
Conversation
The notice content should not contain HTML. If it happens to have any, we clear out the tags before displaying the error.
…he wp-admin sidebar. If the error notice is too long, some part of it gets hidden behind the wp-admin sidebar on the left side. This commit decreases maximum width of the notice so it wouldn't happen.
44fe2ea to
9a10ee6
Compare
|
Thank you for the great PR description! When this PR is ready for review, please apply the E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-16690 Scheduled Jetpack release: August 4, 2020. |
|
@sergeymitr This seems to hide the dismiss button in my testing Edit: It's because there was no space after stripping the HTML :) I don't think we'll ever see a long string like this without spaces, so may not be a problem. |
|
Looks good to me! |
dereksmart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well for me
…dth. (#16690) * Removing HTML tags from the error text. * Limiting the maximum width of the notice.
|
Cherry-picked to |
Follow-up of #16690 The contents of the dashboard notices is not always a string. It can be a React element. When that's the case, let's avoid any errors by not using the replace method which is only available for strings.
Follow-up of #16690 The contents of the dashboard notices is not always a string. It can be a React element. When that's the case, let's avoid any errors by not using the replace method which is only available for strings.
…ic/jetpack into add/jetpack-lazy-images-package * 'add/jetpack-lazy-images-package' of github.com:Automattic/jetpack: (40 commits) Lodash: Revert to previous version (#16735) New class to handle async XML-RPC requests (#16674) Social Previews: Sidebar design updates (#16725) Update E2E locator for classic connection flow (#16708) Woo Services: update to use existing Jetpack plugin install tools (#16672) Admin Page: avoid blank dashboard when notice is not a string (#16721) Admin Page: update string still using old i18n format (#16722) Social Previews: Add sidebar UI (#16633) Fix recurring payments block disconnecting (sometimes) when existing article is reopened in block editor. (#16640) Connection Register: Add current user email to connection register request (#16712) Update versions to start 8.9 Release cycle (#16706) Donations block: Make currency and amounts editable (#16593) Update dependency @automattic/calypso-color-schemes to v2 Error Notice: removing HTML code, adjusting maximum width. (#16690) Update dependency swiper to v6 (#16587) Site Scan: Short-circuit update_threats_link() if Admin Bar is not present (#16677) Update vulnerable NPM packages (#16659) E2E Tests: Add Jetpack updater test (#16437) check for subdir site before rendering Ads.txt section (#16671) VideoPress Block: Retain alignment support (#16651) ...
…dth. (#16690) * Removing HTML tags from the error text. * Limiting the maximum width of the notice.

The notice content should not contain HTML. If it happens to have any, we clear out the tags before displaying the error.
Changes proposed in this Pull Request:
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
functions.phpand add following code to display the connection error notice:packages/connection/src/class-rest-connector.phpand add this line into the beginning of theconnection_reconnect()method:something something HTML something somethingBefore:
After:
Proposed changelog entry for your changes:
N/a.