{dataInput}
@@ -201,7 +218,6 @@ export default class DataProperty extends React.Component {
return
diff --git a/src/components/fields/_ExpressionProperty.jsx b/src/components/fields/_ExpressionProperty.jsx
index 675dc3f..8c5ab96 100644
--- a/src/components/fields/_ExpressionProperty.jsx
+++ b/src/components/fields/_ExpressionProperty.jsx
@@ -17,18 +17,22 @@ export default class ExpressionProperty extends React.Component {
fieldName: PropTypes.string,
fieldSpec: PropTypes.object,
value: PropTypes.any,
- error: PropTypes.object,
+ errors: PropTypes.object,
onChange: PropTypes.func,
onUndo: PropTypes.func,
canUndo: PropTypes.func,
}
+ static defaultProps = {
+ errors: {},
+ }
+
constructor (props) {
super();
}
render() {
- const {value, canUndo} = this.props;
+ const {errors, fieldName, fieldType, value, canUndo} = this.props;
const undoDisabled = canUndo ? !canUndo() : true;
const deleteStopBtn = (
@@ -53,8 +57,10 @@ export default class ExpressionProperty extends React.Component {
>
);
+ const error = errors[fieldType+"."+fieldName];
+
return
+ const error = errors[fieldType+"."+fieldName];
+
return {
const zoomLevel = stop[0]
const key = this.state.refs[idx];
const value = stop[1]
const deleteStopBtn=
+ const errorKeyStart = `${fieldType}.${fieldName}.stops[${idx}]`;
+ const foundErrors = Object.entries(errors).filter(([key, error]) => {
+ return key.startsWith(errorKeyStart);
+ });
+
+ const message = foundErrors.map(([key, error]) => {
+ return error.message;
+ }).join("");
+ const error = message ? {message} : undefined;
+
return