Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67da780

Browse files
authored
fix: avoid error when AI usage is zero (#19388)
Fixes a bug that prevents the managed AI agent usage from showing in thelicenses page of the dashboard when the usage is zero. Adds a story withthis case as well.
1 parentc310a32 commit67da780

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

‎site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.stories.tsx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ type Story = StoryObj<typeof ManagedAgentsConsumption>;
2626

2727
exportconstDefault:Story={};
2828

29+
exportconstZeroUsage:Story={
30+
args:{
31+
managedAgentFeature:{
32+
enabled:true,
33+
actual:0,
34+
soft_limit:60000,
35+
limit:120000,
36+
usage_period:{
37+
start:"February 27, 2025",
38+
end:"February 27, 2026",
39+
issued_at:"February 27, 2025",
40+
},
41+
entitlement:"entitled",
42+
},
43+
},
44+
};
45+
2946
exportconstNearLimit:Story={
3047
args:{
3148
managedAgentFeature:{

‎site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
4444
conststartDate=managedAgentFeature.usage_period?.start;
4545
constendDate=managedAgentFeature.usage_period?.end;
4646

47-
if(!usage||usage<0){
47+
if(usage===undefined||usage<0){
4848
return<ErrorAlerterror="Invalid usage data"/>;
4949
}
5050

51-
if(!included||included<0||!limit||limit<0){
51+
if(
52+
included===undefined||
53+
included<0||
54+
limit===undefined||
55+
limit<0
56+
){
5257
return<ErrorAlerterror="Invalid license usage limits"/>;
5358
}
5459

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp