Added referral source to bodyshop + form. BOD-158
This commit is contained in:
@@ -1,46 +1,66 @@
|
||||
import { Form, Input, InputNumber, Switch } from "antd";
|
||||
import { Form, Input, InputNumber, Switch, Select } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import FormRow from "../layout-form-row/layout-form-row.component";
|
||||
|
||||
export default function JobsDetailClaims({ job }) {
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
|
||||
export function JobsDetailClaims({ bodyshop, job }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<FormRow>
|
||||
<Form.Item label={t("jobs.fields.csr")} name='csr'>
|
||||
<Form.Item label={t("jobs.fields.csr")} name="csr">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.ponumber")} name='po_number'>
|
||||
<Form.Item label={t("jobs.fields.ponumber")} name="po_number">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.unitnumber")} name='unit_number'>
|
||||
<Form.Item label={t("jobs.fields.unitnumber")} name="unit_number">
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.kmin")} name='kmin'>
|
||||
<Form.Item label={t("jobs.fields.kmin")} name="kmin">
|
||||
<InputNumber precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("jobs.fields.kmout")} name='kmout'>
|
||||
<Form.Item label={t("jobs.fields.kmout")} name="kmout">
|
||||
<InputNumber precision={1} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.exempt")}
|
||||
valuePropName='checked'
|
||||
name='exempt'>
|
||||
valuePropName="checked"
|
||||
name="exempt"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("jobs.fields.specialcoveragepolicy")}
|
||||
valuePropName='checked'
|
||||
name='special_coverage_policy'>
|
||||
valuePropName="checked"
|
||||
name="special_coverage_policy"
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
</FormRow>
|
||||
|
||||
<Form.Item label={t("jobs.fields.referralsource")} name='referral_source'>
|
||||
<Input />
|
||||
<Form.Item label={t("jobs.fields.referralsource")} name="referral_source">
|
||||
<Select>
|
||||
{bodyshop.md_referral_sources.map((s) => (
|
||||
<Select.Option key={s} value={s}>
|
||||
{s}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailClaims);
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import React from "react";
|
||||
import { Form, Input, Button, Collapse, InputNumber, Radio } from "antd";
|
||||
import {
|
||||
Form,
|
||||
Input,
|
||||
Button,
|
||||
Collapse,
|
||||
InputNumber,
|
||||
Radio,
|
||||
Select,
|
||||
} from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import ShopInfoROStatusComponent from "./shop-info.rostatus.component";
|
||||
import ShopInfoOrderStatusComponent from "./shop-info.orderstatus.component";
|
||||
@@ -179,6 +187,20 @@ export default function ShopInfoComponent({ form }) {
|
||||
);
|
||||
}}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name={["md_referral_sources"]}
|
||||
label={t("bodyshop.fields.md_referral_sources")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
type: "array",
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select mode="tags" />
|
||||
</Form.Item>
|
||||
</Collapse.Panel>
|
||||
<Collapse.Panel
|
||||
key="roStatus"
|
||||
|
||||
@@ -34,6 +34,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
@@ -86,6 +87,7 @@ export const UPDATE_SHOP = gql`
|
||||
stripe_acct_id
|
||||
ssbuckets
|
||||
scoreboard_target
|
||||
md_referral_sources
|
||||
employees {
|
||||
id
|
||||
first_name
|
||||
|
||||
@@ -13,7 +13,7 @@ import rootSaga from "./root.saga";
|
||||
const sagaMiddleWare = createSagaMiddleware();
|
||||
|
||||
const reduxSyncConfig = {
|
||||
whitelist: ["ADD_RECENT_ITEM"],
|
||||
whitelist: ["ADD_RECENT_ITEM", "SET_SHOP_DETAILS"],
|
||||
};
|
||||
|
||||
const middlewares = [
|
||||
|
||||
Reference in New Issue
Block a user