-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Change cancellation confirmation banner and handle auto-refund … #3399
Conversation
Bundle ReportChanges will decrease total bundle size by 6.14MB (-35.7%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3399 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 808 808
Lines 14263 14271 +8
Branches 3945 3951 +6
=======================================
+ Hits 14142 14150 +8
Misses 112 112
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3399 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 808 808
Lines 14263 14271 +8
Branches 3938 3944 +6
=======================================
+ Hits 14142 14150 +8
Misses 112 112
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3399 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 808 808
Lines 14263 14271 +8
Branches 3945 3951 +6
=======================================
+ Hits 14142 14150 +8
Misses 112 112
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3399 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 808 808
Lines 14263 14271 +8
Branches 3945 3944 -1
=======================================
+ Hits 14142 14150 +8
Misses 112 112
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Bundle ReportChanges will decrease total bundle size by 6.14MB (-35.7%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
3022e9a
to
5c3abac
Compare
<Alert variant="info"> | ||
<Alert.Title className="text-sm">Cancellation confirmation</Alert.Title> | ||
<Alert.Description className="text-sm"> | ||
Your subscription has been successfully canceled. Your account{' '} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancelled vs. canceled -> only calling it out cuz the banner has 2 l's :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently both are correct and canceled
is prefered in American English? I've always been more drawn to cancelled though until I googled this haha. I'm gonna change it back 🤷
{accountDetails?.subscriptionDetail || | ||
planUpdatedNotification.isRefundedCancellation ? ( | ||
planUpdatedNotification.isCancellation ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im wondering if cancellation or auto refund is the more important aspect of this variable name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thought comes from the variable "isCancellation" only being true for a very small percentage of total cancellations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isCancellation is always true when we want to show this component regardless of accountDetails?.subscriptionDetail
's value so will be removing that check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes look good! Just some small stuff
812c84c
to
2f21752
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved by Cynn1989
expect( | ||
screen.getByText(/Subscription Pending Cancellation/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve
@@ -38,23 +38,42 @@ describe('InfoMessageCancellation', () => { | |||
}) | |||
}) | |||
|
|||
describe('when the subscription is cancelled', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not canceled approved
@@ -18,7 +18,7 @@ const subscriptionDetail = { | |||
}, | |||
} as z.infer<typeof SubscriptionDetailSchema> | |||
|
|||
describe('InfoMessageCancellation', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
@@ -3,7 +3,7 @@ import { z } from 'zod' | |||
|
|||
import { SubscriptionDetailSchema } from 'services/account' | |||
|
|||
import InfoMessageCancellation from './InfoMessageCancellation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
…cancel
Description
Closes codecov/engineering-team#2507
Figma: https://www.figma.com/design/WispRoZQs6rGwy0nrwN9xB/GH-1507?node-id=1-2&t=AnqFQfPjam4O0AF8-1
Copy of the banner and the "alert" component has changed.
Related to codecov/codecov-api#894
Code Example
Notable Changes
In order to be able to figure out that we have issued a Stripe auto-refund and immediately canceled a subscription, we are utilizing Plan Page context while also checking that there is no
subscriptionDetail
populated, also known as being on the free plan. Without the context, we don't know when a cancellation has been fired because we have no signal that a cancellation has already happened and without checking the non-existence of subscriptionDetail, we don't know that it is not a "cancel at period end" cancellation.Screenshots
Updating seat count:
Cancel at period end outside of grace period: (disregard width: it will be inline with the cards like the screenshot below)
Cancel immediately with refund:
Link to Sample Entry
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.