fix(web): render and filter usage as environments respond #9860
Merged
juliusmarmingemerged 3 commits into
main fromrefs/pull/9860/head·merged by juliusmarminge View on GitHubShowing 7 changed files with 35 additions and 6 deletions (loading 5).
x
@@ -426,10 +426,18 @@
-export function UsageLimitsSection() {
+export function UsageLimitsSection({
+ selectedEnvironmentIds,
+}: {
+ readonly selectedEnvironmentIds: ReadonlySet<EnvironmentId> | null;
+}) {
- const groups = collectLimitsGroups(presentations);
- const sources = collectLimitSources(presentations);
+ const selected =
+ selectedEnvironmentIds === null
+ ? presentations
+ : new Map([...presentations].filter(([id]) => selectedEnvironmentIds.has(id)));
+ const groups = collectLimitsGroups(selected);
+ const sources = collectLimitSources(selected);
Resolvedby juliusmarminge
Limits empty copy ignores filter#
Low Severity
The new environment filter can hide every limits-reporting environment, but the empty state still says no connected environment reports limits. On the Limits tab, a missing or cleared selection also says to connect or select an environment to see usage.
Additional Locations (1)
Fixed in 3c48e353a. The limits empty state now refers to selected environments, and clearing the filter on the Limits tab says to select an environment to see limits. Scoped lint and the usage/page tests pass.
@@ -437,7 +445,7 @@
- No provider on a connected environment reports subscription limits.
+ No provider on the selected environments reports subscription limits.

