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

feat: Change cancellation confirmation banner and handle auto-refund … #3399

Merged
merged 8 commits into from
Oct 22, 2024

Conversation

calvin-codecov
Copy link
Contributor

@calvin-codecov calvin-codecov commented Oct 16, 2024

…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:
Update_seats

Cancel at period end outside of grace period: (disregard width: it will be inline with the cards like the screenshot below)
cancel_period_end

Cancel immediately with refund:
Screenshot 2024-10-16 at 3 04 10 PM

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.

@codecov-staging
Copy link

codecov-staging bot commented Oct 16, 2024

Bundle Report

Changes will decrease total bundle size by 6.14MB (-35.7%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system 5.5MB 36 bytes (-0.0%) ⬇️
gazebo-staging-system-esm 5.55MB 159 bytes (-0.0%) ⬇️
gazebo-staging-array-push (removed) 6.14MB (-100.0%) ⬇️

@codecov-qa
Copy link

codecov-qa bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.15%. Comparing base (b094a59) to head (1cdc12c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           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           
Files with missing lines Coverage Δ
src/pages/PlanPage/context.tsx 100.00% <ø> (ø)
...anPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.tsx 100.00% <100.00%> (ø)
...an/InfoAlertCancellation/InfoAlertCancellation.tsx 100.00% <100.00%> (ø)
src/services/account/useCancelPlan.js 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.89% <100.00%> (+<0.01%) ⬆️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.06% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b094a59...1cdc12c. Read the comment docs.

Copy link

codecov-public-qa bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.15%. Comparing base (b094a59) to head (1cdc12c).

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           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           
Files Coverage Δ
src/pages/PlanPage/context.tsx 100.00% <ø> (ø)
...anPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.tsx 100.00% <100.00%> (ø)
...an/InfoAlertCancellation/InfoAlertCancellation.tsx 100.00% <100.00%> (ø)
src/services/account/useCancelPlan.js 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.89% <100.00%> (+<0.01%) ⬆️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.06% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b094a59...1cdc12c. Read the comment docs.

@codecov-notifications
Copy link

codecov-notifications bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@           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           
Files with missing lines Coverage Δ
src/pages/PlanPage/context.tsx 100.00% <ø> (ø)
...anPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.tsx 100.00% <100.00%> (ø)
...an/InfoAlertCancellation/InfoAlertCancellation.tsx 100.00% <100.00%> (ø)
src/services/account/useCancelPlan.js 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.89% <100.00%> (+<0.01%) ⬆️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.06% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b094a59...1cdc12c. Read the comment docs.

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.15%. Comparing base (b094a59) to head (1cdc12c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           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           
Files with missing lines Coverage Δ
src/pages/PlanPage/context.tsx 100.00% <ø> (ø)
...anPage/subRoutes/CurrentOrgPlan/CurrentOrgPlan.tsx 100.00% <100.00%> (ø)
...an/InfoAlertCancellation/InfoAlertCancellation.tsx 100.00% <100.00%> (ø)
src/services/account/useCancelPlan.js 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 100.00% <ø> (ø)
Pages 98.89% <100.00%> (+<0.01%) ⬆️
Services 99.45% <100.00%> (+<0.01%) ⬆️
Shared 99.80% <ø> (ø)
UI 99.06% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b094a59...1cdc12c. Read the comment docs.

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Oct 16, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
3022e9a Wed, 16 Oct 2024 18:35:31 GMT Expired Expired
5c3abac Wed, 16 Oct 2024 22:17:40 GMT Expired Expired
9ff8e6d Wed, 16 Oct 2024 22:51:12 GMT Expired Expired
42f7cf9 Wed, 16 Oct 2024 23:24:52 GMT Expired Expired
812c84c Mon, 21 Oct 2024 20:31:04 GMT Expired Expired
2d607b5 Tue, 22 Oct 2024 17:27:12 GMT Expired Expired
2d607b5 Tue, 22 Oct 2024 17:29:19 GMT Expired Expired
4af5e02 Tue, 22 Oct 2024 18:43:06 GMT Expired Expired
1cdc12c Tue, 22 Oct 2024 20:03:31 GMT Cloud Enterprise

Copy link

codecov bot commented Oct 16, 2024

Bundle Report

Changes will decrease total bundle size by 6.14MB (-35.7%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 5.5MB 36 bytes (-0.0%) ⬇️
gazebo-production-system-esm 5.55MB 159 bytes (-0.0%) ⬇️
gazebo-production-array-push (removed) 6.14MB (-100.0%) ⬇️

<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{' '}
Copy link
Contributor

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

Copy link
Contributor Author

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 ? (
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

@ajay-sentry ajay-sentry left a 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

Copy link

@Cynn1989 Cynn1989 left a 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/)

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', () => {

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', () => {

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'

Choose a reason for hiding this comment

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

Approved

@calvin-codecov calvin-codecov added this pull request to the merge queue Oct 22, 2024
Merged via the queue into main with commit ed82911 Oct 22, 2024
62 checks passed
@calvin-codecov calvin-codecov deleted the cy/cancellation_banner branch October 22, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gazebo] Update Cancelation Banner Copy and Logic for Refunded User
4 participants