wip
This commit is contained in:
@@ -28,6 +28,7 @@ export function SalutationList({ ...restProps }: SalutationListProps) {
|
|||||||
items={items}
|
items={items}
|
||||||
valueAccessor={'key'}
|
valueAccessor={'key'}
|
||||||
textAccessor={'label'}
|
textAccessor={'label'}
|
||||||
|
labelAccessor={'_label'}
|
||||||
placeholder={intl.get('salutation')}
|
placeholder={intl.get('salutation')}
|
||||||
filterable={false}
|
filterable={false}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
|
|||||||
@@ -22,18 +22,13 @@ export function CustomerFloatingActions() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Formik context.
|
// Formik context.
|
||||||
const { resetForm, submitForm, isSubmitting } = useFormikContext();
|
const { submitForm, isSubmitting } = useFormikContext();
|
||||||
|
|
||||||
// Handle submit button click.
|
// Handle submit button click.
|
||||||
const handleSubmitBtnClick = (_event: React.MouseEvent<HTMLElement>) => {
|
const handleSubmitBtnClick = (_event: React.MouseEvent<HTMLElement>) => {
|
||||||
setSubmitPayload({ noRedirect: false });
|
setSubmitPayload({ noRedirect: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
// handle clear button clicl.
|
|
||||||
const handleClearBtnClick = (_event: React.MouseEvent<HTMLElement>) => {
|
|
||||||
resetForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Handle submit & new button click.
|
// Handle submit & new button click.
|
||||||
const handleSubmitAndNewClick = (_event: React.MouseEvent<HTMLElement>) => {
|
const handleSubmitAndNewClick = (_event: React.MouseEvent<HTMLElement>) => {
|
||||||
submitForm();
|
submitForm();
|
||||||
@@ -44,7 +39,7 @@ export function CustomerFloatingActions() {
|
|||||||
<FloatingActionsGroup spacing={10}>
|
<FloatingActionsGroup spacing={10}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<SaveButton
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
intent={Intent.PRIMARY}
|
intent={Intent.PRIMARY}
|
||||||
@@ -61,9 +56,9 @@ export function CustomerFloatingActions() {
|
|||||||
/>
|
/>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
interactionKind={PopoverInteractionKind.CLICK}
|
||||||
position={Position.BOTTOM_LEFT}
|
position={Position.BOTTOM_RIGHT}
|
||||||
|
minimal
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -72,27 +67,16 @@ export function CustomerFloatingActions() {
|
|||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
||||||
{/* ----------- Clear & Reset----------- */}
|
|
||||||
<Button
|
|
||||||
className={'ml1'}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
onClick={handleClearBtnClick}
|
|
||||||
text={!isNewMode ? <T id={'reset'} /> : <T id={'clear'} />}
|
|
||||||
/>
|
|
||||||
</FloatingActionsGroup>
|
</FloatingActionsGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FloatingActionsGroup = styled(Group)`
|
const FloatingActionsGroup = styled(Group)`
|
||||||
padding: 12px 0;
|
padding: 10px 0;
|
||||||
padding-left: 165px;
|
padding-left: 165px;
|
||||||
border-top: 1px solid #50555a;
|
border-top: 1px solid #50555a;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: var(--color-card-background);
|
background: var(--color-card-background);
|
||||||
`;
|
z-index: 1;
|
||||||
|
`;
|
||||||
const SaveButton = styled(Button)`
|
|
||||||
min-width: 80px;
|
|
||||||
`;
|
|
||||||
@@ -25,11 +25,10 @@ export function CustomerFormContent() {
|
|||||||
<Card className={css`padding-bottom: 0 !important;`}>
|
<Card className={css`padding-bottom: 0 !important;`}>
|
||||||
<Group verticalAlign={'top'} alignItems={'flex-start'} flexWrap={'nowrap'}>
|
<Group verticalAlign={'top'} alignItems={'flex-start'} flexWrap={'nowrap'}>
|
||||||
<Tabs
|
<Tabs
|
||||||
vertical
|
|
||||||
large
|
|
||||||
selectedTabId={selectedTabId}
|
selectedTabId={selectedTabId}
|
||||||
onChange={handleTabChange}
|
onChange={handleTabChange}
|
||||||
className={css`position: sticky; top: 20px; .bp4-large > .bp4-tab{font-size: 14px;} `}
|
className={css`position: sticky; top: 20px;`}
|
||||||
|
vertical
|
||||||
>
|
>
|
||||||
<Tab id={'primary'} title={'Basic'} />
|
<Tab id={'primary'} title={'Basic'} />
|
||||||
<Tab id={'financial'} title={'Financial'} />
|
<Tab id={'financial'} title={'Financial'} />
|
||||||
|
|||||||
+6
-2
@@ -12,6 +12,7 @@ import {
|
|||||||
FMoneyInputGroup,
|
FMoneyInputGroup,
|
||||||
ExchangeRateInputGroup,
|
ExchangeRateInputGroup,
|
||||||
FDateInput,
|
FDateInput,
|
||||||
|
Icon,
|
||||||
Box,
|
Box,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { useCustomerFormContext } from './CustomerFormProvider';
|
import { useCustomerFormContext } from './CustomerFormProvider';
|
||||||
@@ -58,12 +59,12 @@ export function CustomerFormFinancialSection() {
|
|||||||
label={<T id={'customer.label.opening_branch'} />}
|
label={<T id={'customer.label.opening_branch'} />}
|
||||||
name={'opening_balance_branch_id'}
|
name={'opening_balance_branch_id'}
|
||||||
inline
|
inline
|
||||||
fill
|
|
||||||
>
|
>
|
||||||
<BranchSelect
|
<BranchSelect
|
||||||
name={'opening_balance_branch_id'}
|
name={'opening_balance_branch_id'}
|
||||||
branches={branches}
|
branches={branches}
|
||||||
popoverProps={{ minimal: true }}
|
popoverProps={{ minimal: true }}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</FeatureCan>
|
</FeatureCan>
|
||||||
@@ -95,6 +96,9 @@ function CustomerOpeningBalanceAtField() {
|
|||||||
disabled={customerId}
|
disabled={customerId}
|
||||||
formatDate={(date) => date.toLocaleDateString()}
|
formatDate={(date) => date.toLocaleDateString()}
|
||||||
parseDate={(str) => new Date(str)}
|
parseDate={(str) => new Date(str)}
|
||||||
|
inputProps={{
|
||||||
|
leftIcon: <Icon icon={'date-range'} />,
|
||||||
|
}}
|
||||||
fill={true}
|
fill={true}
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
@@ -118,7 +122,7 @@ function CustomerOpeningBalanceField() {
|
|||||||
fastField={true}
|
fastField={true}
|
||||||
fill
|
fill
|
||||||
>
|
>
|
||||||
<ControlGroup fill>
|
<ControlGroup>
|
||||||
<InputPrependText text={values.currency_code as string} />
|
<InputPrependText text={values.currency_code as string} />
|
||||||
<FMoneyInputGroup
|
<FMoneyInputGroup
|
||||||
name={'opening_balance'}
|
name={'opening_balance'}
|
||||||
|
|||||||
@@ -166,6 +166,9 @@ const CustomerFormFields = styled.div`
|
|||||||
.bp6-form-content {
|
.bp6-form-content {
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
.bp4-form-group{
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
.bp4-form-group.bp4-inline label.bp4-label {
|
.bp4-form-group.bp4-inline label.bp4-label {
|
||||||
min-width: 140px;
|
min-width: 140px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'country'} />}
|
label={<T id={'country'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'billing_address_country'} fill />
|
<FInputGroup name={'billing_address_country'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -28,8 +29,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'address_line_1'} />}
|
label={<T id={'address_line_1'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FTextArea name={'billing_address1'} fill />
|
<FTextArea name={'billing_address1'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -37,8 +39,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'address_line_2'} />}
|
label={<T id={'address_line_2'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FTextArea name={'billing_address2'} fill />
|
<FTextArea name={'billing_address2'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -46,8 +49,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'city_town'} />}
|
label={<T id={'city_town'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'billing_address_city'} fill />
|
<FInputGroup name={'billing_address_city'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -55,8 +59,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'state'} />}
|
label={<T id={'state'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'billing_address_state'} fill />
|
<FInputGroup name={'billing_address_state'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -64,8 +69,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'zip_code'} />}
|
label={<T id={'zip_code'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'billing_address_postcode'} fill />
|
<FInputGroup name={'billing_address_postcode'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -73,8 +79,9 @@ export function VendorBillingAddress() {
|
|||||||
label={<T id={'phone'} />}
|
label={<T id={'phone'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'billing_address_phone'} fill />
|
<FInputGroup name={'billing_address_phone'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -44,10 +44,12 @@ export function VendorFinanicalPanelTab() {
|
|||||||
label={<T id={'currency'} />}
|
label={<T id={'currency'} />}
|
||||||
fastField
|
fastField
|
||||||
inline
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<CurrencySelectList
|
<CurrencySelectList
|
||||||
name="currency_code"
|
name="currency_code"
|
||||||
items={currencies}
|
items={currencies}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
@@ -93,16 +95,17 @@ function VendorOpeningBalanceField() {
|
|||||||
<FFormGroup
|
<FFormGroup
|
||||||
name={'opening_balance'}
|
name={'opening_balance'}
|
||||||
label={<T id={'opening_balance'} />}
|
label={<T id={'opening_balance'} />}
|
||||||
inline={true}
|
|
||||||
shouldUpdate={openingBalanceFieldShouldUpdate}
|
shouldUpdate={openingBalanceFieldShouldUpdate}
|
||||||
shouldUpdateDeps={{ currencyCode: values.currency_code }}
|
shouldUpdateDeps={{ currencyCode: values.currency_code }}
|
||||||
fastField={true}
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<ControlGroup>
|
<ControlGroup>
|
||||||
<InputPrependText text={values.currency_code} />
|
<InputPrependText text={values.currency_code} />
|
||||||
<FMoneyInputGroup
|
<FMoneyInputGroup
|
||||||
name={'opening_balance'}
|
name={'opening_balance'}
|
||||||
inputGroupProps={{ fill: true }}
|
inputGroupProps={{ fill: true }}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
@@ -123,8 +126,9 @@ function VendorOpeningBalanceAtField() {
|
|||||||
<FFormGroup
|
<FFormGroup
|
||||||
name={'opening_balance_at'}
|
name={'opening_balance_at'}
|
||||||
label={<T id={'opening_balance_at'} />}
|
label={<T id={'opening_balance_at'} />}
|
||||||
inline={true}
|
|
||||||
helperText={<ErrorMessage name="opening_balance_at" />}
|
helperText={<ErrorMessage name="opening_balance_at" />}
|
||||||
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FDateInput
|
<FDateInput
|
||||||
name={'opening_balance_at'}
|
name={'opening_balance_at'}
|
||||||
@@ -132,7 +136,8 @@ function VendorOpeningBalanceAtField() {
|
|||||||
disabled={vendorId}
|
disabled={vendorId}
|
||||||
formatDate={(date) => date.toLocaleDateString()}
|
formatDate={(date) => date.toLocaleDateString()}
|
||||||
parseDate={(str) => new Date(str)}
|
parseDate={(str) => new Date(str)}
|
||||||
fill={true}
|
fill
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
);
|
);
|
||||||
@@ -156,12 +161,14 @@ function VendorOpeningBalanceExchangeRateField() {
|
|||||||
<FFormGroup
|
<FFormGroup
|
||||||
label={' '}
|
label={' '}
|
||||||
name={'opening_balance_exchange_rate'}
|
name={'opening_balance_exchange_rate'}
|
||||||
inline={true}
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<ExchangeRateInputGroup
|
<ExchangeRateInputGroup
|
||||||
fromCurrency={values.currency_code}
|
fromCurrency={values.currency_code}
|
||||||
toCurrency={currentOrganization.base_currency}
|
toCurrency={currentOrganization.base_currency}
|
||||||
name={'opening_balance_exchange_rate'}
|
name={'opening_balance_exchange_rate'}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { useVendorFormContext } from './VendorFormProvider';
|
|||||||
*/
|
*/
|
||||||
export function VendorFloatingActions() {
|
export function VendorFloatingActions() {
|
||||||
// Formik context.
|
// Formik context.
|
||||||
const { resetForm, isSubmitting, submitForm } = useFormikContext();
|
const { isSubmitting, submitForm } = useFormikContext();
|
||||||
|
|
||||||
// Vendor form context.
|
// Vendor form context.
|
||||||
const { isNewMode, setSubmitPayload } = useVendorFormContext();
|
const { isNewMode, setSubmitPayload } = useVendorFormContext();
|
||||||
@@ -36,16 +36,11 @@ export function VendorFloatingActions() {
|
|||||||
setSubmitPayload({ noRedirect: true });
|
setSubmitPayload({ noRedirect: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle clear button click.
|
|
||||||
const handleClearBtnClick = () => {
|
|
||||||
resetForm();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FloatingActionsGroup spacing={10}>
|
<FloatingActionsGroup spacing={10}>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
{/* ----------- Save and New ----------- */}
|
{/* ----------- Save and New ----------- */}
|
||||||
<SaveButton
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
loading={isSubmitting}
|
loading={isSubmitting}
|
||||||
intent={Intent.PRIMARY}
|
intent={Intent.PRIMARY}
|
||||||
@@ -62,9 +57,9 @@ export function VendorFloatingActions() {
|
|||||||
/>
|
/>
|
||||||
</Menu>
|
</Menu>
|
||||||
}
|
}
|
||||||
minimal={true}
|
|
||||||
interactionKind={PopoverInteractionKind.CLICK}
|
interactionKind={PopoverInteractionKind.CLICK}
|
||||||
position={Position.BOTTOM_LEFT}
|
position={Position.BOTTOM_RIGHT}
|
||||||
|
minimal
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
@@ -73,26 +68,16 @@ export function VendorFloatingActions() {
|
|||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
{/* ----------- Clear & Reset----------- */}
|
|
||||||
<Button
|
|
||||||
className={'ml1'}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
onClick={handleClearBtnClick}
|
|
||||||
text={!isNewMode ? <T id={'reset'} /> : <T id={'clear'} />}
|
|
||||||
/>
|
|
||||||
</FloatingActionsGroup>
|
</FloatingActionsGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FloatingActionsGroup = styled(Group)`
|
const FloatingActionsGroup = styled(Group)`
|
||||||
padding: 12px 0;
|
padding: 10px 0;
|
||||||
padding-left: 165px;
|
padding-left: 165px;
|
||||||
border-top: 1px solid #50555a;
|
border-top: 1px solid #50555a;
|
||||||
position: sticky;
|
position: sticky;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
background: var(--color-card-background);
|
background: var(--color-card-background);
|
||||||
`;
|
z-index: 1;
|
||||||
|
`;
|
||||||
const SaveButton = styled(Button)`
|
|
||||||
min-width: 80px;
|
|
||||||
`;
|
|
||||||
+12
-9
@@ -2,21 +2,22 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { ControlGroup } from '@blueprintjs/core';
|
import { ControlGroup } from '@blueprintjs/core';
|
||||||
import { FormattedMessage as T, FFormGroup, FInputGroup } from '@/components';
|
import { FormattedMessage as T, FFormGroup, FInputGroup, Box } from '@/components';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vendor form after primary section.
|
* Vendor form after primary section.
|
||||||
*/
|
*/
|
||||||
export function VendorFormAfterPrimarySection() {
|
export function VendorFormAfterPrimarySection() {
|
||||||
return (
|
return (
|
||||||
<div className={'customer-form__after-primary-section-content'}>
|
<Box>
|
||||||
{/*------------ Vendor email -----------*/}
|
{/*------------ Vendor email -----------*/}
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
name={'email'}
|
name={'email'}
|
||||||
label={<T id={'vendor_email'} />}
|
label={<T id={'vendor_email'} />}
|
||||||
inline={true}
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'email'} />
|
<FInputGroup name={'email'} fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
{/*------------ Phone number -----------*/}
|
{/*------------ Phone number -----------*/}
|
||||||
@@ -24,21 +25,23 @@ export function VendorFormAfterPrimarySection() {
|
|||||||
name={'work_phone'}
|
name={'work_phone'}
|
||||||
className={'form-group--phone-number'}
|
className={'form-group--phone-number'}
|
||||||
label={<T id={'phone_number'} />}
|
label={<T id={'phone_number'} />}
|
||||||
inline={true}
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<ControlGroup>
|
<ControlGroup>
|
||||||
<FInputGroup name={'work_phone'} placeholder={intl.get('work')} />
|
<FInputGroup name={'work_phone'} placeholder={intl.get('work')} fastField />
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'personal_phone'}
|
name={'personal_phone'}
|
||||||
placeholder={intl.get('mobile')}
|
placeholder={intl.get('mobile')}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
{/*------------ Vendor website -----------*/}
|
{/*------------ Vendor website -----------*/}
|
||||||
<FFormGroup name={'website'} label={<T id={'website'} />} inline={true}>
|
<FFormGroup name={'website'} label={<T id={'website'} />} inline fastField>
|
||||||
<FInputGroup name={'website'} placeholder={'http://'} />
|
<FInputGroup name={'website'} placeholder={'http://'} fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</div>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,22 +29,26 @@ export function VendorFormBasicSection({}) {
|
|||||||
label={<T id={'contact_name'} />}
|
label={<T id={'contact_name'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<ControlGroup fill>
|
<ControlGroup fill>
|
||||||
<SalutationList
|
<SalutationList
|
||||||
name={'salutation'}
|
name={'salutation'}
|
||||||
popoverProps={{ minimal: true }}
|
popoverProps={{ minimal: true }}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'first_name'}
|
name={'first_name'}
|
||||||
placeholder={intl.get('first_name')}
|
placeholder={intl.get('first_name')}
|
||||||
inputRef={(ref) => (firstNameFieldRef.current = ref)}
|
inputRef={(ref) => (firstNameFieldRef.current = ref)}
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'last_name'}
|
name={'last_name'}
|
||||||
placeholder={intl.get('last_name')}
|
placeholder={intl.get('last_name')}
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</ControlGroup>
|
</ControlGroup>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
@@ -55,10 +59,9 @@ export function VendorFormBasicSection({}) {
|
|||||||
helperText="Add a unique account number to identify, reference and search for the contact."
|
helperText="Add a unique account number to identify, reference and search for the contact."
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup
|
<FInputGroup name={'vendor_code'} fill fastField />
|
||||||
name={'vendor_code'}
|
|
||||||
fill />
|
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
{/*----------- Company Name -----------*/}
|
{/*----------- Company Name -----------*/}
|
||||||
@@ -67,8 +70,9 @@ export function VendorFormBasicSection({}) {
|
|||||||
label={<T id={'company_name'} />}
|
label={<T id={'company_name'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'company_name'} fill />
|
<FInputGroup name={'company_name'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
{/*----------- Display Name -----------*/}
|
{/*----------- Display Name -----------*/}
|
||||||
@@ -78,11 +82,13 @@ export function VendorFormBasicSection({}) {
|
|||||||
helperText="This is the name that appears on invoices and emails."
|
helperText="This is the name that appears on invoices and emails."
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<DisplayNameList
|
<DisplayNameList
|
||||||
name={'display_name'}
|
name={'display_name'}
|
||||||
popoverProps={{ minimal: true }}
|
popoverProps={{ minimal: true }}
|
||||||
buttonProps={{ fill: true }}
|
buttonProps={{ fill: true }}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
@@ -93,10 +99,12 @@ export function VendorFormBasicSection({}) {
|
|||||||
name={'email'}
|
name={'email'}
|
||||||
label={<T id={'vendor_email'} />}
|
label={<T id={'vendor_email'} />}
|
||||||
inline
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'email'}
|
name={'email'}
|
||||||
leftIcon={<Icon icon="envelope" />}
|
leftIcon={<Icon icon="envelope" />}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
@@ -106,26 +114,26 @@ export function VendorFormBasicSection({}) {
|
|||||||
className={'form-group--phone-number'}
|
className={'form-group--phone-number'}
|
||||||
label={<T id={'phone_number'} />}
|
label={<T id={'phone_number'} />}
|
||||||
inline
|
inline
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<Stack spacing={10}>
|
<Stack spacing={10}>
|
||||||
<FInputGroup
|
<FInputGroup name={'work_phone'} placeholder={intl.get('work')} leftIcon="phone" fastField
|
||||||
name={'work_phone'}
|
|
||||||
placeholder={intl.get('work')}
|
|
||||||
leftIcon="phone"
|
|
||||||
/>
|
/>
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'personal_phone'}
|
name={'personal_phone'}
|
||||||
placeholder={intl.get('mobile')}
|
placeholder={intl.get('mobile')}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
{/*------------ Vendor website -----------*/}
|
{/*------------ Vendor website -----------*/}
|
||||||
<FFormGroup name={'website'} label={<T id={'website'} />} inline>
|
<FFormGroup name={'website'} label={<T id={'website'} />} inline fastField>
|
||||||
<FInputGroup
|
<FInputGroup
|
||||||
name={'website'}
|
name={'website'}
|
||||||
placeholder={'http://'}
|
placeholder={'http://'}
|
||||||
leftIcon={<BlueprintIcon icon="globe-network" />}
|
leftIcon={<BlueprintIcon icon="globe-network" />}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ export function VendorFormContent() {
|
|||||||
<Card className={css`padding-bottom: 0 !important;`}>
|
<Card className={css`padding-bottom: 0 !important;`}>
|
||||||
<Group verticalAlign={'top'} alignItems={'flex-start'} flexWrap={'nowrap'}>
|
<Group verticalAlign={'top'} alignItems={'flex-start'} flexWrap={'nowrap'}>
|
||||||
<Tabs
|
<Tabs
|
||||||
vertical
|
|
||||||
large
|
|
||||||
selectedTabId={selectedTabId}
|
selectedTabId={selectedTabId}
|
||||||
onChange={handleTabChange}
|
onChange={handleTabChange}
|
||||||
className={css`position: sticky; top: 20px; .bp4-large > .bp4-tab{font-size: 14px;} `}
|
className={css`position: sticky; top: 20px;`}
|
||||||
|
vertical
|
||||||
>
|
>
|
||||||
<Tab id={'primary'} title={'Basic'} />
|
<Tab id={'primary'} title={'Basic'} />
|
||||||
<Tab id={'financial'} title={'Financial'} />
|
<Tab id={'financial'} title={'Financial'} />
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
FMoneyInputGroup,
|
FMoneyInputGroup,
|
||||||
ExchangeRateInputGroup,
|
ExchangeRateInputGroup,
|
||||||
FDateInput,
|
FDateInput,
|
||||||
|
Icon,
|
||||||
Box,
|
Box,
|
||||||
} from '@/components';
|
} from '@/components';
|
||||||
import { useVendorFormContext } from './VendorFormProvider';
|
import { useVendorFormContext } from './VendorFormProvider';
|
||||||
@@ -46,6 +47,7 @@ export function VendorFormFinancialSection() {
|
|||||||
name="currency_code"
|
name="currency_code"
|
||||||
items={currencies}
|
items={currencies}
|
||||||
disabled={vendorId}
|
disabled={vendorId}
|
||||||
|
fastField
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
@@ -95,6 +97,9 @@ function VendorOpeningBalanceAtField() {
|
|||||||
disabled={vendorId}
|
disabled={vendorId}
|
||||||
formatDate={(date) => date.toLocaleDateString()}
|
formatDate={(date) => date.toLocaleDateString()}
|
||||||
parseDate={(str) => new Date(str)}
|
parseDate={(str) => new Date(str)}
|
||||||
|
inputProps={{
|
||||||
|
leftIcon: <Icon icon={'date-range'} />,
|
||||||
|
}}
|
||||||
fill={true}
|
fill={true}
|
||||||
/>
|
/>
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|||||||
@@ -120,7 +120,9 @@ const VendorFormFields = styled.div`
|
|||||||
.bp6-form-content {
|
.bp6-form-content {
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
.bp4-form-group{
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
.bp4-form-group.bp4-inline label.bp4-label {
|
.bp4-form-group.bp4-inline label.bp4-label {
|
||||||
min-width: 140px;
|
min-width: 140px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ export function VendorFormNotesSection() {
|
|||||||
<T id={'notes'} />
|
<T id={'notes'} />
|
||||||
</VendorFormSectionTitle>
|
</VendorFormSectionTitle>
|
||||||
|
|
||||||
<FFormGroup name={'note'} label={<T id={'note'} />} inline fill>
|
<FFormGroup name={'note'} label={<T id={'note'} />} inline fill fastField>
|
||||||
<FTextArea name={'note'} fill />
|
<FTextArea name={'note'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,82 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import React from 'react';
|
|
||||||
import intl from 'react-intl-universal';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { ControlGroup } from '@blueprintjs/core';
|
|
||||||
import {
|
|
||||||
FormattedMessage as T,
|
|
||||||
FFormGroup,
|
|
||||||
FInputGroup,
|
|
||||||
Hint,
|
|
||||||
FieldRequiredHint,
|
|
||||||
SalutationList,
|
|
||||||
DisplayNameList,
|
|
||||||
} from '@/components';
|
|
||||||
import { CLASSES } from '@/constants/classes';
|
|
||||||
import { useAutofocus } from '@/hooks';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vendor form primary section.
|
|
||||||
*/
|
|
||||||
export function VendorFormPrimarySection() {
|
|
||||||
const firstNameFieldRef = useAutofocus();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={'customer-form__primary-section-content'}>
|
|
||||||
{/**----------- Vendor name -----------*/}
|
|
||||||
<FFormGroup
|
|
||||||
name={'salutation'}
|
|
||||||
className={classNames('form-group--contact_name')}
|
|
||||||
label={<T id={'contact_name'} />}
|
|
||||||
inline={true}
|
|
||||||
>
|
|
||||||
<ControlGroup>
|
|
||||||
<SalutationList
|
|
||||||
name={'salutation'}
|
|
||||||
popoverProps={{ minimal: true }}
|
|
||||||
/>
|
|
||||||
<FInputGroup
|
|
||||||
name={'first_name'}
|
|
||||||
placeholder={intl.get('first_name')}
|
|
||||||
className={classNames('input-group--first-name')}
|
|
||||||
inputRef={(ref) => (firstNameFieldRef.current = ref)}
|
|
||||||
/>
|
|
||||||
<FInputGroup
|
|
||||||
name={'last_name'}
|
|
||||||
placeholder={intl.get('last_name')}
|
|
||||||
className={classNames('input-group--last-name')}
|
|
||||||
/>
|
|
||||||
</ControlGroup>
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
{/*----------- Company Name -----------*/}
|
|
||||||
<FFormGroup
|
|
||||||
name={'company_name'}
|
|
||||||
className={classNames('form-group--company_name')}
|
|
||||||
label={<T id={'company_name'} />}
|
|
||||||
inline={true}
|
|
||||||
>
|
|
||||||
<FInputGroup name={'company_name'} />
|
|
||||||
</FFormGroup>
|
|
||||||
|
|
||||||
{/*----------- Display Name -----------*/}
|
|
||||||
<FFormGroup
|
|
||||||
name={'display_name'}
|
|
||||||
label={
|
|
||||||
<>
|
|
||||||
<T id={'display_name'} />
|
|
||||||
<FieldRequiredHint />
|
|
||||||
<Hint />
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
fastField
|
|
||||||
inline
|
|
||||||
>
|
|
||||||
<DisplayNameList
|
|
||||||
name={'display_name'}
|
|
||||||
popoverProps={{ minimal: true }}
|
|
||||||
/>
|
|
||||||
</FFormGroup>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -19,8 +19,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'country'} />}
|
label={<T id={'country'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'shipping_address_country'} fill />
|
<FInputGroup name={'shipping_address_country'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -28,8 +29,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'address_line_1'} />}
|
label={<T id={'address_line_1'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FTextArea name={'shipping_address1'} fill />
|
<FTextArea name={'shipping_address1'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -37,8 +39,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'address_line_2'} />}
|
label={<T id={'address_line_2'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FTextArea name={'shipping_address2'} fill />
|
<FTextArea name={'shipping_address2'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -46,8 +49,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'city_town'} />}
|
label={<T id={'city_town'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'shipping_address_city'} fill />
|
<FInputGroup name={'shipping_address_city'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -55,8 +59,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'state'} />}
|
label={<T id={'state'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'shipping_address_state'} fill />
|
<FInputGroup name={'shipping_address_state'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -64,8 +69,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'zip_code'} />}
|
label={<T id={'zip_code'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'shipping_address_postcode'} fill />
|
<FInputGroup name={'shipping_address_postcode'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
|
|
||||||
<FFormGroup
|
<FFormGroup
|
||||||
@@ -73,8 +79,9 @@ export function VendorShippingAddress() {
|
|||||||
label={<T id={'phone'} />}
|
label={<T id={'phone'} />}
|
||||||
inline
|
inline
|
||||||
fill
|
fill
|
||||||
|
fastField
|
||||||
>
|
>
|
||||||
<FInputGroup name={'shipping_address_phone'} fill />
|
<FInputGroup name={'shipping_address_phone'} fill fastField />
|
||||||
</FFormGroup>
|
</FFormGroup>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
// @ts-nocheck
|
|
||||||
import React from 'react';
|
|
||||||
import intl from 'react-intl-universal';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
import { Tabs, Tab } from '@blueprintjs/core';
|
|
||||||
import { CLASSES } from '@/constants/classes';
|
|
||||||
|
|
||||||
import { VendorFinanicalPanelTab } from './VendorFinanicalPanelTab';
|
|
||||||
|
|
||||||
import CustomerAddressTabs from '@/containers/Customers/CustomerForm/CustomerAddressTabs';
|
|
||||||
import CustomerNotePanel from '@/containers/Customers/CustomerForm/CustomerNotePanel';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vendor form tabs.
|
|
||||||
*/
|
|
||||||
export function VendorsTabs() {
|
|
||||||
return (
|
|
||||||
<div className={classNames(CLASSES.PAGE_FORM_TABS)}>
|
|
||||||
<Tabs
|
|
||||||
animate={true}
|
|
||||||
id={'vendor-tabs'}
|
|
||||||
large={true}
|
|
||||||
defaultSelectedTabId="financial"
|
|
||||||
>
|
|
||||||
<Tab
|
|
||||||
id={'financial'}
|
|
||||||
title={intl.get('financial_details')}
|
|
||||||
panel={<VendorFinanicalPanelTab />}
|
|
||||||
/>
|
|
||||||
<Tab
|
|
||||||
id={'address'}
|
|
||||||
title={intl.get('address')}
|
|
||||||
panel={<CustomerAddressTabs />}
|
|
||||||
/>
|
|
||||||
<Tab
|
|
||||||
id="notes"
|
|
||||||
title={intl.get('notes')}
|
|
||||||
panel={<CustomerNotePanel />}
|
|
||||||
/>
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user