-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: render projected amount at top of page #29195
base: master
Are you sure you want to change the base?
Conversation
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.
PR Summary
Added a feature to display projected billing totals on the billing page when enabled by a feature flag.
- Added new feature flag
PROJECTED_TOTAL_AMOUNT
infrontend/src/lib/constants.tsx
with owner attribution - Extended
BillingType
interface infrontend/src/types.ts
withprojected_total_amount_usd
andprojected_total_amount_usd_after_discount
properties - Implemented conditional rendering in
frontend/src/scenes/billing/Billing.tsx
to show projected totals alongside current bill when the feature flag is enabled and projected amount > 0 - Added informative tooltip to explain the projected total amount to users
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
billing?.projected_total_amount_usd | ||
)} |
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.
style: Optional chaining is redundant here since we already check for billing?.projected_total_amount_usd on line 194
billing?.projected_total_amount_usd | |
)} | |
billing.projected_total_amount_usd | |
)} |
Size Change: +625 B (+0.01%) Total Size: 9.72 MB ℹ️ View Unchanged
|
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.
Looks good to me. This doesn't not break if the customer has also credits, right? Bceause it's in the same space.
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.
Kewl 👍
Yeah they will just show side by side |
Changes
If the project amount is > 0 and the feature flag is on then render the rolled up total. Behind ff for now to test.
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
It doesn't have an impact.
How did you test this code?
Manually