Refactoring for 3tier setup BOD-83
This commit is contained in:
@@ -41,6 +41,7 @@ const wsLink = new WebSocketLink({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const subscriptionMiddleware = {
|
||||
applyMiddleware: async (options, next) => {
|
||||
options.authToken =
|
||||
@@ -118,7 +119,6 @@ export const client = new ApolloClient({
|
||||
export default class AppContainer extends Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.state = { client };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import { Form, Input, Button, Collapse, InputNumber } from "antd";
|
||||
import { Form, Input, Button, Collapse, InputNumber, Radio } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ShopInfoROStatusComponent from "./shop-info.rostatus.component";
|
||||
import ShopInfoOrderStatusComponent from "./shop-info.orderstatus.component";
|
||||
@@ -9,95 +9,126 @@ export default function ShopInfoComponent({ form }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Button type="primary" htmlType="submit">
|
||||
<Button type='primary' htmlType='submit'>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
<Collapse defaultActiveKey="shopinfo">
|
||||
<Collapse.Panel key="shopinfo" header={t("bodyshop.labels.shopinfo")}>
|
||||
<Form.Item label={t("bodyshop.fields.shopname")} name="shopname">
|
||||
<Collapse defaultActiveKey='shopinfo'>
|
||||
<Collapse.Panel key='shopinfo' header={t("bodyshop.labels.shopinfo")}>
|
||||
<Form.Item label={t("bodyshop.fields.shopname")} name='shopname'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.address1")} name="address1">
|
||||
<Form.Item label={t("bodyshop.fields.address1")} name='address1'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label={t("bodyshop.fields.address2")} name="address2">
|
||||
<Form.Item label={t("bodyshop.fields.address2")} name='address2'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.city")} name="city">
|
||||
<Form.Item label={t("bodyshop.fields.city")} name='city'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.state")} name="state">
|
||||
<Form.Item label={t("bodyshop.fields.state")} name='state'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.zip_post")} name="zip_post">
|
||||
<Form.Item label={t("bodyshop.fields.zip_post")} name='zip_post'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.country")} name="country">
|
||||
<Form.Item label={t("bodyshop.fields.country")} name='country'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
||||
<Form.Item label={t("bodyshop.fields.email")} name='email'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.federal_tax_id")}
|
||||
name="federal_tax_id"
|
||||
>
|
||||
name='federal_tax_id'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.insurance_vendor_id")}
|
||||
name="insurance_vendor_id"
|
||||
>
|
||||
name='insurance_vendor_id'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.logo_img_path")}
|
||||
name="logo_img_path"
|
||||
>
|
||||
name='logo_img_path'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.state_tax_id")}
|
||||
name="state_tax_id"
|
||||
>
|
||||
name='state_tax_id'>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.invoice_federal_tax_rate")}
|
||||
name={["invoice_tax_rates", "federal_tax_rate"]}
|
||||
>
|
||||
name={["invoice_tax_rates", "federal_tax_rate"]}>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.invoice_state_tax_rate")}
|
||||
name={["invoice_tax_rates", "state_tax_rate"]}
|
||||
>
|
||||
name={["invoice_tax_rates", "state_tax_rate"]}>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.invoice_local_tax_rate")}
|
||||
name={["invoice_tax_rates", "local_tax_rate"]}
|
||||
>
|
||||
name={["invoice_tax_rates", "local_tax_rate"]}>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.labels.accountingtiers")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={["accountingconfig", "tiers"]}>
|
||||
<Radio.Group>
|
||||
<Radio value={2}>2</Radio>
|
||||
<Radio value={3}>3</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
<Form.Item shouldUpdate>
|
||||
{() => {
|
||||
return (
|
||||
<Form.Item
|
||||
label={t("bodyshop.labels.2tiersetup")}
|
||||
shouldUpdate
|
||||
rules={[
|
||||
{
|
||||
required:
|
||||
form.getFieldValue(["accountingconfig", "tiers"]) === 2,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={["accountingconfig", "twotierpref"]}>
|
||||
<Radio.Group
|
||||
disabled={
|
||||
form.getFieldValue(["accountingconfig", "tiers"]) === 3
|
||||
}>
|
||||
<Radio value='name'>{t("bodyshop.labels.2tiername")}</Radio>
|
||||
<Radio value='source'>
|
||||
{t("bodyshop.labels.2tiersource")}
|
||||
</Radio>
|
||||
</Radio.Group>
|
||||
</Form.Item>
|
||||
);
|
||||
}}
|
||||
</Form.Item>
|
||||
</Collapse.Panel>
|
||||
<Collapse.Panel
|
||||
key="roStatus"
|
||||
header={t("bodyshop.labels.jobstatuses")}
|
||||
>
|
||||
key='roStatus'
|
||||
header={t("bodyshop.labels.jobstatuses")}>
|
||||
<ShopInfoROStatusComponent form={form} />
|
||||
</Collapse.Panel>
|
||||
<Collapse.Panel
|
||||
key="orderStatus"
|
||||
header={t("bodyshop.labels.orderstatuses")}
|
||||
>
|
||||
key='orderStatus'
|
||||
header={t("bodyshop.labels.orderstatuses")}>
|
||||
<ShopInfoOrderStatusComponent form={form} />
|
||||
</Collapse.Panel>
|
||||
<Collapse.Panel
|
||||
key="responsibilityCenters"
|
||||
header={t("bodyshop.labels.responsibilitycenters.title")}
|
||||
>
|
||||
key='responsibilityCenters'
|
||||
header={t("bodyshop.labels.responsibilitycenters.title")}>
|
||||
<ShopInfoResponsibilityCenterComponent form={form} />
|
||||
</Collapse.Panel>
|
||||
</Collapse>
|
||||
|
||||
@@ -29,6 +29,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
production_config
|
||||
invoice_tax_rates
|
||||
inhousevendorid
|
||||
accountingconfig
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import queryString from "query-string";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
@@ -14,7 +14,7 @@ import { selectInstanceConflict } from "../../redux/user/user.selectors";
|
||||
import HeaderContainer from "../../components/header/header.container";
|
||||
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
|
||||
import PrintCenterModalContainer from "../../components/print-center-modal/print-center-modal.container";
|
||||
import ConflictComponent from '../../components/conflict/conflict.component'
|
||||
import ConflictComponent from "../../components/conflict/conflict.component";
|
||||
|
||||
import "./manage.page.styles.scss";
|
||||
const ManageRootPage = lazy(() =>
|
||||
@@ -118,9 +118,8 @@ export function Manage({ match, conflict }) {
|
||||
</Header>
|
||||
<Layout>
|
||||
<Content
|
||||
className="content-container"
|
||||
style={{ padding: "0em 4em 4em" }}
|
||||
>
|
||||
className='content-container'
|
||||
style={{ padding: "0em 4em 4em" }}>
|
||||
<FcmNotification />
|
||||
<ErrorBoundary>
|
||||
{conflict ? (
|
||||
@@ -129,8 +128,7 @@ export function Manage({ match, conflict }) {
|
||||
<Suspense
|
||||
fallback={
|
||||
<LoadingSpinner message={t("general.labels.loadingapp")} />
|
||||
}
|
||||
>
|
||||
}>
|
||||
<BreadCrumbs />
|
||||
<EnterInvoiceModalContainer />
|
||||
<EmailOverlayContainer />
|
||||
|
||||
@@ -142,6 +142,10 @@
|
||||
"zip_post": "Zip/Postal Code"
|
||||
},
|
||||
"labels": {
|
||||
"2tiername": "Name => RO",
|
||||
"2tiersetup": "2 Tier Setup",
|
||||
"2tiersource": "Source => RO",
|
||||
"accountingtiers": "Number of Tiers to Use for Export",
|
||||
"alljobstatuses": "All Job Statuses",
|
||||
"allopenjobstatuses": "All Open Job Statuses",
|
||||
"customtemplates": "Custom Templates",
|
||||
|
||||
@@ -142,6 +142,10 @@
|
||||
"zip_post": ""
|
||||
},
|
||||
"labels": {
|
||||
"2tiername": "",
|
||||
"2tiersetup": "",
|
||||
"2tiersource": "",
|
||||
"accountingtiers": "",
|
||||
"alljobstatuses": "",
|
||||
"allopenjobstatuses": "",
|
||||
"customtemplates": "",
|
||||
|
||||
@@ -142,6 +142,10 @@
|
||||
"zip_post": ""
|
||||
},
|
||||
"labels": {
|
||||
"2tiername": "",
|
||||
"2tiersetup": "",
|
||||
"2tiersource": "",
|
||||
"accountingtiers": "",
|
||||
"alljobstatuses": "",
|
||||
"allopenjobstatuses": "",
|
||||
"customtemplates": "",
|
||||
|
||||
Reference in New Issue
Block a user