{
mergeCompanies
};
- return (
- {
- return ;
- }}
- refetch={() => {
- this.props.companiesMainQuery.refetch();
- }}
- />
- );
+ const companiesList = props => {
+ return ;
+ };
+
+ const refetch = () => {
+ this.props.companiesMainQuery.refetch();
+ };
+
+ return ;
}
}
diff --git a/src/modules/companies/routes.tsx b/src/modules/companies/routes.tsx
index 8b74eb3b6..f41be3f7e 100755
--- a/src/modules/companies/routes.tsx
+++ b/src/modules/companies/routes.tsx
@@ -3,30 +3,32 @@ import * as React from 'react';
import { Route } from 'react-router-dom';
import { CompaniesList, CompanyDetails } from './containers';
-const routes = () => (
-
- {
- const queryParams = queryString.parse(location.search);
- const id = match.params.id;
+const routes = () => {
+ const details = ({ match, location }) => {
+ const queryParams = queryString.parse(location.search);
+ const id = match.params.id;
- return ;
- }}
- />
+ return ;
+ };
- {
- const queryParams = queryString.parse(location.search);
- return ;
- }}
- />
-
-);
+ const list = ({ location }) => {
+ const queryParams = queryString.parse(location.search);
+
+ return ;
+ };
+
+ return (
+
+
+
+
+
+ );
+};
export default routes;
diff --git a/src/modules/customers/components/common/ActionSection.tsx b/src/modules/customers/components/common/ActionSection.tsx
index 5669d49ef..bbc8b646f 100644
--- a/src/modules/customers/components/common/ActionSection.tsx
+++ b/src/modules/customers/components/common/ActionSection.tsx
@@ -38,6 +38,23 @@ class ActionSection extends React.Component {
render() {
const { customer, remove, merge } = this.props;
+ const customerForm = props => {
+ return ;
+ };
+
+ const generateOptions = customers => {
+ return customers.map((cus, key) => ({
+ key,
+ value: JSON.stringify(cus),
+ label:
+ cus.firstName ||
+ cus.lastName ||
+ cus.primaryEmail ||
+ cus.primaryPhone ||
+ 'N/A'
+ }));
+ };
+
return (
{this.renderButton()}
@@ -46,14 +63,12 @@ class ActionSection extends React.Component {
confirm().then(() => remove())}>
+ remove())}>
{__('Edit')}
}
size="lg"
- content={props => (
-
- )}
+ content={customerForm}
/>
@@ -62,22 +77,13 @@ class ActionSection extends React.Component {
object={customer}
searchObject={searchCustomer}
mergeForm={CustomersMerge}
- generateOptions={customers => {
- return customers.map((cus, key) => ({
- key,
- value: JSON.stringify(cus),
- label:
- cus.firstName ||
- cus.lastName ||
- cus.primaryEmail ||
- cus.primaryPhone ||
- 'N/A'
- }));
- }}
+ generateOptions={generateOptions}
/>
- confirm().then(() => remove())}>{__('Delete')}
+ remove())}>
+ {__('Delete')}
+
diff --git a/src/modules/customers/components/common/CustomerSection.tsx b/src/modules/customers/components/common/CustomerSection.tsx
index 9cd51fefa..6b90f25b9 100644
--- a/src/modules/customers/components/common/CustomerSection.tsx
+++ b/src/modules/customers/components/common/CustomerSection.tsx
@@ -57,6 +57,16 @@ function CustomerSection({ name, customers, onSelect }: Props) {
);
};
+ const customerChooser = props => {
+ return (
+
+ );
+ };
+
return (
{__('Customers')}
@@ -70,13 +80,7 @@ function CustomerSection({ name, customers, onSelect }: Props) {
}
- content={props => (
-
- )}
+ content={customerChooser}
/>
diff --git a/src/modules/customers/components/common/InfoSection.tsx b/src/modules/customers/components/common/InfoSection.tsx
index 1c272621e..fde0d9089 100644
--- a/src/modules/customers/components/common/InfoSection.tsx
+++ b/src/modules/customers/components/common/InfoSection.tsx
@@ -65,6 +65,10 @@ class InfoSection extends React.Component {
const { customer } = this.props;
const { links = {}, isUser } = customer;
+ const customerForm = props => {
+ return ;
+ };
+
return (
@@ -83,9 +87,7 @@ class InfoSection extends React.Component {
title="Edit basic info"
trigger={}
size="lg"
- content={props => (
-
- )}
+ content={customerForm}
/>
);
diff --git a/src/modules/customers/components/common/TargetMerge.tsx b/src/modules/customers/components/common/TargetMerge.tsx
index 9a7fe92e0..9e5903c3f 100644
--- a/src/modules/customers/components/common/TargetMerge.tsx
+++ b/src/modules/customers/components/common/TargetMerge.tsx
@@ -31,7 +31,11 @@ class TargetMergeModal extends React.Component {
}
handleSearch(value) {
- this.props.searchObject(value, objects => this.setState({ objects }));
+ const { objects } = this.state;
+
+ if (objects.length < 1) {
+ this.props.searchObject(value, objs => this.setState({ objects: objs }));
+ }
}
onSelect(option) {
@@ -65,7 +69,7 @@ class TargetMergeModal extends React.Component {
|