Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private renderChildren(prop: ContainmentProperty,
parentPath: string,
parentSchema: JsonSchema) {
const composedPath = compose(parentPath, prop.property);
const data = resolveData(this.props.data, composedPath);
const schema = prop.schema;
const array = data;
const key = prop.property;
const parentProperties = JsonForms.schemaService.getContainmentProperties(parentSchema);
for (const property of parentProperties) {
// If available, additionally use schema id to identify the correct property
if (!_.isEmpty(schema.id) && schema.id !== property.schema.id) {
continue;
}
if (key === property.property) {
return this.expandArray(array, property, composedPath);
}
}
// TODO proper logging
return data.map((element, index) => {
const composedPath = compose(path, index + '');
return this.expandObject(
composedPath,
schema,
path
);
});
}
data ? data.map((child, index) => {
const generatedUi = generateDefaultUISchema(resolvedSchema, 'HorizontalLayout');
const childPath = compose(path, index + '');
return (
);
}) : <p>No data</p>
}
return data.map((element, index) => {
const composedPath = compose(path, index.toString());
return this.expandObject(composedPath, property.schema, path);
});
}