-
Notifications
You must be signed in to change notification settings - Fork 808
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
Social | Hide irrelevant UI on social admin page #41393
base: trunk
Are you sure you want to change the base?
Social | Hide irrelevant UI on social admin page #41393
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 3 files.
|
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 don't think we can get away with not using the is_wpcom
checks. I think it might be worth having a utility function for it, rather than always checking the site.host value.
I've adjusted it to use the is_share_limit_enabled
for the cards, but that seems a bit unnecessary now if we can't remove the other is_wpcom checks. I suppose the less we have the better?
@gmjuhasz Could you take a look at this please? I think we could probably merge it for the Jetpack release, and improve the WPCOM side of things before we enable it there.
: __( | ||
'Connect your social media accounts and send a post’s featured image and content to the selected channels with a single click when the post is published.', | ||
'jetpack-publicize-components' | ||
) } | ||
| ||
<ExternalLink href="https://jetpack.com/redirect/?source=social-plugin-publicize-support-admin-page"> |
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.
We need to update these on WPCOM, or we might be able to handle it via the Jetpack redirect code. I'm not sure if we have the current site type.
projects/js-packages/publicize-components/src/components/admin-page/toggles/styles.module.scss
Outdated
Show resolved
Hide resolved
<GlobalNotices /> | ||
{ ( ! hasSocialPaidFeatures() && showPricingPage ) || forceDisplayPricingPage ? ( | ||
{ ( ! is_wpcom && ! is_woa && ! hasSocialPaidFeatures() && showPricingPage ) || |
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 was thinking we probably shouldn't show the pricing page on WoA either. I think we can see the plan there, but it would make for a more consistent experience.
…rrelevant-ui-on-admin-page
projects/js-packages/publicize-components/src/components/admin-page/header/index.js
Show resolved
Hide resolved
@@ -92,7 +92,8 @@ const SocialModuleToggle: React.FC = () => { | |||
{ ! is_wpcom | |||
? __( | |||
'When enabled, you’ll be able to connect your social media accounts and send a post’s featured image and content to the selected channels with a single click when the post is published.', | |||
'jetpack-publicize-components' | |||
'jetpack-publicize-components', | |||
/* dummy arg to avoid bad minification */ 0 |
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.
TS won't be happy with this. A better solution will be to use __
in one string and _x
in the other with some optional/empty context.
* | ||
* @return {boolean} Whether the site host is wpcom. | ||
*/ | ||
export function isWpcomSite() { |
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.
All these utils should ideally goto script-data js package utils, because these are not specific to Social.
But, we should use optional chaining when calling them to avoid Quad Layers plugin mess.
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.
Right, I can move them, this projects/js-packages/publicize-components/src/utils/script-data.ts
also sounded like utils for script data tho.
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.
Done in f4d39a6
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.
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.
Now I don't see it on simple sites 🤔 Doing some more testing
Proposed changes:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
wpsh
add_blog_sticker( 'jetpack-social-admin-page', null, null, blog-id-here );