Added inline errors to the code-mirror editors based on field spec.

This commit is contained in:
orangemug
2020-03-08 18:38:32 +00:00
parent be7642976b
commit ce976991d4
6 changed files with 185 additions and 8 deletions

View File

@@ -358,7 +358,9 @@ export default class App extends React.Component {
if (message) {
try {
const objPath = message.split(":")[0];
unset(dirtyMapStyle, objPath);
// Errors can be deply nested for example 'layers[0].filter[1][1][0]' we only care upto the property 'layers[0].filter'
const unsetPath = objPath.match(/^\S+?\[\d+\]\.[^\[]+/)[0];
unset(dirtyMapStyle, unsetPath);
}
catch (err) {
console.warn(err);