Skip to content

Commit 7f6e819

Browse files
committed
Show required attributes
Signed-off-by: David Gageot <[email protected]>
1 parent 551bb4c commit 7f6e819

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ const ConfigEditor = ({
7878
return null;
7979
}
8080

81+
const schema = new JsonSchemaLibrary.Draft2019(catalogItem.config[0]);
82+
const requiredAttributes = (schema.rootSchema.required || []) as string[];
83+
8184
return (
8285
<Stack spacing={1}>
8386
<Typography variant="subtitle2">Parameters</Typography>
@@ -97,7 +100,7 @@ const ConfigEditor = ({
97100
<TextField
98101
fullWidth
99102
size="small"
100-
label={key}
103+
label={`${key} ${requiredAttributes.includes(key) ? ' (required)' : ''}`}
101104
value={localConfig[key]}
102105
onChange={(e) =>
103106
setLocalConfig({ ...localConfig, [key]: e.target.value })

0 commit comments

Comments
 (0)