-
Notifications
You must be signed in to change notification settings - Fork 32
feat: Add messaging for free seats and clarify paid #3925
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
Conversation
accountDetails?: z.infer<typeof AccountDetailsSchema> | null | ||
) { | ||
const timestamp = accountDetails?.subscriptionDetail?.latestInvoice?.periodEnd | ||
const timestamp = accountDetails?.subscriptionDetail?.currentPeriodEnd |
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.
This change makes this consistent with the uses in PaymentCard and DowngradePlan. latestInvoice?.periodEnd
looked buggy - in test, I started a new subscription and invoice.periodStart
and invoice.periodEnd
were the same time integer value coming back from Stripe (the buggy effect was that it said my next biliing date was the same date as the one that I started the subscription)
Bundle ReportChanges will increase total bundle size by 3.72kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-production-systemAssets Changed:
Files in
Files in
Files in
view changes for bundle: gazebo-production-esmAssets Changed:
Files in
Files in
Files in
|
Bundle ReportChanges will increase total bundle size by 3.72kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: gazebo-staging-esmAssets Changed:
Files in
Files in
Files in
view changes for bundle: gazebo-staging-systemAssets Changed:
Files in
Files in
Files in
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3925 +/- ##
==========================================
- Coverage 98.62% 98.61% -0.01%
==========================================
Files 828 828
Lines 15099 15125 +26
Branches 4326 4338 +12
==========================================
+ Hits 14891 14916 +25
- Misses 200 201 +1
Partials 8 8
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
@@ Coverage Diff @@
## main #3925 +/- ##
==========================================
- Coverage 98.62% 98.61% -0.01%
==========================================
Files 828 828
Lines 15099 15125 +26
Branches 4318 4346 +28
==========================================
+ Hits 14891 14916 +25
- Misses 200 201 +1
Partials 8 8
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3925 +/- ##
==========================================
- Coverage 98.62% 98.61% -0.01%
==========================================
Files 828 828
Lines 15099 15125 +26
Branches 4326 4346 +20
==========================================
+ Hits 14891 14916 +25
- Misses 200 201 +1
Partials 8 8
Continue to review full report in Codecov by Sentry.
|
✅ Deploy preview for gazebo ready!Previews expire after 1 month automatically.
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #3925 +/- ##
==========================================
+ Coverage 96.54% 98.61% +2.06%
==========================================
Files 828 828
Lines 15099 15125 +26
Branches 4318 4346 +28
==========================================
+ Hits 14578 14916 +338
+ Misses 466 201 -265
+ Partials 55 8 -47
... and 42 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx
Outdated
Show resolved
Hide resolved
3db633f
to
2db2598
Compare
src/pages/PlanPage/subRoutes/CurrentOrgPlan/BillingDetails/PaymentCard/PaymentCard.jsx
Outdated
Show resolved
Hide resolved
f7544a1
to
d7146ac
Compare
const subscriptionDetail = accountDetails?.subscriptionDetail | ||
const card = subscriptionDetail?.defaultPaymentMethod?.card | ||
const usBankAccount = subscriptionDetail?.defaultPaymentMethod?.usBankAccount | ||
const isPerYear = planData?.plan?.billingRate === BillingRate.ANNUALLY |
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.
should we put this stuff in a useCallback or smth?
) | ||
} | ||
const nextBillPrice = formatNumberToUSD( | ||
isPerYear ? billPrice * 12 : billPrice |
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.
nit: magic number
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.
yeah... i don't like the magic number. I grabbed this from PriceCallout.tsx but I think both should be changed.
const card = subscriptionDetail?.defaultPaymentMethod?.card | ||
const usBankAccount = subscriptionDetail?.defaultPaymentMethod?.usBankAccount | ||
const isPerYear = planData?.plan?.billingRate === BillingRate.ANNUALLY | ||
let seats = |
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.
Is there a way we can get around all the ?? 0 stuff? Maybe for the base unit price part at least we can set that in the usePlanData hook directly
src/pages/PlanPage/subRoutes/CurrentOrgPlan/CurrentPlanCard/PaidPlanCard/PaidPlanCard.tsx
Show resolved
Hide resolved
<p>Up to {TEAM_PLAN_MAX_ACTIVE_USERS} users</p> | ||
<p> | ||
Up to {TEAM_PLAN_MAX_ACTIVE_USERS} | ||
{planData?.plan?.freeSeatCount ? ' paid' : ''} users |
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.
I think we could probably just say "paid" here regardless of the freeSeatCount, right?
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.
Adalene and I were thinking of leaving out "paid" as often as possible for simplification when a user doesn't have free seats because it should be a very small percentage of total users. I could go either way this though since we decided on this before I realized the plan card benefits list can't dynamically decide on adding "paid" since they're from the DB so one could argue we just say "paid" everywhere for consistency. Thoughts?
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.
I'm on team paid everywhere personally but I can see why we decided to do the conditional. I think I saw somewhere else in the code where we added paid unconditionally though (in this PR)
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.
lgtm!
Closes https://linear.app/getsentry/issue/CCMRG-1333/billing-ui-should-display-free-seats-as-a-clear-part-of-total-seats
Relies on codecov/umbrella#413 for GQL info
This PR is employing a couple of techniques to better clarify paid vs free seats. Since free seats are uncommon, we generally do not want to add too much extra text for all use cases as it will be irrelevant for most.
Side note: any of the benefits list bullet point text for individual plans come from DB entries which have been updated, instead of gazebo code.
NOTE: Most of the changes are just updating test data to include
freeSeatCount
which now comes from GQL.