Skip to content

Commit 2d41a91

Browse files
authored
Add educational content to the cancellation flow (#69950)
* Fix wrong plan cost and refund. * Fix a bug that actionButtonUrl doesn't work * Open a livechat directly with a dummy text * Show the cancellation reason in LiveChat * Add educational content to the cancellation flow * Add a link for a domain support doc * Update images and content * Reduce the gap above the CTA * Visual update * Reduce the header font size * Fix a typo; fix visual style of a link * Add a missing symbol. * Improve LiveChat * Fix CI errors
1 parent 512fbcf commit 2d41a91

15 files changed

Lines changed: 473 additions & 5 deletions

File tree

apps/happychat/src/happychat.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function ParentConnection( { chatStatus, timeline, geoLocation } ) {
5656
calypsoSectionName: 'gutenberg-editor',
5757
wpcomSiteId: message.siteId?.toString(),
5858
wpcomSitePlan: message.planSlug,
59+
...( message.extraFields || {} ),
5960
} )
6061
);
6162
dispatch(
82.1 KB
Loading
64 KB
Loading
72.9 KB
Loading
89.5 KB
Loading

client/components/marketing-survey/cancel-purchase-form/get-upsell-type.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export type UpsellType =
2525
| 'live-chat:plugins'
2626
| 'live-chat:themes'
2727
| 'live-chat:domains'
28+
| 'education:loading-time'
29+
| 'education:seo'
30+
| 'education:free-domain'
31+
| 'education:domain-connection'
2832
| 'upgrade-atomic';
2933

3034
/**
@@ -89,10 +93,15 @@ export function getUpsellType( reason: string, opts: UpsellOptions ): UpsellType
8993
return '';
9094
}
9195
return 'upgrade-atomic';
92-
96+
case 'seoIssues':
97+
return 'education:seo';
98+
case 'loadingTime':
99+
return 'education:loading-time';
93100
case 'didNotGetFreeDomain':
94-
case 'otherDomainIssues':
101+
return 'education:free-domain';
95102
case 'domainConnection':
103+
return 'education:domain-connection';
104+
case 'otherDomainIssues':
96105
return liveChatSupported ? 'live-chat:domains' : '';
97106
}
98107

client/components/marketing-survey/cancel-purchase-form/index.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import {
4747
nextAdventureOptionsForPurchase,
4848
} from './options-for-product';
4949
import PrecancellationChatButton from './precancellation-chat-button';
50+
import EducationContentStep from './step-components/educational-content-step';
5051
import FeedbackStep from './step-components/feedback-step';
5152
import NextAdventureStep from './step-components/next-adventure-step';
5253
import UpsellStep from './step-components/upsell-step';
@@ -311,7 +312,7 @@ class CancelPurchaseForm extends Component {
311312
surveyContent() {
312313
const { atomicTransfer, translate, isImport, moment, purchase, site, hasBackupsFeature } =
313314
this.props;
314-
const { atomicRevertCheckOne, atomicRevertCheckTwo, surveyStep } = this.state;
315+
const { atomicRevertCheckOne, atomicRevertCheckTwo, surveyStep, upsell } = this.state;
315316

316317
if ( surveyStep === FEEDBACK_STEP ) {
317318
return (
@@ -330,6 +331,17 @@ class CancelPurchaseForm extends Component {
330331
const allSteps = this.getAllSurveySteps();
331332
const isLastStep = surveyStep === allSteps[ allSteps.length - 1 ];
332333

334+
if ( upsell.startsWith( 'education:' ) ) {
335+
return (
336+
<EducationContentStep
337+
type={ upsell }
338+
site={ site }
339+
onDecline={ isLastStep ? this.onSubmit : this.clickNext }
340+
cancellationReason={ this.state.questionOneText }
341+
/>
342+
);
343+
}
344+
333345
return (
334346
<UpsellStep
335347
upsell={ this.state.upsell }

0 commit comments

Comments
 (0)