feat (lang): preference.

This commit is contained in:
elforjani3
2021-06-07 11:58:48 +02:00
parent 05528395c1
commit c6eadaca09
6 changed files with 68 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { Menu, MenuItem, MenuDivider } from '@blueprintjs/core'; import { Menu, MenuItem, MenuDivider } from '@blueprintjs/core';
import { useHistory, useLocation } from 'react-router-dom'; import { useHistory, useLocation } from 'react-router-dom';
import { FormattedMessage as T } from 'react-intl';
import preferencesMenu from 'config/preferencesMenu'; import preferencesMenu from 'config/preferencesMenu';
import PreferencesSidebarContainer from './PreferencesSidebarContainer'; import PreferencesSidebarContainer from './PreferencesSidebarContainer';
@@ -32,7 +33,7 @@ export default function PreferencesSidebar() {
return ( return (
<PreferencesSidebarContainer> <PreferencesSidebarContainer>
<div class="preferences-sidebar__head"> <div class="preferences-sidebar__head">
<h2>Preferences</h2> <h2>{<T id={'preferences'} />}</h2>
</div> </div>
<Menu className="preferences-sidebar__menu">{items}</Menu> <Menu className="preferences-sidebar__menu">{items}</Menu>

View File

@@ -48,7 +48,11 @@ export default function AccountantForm() {
<FormGroup inline={true}> <FormGroup inline={true}>
<Checkbox <Checkbox
inline={true} inline={true}
label={'Make account code required when create a new accounts.'} label={
<T
id={'make_account_code_required_when_create_a_new_accounts'}
/>
}
name={'account_code_required'} name={'account_code_required'}
{...field} {...field}
/> />
@@ -62,7 +66,11 @@ export default function AccountantForm() {
<Checkbox <Checkbox
inline={true} inline={true}
label={ label={
'Should account code be unique when create a new account.' <T
id={
'should_account_code_be_unique_when_create_a_new_account'
}
/>
} }
name={'account_code_unique'} name={'account_code_unique'}
{...field} {...field}
@@ -115,7 +123,11 @@ export default function AccountantForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it after customer make payment.' <T
id={
'select_a_preferred_account_to_deposit_into_it_after_customer_make_payment'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
@@ -147,7 +159,11 @@ export default function AccountantForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it after customer make payment.' <T
id={
'select_a_preferred_account_to_deposit_into_it_after_customer_make_payment'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
@@ -178,7 +194,11 @@ export default function AccountantForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it vendor advanced deposits.' <T
id={
'select_a_preferred_account_to_deposit_into_it_vendor_advanced_deposits'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}

View File

@@ -44,7 +44,7 @@ export default function PreferencesGeneralForm({}) {
inline={true} inline={true}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={'form-group--org-name'} className={'form-group--org-name'}
helperText={'Shown on sales forms and purchase orders.'} helperText={<T id={'shown_on_sales_forms_and_purchase_orders'} />}
> >
<InputGroup medium={'true'} {...field} /> <InputGroup medium={'true'} {...field} />
</FormGroup> </FormGroup>
@@ -59,9 +59,7 @@ export default function PreferencesGeneralForm({}) {
inline={true} inline={true}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
className={classNames('form-group--select-list', CLASSES.FILL)} className={classNames('form-group--select-list', CLASSES.FILL)}
helperText={ helperText={<T id={'for_reporting_you_can_specify_any_month'} />}
'For reporting, you can specify any month as the start of your financial year (also called your financial reporting year or accounting year).'
}
> >
<DateInput <DateInput
{...momentFormatter('MMMM Do YYYY')} {...momentFormatter('MMMM Do YYYY')}
@@ -125,7 +123,11 @@ export default function PreferencesGeneralForm({}) {
inline={true} inline={true}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
helperText={ helperText={
"You can't change the base currency as there are transactions recorded in your organization." <T
id={
'you_can_t_change_the_base_currency_as_there_are_transactions'
}
/>
} }
> >
<ListSelect <ListSelect

View File

@@ -38,7 +38,11 @@ export default function ItemForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it after customer make payment.' <T
id={
'select_a_preferred_account_to_deposit_into_it_after_customer_make_payment'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
@@ -70,7 +74,11 @@ export default function ItemForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it after customer make payment.' <T
id={
'select_a_preferred_account_to_deposit_into_it_after_customer_make_payment'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}
@@ -102,7 +110,11 @@ export default function ItemForm() {
</strong> </strong>
} }
helperText={ helperText={
'Select a preferred account to deposit into it vendor advanced deposits.' <T
id={
'select_a_preferred_account_to_deposit_into_it_vendor_advanced_deposits'
}
/>
} }
labelInfo={<FieldRequiredHint />} labelInfo={<FieldRequiredHint />}
intent={inputIntent({ error, touched })} intent={inputIntent({ error, touched })}

View File

@@ -1,8 +1,9 @@
import React from 'react'; import React from 'react';
import { Tabs, Tab } from '@blueprintjs/core'; import { Tabs, Tab } from '@blueprintjs/core';
import { formatMessage } from 'services/intl';
import classNames from 'classnames'; import classNames from 'classnames';
import 'style/pages/Preferences/Users.scss' import 'style/pages/Preferences/Users.scss';
import { CLASSES } from 'common/classes'; import { CLASSES } from 'common/classes';
import PreferencesSubContent from 'components/Preferences/PreferencesSubContent'; import PreferencesSubContent from 'components/Preferences/PreferencesSubContent';
@@ -16,15 +17,17 @@ function UsersPreferences({ openDialog }) {
const onChangeTabs = (currentTabId) => {}; const onChangeTabs = (currentTabId) => {};
return ( return (
<div className={classNames( <div
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT, className={classNames(
CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_USERS, CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT,
)}> CLASSES.PREFERENCES_PAGE_INSIDE_CONTENT_USERS,
)}
>
<div className={classNames(CLASSES.CARD)}> <div className={classNames(CLASSES.CARD)}>
<div className={classNames(CLASSES.PREFERENCES_PAGE_TABS)}> <div className={classNames(CLASSES.PREFERENCES_PAGE_TABS)}>
<Tabs animate={true} onChange={onChangeTabs}> <Tabs animate={true} onChange={onChangeTabs}>
<Tab id="users" title="Users" /> <Tab id="users" title={formatMessage({ id: 'users' })} />
<Tab id="roles" title="Roles" /> <Tab id="roles" title={formatMessage({ id: 'roles' })} />
</Tabs> </Tabs>
</div> </div>
<PreferencesSubContent preferenceTab="users" /> <PreferencesSubContent preferenceTab="users" />

View File

@@ -973,6 +973,14 @@
"summerize_how_much_each_customer_owes_your_business":"Summarize how much each customer owes your business.", "summerize_how_much_each_customer_owes_your_business":"Summarize how much each customer owes your business.",
"duplicate_customer":"Duplicate customer", "duplicate_customer":"Duplicate customer",
"duplicate_vendor":"Duplicate vendor", "duplicate_vendor":"Duplicate vendor",
"new_billing":"New Billing" "new_billing":"New Billing",
"shown_on_sales_forms_and_purchase_orders":"Shown on sales forms and purchase orders.",
"for_reporting_you_can_specify_any_month":"For reporting, you can specify any month as the start of your financial year (also called your financial reporting year or accounting year).",
"you_can_t_change_the_base_currency_as_there_are_transactions":"You can't change the base currency as there are transactions recorded in your organization.",
"make_account_code_required_when_create_a_new_accounts":"Make account code required when create a new accounts.",
"should_account_code_be_unique_when_create_a_new_account":"Should account code be unique when create a new account.",
"select_a_preferred_account_to_deposit_into_it_after_customer_make_payment":"Select a preferred account to deposit into it after customer make payment.",
"select_a_preferred_account_to_deposit_into_it_vendor_advanced_deposits":"Select a preferred account to deposit into it vendor advanced deposits.",
"roles":"Roles"
} }