in modules/core/src/components/stream-settings-panel.js [57:102]
export function createFormData(metadata, opts) {
if (!metadata) {
return null;
}
const root = {};
const {style = {}, collapsible = false} = opts;
for (const streamName in metadata) {
const parentKey = getParentKey(streamName);
let siblings = root;
if (parentKey) {
root[parentKey] = root[parentKey] || {
type: 'checkbox',
children: {},
collapsible,
badge: (
<Badge
userStyle={style.badge}
type={
(metadata[streamName] && metadata[streamName].primitive_type) ||
metadata[streamName].scalar_type
}
/>
)
};
siblings = root[parentKey].children;
}
if (!siblings[streamName]) {
siblings[streamName] = {
type: 'checkbox',
title: streamName.replace(parentKey, ''),
badge: (
<Badge
userStyle={style.badge}
type={metadata[streamName].primitive_type || metadata[streamName].scalar_type}
/>
)
};
}
}
return root;
}