diff --git a/client/src/components/Dialog/DialogContent.js b/client/src/components/Dialog/DialogContent.js index f20418beb..56eab54dd 100644 --- a/client/src/components/Dialog/DialogContent.js +++ b/client/src/components/Dialog/DialogContent.js @@ -1,15 +1,18 @@ import React from 'react'; import { Spinner, Classes } from '@blueprintjs/core'; +import classNames from 'classnames'; export default function DialogContent(props) { const { isLoading, children } = props; const loadingContent = ( -
- ); - return ( -
- {isLoading ? loadingContent : children} +
+
); -} \ No newline at end of file + return
{isLoading ? loadingContent : children}
; +} diff --git a/client/src/containers/Items/ItemForm.js b/client/src/containers/Items/ItemForm.js index 2ee76292f..b6dc6917f 100644 --- a/client/src/containers/Items/ItemForm.js +++ b/client/src/containers/Items/ItemForm.js @@ -94,8 +94,10 @@ function ItemForm({ ); // Transform API errors. - const transformApiErrors = (errors) => { + const transformApiErrors = (error) => { + const { response: { data: { errors } } } = error; const fields = {}; + if (errors.find((e) => e.type === 'ITEM.NAME.ALREADY.EXISTS')) { fields.name = formatMessage({ id: 'the_name_used_before' }); } diff --git a/client/src/containers/Items/ItemFormBody.js b/client/src/containers/Items/ItemFormBody.js index 8c4dc404f..5255e1381 100644 --- a/client/src/containers/Items/ItemFormBody.js +++ b/client/src/containers/Items/ItemFormBody.js @@ -1,6 +1,12 @@ import React from 'react'; import { FastField, Field, ErrorMessage } from 'formik'; -import { FormGroup, Classes, Checkbox, ControlGroup } from '@blueprintjs/core'; +import { + FormGroup, + Classes, + TextArea, + Checkbox, + ControlGroup, +} from '@blueprintjs/core'; import { AccountsSelectList, MoneyInputGroup, @@ -100,6 +106,25 @@ function ItemFormBody({ baseCurrency }) { )} + + + {({ form: { values }, field, meta: { error, touched } }) => ( + } + className={'form-group--sell-description'} + intent={inputIntent({ error, touched })} + helperText={} + inline={true} + > +