-
Notifications
You must be signed in to change notification settings - Fork 175
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
MWPW-142590 - [Share] enhancement - ability to edit text above icons #2070
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
|
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #2070 +/- ##
==========================================
+ Coverage 96.35% 96.40% +0.04%
==========================================
Files 165 165
Lines 43534 43558 +24
==========================================
+ Hits 41947 41991 +44
+ Misses 1587 1567 -20 ☔ View full report in Codecov by Sentry. |
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.
Couple nits but looking good to me otherwise!
libs/blocks/share/share.js
Outdated
const childDiv = rows[0].querySelector(':scope > div'); | ||
const emptyRow = childDiv?.innerText.trim() === ''; | ||
/* eslint-disable no-confusing-arrow,no-useless-escape */ | ||
const toSentenceCase = (str) => str && typeof str === 'string' ? str.toLowerCase().replace(/(^\s*\w|[\.\!\?]\s*\w)/g, (c) => c.toUpperCase()) : ''; |
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.
nit: If we're already disabling eslint for this line, do you think we could break it out into multiple lines for better readability?
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.
Ah yep. Good call.
I added the /* eslint-disable-next-line no-useless-escape */
part
(I tested removing those 'useless' escapes and it didn't 'Sentence Case' right so I left that part as is)
I adjusted the arg into a few lines for better readability and fixes 'no-confusing-arrow' clause. :)
Thanks for the feedback
This pull request is not passing all required checks. Please see this discussion for information on how to get all checks passing. Inconsistent checks can be manually retried. |
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
This PR is currently in the |
Hi @ryanmparrish ! Please do not forget to assign a QA engineer to verify the changes. |
@elan-tbx I assigned this to you for a verified label. Thanks |
Reminder to set the |
…dobecom#2070) * Check for block content and use as header if exists, updated twitter icon ref * Refactored to allow for authoring icon discression * share.test for new custom title, refactored so .inline doesn't have title support * remove test console * linting * eslint adjust better readability
Authors would like to modify the 'Share this page' text that appears above the social icons in the
Share
block.X
versionNote: The variant
.inline
does not support a title and strips out any authored text in the block content.Resolves: MWPW-142590
Test URLs:
Authoring Docs
Testing notes: To author a custom title in the
Share
block, simply add the title in the blocks first content row. Works with or without the custom share url authoring options.