-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Adds 'nofollow' setting to Button block #54110
Adds 'nofollow' setting to Button block #54110
Conversation
f22ca0c
to
3137c93
Compare
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.
One note below.
This is looking good, just needs a rebase I think. |
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.
I'm going to block this PR because I"m not confident that we should be adding to the API of this component.
Let's discuss this further and get a wider range of opinions before we proceed.
Thank you 🙇
8ae1504
to
08d44c6
Compare
2626796
to
dbe9b5f
Compare
Hi @getdave, just a friendly nudge to request your review of the latest changes on my PR when you have a moment. Thanks! |
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.
This is very close. Thank you for your patience.
I think upon reflection some unit tests would help add confidence here. They will also lay a solid foundation for a later refactoring.
Use constant instead of string Update e2e test for Button nofollow link setting Improve settings toggle logic - Update nofollow control label Update link control label
6df0f71
to
7895ebd
Compare
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.
Great work here. A few more tweaks and we should be in a good place.
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.
Thank you for all the work on this.
LGTM 🚀
Note to WP 6.4 leads. I don't believe we need to backport this PR. Happy to be advised otherwise if folks find it to be sufficiently "blessed". |
What?
Add the ability to toggle the
nofollow
for Button's link.Partial implementation of #54091
Prior art for Rich text link #53945
Why?
Check #53945 (comment)
How?
nofollow
option in theAdvanced
settings areaTesting Instructions
opensInNewTab
andnofollow
rel
andtarget
attributes has been inserted correctlytarget="_blank" rel="noreferrer noopener"
target="" rel="nofollow"
target="_blank" rel="noreferrer noopener nofollow"
target="" rel=""
Testings
Verify and update these e2e tests
npm run test:e2e:playwright -- test/e2e/specs/editor/blocks/links.spec.js
npm run test:e2e:playwright -- test/e2e/specs/editor/blocks/buttons.spec.js
Insert new unit testing for updateLinkAttributes
npm run test:unit -- packages/block-library/src/button
Testing Instructions for Keyboard
Screenshots or screencast
Kapture.2023-09-01.at.19.39.59.mp4
cc: @getdave