Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f0700b5e5 | ||
|
|
48348da663 | ||
|
|
b32abc0417 |
@@ -3,6 +3,7 @@ import { MenuItem, Button } from '@blueprintjs/core';
|
||||
import { Select } from '@blueprintjs/select';
|
||||
import * as R from 'ramda';
|
||||
import classNames from 'classnames';
|
||||
import intl from 'react-intl-universal'
|
||||
|
||||
import { MenuItemNestedText, FormattedMessage as T } from 'components';
|
||||
import { filterAccountsByQuery } from './utils';
|
||||
@@ -16,7 +17,7 @@ const createNewItemRenderer = (query, active, handleClick) => {
|
||||
return (
|
||||
<MenuItem
|
||||
icon="add"
|
||||
text={`Create "${query}"`}
|
||||
text={intl.get('list.create', { value: `"${query}"` })}
|
||||
active={active}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
|
||||
@@ -18,7 +18,7 @@ const createNewItemRenderer = (query, active, handleClick) => {
|
||||
return (
|
||||
<MenuItem
|
||||
icon="add"
|
||||
text={`Create "${query}"`}
|
||||
text={intl.get('list.create', { value: `"${query}"` })}
|
||||
active={active}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
|
||||
// Filter Contact List
|
||||
@@ -34,7 +35,7 @@ export const createNewItemRenderer = (query, active, handleClick) => {
|
||||
return (
|
||||
<MenuItem
|
||||
icon="add"
|
||||
text={`Create "${query}"`}
|
||||
text={intl.get('list.create', { value: `"${query}"` })}
|
||||
active={active}
|
||||
shouldDismissPopover={false}
|
||||
onClick={handleClick}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { MenuItem } from '@blueprintjs/core';
|
||||
import { Suggest } from '@blueprintjs/select';
|
||||
import classNames from 'classnames';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import intl from 'react-intl-universal';
|
||||
import { CLASSES } from 'common/classes';
|
||||
|
||||
import { FormattedMessage as T } from 'components';
|
||||
@@ -24,7 +24,7 @@ const createNewItemRenderer = (query, active, handleClick) => {
|
||||
return (
|
||||
<MenuItem
|
||||
icon="add"
|
||||
text={`Create "${query}"`}
|
||||
text={intl.get('list.create', { value: `"${query}"` })}
|
||||
active={active}
|
||||
shouldDismissPopover={false}
|
||||
onClick={handleClick}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import * as R from 'ramda';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
export const transformApiErrors = (errors) => {
|
||||
const fields = {};
|
||||
@@ -42,12 +43,18 @@ const mergeWithAccount = R.curry((transformed, account) => {
|
||||
};
|
||||
});
|
||||
|
||||
/**
|
||||
* Default account payload transformer.
|
||||
*/
|
||||
const defaultPayloadTransform = () => ({});
|
||||
|
||||
/**
|
||||
* Defined payload transformers.
|
||||
*/
|
||||
function getConditions() {
|
||||
return [
|
||||
['edit', transformEditMode],
|
||||
['edit'],
|
||||
['new_child', transformEditMode],
|
||||
['NEW_ACCOUNT_DEFINED_TYPE', transformNewAccountDefinedType],
|
||||
];
|
||||
}
|
||||
@@ -59,9 +66,13 @@ export const transformAccountToForm = (account, payload) => {
|
||||
const conditions = getConditions();
|
||||
|
||||
const results = conditions.map((condition) => {
|
||||
const transformer = !isEmpty(condition[1])
|
||||
? condition[1]
|
||||
: defaultPayloadTransform;
|
||||
|
||||
return [
|
||||
condition[0] === payload.action ? R.T : R.F,
|
||||
mergeWithAccount(condition[1](payload)),
|
||||
mergeWithAccount(transformer(payload)),
|
||||
];
|
||||
});
|
||||
return R.cond(results)(account);
|
||||
|
||||
@@ -15,7 +15,8 @@ export default function QuickWriteVendorDrawerContent({ displayName }) {
|
||||
<React.Fragment>
|
||||
<DrawerHeaderContent
|
||||
name="quick-create-customer"
|
||||
title={"Create a new vendor"}
|
||||
title={<T id={'create_a_new_vendor'} />}
|
||||
|
||||
/>
|
||||
<DrawerBody>
|
||||
<QuickVendorFormDrawer displayName={displayName} />
|
||||
|
||||
@@ -1479,5 +1479,6 @@
|
||||
"sms_notification.estimate_details.type": "تفاصيل فاتورة عرض الاسعار",
|
||||
"sms_notification.payment_details.type": "شكر علي عملية الدفع",
|
||||
"sms_notification.receipt_details.type": "تفاصيل إيصال البيع",
|
||||
"personal": "المحمول"
|
||||
"personal": "المحمول",
|
||||
"list.create":"إضافة {value}"
|
||||
}
|
||||
@@ -1400,7 +1400,7 @@
|
||||
"cash_flow_drawer.label_transaction_type": "Transaction type",
|
||||
"cash_flow.drawer.label_transaction_no": "Transaction number",
|
||||
"cash_flow.drawer.label_transaction": "Cash flow Transaction {number}",
|
||||
"cash_flow.transactions.no_results": "There are no deposit/withdrawal transactions on the current account.",
|
||||
"cash_flow.account_transactions.no_results": "There are no deposit/withdrawal transactions on the current account.",
|
||||
"cash_flow_balance_in": "Balance in {name}",
|
||||
"cash_flow.accounts.no_results": "There are no cashflow accounts with current filter criteria.",
|
||||
"cash_flow_money_in": "Money In",
|
||||
@@ -1466,5 +1466,6 @@
|
||||
"sms_notification.estimate_details.type": "Sale estimate details",
|
||||
"sms_notification.payment_details.type": "Payment receive thank you.",
|
||||
"sms_notification.receipt_details.type": "Sale receipt details",
|
||||
"personal": "Personal"
|
||||
"personal": "Personal",
|
||||
"list.create":"Create {value}"
|
||||
}
|
||||
@@ -21,12 +21,12 @@ export default [
|
||||
loader: () => import('containers/Authentication/ResetPassword'),
|
||||
}),
|
||||
},
|
||||
// {
|
||||
// path: `${BASE_URL}/invite/:token/accept`,
|
||||
// component: LazyLoader({
|
||||
// loader: () => import('containers/Authentication/InviteAccept'),
|
||||
// }),
|
||||
// },
|
||||
{
|
||||
path: `${BASE_URL}/invite/:token/accept`,
|
||||
component: LazyLoader({
|
||||
loader: () => import('containers/Authentication/InviteAccept'),
|
||||
}),
|
||||
},
|
||||
{
|
||||
path: `${BASE_URL}/register`,
|
||||
component: LazyLoader({
|
||||
|
||||
Reference in New Issue
Block a user