-
Notifications
You must be signed in to change notification settings - Fork 875
feat(site): show license utilization in general settings #15683
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
site/src/pages/DeploymentSettingsPage/GeneralSettingsPage/GeneralSettingsPageView.stories.tsx
Show resolved
Hide resolved
{entitlements!.features.user_limit.actual}/ | ||
{entitlements!.features.user_limit.limit} 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.
Would it make sense to give these a similar treatment to licenseUtilizationPercentage
and check if we can evaluate them based on whether entitlements
is nil?
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.
Just a minor suggestion, otherwise LGTM (deferring approval for fe).
entitlements?.features?.user_limit?.limit | ||
? entitlements.features.user_limit.actual / | ||
entitlements.features.user_limit.limit | ||
: undefined; |
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.
Suggestion: Instead of just doing the percentage here, we could prepare the data format in a more convenient way to use in the template:
const licenseInfo =
entitlements?.features?.user_limit?.actual &&
entitlements?.features?.user_limit?.limit
? {
valid: true,
actual: entitlements.features.user_limit.actual,
limit: entitlements.features.user_limit.limit
} : {
valid: false,
actual: 0,
limit: 0,
};
Might not need to even init the actual/limit for the zero case but added it just in case.
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.
Approving to unblock.
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.
It looks good to me. Thanks for digging into the problem and finding the right solution.
One minor thing, that we can do after merge, is to improve the design a bit. cc.: @chrifro
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.
nice!
site/src/pages/DeploymentSettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx
Outdated
Show resolved
Hide resolved
@@ -42,6 +42,7 @@ const meta: Meta<typeof GeneralSettingsPageView> = { | |||
deploymentDAUs: MockDeploymentDAUResponse, | |||
invalidExperiments: [], | |||
safeExperiments: [], | |||
entitlements: undefined, |
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.
entitlements: undefined, |
undefined
is JavaScript's equivalent to a zero value, this doesn't do anything
…ralSettingsPageView.tsx Co-authored-by: ケイラ <mckayla@hey.com>
This PR is the first iteration towards #15297 We cannot yet show license utilization over time, so we show current license utilization. This is because we don't track user states over time. We only track the current user state. A graph over time filtering by active users would therefore not account for day to day changes in user state and be inaccurate. DB schema migrations and related updates will follow that allow us to show license utilization over time.  --------- Co-authored-by: ケイラ <mckayla@hey.com> (cherry picked from commit 7e1ac2e)
This PR is the first iteration towards #15297
We cannot yet show license utilization over time, so we show current license utilization.
This is because we don't track user states over time. We only track the current user state. A graph over time filtering by active users would therefore not account for day to day changes in user state and be inaccurate.
DB schema migrations and related updates will follow that allow us to show license utilization over time.