mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: auto-increment journal number.
WIP: customer form.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { FormGroup, Intent, InputGroup } from '@blueprintjs/core';
|
||||
import { FormGroup, Intent, InputGroup, TextArea } from '@blueprintjs/core';
|
||||
import { Row, Col } from 'components';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
|
||||
@@ -12,353 +12,359 @@ const CustomerBillingAddress = ({
|
||||
getFieldProps,
|
||||
}) => {
|
||||
return (
|
||||
<Row className={'customer-form__tabs-section'}>
|
||||
<Col xs={6}>
|
||||
<h4>
|
||||
<T id={'billing_address'} />
|
||||
</h4>
|
||||
<div
|
||||
className={
|
||||
'customer-form__tabs-section customer-form__tabs-section--address'
|
||||
}
|
||||
>
|
||||
<Row>
|
||||
<Col xs={6}>
|
||||
<h4>
|
||||
<T id={'billing_address'} />
|
||||
</h4>
|
||||
|
||||
<FormGroup
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_country &&
|
||||
touched.billing_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_country"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
label={<T id={'country'} />}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_country &&
|
||||
touched.billing_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_country')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_country"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
label={<T id={'country'} />}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.billing_address_country &&
|
||||
touched.billing_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_country')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'address'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_1" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'address_line_1'} />}
|
||||
className={'form-group--address_line_1'}
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_1')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_1" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<TextArea
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_1')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'address'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_2" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'address_line_2'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_2')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'city_town'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_city &&
|
||||
touched.billing_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_city"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_2" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<TextArea
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_2')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'city_town'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_city &&
|
||||
touched.billing_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_city')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'state'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_state &&
|
||||
touched.billing_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_state"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_city"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.billing_address_city &&
|
||||
touched.billing_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_city')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'state'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_state &&
|
||||
touched.billing_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_state')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'zip_code'} />}
|
||||
intent={
|
||||
errors.billing_address_zipcode &&
|
||||
touched.billing_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_zipcode"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_state"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.billing_address_state &&
|
||||
touched.billing_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_state')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'zip_code'} />}
|
||||
intent={
|
||||
errors.billing_address_zipcode &&
|
||||
touched.billing_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_zipcode')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="billing_address_zipcode"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.billing_address_zipcode &&
|
||||
touched.billing_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_zipcode')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'phone'} />}
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="shipping_phone" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'phone'} />}
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_phone')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
|
||||
<Col xs={6}>
|
||||
<h4>
|
||||
<T id={'shipping_address'} />
|
||||
</h4>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'country'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_country &&
|
||||
touched.shipping_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_country"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="shipping_phone" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_phone')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
</Col>
|
||||
|
||||
<Col xs={6}>
|
||||
<h4>
|
||||
<T id={'shipping_address'} />
|
||||
</h4>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'country'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_country &&
|
||||
touched.shipping_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_country')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_country"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_address_country &&
|
||||
touched.shipping_address_country &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_country')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'address'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_1" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'address_line_1'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_1')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_1" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<TextArea
|
||||
intent={
|
||||
errors.billing_address_1 &&
|
||||
touched.billing_address_1 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_1')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'address'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_2" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'address_line_2'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_2')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'city_town'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_city &&
|
||||
touched.shipping_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_city"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="billing_address_2" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<TextArea
|
||||
intent={
|
||||
errors.billing_address_2 &&
|
||||
touched.billing_address_2 &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('billing_address_2')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'city_town'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_city &&
|
||||
touched.shipping_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_city')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'state'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_state &&
|
||||
touched.shipping_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_state"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_city"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_address_city &&
|
||||
touched.shipping_address_city &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_city')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'state'} />}
|
||||
className={'form-group--journal-number'}
|
||||
intent={
|
||||
errors.shipping_address_state &&
|
||||
touched.shipping_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_state')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'zip_code'} />}
|
||||
intent={
|
||||
errors.shipping_address_zipcode &&
|
||||
touched.shipping_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_zipcode"
|
||||
{...{ errors, touched }}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_state"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_address_state &&
|
||||
touched.shipping_address_state &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_state')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'zip_code'} />}
|
||||
intent={
|
||||
errors.shipping_address_zipcode &&
|
||||
touched.shipping_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_zipcode')}
|
||||
/>
|
||||
</FormGroup>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage
|
||||
name="shipping_address_zipcode"
|
||||
{...{ errors, touched }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_address_zipcode &&
|
||||
touched.shipping_address_zipcode &&
|
||||
Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_address_zipcode')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup
|
||||
label={<T id={'phone'} />}
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="shipping_phone" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
<FormGroup
|
||||
label={<T id={'phone'} />}
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_phone')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
inline={true}
|
||||
helperText={
|
||||
<ErrorMessage name="shipping_phone" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.shipping_phone && touched.shipping_phone && Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('shipping_phone')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function CustomerFinancialPanel({
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={'customer-form__tabs-section customer-form__tabs-section--financial'}>
|
||||
<Row>
|
||||
<Col xs={6}>
|
||||
<FormGroup
|
||||
|
||||
@@ -270,14 +270,14 @@ function CustomerForm({
|
||||
values={values}
|
||||
touched={touched} />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<CustomerFloatingActions
|
||||
onSubmitClick={handleSubmitClick}
|
||||
customer={customer}
|
||||
onCancelClick={handleCancelClick}
|
||||
customerId={null}
|
||||
/>
|
||||
<CustomerFloatingActions
|
||||
onSubmitClick={handleSubmitClick}
|
||||
customer={customer}
|
||||
onCancelClick={handleCancelClick}
|
||||
customerId={null}
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import React from 'react';
|
||||
import { FormGroup, Intent, InputGroup } from '@blueprintjs/core';
|
||||
import { Row, Col } from 'react-grid-system';
|
||||
import {
|
||||
FormGroup,
|
||||
Intent,
|
||||
InputGroup,
|
||||
ControlGroup,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import { ErrorMessage } from 'components';
|
||||
|
||||
@@ -11,14 +15,12 @@ export default function CustomerFormAfterPrimarySection({
|
||||
values,
|
||||
touched,
|
||||
}) {
|
||||
return (
|
||||
return (
|
||||
<div class="customer-form__after-primary-section-content">
|
||||
{/*------------ Customer email -----------*/}
|
||||
{/*------------ Customer email -----------*/}
|
||||
<FormGroup
|
||||
intent={errors.email && touched.email && Intent.DANGER}
|
||||
helperText={
|
||||
<ErrorMessage name={'email'} {...{ errors, touched }} />
|
||||
}
|
||||
helperText={<ErrorMessage name={'email'} {...{ errors, touched }} />}
|
||||
className={'form-group--email'}
|
||||
label={<T id={'customer_email'} />}
|
||||
inline={true}
|
||||
@@ -28,9 +30,8 @@ export default function CustomerFormAfterPrimarySection({
|
||||
{...getFieldProps('email')}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
|
||||
{/*------------ Customer email -----------*/}
|
||||
{/*------------ Customer email -----------*/}
|
||||
<FormGroup
|
||||
intent={errors.work_phone && touched.work_phone && Intent.DANGER}
|
||||
helperText={
|
||||
@@ -40,31 +41,34 @@ export default function CustomerFormAfterPrimarySection({
|
||||
label={<T id={'phone_number'} />}
|
||||
inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.work_phone && touched.work_phone && Intent.DANGER
|
||||
}
|
||||
{...getFieldProps('work_phone')}
|
||||
/>
|
||||
<ControlGroup>
|
||||
<InputGroup
|
||||
intent={errors.work_phone && touched.work_phone && Intent.DANGER}
|
||||
{...getFieldProps('work_phone')}
|
||||
placeholder={'Work'}
|
||||
/>
|
||||
|
||||
<InputGroup
|
||||
intent={errors.work_phone && touched.work_phone && Intent.DANGER}
|
||||
{...getFieldProps('work_phone')}
|
||||
placeholder={'Mobile'}
|
||||
/>
|
||||
</ControlGroup>
|
||||
</FormGroup>
|
||||
|
||||
{/*------------ Customer website -----------*/}
|
||||
{/*------------ Customer website -----------*/}
|
||||
<FormGroup
|
||||
intent={errors.website && touched.website && Intent.DANGER}
|
||||
helperText={
|
||||
<ErrorMessage name={'website'} {...{ errors, touched }} />
|
||||
}
|
||||
helperText={<ErrorMessage name={'website'} {...{ errors, touched }} />}
|
||||
className={'form-group--website'}
|
||||
label={<T id={'website'} />}
|
||||
inline={true}
|
||||
>
|
||||
<InputGroup
|
||||
intent={
|
||||
errors.website && touched.website && Intent.DANGER
|
||||
}
|
||||
intent={errors.website && touched.website && Intent.DANGER}
|
||||
{...getFieldProps('website')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Button,
|
||||
Classes,
|
||||
FormGroup,
|
||||
InputGroup,
|
||||
Intent,
|
||||
TextArea,
|
||||
MenuItem,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import ErrorMessage from 'components/ErrorMessage';
|
||||
|
||||
const CustomerBillingAddress = ({
|
||||
formik: { errors, touched, setFieldValue, getFieldProps },
|
||||
}) => {
|
||||
return (
|
||||
<div>
|
||||
<FormGroup
|
||||
label={<T id={'note'} />}
|
||||
// className={'form-group--description'}
|
||||
intent={errors.note && touched.note && Intent.DANGER}
|
||||
helperText={<ErrorMessage name="note" {...{ errors, touched }} />}
|
||||
inline={true}
|
||||
>
|
||||
<TextArea
|
||||
growVertically={true}
|
||||
large={true}
|
||||
{...getFieldProps('note')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CustomerBillingAddress;
|
||||
34
client/src/containers/Customers/CustomerNotePanel.js
Normal file
34
client/src/containers/Customers/CustomerNotePanel.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { FormGroup, Intent, TextArea, Classes } from '@blueprintjs/core';
|
||||
import { Row, Col } from 'components';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import ErrorMessage from 'components/ErrorMessage';
|
||||
|
||||
export default function CustomerNotePanel({ errors, touched, getFieldProps }) {
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
'customer-form__tabs-section customer-form__tabs-section--note'
|
||||
}
|
||||
>
|
||||
<Row>
|
||||
<Col xs={6}>
|
||||
<FormGroup
|
||||
label={<T id={'note'} />}
|
||||
className={classNames('form-group--select-list', Classes.FILL)}
|
||||
intent={errors.note && touched.note && Intent.DANGER}
|
||||
helperText={
|
||||
<ErrorMessage name="payment_date" {...{ errors, touched }} />
|
||||
}
|
||||
>
|
||||
<TextArea
|
||||
intent={errors.note && touched.note && Intent.DANGER}
|
||||
{...getFieldProps('note')}
|
||||
/>
|
||||
</FormGroup>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -2,58 +2,69 @@ import React, { useState, useCallback } from 'react';
|
||||
import { Tabs, Tab } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import CustomerAddressTabs from './CustomerAddressTabs';
|
||||
import CustomerNotTabs from './CustomerNotTabs';
|
||||
import CustomerAttachmentTabs from './CustomerAttachmentTabs';
|
||||
import CustomerFinancialPanel from './CustomerFinancialPanel';
|
||||
import CustomerNotePanel from './CustomerNotePanel';
|
||||
|
||||
function CustomersTabs({
|
||||
export default function CustomersTabs({
|
||||
setFieldValue,
|
||||
getFieldProps,
|
||||
errors,
|
||||
values,
|
||||
touched,
|
||||
}) {
|
||||
const [animate, setAnimate] = useState(true);
|
||||
const { formatMessage } = useIntl();
|
||||
const handleChangeTabs = useCallback(() => {}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Tabs animate={animate} id={'customer-tabs'} large={true}>
|
||||
<Tabs
|
||||
animate={true}
|
||||
id={'customer-tabs'}
|
||||
large={true}
|
||||
defaultSelectedTabId="financial"
|
||||
>
|
||||
<Tab
|
||||
id={'financial'}
|
||||
title={formatMessage({ id: 'financial_details' })}
|
||||
panel={<CustomerFinancialPanel
|
||||
values={values}
|
||||
errors={errors}
|
||||
setFieldValue={setFieldValue}
|
||||
touched={touched}
|
||||
/>}
|
||||
panel={
|
||||
<CustomerFinancialPanel
|
||||
values={values}
|
||||
errors={errors}
|
||||
setFieldValue={setFieldValue}
|
||||
touched={touched}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Tab
|
||||
id={'address'}
|
||||
title={formatMessage({ id: 'address' })}
|
||||
panel={<CustomerAddressTabs
|
||||
setFieldValue={setFieldValue}
|
||||
getFieldProps={getFieldProps}
|
||||
errors={errors}
|
||||
values={values}
|
||||
touched={touched}
|
||||
/>}
|
||||
panel={
|
||||
<CustomerAddressTabs
|
||||
setFieldValue={setFieldValue}
|
||||
getFieldProps={getFieldProps}
|
||||
errors={errors}
|
||||
values={values}
|
||||
touched={touched}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Tab
|
||||
id="notes"
|
||||
title={formatMessage({ id: 'notes' })}
|
||||
panel={
|
||||
<CustomerNotePanel
|
||||
errors={errors}
|
||||
touched={touched}
|
||||
getFieldProps={getFieldProps}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<Tab
|
||||
id={'attachement'}
|
||||
title={formatMessage({ id: 'attachement' })}
|
||||
panel={<CustomerAttachmentTabs />}
|
||||
/>
|
||||
{/* <Tab
|
||||
id={'note'}
|
||||
title={formatMessage({ id: 'note' })}
|
||||
panel={<CustomerNotTabs formik={formik} />}
|
||||
/> */}
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default CustomersTabs;
|
||||
|
||||
Reference in New Issue
Block a user