Skip to content

Commit 1046880

Browse files
mmtrmatticbot
authored andcommitted
Post editor: Open support links in Help Center (#43883)
This commit ensures that the support links of the Excerpt and Tags panels in the WP.com post editor are opened directly in the Help Center rather than on a new tab. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/15605163055 Upstream-Ref: Automattic/jetpack@f8d762d
1 parent 4543fcc commit 1046880

File tree

15 files changed

+165
-187
lines changed

15 files changed

+165
-187
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '10fb25c1d37a4e546513');
1+
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '0392fe46827b9212ba4c');

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/tags-education/tags-education.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/tags-education/tags-education.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/tags-education/tags-education.rtl.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '8fa6fc4aa9854b670c12');
1+
<?php return array('dependencies' => array('jetpack-connection', 'jetpack-script-data', 'lodash', 'react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '9affbaaee0bb82448e5d');

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/wpcom-block-description-links/wpcom-block-description-links.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/wpcom-block-description-links/wpcom-block-description-links.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-mu-wpcom/src/build/wpcom-block-description-links/wpcom-block-description-links.rtl.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jetpack_vendor/automattic/jetpack-mu-wpcom/src/features/tags-education/tags-education.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { localizeUrl } from '@automattic/i18n-utils';
22
import { useAnalytics } from '@automattic/jetpack-shared-extension-utils';
3-
import { ExternalLink } from '@wordpress/components';
3+
import { WpcomSupportLink } from '@automattic/jetpack-shared-extension-utils/components';
44
import { createHigherOrderComponent } from '@wordpress/compose';
55
import { addFilter } from '@wordpress/hooks';
66

@@ -15,14 +15,15 @@ const addTagsEducationLink = createHigherOrderComponent( PostTaxonomyType => {
1515
return (
1616
<>
1717
<PostTaxonomyType { ...props } />
18-
<ExternalLink
19-
href={ localizeUrl( 'https://wordpress.com/support/posts/tags/' ) }
18+
<WpcomSupportLink
19+
supportLink={ localizeUrl( 'https://wordpress.com/support/posts/tags/' ) }
20+
supportPostId={ 8586 }
2021
onClick={ () => {
2122
tracks.recordEvent( 'jetpack_mu_wpcom_tags_education_link_click' );
2223
} }
2324
>
2425
{ window.wpcomTagsEducation.actionText }
25-
</ExternalLink>
26+
</WpcomSupportLink>
2627
</>
2728
);
2829
};

jetpack_vendor/automattic/jetpack-mu-wpcom/src/features/wpcom-block-description-links/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import blockInfoMapping, {
66
blockInfoWithVariations,
77
childrenBlockInfoWithDifferentUrl,
88
} from './src/block-links-map';
9-
import DescriptionSupportLink from './src/inline-support-link';
9+
import DescriptionSupportLink from './src/description-support-link';
1010

1111
const createLocalizedDescriptionWithLearnMore = (
1212
title: string,
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { localizeUrl } from '@automattic/i18n-utils';
22
import { useAnalytics } from '@automattic/jetpack-shared-extension-utils';
3-
import { Button, ExternalLink } from '@wordpress/components';
4-
import { useDispatch } from '@wordpress/data';
3+
import { WpcomSupportLink } from '@automattic/jetpack-shared-extension-utils/components';
54
import { __ } from '@wordpress/i18n';
65
import React, { useState, JSXElementConstructor, ReactElement } from 'react';
76

@@ -33,9 +32,6 @@ export default function DescriptionSupportLink( {
3332
// Since there was no identifier in the environment to differentiate.
3433
const [ ref, setRef ] = useState< Element | null >();
3534
const { tracks } = useAnalytics();
36-
const helpCenterDispatch = useDispatch( 'automattic/help-center' );
37-
const setShowHelpCenter = helpCenterDispatch?.setShowHelpCenter;
38-
const setShowSupportDoc = helpCenterDispatch?.setShowSupportDoc;
3935

4036
if ( ref && ! ref?.closest( '.block-editor-block-inspector' ) ) {
4137
return children as React.JSX.Element;
@@ -45,39 +41,20 @@ export default function DescriptionSupportLink( {
4541
<>
4642
{ children }
4743
<br />
48-
{ setShowHelpCenter ? (
49-
<Button
50-
onClick={ () => {
51-
setShowHelpCenter( true );
52-
setShowSupportDoc( localizeUrl( url ), postId );
53-
tracks.recordEvent( 'jetpack_mu_wpcom_block_description_support_link_click', {
54-
block: title,
55-
support_link: url,
56-
} );
57-
} }
58-
style={ { marginTop: 10, height: 'unset' } }
59-
ref={ reference => ref !== reference && setRef( reference ) }
60-
className="fse-inline-support-link is-compact"
61-
variant="link"
62-
>
63-
{ __( 'Block guide', 'jetpack-mu-wpcom' ) }
64-
</Button>
65-
) : (
66-
<ExternalLink
67-
onClick={ () => {
68-
tracks.recordEvent( 'jetpack_mu_wpcom_block_description_support_link_click', {
69-
block: title,
70-
support_link: url,
71-
} );
72-
} }
73-
ref={ reference => ref !== reference && setRef( reference ) }
74-
style={ { display: 'block', marginTop: 10, maxWidth: 'fit-content' } }
75-
className="fse-inline-support-link"
76-
href={ url }
77-
>
78-
{ __( 'Learn more', 'jetpack-mu-wpcom' ) }
79-
</ExternalLink>
80-
) }
44+
<WpcomSupportLink
45+
supportLink={ localizeUrl( url ) }
46+
supportPostId={ postId }
47+
onClick={ () => {
48+
tracks.recordEvent( 'jetpack_mu_wpcom_block_description_support_link_click', {
49+
block: title,
50+
support_link: url,
51+
} );
52+
} }
53+
style={ { display: 'block', marginTop: 10, maxWidth: 'fit-content' } }
54+
ref={ reference => ref !== reference && setRef( reference ) }
55+
>
56+
{ __( 'Block guide', 'jetpack-mu-wpcom' ) }
57+
</WpcomSupportLink>
8158
</>
8259
);
8360
}

jetpack_vendor/i18n-map.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
),
5555
'jetpack-mu-wpcom' => array(
5656
'path' => 'jetpack_vendor/automattic/jetpack-mu-wpcom',
57-
'ver' => '6.6.1-alpha1749679623',
57+
'ver' => '6.6.1-alpha1749715778',
5858
),
5959
'jetpack-password-checker' => array(
6060
'path' => 'jetpack_vendor/automattic/jetpack-password-checker',

0 commit comments

Comments
 (0)