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
console.warn('Could not render children because no fitting property was found.');
private expandObject(
path: string,
schema: JsonSchema,
parentPath?: string
) {
const { uischema, rootData, dispatch } = this.props;
const data = resolveData(rootData, path);
const liClasses = this.state.selected === data ? 'selected' : '';
// TODO: key should be set in caller
const vnode = (
<li>
<div>
{
_.has(uischema.options, 'imageProvider') ?
<span> : ''
}
<span>
this.setState({
selected: {</span></span></div></li>