Skip to content

Commit a3262ee

Browse files
committed
feat: add fallback for app status in widget
1 parent de76133 commit a3262ee

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/components/app/details/appDetails/AppStatusCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const AppStatusCard = ({ appDetails, status, cardLoading, setDetailed, message }
6363
metadata: {
6464
...(debugNode ? { object: debugObject } : { message }),
6565
namespace: appDetails.namespace,
66-
status,
66+
status: debugNode?.health?.status ?? appDetails.appStatus,
6767
},
6868
prompt: `Debug ${message || 'error'} ${debugNode ? `of ${debugObject}` : ''} in ${appDetails.namespace}`,
6969
analyticsCategory: `AI_${getAppTypeCategory(appDetails.appType)}_APP_STATUS`,

src/components/v2/appDetails/sourceInfo/environmentStatus/AppStatusDetailModal.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,23 @@ const AppStatusDetailModal = ({
119119
</div>
120120
</div>
121121
<div className="flex dc__gap-12">
122-
{_appDetails && ExplainWithAIButton && _appDetails.appStatus?.toLowerCase() !== 'healthy' && (
123-
<ExplainWithAIButton
124-
intelligenceConfig={{
125-
clusterId: _appDetails.clusterId,
126-
metadata: {
127-
...(debugNode ? { object: debugObject } : { message }),
128-
namespace: _appDetails.namespace,
129-
status: _appDetails.appStatus,
130-
},
131-
prompt: `Debug ${message || 'error'} ${debugNode ? `of ${debugObject}` : ''} in ${_appDetails.namespace}`,
132-
analyticsCategory: `AI_${getAppTypeCategory(_appDetails.appType)}_APP_STATUS`,
133-
}}
134-
/>
135-
)}
122+
{_appDetails &&
123+
ExplainWithAIButton &&
124+
_appDetails.appStatus?.toLowerCase() !== 'healthy' &&
125+
(debugNode || message) && (
126+
<ExplainWithAIButton
127+
intelligenceConfig={{
128+
clusterId: _appDetails.clusterId,
129+
metadata: {
130+
...(debugNode ? { object: debugObject } : { message }),
131+
namespace: _appDetails.namespace,
132+
status: debugNode?.health?.status ?? _appDetails.appStatus,
133+
},
134+
prompt: `Debug ${message || 'error'} ${debugNode ? `of ${debugObject}` : ''} in ${_appDetails.namespace}`,
135+
analyticsCategory: `AI_${getAppTypeCategory(_appDetails.appType)}_APP_STATUS`,
136+
}}
137+
/>
138+
)}
136139
<Button
137140
dataTestId="app-status-details-cross"
138141
icon={<Icon name="ic-close-small" color={null} />}

0 commit comments

Comments
 (0)