Skip to content

Commit f86d7dd

Browse files
author
colinmcneil
committed
Improve feedback for lacking config state
1 parent d151757 commit f86d7dd

File tree

1 file changed

+14
-2
lines changed
  • src/extension/ui/src/components/tile

1 file changed

+14
-2
lines changed

src/extension/ui/src/components/tile/Modal.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Badge,
1111
Box,
1212
ButtonGroup,
13+
Chip,
1314
CircularProgress,
1415
Dialog,
1516
DialogContent,
@@ -94,6 +95,12 @@ const ConfigurationModal = ({
9495
);
9596
}, [catalogItem.secrets]);
9697

98+
useEffect(() => {
99+
if (!catalogItem.canRegister) {
100+
setTabValue(1);
101+
}
102+
}, [catalogItem.canRegister]);
103+
97104
const toolChipStyle = {
98105
padding: '2px 8px',
99106
justifyContent: 'center',
@@ -156,7 +163,6 @@ const ConfigurationModal = ({
156163
}}
157164
/>
158165
{formatName(catalogItem.name)}
159-
160166
<Tooltip
161167
placement="right"
162168
title={
@@ -177,6 +183,12 @@ const ConfigurationModal = ({
177183
/>
178184
</span>
179185
</Tooltip>
186+
{catalogItem.missingSecrets && (
187+
<Chip label="Requires secrets" color="warning" />
188+
)}
189+
{catalogItem.missingConfig && (
190+
<Chip label="Requires configuration" color="warning" />
191+
)}
180192
</Stack>
181193
</DialogTitle>
182194
<IconButton
@@ -289,7 +301,7 @@ const ConfigurationModal = ({
289301
const secretEdited =
290302
(secret.assigned &&
291303
localSecrets[secret.name] !==
292-
ASSIGNED_SECRET_PLACEHOLDER) ||
304+
ASSIGNED_SECRET_PLACEHOLDER) ||
293305
(!secret.assigned &&
294306
localSecrets[secret.name] !== '');
295307
return (

0 commit comments

Comments
 (0)