Skip to content
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

Purchases: Update cancellation page's support link to use Odie #94213

Merged
merged 4 commits into from
Sep 5, 2024

Conversation

jjchrisdiehl
Copy link
Contributor

@jjchrisdiehl jjchrisdiehl commented Sep 4, 2024

Note

Reposted from #93567 - branch was incorrect, updated here

When a customer proceeds through the cancelation flow they have the option to 'Ask a Happiness Engineer' if they have a question:

image

This link leads them to our general /help page which would then require a customer to click on 'Get help' to open an omnichannel chat:

image

A more optimal path may be to open the omnichannel chat directly from the cancellation page, similar to a pre-sale chat during Checkout. This would allow us quick access to a churning customer for one last attempt to address any concerns.

Happy path:
image

@Automattic/martech Is this an oversight or is this the expected behavior of the 'Ask a Happiness Engineer' link?

Related to #93568

Proposed Changes

  • Change out the CALYPSO_CONTACT url with the Odie functionality found in Help Center.

Testing Instructions

  • Go to an existing purchase under /purchases, make sure it isn't expired and can be canceled
  • Click on the 'Cancel [product]' button at the bottom of the page
  • Look for the Have a question? Ask a Happiness Engineer! line in the first paragraph box
  • Click on the Ask a Happiness Engineer link, it should correctly open the Odie/omnichannel chat box
  • Now, you'll need this branch on your local environment for the next part.
  • Go to client/me/purchases/cancel-purchase/refund-information.jsx and make the following change:
	const { data: isMessagingAvailable } = useZendeskMessagingAvailability(
		'wpcom_messaging',
-               true
+		false
	);
  • This should simulate chat not being available and let you test the fallback to our support options in Help Center

@jjchrisdiehl jjchrisdiehl self-assigned this Sep 4, 2024
@matticbot
Copy link
Contributor

matticbot commented Sep 4, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~609 bytes added 📈 [gzipped])

name            parsed_size           gzip_size
site-purchases      +1849 B  (+0.1%)     +609 B  (+0.1%)
purchases           +1849 B  (+0.1%)     +609 B  (+0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~58 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
async-load-automattic-help-center       +333 B  (+0.1%)      +58 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@michaeldcain michaeldcain added the [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. label Sep 5, 2024
@jjchrisdiehl
Copy link
Contributor Author

Functionally is working as expected - deploying 🚀

@jjchrisdiehl jjchrisdiehl merged commit 64274a1 into trunk Sep 5, 2024
14 checks passed
@jjchrisdiehl jjchrisdiehl deleted the update/cancellation_page_support_link branch September 5, 2024 23:25
setShowHelpCenter,
] );

const ContactSupportLink = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining a functional component inside another component is a bad idea. The internal component will be recreated on every render.

I'll see if I can fix this in #94864

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

openZendeskWidget( {
siteUrl: siteUrl,
siteId: siteId,
message: `${ status }: Import onboarding flow; migration failed`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is status here? It's not defined anywhere that I can see.

Copy link
Contributor Author

@jjchrisdiehl jjchrisdiehl Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was a poorly hacked together usage of the new Odie flow, which is a lot more elaborate than it once was. I pulled this code from the example shown here #93567 (comment) looks like the file he linked to is gone, you can see it from trunk here https://github.com/Automattic/wp-calypso/blob/trunk/client/blocks/importer/wordpress/import-everything/migration-error/index.tsx

Only closer inspection, status is not defined in this file, but, it seems it is defined on the global window object so it didn't throw any errors when I was rigging this up. Also, the text I copied over should've read something like "Cancellation flow, just in time support request" or something along these lines 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really need status for this use case.

@@ -29,7 +43,7 @@ const CancelPurchaseRefundInformation = ( {
confirmCancelBundledDomain,
onCancelConfirmationStateChange,
} ) => {
const { refundPeriodInDays } = purchase;
const { siteId, siteUrl, refundPeriodInDays } = purchase;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Purchase TypeScript type defined here does not have a siteUrl property. I assume one exists, though? If so we need to add that to the type. I'll see if I can confirm that it exists and try to add it in #94864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants