Skip to content

Commit

Permalink
Social: Add share status feature flag (#39015)
Browse files Browse the repository at this point in the history
* Add feature flag

* changelog

* Fixup versions
  • Loading branch information
gmjuhasz authored Aug 22, 2024
1 parent befb138 commit 0728499
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added the new feature flag for the social share status
2 changes: 1 addition & 1 deletion projects/js-packages/publicize-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize-components",
"version": "0.62.1-alpha",
"version": "0.63.0-alpha",
"description": "A library of JS components required by the Publicize editor plugin",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/publicize-components/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import usePublicizeConfig from '../../hooks/use-publicize-config';
import useRefreshConnections from '../../hooks/use-refresh-connections';
import { usePostJustPublished } from '../../hooks/use-saving-post';
import useSelectSocialMediaConnections from '../../hooks/use-social-media-connections';
import { store as socialStore } from '../../social-store';
import PublicizeForm from '../form';
import { ManualSharing } from '../manual-sharing';
import { SharePostRow } from '../share-post';
Expand All @@ -25,6 +26,13 @@ const PublicizePanel = ( { prePublish, children } ) => {

const { isPublicizeEnabled, hidePublicizeFeature, togglePublicizeFeature } = usePublicizeConfig();

const { featureFlags } = useSelect( select => {
const store = select( socialStore );
return {
featureFlags: store.featureFlags(),
};
}, [] );

// Refresh connections when the post is just published.
usePostJustPublished(
function () {
Expand Down Expand Up @@ -71,7 +79,12 @@ const PublicizePanel = ( { prePublish, children } ) => {
<SharePostRow />
</Fragment>
) }
{ isPostPublished && <ManualSharing /> }
{ isPostPublished && (
<>
<ManualSharing />
{ featureFlags?.useShareStatus && 'Share status modal comes here' }
</>
) }
</PanelWrapper>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useSelect } from '@wordpress/data';
import { PluginPostPublishPanel } from '@wordpress/edit-post';
import { store as editorStore } from '@wordpress/editor';
import { __ } from '@wordpress/i18n';
import { store as socialStore } from '../../social-store';
import { ManualSharingInfo } from '../manual-sharing/info';
import { ShareButtons } from '../share-buttons/share-buttons';
import styles from './styles.module.scss';
Expand All @@ -15,6 +16,13 @@ import styles from './styles.module.scss';
export default function PostPublishManualSharing() {
const { isCurrentPostPublished } = useSelect( select => select( editorStore ), [] );

const { featureFlags } = useSelect( select => {
const store = select( socialStore );
return {
featureFlags: store.featureFlags(),
};
}, [] );

if ( ! isCurrentPostPublished() ) {
return null;
}
Expand All @@ -29,6 +37,7 @@ export default function PostPublishManualSharing() {
<ThemeProvider>
<ManualSharingInfo className={ styles.description } variant="body-small" />
<ShareButtons />
{ featureFlags?.useShareStatus && 'Share status modal comes here' }
</ThemeProvider>
</PluginPostPublishPanel>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Added the new feature flag for the social share status
2 changes: 1 addition & 1 deletion projects/packages/publicize/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"link-template": "https://github.com/Automattic/jetpack-publicize/compare/v${old}...v${new}"
},
"branch-alias": {
"dev-trunk": "0.49.x-dev"
"dev-trunk": "0.50.x-dev"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/publicize/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-publicize",
"version": "0.49.3-alpha",
"version": "0.50.0-alpha",
"description": "Publicize makes it easy to share your site’s posts on several social media networks automatically when you publish a new post.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/publicize/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ class Settings {
'feature_name' => 'editor-preview',
'variable_name' => 'useEditorPreview',
),
array(
'flag_name' => 'share_status',
'feature_name' => 'share-status',
'variable_name' => 'useShareStatus',
),
);

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/jetpack/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


4 changes: 2 additions & 2 deletions projects/plugins/social/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0728499

Please sign in to comment.