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
Remove free tier threshold defaults, make Plans page respect custom free tiers #4531
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.
LGTM otherwise
jsapp/js/account/plan.component.tsx
Outdated
@@ -27,7 +27,9 @@ import Button from 'js/components/common/button'; | |||
import classnames from 'classnames'; | |||
import LoadingSpinner from 'js/components/common/loadingSpinner'; | |||
import {notify} from 'js/utils'; | |||
import {BaseProduct} from "js/account/subscriptionStore"; | |||
import {BaseProduct} from 'js/account/subscriptionStore'; | |||
import EnvStore, {FreeTierThresholds, FreeTierDisplay} from 'js/envStore'; |
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.
EnvStore doesn't appear to be used. If this unused import is important for some reason, it should be documented.
jsapp/js/account/plan.component.tsx
Outdated
const thresholds = envStore.data.free_tier_thresholds as FreeTierThresholds; | ||
const display = envStore.data.free_tier_display as FreeTierDisplay; |
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.
You don't need the as part. Without FreeTierDisplay it will error because it seems to think it could also be {}
but there would be cleaner ways to address this. Either a conditional or better yet figure out why it sometimes is {}
(but the later may be out of scope)
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 might either define it as public free_tier_display: FreeTierDisplay | null = null;
if you want it to be in some null-ish state. Or else make your name optional if you consider {} to be a valid Free Tier Display.
The usage of "as" overrides type checking, making it less useful. It would be better to review how the nullish state should actually be presented.
return null; | ||
}, [envStore.isReady]); | ||
|
||
const hasManageableStatus = useCallback( |
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 is a useCallback because you want it to be a function that accepts various subscriptions right? Just checking my own understanding, I don't think there is a change to make.
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.
Yep!
Checklist
Description
Adds the ability to rename the default free plan.
Notes
The default properties of
FREE_TIER_THRESHOLDS
have been all set to None, since those values should be configured on a per-server basis.The free tier on the Plans page has also been updated to reflect the values in
FREE_TIER_DISPLAY
.