diff --git a/packages/webapp/package.json b/packages/webapp/package.json index 87b28d75..93613a71 100644 --- a/packages/webapp/package.json +++ b/packages/webapp/package.json @@ -5,6 +5,7 @@ "scripts": { "start": "webpack serve", "build": "webpack --mode production", + "build-dev": "webpack --mode development", "lint": "eslint src", "extract": "formatjs extract", "compile": "formatjs compile" diff --git a/packages/webapp/src/client/index.ts b/packages/webapp/src/client/index.ts index 23f932fc..92a7456d 100644 --- a/packages/webapp/src/client/index.ts +++ b/packages/webapp/src/client/index.ts @@ -46,20 +46,18 @@ export const parseResponseOnError = (response: any): ErrorInfo => { break; default: if (data) { + result = {}; // Set global errors ... if (data.globalErrors) { - let msg; + let msg:string; let errors = data.globalErrors; if (errors.length > 0) { - msg = errors[0]; + result.msg = errors[0]; } - result = { msg: errors }; } // Set field errors ... if (data.fieldErrors) { - // @Todo: Fix this ... - result = { msg: data.fieldErrors }; result.fields = new Map(); } diff --git a/packages/webapp/src/components/form/global-error/styled.ts b/packages/webapp/src/components/form/global-error/styled.ts index b689fa87..be0a9562 100644 --- a/packages/webapp/src/components/form/global-error/styled.ts +++ b/packages/webapp/src/components/form/global-error/styled.ts @@ -5,7 +5,8 @@ import { Alert } from "@material-ui/lab"; export const StyledAlert = withStyles({ root: { - padding: '10px 0px 10px 0px' + padding: '10px 15px', + margin: '5px 0px ' } })(Alert);