Skip to content

Commit 2822c0b

Browse files
committed
Fix for dotted properties
Signed-off-by: David Gageot <[email protected]>
1 parent 254c432 commit 2822c0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
} from '../../MergeDeep';
1818
import { useConfig } from '../../queries/useConfig';
1919
import { CatalogItemRichened } from '../../types/catalog';
20+
import { get } from 'lodash-es';
2021

2122
JsonSchema.settings.GET_TEMPLATE_RECURSION_LIMIT = 1000;
2223
JsonSchema.settings.templateDefaultOptions.addOptionalProps = true;
@@ -87,7 +88,7 @@ const ConfigEditor = ({
8788
<Stack>
8889
{Object.keys(flattenedConfig).map((key: string) => {
8990
const edited = localConfig[key] !== flattenedConfig[key];
90-
const propertyType = schema.rootSchema.properties[key].type;
91+
const propertyType = get(schema.rootSchema.properties, key.replaceAll(".", ".properties.")).type;
9192

9293
let label = key
9394
if (propertyType === "array") {
@@ -171,7 +172,7 @@ function sanitizeConfig(config: { [key: string]: any; }, catalogItem: CatalogIte
171172

172173
// Use the right types for each attribute
173174
const typedConfig = Object.fromEntries(Object.entries(requiredConfig).map(([key, value]) => {
174-
const propertyType = schema.rootSchema.properties[key].type;
175+
const propertyType = get(schema.rootSchema.properties, key.replaceAll(".", ".properties.")).type;
175176
switch (propertyType) {
176177
case "integer":
177178
return [key, parseInt(value) || 0];

0 commit comments

Comments
 (0)