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

fix(ui): remove mentions of TSM-specific limits for Serverless users #6889

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/billing/components/Free/OrgLimits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ export const OrgLimits: FC = () => {
)
}

// The 'dashboards', 'tasks', 'checks', and 'rules' limits are not applicable to orgs using IOx.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put this check at the beginning of the return/render, since it looks like it supersedes the other rules about which limits should be displayed?

if (orgUsesIOx) {
const hiddenLimits = ['dashboards', 'tasks', 'checks', 'rules']

if (hiddenLimits.includes(limitName)) {
return null
}
}

// By default, any 'limit' is a single object literal containing one limitStatus.
return (
<LimitCard
Expand Down
37 changes: 21 additions & 16 deletions src/billing/components/Free/PAYGConversion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ export const Credit250PAYGConversion: FC = () => {
<ul className="credit-250-conversion-panel--benefits">
<li>Unlimited buckets to store your data</li>
<li>Unlimited storage retention</li>
<li>Unlimited dashboards</li>
<li>Unlimited tasks</li>
<li>Unlimited alert checks and notification rules</li>
<li>HTTP and PagerDuty notifications</li>
{!orgUsesIOx && (
<li>
Up to {Intl.NumberFormat().format(CARDINALITY_LIMIT)} series
cardinality
</li>
<>
<li>Unlimited dashboards</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the absence of limits (no task limit, no alert limit, no pagerduty limit) only apply to TSM?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only TSM should get this message, I can see how that isn't very clear. I can restate it as a ternary on orgUsesIOx.

<li>Unlimited tasks</li>
<li>Unlimited alert checks and notification rules</li>
<li>HTTP and PagerDuty notifications</li>
<li>
Up to {Intl.NumberFormat().format(CARDINALITY_LIMIT)} series
cardinality
</li>
</>
)}
</ul>
</div>
Expand Down Expand Up @@ -121,15 +123,18 @@ export const PAYGConversion: FC = () => {
<ul className="conversion-panel--benefits">
<li>Unlimited buckets to store your data</li>
<li>Unlimited storage retention</li>
<li>Unlimited dashboards</li>
<li>Unlimited tasks</li>
<li>Unlimited alert checks and notification rules</li>
<li>HTTP and PagerDuty notifications</li>
{!orgUsesIOx && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above.

<li>
Up to {Intl.NumberFormat().format(CARDINALITY_LIMIT)}{' '}
series cardinality
</li>
<>
<li>Unlimited dashboards</li>
<li>Unlimited tasks</li>
<li>Unlimited alert checks and notification rules</li>
<li>HTTP and PagerDuty notifications</li>
<li>
Up to{' '}
{Intl.NumberFormat().format(CARDINALITY_LIMIT)}{' '}
series cardinality
</li>
</>
)}
</ul>
</div>
Expand Down
84 changes: 44 additions & 40 deletions src/operator/OrgOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const OrgOverlay: FC = () => {
const isIOx =
organization?.storageType &&
organization.storageType.toLowerCase() === 'iox'
const canSeeCardinalityLimits = !isIOx
const canSeeTsmLimits = !isIOx

useEffect(() => {
handleGetLimits(orgID)
Expand Down Expand Up @@ -223,7 +223,7 @@ export const OrgOverlay: FC = () => {
onChangeLimits={setLimits}
/>
</Grid.Column>
{canSeeCardinalityLimits && (
{canSeeTsmLimits && (
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Series Cardinality" />
<LimitsField
Expand Down Expand Up @@ -265,45 +265,49 @@ export const OrgOverlay: FC = () => {
onChangeLimits={setLimits}
/>
</Grid.Column>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Notifications" />
<LimitsField
type={InputType.Number}
name="notificationRule.maxNotifications"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Dashboards" />
<LimitsField
type={InputType.Number}
name="dashboard.maxDashboards"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Tasks" />
<LimitsField
type={InputType.Number}
name="task.maxTasks"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Checks" />
<LimitsField
type={InputType.Number}
name="check.maxChecks"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
{canSeeTsmLimits && (
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Notifications" />
<LimitsField
type={InputType.Number}
name="notificationRule.maxNotifications"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
)}
</Grid.Row>
{canSeeTsmLimits && (
<Grid.Row>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Dashboards" />
<LimitsField
type={InputType.Number}
name="dashboard.maxDashboards"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Tasks" />
<LimitsField
type={InputType.Number}
name="task.maxTasks"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
<Grid.Column widthMD={Columns.Four}>
<Form.Label label="Max Checks" />
<LimitsField
type={InputType.Number}
name="check.maxChecks"
limits={limits}
onChangeLimits={setLimits}
/>
</Grid.Column>
</Grid.Row>
)}
{limits?.timeout && (
<Grid.Row>
<Grid.Column widthMD={Columns.Four}>
Expand Down