Skip to content

Commit b31e906

Browse files
committed
Update KB article links to use Help center.
1 parent 600664f commit b31e906

File tree

11 files changed

+91
-47
lines changed

11 files changed

+91
-47
lines changed

client/a8c-for-agencies/components/a4a-request-wp-admin-access/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Button } from '@wordpress/components';
22
import { useTranslate } from 'i18n-calypso';
3+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
34
import illustration from 'calypso/assets/images/a8c-for-agencies/request-wp-admin-access-illustration.svg';
45
import { useDispatch } from 'calypso/state';
56
import { recordTracksEvent } from 'calypso/state/analytics/actions';
@@ -9,14 +10,15 @@ import './style.scss';
910
export function A4ARequestWPAdminAccess() {
1011
const translate = useTranslate();
1112
const dispatch = useDispatch();
13+
const { showSupportGuide } = useHelpCenter();
1214

1315
const onLearnMoreClick = () => {
1416
dispatch( recordTracksEvent( 'calypso_a4a_team_learn_more_wp_admin_access_click' ) );
17+
showSupportGuide(
18+
'https://agencieshelp.automattic.com/knowledge-base/invite-and-manage-team-members/#allowing-team-members-to-access-wp-admin'
19+
);
1520
};
1621

17-
const kbArticleUrl =
18-
'https://agencieshelp.automattic.com/knowledge-base/invite-and-manage-team-members/#allowing-team-members-to-access-wp-admin';
19-
2022
return (
2123
<div className="a4a-request-wp-admin-access">
2224
<div className="a4a-request-wp-admin-access__content">
@@ -31,9 +33,7 @@ export function A4ARequestWPAdminAccess() {
3133
<Button
3234
variant="link"
3335
className="a4a-request-wp-admin-access__learn-more-button"
34-
href={ kbArticleUrl }
3536
onClick={ onLearnMoreClick }
36-
target="_blank"
3737
>
3838
{ translate( 'Learn more about team member permissions ↗' ) }
3939
</Button>

client/a8c-for-agencies/sections/marketplace/products-overview/product-card/woopayments-custom-description/index.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Icon, info } from '@wordpress/icons';
22
import { useTranslate } from 'i18n-calypso';
33
import { useCallback } from 'react';
4+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
45
import { useDispatch } from 'calypso/state';
56
import { recordTracksEvent } from 'calypso/state/analytics/actions';
67

@@ -9,14 +10,18 @@ import './style.scss';
910
export default function WooPaymentsCustomDescription() {
1011
const translate = useTranslate();
1112
const dispatch = useDispatch();
13+
const { showSupportGuide } = useHelpCenter();
1214

1315
const onLearnMoreClick = useCallback( () => {
1416
dispatch(
1517
recordTracksEvent(
1618
'calypso_marketplace_products_overview_woopayments_learn_more_revenue_share_click'
1719
)
1820
);
19-
}, [ dispatch ] );
21+
showSupportGuide(
22+
'https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/'
23+
);
24+
}, [ dispatch, showSupportGuide ] );
2025

2126
const onViewFullTermsClick = useCallback( () => {
2227
dispatch(
@@ -41,14 +46,8 @@ export default function WooPaymentsCustomDescription() {
4146
'To qualify for revenue sharing, you must install and connect the Automattic for Agencies plugin and WooPayments extension on your client sites. We recommend using this marketplace to install WooPayments after adding the Automattic for Agencies plugin for easier license and client site management. {{a}}Learn more{{/a}}',
4247
{
4348
components: {
44-
a: (
45-
<a
46-
href="https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/"
47-
target="_blank"
48-
rel="noopener noreferrer"
49-
onClick={ onLearnMoreClick }
50-
></a>
51-
),
49+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
50+
a: <a onClick={ onLearnMoreClick } href="#" />,
5251
},
5352
}
5453
) }

client/a8c-for-agencies/sections/marketplace/products-overview/product-card/woopayments-revenue-share-notice/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { Icon, info } from '@wordpress/icons';
22
import { useTranslate } from 'i18n-calypso';
3+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
34

45
import './style.scss';
56

67
export default function WooPaymentsRevenueShareNotice() {
78
const translate = useTranslate();
9+
const { showSupportGuide } = useHelpCenter();
810

911
return (
1012
<div className="product-card__revenue-share-notice">
@@ -15,13 +17,15 @@ export default function WooPaymentsRevenueShareNotice() {
1517
{
1618
components: {
1719
a: (
20+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
1821
<a
19-
href="https://agencieshelp.automattic.com/knowledge-base/the-automattic-for-agencies-client-plugin/"
20-
target="_blank"
21-
rel="noopener noreferrer"
22-
>
23-
A4A
24-
</a>
22+
onClick={ () =>
23+
showSupportGuide(
24+
'https://agencieshelp.automattic.com/knowledge-base/the-automattic-for-agencies-client-plugin/'
25+
)
26+
}
27+
href="#"
28+
/>
2529
),
2630
},
2731
}

client/a8c-for-agencies/sections/migrations/primary/migrations-overview-v2/sections/migrations-faqs/index.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useTranslate } from 'i18n-calypso';
33
import { useCallback } from 'react';
44
import PageSection from 'calypso/a8c-for-agencies/components/page-section';
55
import { A4A_MIGRATIONS_PAYMENT_SETTINGS } from 'calypso/a8c-for-agencies/components/sidebar-menu/lib/constants';
6+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
67
import FoldableFAQ from 'calypso/components/foldable-faq';
78
import { preventWidows } from 'calypso/lib/formatting';
89
import { useDispatch } from 'calypso/state';
@@ -13,6 +14,7 @@ import './style.scss';
1314
export default function MigrationsFAQs() {
1415
const translate = useTranslate();
1516
const dispatch = useDispatch();
17+
const { showSupportGuide } = useHelpCenter();
1618

1719
const onFaqToggle = useCallback(
1820
( faqArgs: { id: string; buttonId: string; isExpanded: boolean; height: number } ) => {
@@ -147,13 +149,15 @@ export default function MigrationsFAQs() {
147149
{
148150
components: {
149151
PayoutKBLink: (
152+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
150153
<a
151-
href="https://agencieshelp.automattic.com/knowledge-base/automattic-for-agencies-earnings/"
152-
target="_blank"
153-
rel="noreferrer"
154-
onClick={ () =>
155-
dispatch( recordTracksEvent( 'calypso_a4a_migrations_payout_kb_link_click' ) )
156-
}
154+
onClick={ () => {
155+
dispatch( recordTracksEvent( 'calypso_a4a_migrations_payout_kb_link_click' ) );
156+
showSupportGuide(
157+
'https://agencieshelp.automattic.com/knowledge-base/automattic-for-agencies-earnings/'
158+
);
159+
} }
160+
href="#"
157161
/>
158162
),
159163
PaymentSettingLink: (

client/a8c-for-agencies/sections/partner-directory/dashboard/index.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
77
import { A4A_PARTNER_DIRECTORY_LINK } from 'calypso/a8c-for-agencies/components/sidebar-menu/lib/constants';
88
import StepSection from 'calypso/a8c-for-agencies/components/step-section';
99
import StepSectionItem from 'calypso/a8c-for-agencies/components/step-section-item';
10+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
1011
import { useDispatch, useSelector } from 'calypso/state';
1112
import { setActiveAgency } from 'calypso/state/a8c-for-agencies/agency/actions';
1213
import { getActiveAgency } from 'calypso/state/a8c-for-agencies/agency/selectors';
@@ -46,6 +47,7 @@ interface StatusBadge {
4647
const PartnerDirectoryDashboard = () => {
4748
const translate = useTranslate();
4849
const dispatch = useDispatch();
50+
const { showSupportGuide } = useHelpCenter();
4951

5052
const agency = useSelector( getActiveAgency );
5153

@@ -212,11 +214,25 @@ const PartnerDirectoryDashboard = () => {
212214
className="partner-directory-dashboard__learn-more-section"
213215
heading={ translate( 'Learn more about the program' ) }
214216
>
215-
<ExternalLink href="https://agencieshelp.automattic.com/knowledge-base/agency-directory-listings">
217+
<ExternalLink
218+
href="#"
219+
onClick={ () =>
220+
showSupportGuide(
221+
'https://agencieshelp.automattic.com/knowledge-base/agency-directory-listings'
222+
)
223+
}
224+
>
216225
{ translate( 'How does the approval process work?' ) }
217226
</ExternalLink>
218227
<br />
219-
<ExternalLink href="https://agencieshelp.automattic.com/knowledge-base/agency-directory-listings/#profile-content">
228+
<ExternalLink
229+
href="#"
230+
onClick={ () =>
231+
showSupportGuide(
232+
'https://agencieshelp.automattic.com/knowledge-base/agency-directory-listings/#profile-content'
233+
)
234+
}
235+
>
220236
{ translate( 'What can I put on my public profile?' ) }
221237
</ExternalLink>
222238
</StepSection>

client/a8c-for-agencies/sections/referrals/consolidated-view/index.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from 'calypso/a8c-for-agencies/components/consolidated-stats-card';
77
import { AGENCY_EARNINGS_LEARN_MORE_LINK } from 'calypso/a8c-for-agencies/constants';
88
import useProductsQuery from 'calypso/a8c-for-agencies/data/marketplace/use-products-query';
9+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
910
import useGetConsolidatedPayoutData from '../hooks/use-get-consolidated-payout-data';
1011
import PayoutCards from './payout-cards';
1112
import type { Referral } from '../types';
@@ -20,6 +21,7 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
2021
const { data: productsData, isFetching } = useProductsQuery( false, false, true );
2122
const { previousQuarterExpectedCommission, pendingOrders, currentQuarterExpectedCommission } =
2223
useGetConsolidatedPayoutData( referrals, productsData );
24+
const { showSupportGuide } = useHelpCenter();
2325

2426
return (
2527
<ConsolidatedStatsGroup className="consolidated-view">
@@ -34,10 +36,10 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
3436
{
3537
components: {
3638
a: (
39+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
3740
<a
38-
href={ AGENCY_EARNINGS_LEARN_MORE_LINK }
39-
target="_blank"
40-
rel="noreferrer noopener"
41+
onClick={ () => showSupportGuide( AGENCY_EARNINGS_LEARN_MORE_LINK ) }
42+
href="#"
4143
/>
4244
),
4345
br: <br />,
@@ -61,11 +63,8 @@ export default function ConsolidatedViews( { referrals, totalPayouts }: Consolid
6163
{
6264
components: {
6365
a: (
64-
<a
65-
href={ AGENCY_EARNINGS_LEARN_MORE_LINK }
66-
target="_blank"
67-
rel="noreferrer noopener"
68-
/>
66+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
67+
<a onClick={ () => showSupportGuide( AGENCY_EARNINGS_LEARN_MORE_LINK ) } href="#" />
6968
),
7069
br: <br />,
7170
},

client/a8c-for-agencies/sections/referrals/consolidated-view/payout-cards.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Button } from '@wordpress/components';
33
import { useTranslate } from 'i18n-calypso';
44
import { ConsolidatedStatsCard } from 'calypso/a8c-for-agencies/components/consolidated-stats-card';
55
import { AGENCY_EARNINGS_LEARN_MORE_LINK } from 'calypso/a8c-for-agencies/constants';
6+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
67
import useGetPayoutData from '../hooks/use-get-payout-data';
78

89
import './style.scss';
@@ -25,6 +26,7 @@ function PayoutAmount( {
2526
handleHalfQuarter?: boolean;
2627
} ) {
2728
const translate = useTranslate();
29+
const { showSupportGuide } = useHelpCenter();
2830

2931
return (
3032
<ConsolidatedStatsCard
@@ -69,9 +71,7 @@ function PayoutAmount( {
6971

7072
<div>
7173
<Button
72-
href={ AGENCY_EARNINGS_LEARN_MORE_LINK }
73-
target="_blank"
74-
rel="noreferrer noopener"
74+
onClick={ () => showSupportGuide( AGENCY_EARNINGS_LEARN_MORE_LINK ) }
7575
variant="link"
7676
>
7777
{ translate( 'Learn more' ) }

client/a8c-for-agencies/sections/team/primary/get-started/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import MobileSidebarNavigation from 'calypso/a8c-for-agencies/components/sidebar
77
import { A4A_TEAM_INVITE_LINK } from 'calypso/a8c-for-agencies/components/sidebar-menu/lib/constants';
88
import StepSection from 'calypso/a8c-for-agencies/components/step-section';
99
import StepSectionItem from 'calypso/a8c-for-agencies/components/step-section-item';
10+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
1011
import LayoutBody from 'calypso/layout/hosting-dashboard/body';
1112
import LayoutHeader, {
1213
LayoutHeaderActions as Actions,
@@ -20,6 +21,7 @@ import './style.scss';
2021
export default function GetStarted() {
2122
const translate = useTranslate();
2223
const dispatch = useDispatch();
24+
const { showSupportGuide } = useHelpCenter();
2325

2426
const isDesktop = useDesktopBreakpoint();
2527

@@ -31,6 +33,9 @@ export default function GetStarted() {
3133

3234
const onLearnMoreClick = () => {
3335
dispatch( recordTracksEvent( 'calypso_a4a_team_learn_more_managing_members_click' ) );
36+
showSupportGuide(
37+
'https://agencieshelp.automattic.com/knowledge-base/invite-and-manage-team-members'
38+
);
3439
};
3540

3641
return (
@@ -89,8 +94,6 @@ export default function GetStarted() {
8994
<Button
9095
className="team-list-get-started__learn-more-button"
9196
variant="link"
92-
target="_blank"
93-
href="https://agencieshelp.automattic.com/knowledge-base/invite-and-manage-team-members"
9497
onClick={ onLearnMoreClick }
9598
>
9699
{ translate( 'Team members Knowledge Base article ↗' ) }

client/a8c-for-agencies/sections/woopayments/dashboard-content/consolidated-views.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import {
44
ConsolidatedStatsCard,
55
ConsolidatedStatsGroup,
66
} from 'calypso/a8c-for-agencies/components/consolidated-stats-card';
7+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
78
import PayoutCards from '../../referrals/consolidated-view/payout-cards';
89
import { useWooPaymentsContext } from '../context';
910

1011
const WooPaymentsConsolidatedViews = () => {
1112
const translate = useTranslate();
13+
const { showSupportGuide } = useHelpCenter();
1214

1315
const { woopaymentsData, isLoadingWooPaymentsData } = useWooPaymentsContext();
1416
const totalCommission = woopaymentsData?.data?.total?.payout ?? 0;
@@ -17,9 +19,6 @@ const WooPaymentsConsolidatedViews = () => {
1719
const currentQuarterExpectedCommission =
1820
woopaymentsData?.data?.estimated?.current_quarter?.payout ?? 0;
1921

20-
const learnMoreLink =
21-
'https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/';
22-
2322
return (
2423
<ConsolidatedStatsGroup className="consolidated-view">
2524
<ConsolidatedStatsCard
@@ -31,7 +30,17 @@ const WooPaymentsConsolidatedViews = () => {
3130
'{{br/}}{{br/}}{{a}}Learn more{{/a}} ↗',
3231
{
3332
components: {
34-
a: <a href={ learnMoreLink } target="_blank" rel="noreferrer noopener" />,
33+
a: (
34+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
35+
<a
36+
onClick={ () =>
37+
showSupportGuide(
38+
'https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/'
39+
)
40+
}
41+
href="#"
42+
/>
43+
),
3544
br: <br />,
3645
},
3746
}

client/a8c-for-agencies/sections/woopayments/primary/woopayments-dashboard/empty-state.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ExternalLink } from '@wordpress/components';
22
import { useTranslate } from 'i18n-calypso';
33
import StepSection from 'calypso/a8c-for-agencies/components/step-section';
44
import StepSectionItem from 'calypso/a8c-for-agencies/components/step-section-item';
5+
import useHelpCenter from 'calypso/a8c-for-agencies/hooks/use-help-center';
56
import wooPaymentsLogo from 'calypso/assets/images/a8c-for-agencies/woopayments/logo.svg';
67
import { useDispatch } from 'calypso/state';
78
import { recordTracksEvent } from 'calypso/state/analytics/actions';
@@ -10,6 +11,7 @@ import AddWooPaymentsToSite from '../../add-woopayments-to-site';
1011
const WooPaymentsDashboardEmptyState = () => {
1112
const translate = useTranslate();
1213
const dispatch = useDispatch();
14+
const { showSupportGuide } = useHelpCenter();
1315

1416
return (
1517
<div className="woopayments-dashboard-empty-state__content">
@@ -40,8 +42,11 @@ const WooPaymentsDashboardEmptyState = () => {
4042
dispatch(
4143
recordTracksEvent( 'calypso_a4a_woopayments_learn_more_about_program_click' )
4244
);
45+
showSupportGuide(
46+
'https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/'
47+
);
4348
} }
44-
href="https://agencieshelp.automattic.com/knowledge-base/earn-revenue-share-when-clients-use-woopayments/"
49+
href="#"
4550
>
4651
{ translate( 'Check out the full details in the Knowledge Base' ) }
4752
</ExternalLink>

0 commit comments

Comments
 (0)