Social: use connection template in per-network editor#48568
Social: use connection template in per-network editor#48568manzoorwanijk merged 3 commits intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
| export const SOCIAL_NOTES_CONFIG_KEY = 'jetpack_social_notes_config'; | ||
| export const SHOW_PRICING_PAGE_KEY = 'jetpack-social_show_pricing_page'; | ||
| export const MESSAGE_TEMPLATE_KEY = 'jetpack_social_message_template'; | ||
| export const DEFAULT_MESSAGE_TEMPLATE = '{title}\n\n{excerpt}\n\n{url}'; |
There was a problem hiding this comment.
I think we should avoid re-defining this and we should rather use messageTemplate from the script data that I added in #48560, as it reads the saved settings template.
There was a problem hiding this comment.
Updated in 68910cc. I removed the duplicated DEFAULT_MESSAGE_TEMPLATE JS constant and now treat getSocialSettings().messageTemplate as the global template layer. That selector already falls back to the social script-data settings.messageTemplate when REST settings are not loaded, so an empty saved global template now falls through to the network default without hardcoding the PHP default in JS.
|
Merging this to rebase #48573 |
Fixes SOCIAL-453
Proposed changes
social-message-templates.messageHelp/messagePlaceholdersupport fromSharePostFormtoMessageBoxControl.messageTemplatesetting from social script data/store fallback instead of duplicating the PHP default template in JS.MessageBoxControlhelp override.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
social-enhanced-publishingandsocial-message-templates.Connection template will be used if empty.Global template will be used if empty.The default network template will be used if empty.social-message-templates.pnpm --filter @automattic/jetpack-publicize test -- per-network.test.tsx message-box-control/tests/index.test.jspnpm --filter @automattic/jetpack-publicize typecheckpnpm --filter @automattic/jetpack-publicize run build-production-concurrently