Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
data.map((_child, index) => {
const childPath = Paths.compose(
path,
`${index}`
);
// TODO
const errorsPerEntry: any[] = filter(childErrors, error =>
error.dataPath.startsWith(childPath)
);
return (
{schema.properties ? (
fpflow(
fpkeys,
fpfilter(
prop => schema.properties[prop].type !== 'array'
),
onClick={() => {
const newData = _.keys(prop.schema.properties).reduce(
(d, key) => {
if (prop.schema.properties[key].default) {
d[key] = prop.schema.properties[key].default;
}
// FIXME generate id if identifying property is set in editor to allow id refs
return d;
},
{}
);
const arrayPath = Paths.compose(path, prop.property);
const array = Resolve.data(rootData, arrayPath) as any[];
const selectionIndex = _.isEmpty(array) ? 0 : array.length;
const selectionPath = Paths.compose(arrayPath, selectionIndex.toString());
add(path, prop, newData);
setSelection(prop.schema, newData, selectionPath)();
closeDialog();
}}
>
return getValidColumnProps(schema).map(prop => {
const cellPath = Paths.compose(
rowPath,
prop
);
const props = {
propName: prop,
schema,
rowPath,
cellPath,
enabled
};
return ;
});
} else {
Object.keys(groupedProps).map(groupKey =>
)
return data.map((_element: any, index: number) => {
const composedPath = Paths.compose(path, index.toString());
return (
);
});
};
const controlElement = uischema as MasterDetailLayout;
this.setState({
dialog: {
open: false,
schema: undefined,
path: undefined
}
});
const path = Paths.fromScopable(controlElement);
if (_.isArray(resolvedRootData)) {
this.setState({
selected: {
schema: resolvedSchema.items,
data: resolvedRootData[0],
path: Paths.compose(path, '0')
}
});
} else {
this.setState({
selected: {
schema: resolvedSchema,
data: resolvedRootData,
path: path
}
});
}
}
No data : data.map((_child, index) => {
const childPath = Paths.compose(path, index + '');
return (
{
_.chain(resolvedSchema.properties)
.keys()
.filter(prop => resolvedSchema.properties[prop].type !== 'array')
.map((prop, idx) => {
return (
add(path, prop, newData) {
dispatch(
update(
Paths.compose(path, prop.property),
array => {
if (_.isEmpty(array)) {
return [newData];
}
array.push(newData);
return array;
}
)
);
}
});
fpmap(prop => {
const childPropPath = Paths.compose(
childPath,
prop.toString()
);
return (
);
})
)(schema.properties)