feat (lang) : add Contacts & Sales & Purchases.

This commit is contained in:
elforjani3
2021-06-06 20:32:55 +02:00
parent 366404e1d6
commit a70fd300f2
26 changed files with 161 additions and 122 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react';
import Dragzone from 'components/Dragzone';
import { FormattedMessage as T } from 'react-intl';
/**
* Vendor Attahment Tab.
@@ -11,7 +12,7 @@ function VendorAttahmentTab() {
initialFiles={[]}
onDrop={null}
onDeleteFile={[]}
hint={'Attachments: Maxiumum size: 20MB'}
hint={<T id={'attachments_maximum'} />}
/>
</div>
);

View File

@@ -1,13 +1,15 @@
import React from 'react';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { inputIntent } from 'utils';
/**
* Vendor form after primary section.
*/
function VendorFormAfterPrimarySection() {
const { formatMessage } = useIntl();
return (
<div class="customer-form__after-primary-section-content">
{/*------------ Vendor email -----------*/}
@@ -36,7 +38,7 @@ function VendorFormAfterPrimarySection() {
{({ field, meta: { error, touched } }) => (
<InputGroup
intent={inputIntent({ error, touched })}
placeholder={'Work'}
placeholder={formatMessage({ id: 'work' })}
{...field}
/>
)}
@@ -45,7 +47,7 @@ function VendorFormAfterPrimarySection() {
{({ field, meta: { error, touched } }) => (
<InputGroup
intent={inputIntent({ error, touched })}
placeholder={'Mobile'}
placeholder={formatMessage({ id: 'Mobile' })}
{...field}
/>
)}

View File

@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { FormGroup, InputGroup, ControlGroup } from '@blueprintjs/core';
import { FastField, Field, ErrorMessage } from 'formik';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T, useIntl } from 'react-intl';
import {
Hint,
FieldRequiredHint,
@@ -20,6 +20,7 @@ import { useAutofocus } from 'hooks';
*/
function VendorFormPrimarySection() {
const firstNameFieldRef = useAutofocus();
const { formatMessage } = useIntl();
return (
<div className={'customer-form__primary-section-content'}>
@@ -51,7 +52,7 @@ function VendorFormPrimarySection() {
<FastField name={'first_name'}>
{({ field, meta: { error, touched } }) => (
<InputGroup
placeholder={'First Name'}
placeholder={formatMessage({ id: 'first_name' })}
intent={inputIntent({ error, touched })}
className={classNames('input-group--first-name')}
inputRef={(ref) => (firstNameFieldRef.current = ref)}
@@ -63,7 +64,7 @@ function VendorFormPrimarySection() {
<FastField name={'last_name'}>
{({ field, meta: { error, touched } }) => (
<InputGroup
placeholder={'Last Name'}
placeholder={formatMessage({ id: 'last_name' })}
intent={inputIntent({ error, touched })}
className={classNames('input-group--last-name')}
{...field}

View File

@@ -2,17 +2,17 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components';
import { FormattedMessage as T } from 'react-intl';
export default function VendorsEmptyStatus() {
const history = useHistory();
return (
<EmptyStatus
title={"Create and manage your organization's vendors."}
title={<T id={'create_and_manage_your_organization_s_vendors'} />}
description={
<p>
Here a list of your organization products and services, to be used
when you create invoices or bills to your customers or vendors.
<T id={'here_a_list_of_your_organization_products_and_services'} />
</p>
}
action={
@@ -24,11 +24,11 @@ export default function VendorsEmptyStatus() {
history.push('/vendors/new');
}}
>
New vendor
<T id={'new_vendor'} />
</Button>
<Button intent={Intent.NONE} large={true}>
Learn more
<T id={'learn_more'} />
</Button>
</>
}