fix(insights): keep paused calendars visible and chart scales finite … · simstudioai/sim@f2ead22 · GitHub
Skip to content

Commit f2ead22

Browse files
authored
fix(insights): keep paused calendars visible and chart scales finite (#9274)
1 parent daca837 commit f2ead22

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎apps/sim/ee/organization-usage/components/usage-calendar.tsx‎

Lines changed: 1 addition & 1 deletion

‎apps/sim/ee/organization-usage/components/usage-consumers.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ export function UsageConsumers({
299299
row={row}
300300
info={
301301
dimension === 'workspace' && !row.id
302-
? 'Usage without a workspace link, including organization-level activity and permanently deleted workspaces.'
302+
? 'Usage without a workspace link, including organization-level activity and retained charges from permanently deleted workspaces. This view cannot distinguish between them.'
303303
: undefined
304304
}
305305
isMember={dimension === 'member'}

‎packages/emcn/src/components/charts/geometry.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ describe('resolveBarTickValues', () => {
1515
expect(resolveBarTickValues(peak)).toEqual(expected)
1616
})
1717

18+
it.each([Number.MIN_VALUE, 1e-323, 2e-323, 1.5e308, Number.MAX_VALUE])(
19+
'keeps a finite, increasing scale covering an extreme finite peak of %s',
20+
(peak) => {
21+
const ticks = resolveBarTickValues(peak)
22+
expect(ticks.length).toBeGreaterThanOrEqual(2)
23+
expect(ticks.length).toBeLessThanOrEqual(6)
24+
expect(ticks[0]).toBe(0)
25+
expect(ticks[ticks.length - 1]).toBeGreaterThanOrEqual(peak)
26+
expect(ticks.every(Number.isFinite)).toBe(true)
27+
expect(ticks.every((tick, index) => index === 0 || tick > ticks[index - 1])).toBe(true)
28+
}
29+
)
30+
1831
it.each([0, -1, Number.NaN, Number.POSITIVE_INFINITY])(
1932
'provides a finite, nonzero scale for an empty or invalid peak of %s',
2033
(peak) => {

‎packages/emcn/src/components/charts/geometry.ts‎

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)