mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 17:31:14 +01:00
Include missing errors from expressions UI.
This commit is contained in:
parent
39333953d7
commit
35098111ac
1 changed files with 12 additions and 1 deletions
|
@ -62,7 +62,18 @@ export default class ExpressionProperty extends React.Component {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
const error = errors[fieldType+"."+fieldName];
|
const fieldError = errors[fieldType+"."+fieldName];
|
||||||
|
const errorKeyStart = `${fieldType}.${fieldName}[`;
|
||||||
|
const foundErrors = Object.entries(errors).filter(([key, error]) => {
|
||||||
|
return key.startsWith(errorKeyStart);
|
||||||
|
});
|
||||||
|
let message = foundErrors.map(([key, error]) => {
|
||||||
|
return error.message;
|
||||||
|
}).join("");
|
||||||
|
if (fieldError) {
|
||||||
|
message = fieldError.message + message;
|
||||||
|
}
|
||||||
|
const error = message ? {message} : undefined;
|
||||||
|
|
||||||
return <InputBlock
|
return <InputBlock
|
||||||
error={error}
|
error={error}
|
||||||
|
|
Loading…
Reference in a new issue