diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 50edb75af..cd6dec3d9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -17452,6 +17452,27 @@ + + receiveinvoice + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index f63a7586f..3d002b53e 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -15,6 +15,11 @@ import GlobalLoadingBar from "../components/global-loading-bar/global-loading-ba import { auth } from "../firebase/firebase.utils"; import errorLink from "../graphql/apollo-error-handling"; import App from "./App"; +import { ConfigProvider } from "antd"; +import enLocale from "antd/es/locale/en_US"; +import moment from "moment"; + +moment.locale("en-US"); if (process.env.NODE_ENV === "production") LogRocket.init("gvfvfw/bodyshopapp"); @@ -124,8 +129,14 @@ export const client = new ApolloClient({ export default function AppContainer() { return ( - - + + + + ); } diff --git a/client/src/components/_test/test.component.jsx b/client/src/components/_test/test.component.jsx index ab74456b6..e32ebc2c9 100644 --- a/client/src/components/_test/test.component.jsx +++ b/client/src/components/_test/test.component.jsx @@ -1,6 +1,6 @@ import { PaymentRequestButtonElement, - useStripe, + useStripe } from "@stripe/react-stripe-js"; import React, { useEffect, useState } from "react"; import { connect } from "react-redux"; @@ -9,8 +9,6 @@ import { logImEXEvent } from "../../firebase/firebase.utils"; import { setEmailOptions } from "../../redux/email/email.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; import { TemplateList } from "../../utils/TemplateConstants"; -import { Input, InputNumber, Popover } from "antd"; -import { isInteger } from "lodash"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -20,8 +18,6 @@ const mapDispatchToProps = (dispatch) => ({ setEmailOptions: (e) => dispatch(setEmailOptions(e)), }); - - function Test({ bodyshop, setEmailOptions }) { const stripe = useStripe(); @@ -48,18 +44,17 @@ function Test({ bodyshop, setEmailOptions }) { // var details = { // total: { label: "", amount: { currency: "CAD", value: "0.00" } }, // }; - // new PaymentRequest( - // [{ supportedMethods: ["basic-card"] }], - // {} - // // details - // ).show(); + new PaymentRequest( + [{ supportedMethods: ["basic-card"] }], + {} + // details + ).show(); } }); } }, [stripe]); if (paymentRequest) { - return (
diff --git a/client/src/components/contract-form/contract-form.component.jsx b/client/src/components/contract-form/contract-form.component.jsx index ffd7ff00d..9c24cbecc 100644 --- a/client/src/components/contract-form/contract-form.component.jsx +++ b/client/src/components/contract-form/contract-form.component.jsx @@ -1,11 +1,11 @@ -import { DatePicker, Form, Input, InputNumber } from "antd"; +import { Form, Input, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import ContractStatusSelector from "../contract-status-select/contract-status-select.component"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component"; import InputPhone from "../form-items-formatted/phone-form-item.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; - export default function ContractFormComponent({ form }) { const { t } = useTranslation(); return ( @@ -36,7 +36,7 @@ export default function ContractFormComponent({ form }) { }, ]} > - + - + - + @@ -98,7 +98,7 @@ export default function ContractFormComponent({ form }) { }, ]} > - + - + diff --git a/client/src/components/contract-status-select/contract-status-select.component.jsx b/client/src/components/contract-status-select/contract-status-select.component.jsx index 885b1556a..5d675e6fd 100644 --- a/client/src/components/contract-status-select/contract-status-select.component.jsx +++ b/client/src/components/contract-status-select/contract-status-select.component.jsx @@ -14,7 +14,7 @@ const ContractStatusComponent = ( if (value !== option && onChange) { onChange(option); } - }, [option, onChange]); + }, [value, option, onChange]); return ( @@ -182,7 +183,7 @@ export default function CourtesyCarCreateFormComponent({ form }) { }, ]} > - + - + diff --git a/client/src/components/courtesy-car-fuel-select/courtesy-car-fuel-select.component.jsx b/client/src/components/courtesy-car-fuel-select/courtesy-car-fuel-select.component.jsx index 07aa8df49..fa62ebe39 100644 --- a/client/src/components/courtesy-car-fuel-select/courtesy-car-fuel-select.component.jsx +++ b/client/src/components/courtesy-car-fuel-select/courtesy-car-fuel-select.component.jsx @@ -10,7 +10,7 @@ const CourtesyCarFuelComponent = ({ value = 100, onChange }, ref) => { if (value !== option && onChange) { onChange(option); } - }, [option, onChange]); + }, [value, option, onChange]); const marks = { 0: { diff --git a/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.component.jsx b/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.component.jsx index 1a516a9ad..7966c8093 100644 --- a/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.component.jsx +++ b/client/src/components/courtesy-car-return-modal/courtesy-car-return-modal.component.jsx @@ -1,7 +1,8 @@ -import { Form, DatePicker, InputNumber } from "antd"; +import { Form, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component"; +import FormDatePicker from '../form-date-picker/form-date-picker.component'; export default function CourtesyCarReturnModalComponent() { const { t } = useTranslation(); @@ -18,7 +19,7 @@ export default function CourtesyCarReturnModalComponent() { } ]} > - + { - const { t } = useTranslation(); +const dateFormat = "MM/DD/YYYY"; +const FormDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => { const handleChange = (newDate) => { if (value !== newDate && onChange) { onChange(newDate); @@ -23,9 +22,14 @@ const CustomDatePicker = ({ value, onChange, onBlur, ...restProps }, ref) => { return (
- +
); }; -export default forwardRef(CustomDatePicker); +export default forwardRef(FormDatePicker); diff --git a/client/src/components/form-input-number-calculator/form-input-number-calculator.component.jsx b/client/src/components/form-input-number-calculator/form-input-number-calculator.component.jsx index 1655ccb03..b3f8c35e7 100644 --- a/client/src/components/form-input-number-calculator/form-input-number-calculator.component.jsx +++ b/client/src/components/form-input-number-calculator/form-input-number-calculator.component.jsx @@ -50,7 +50,7 @@ const FormInputNUmberCalculator = ( useEffect(() => { if (value !== formValue && formOnChange) formOnChange(value); - }, [formOnChange, value]); + }, [formOnChange, formValue, value]); useEffect(() => { if (history.length > 2) { diff --git a/client/src/components/invoice-form/invoice-form.component.jsx b/client/src/components/invoice-form/invoice-form.component.jsx index be50940f3..33747887b 100644 --- a/client/src/components/invoice-form/invoice-form.component.jsx +++ b/client/src/components/invoice-form/invoice-form.component.jsx @@ -1,15 +1,8 @@ -import { - Button, - DatePicker, - Form, - Input, - Statistic, - Switch, - Upload, -} from "antd"; +import { Button, Form, Input, Statistic, Switch, Upload } from "antd"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import AlertComponent from "../alert/alert.component"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import JobSearchSelect from "../job-search-select/job-search-select.component"; import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component"; @@ -113,7 +106,7 @@ export default function InvoiceFormComponent({ }, ]} > - +
+ onSelect={onSelect} + > {t("invoicelines.labels.other")} @@ -42,14 +43,15 @@ const InvoiceLineSearchSelect = ( cost={item.act_price ? item.act_price : 0} part_type={item.part_type} line_desc={item.line_desc} - part_qty={item.part_qty}> - + part_qty={item.part_qty} + > + {item.line_desc} - {item.oem_partno} + {item.oem_partno} - + {item.act_price || 0} diff --git a/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx b/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx index 40b79a485..c01cba278 100644 --- a/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx +++ b/client/src/components/job-scoreboard-add-button/job-scoreboard-add-button.component.jsx @@ -1,18 +1,11 @@ import { useMutation } from "@apollo/react-hooks"; -import { - Button, - Card, - DatePicker, - Form, - InputNumber, - notification, - Popover, -} from "antd"; +import { Button, Card, Form, InputNumber, notification, Popover } from "antd"; import moment from "moment"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import { INSERT_SCOREBOARD_ENTRY } from "../../graphql/scoreboard.queries"; import { logImEXEvent } from "../../firebase/firebase.utils"; +import { INSERT_SCOREBOARD_ENTRY } from "../../graphql/scoreboard.queries"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; export default function ScoreboardAddButton({ job, ...otherBtnProps }) { const { t } = useTranslation(); @@ -49,44 +42,48 @@ export default function ScoreboardAddButton({ job, ...otherBtnProps }) {
+ initialValues={{}} + > - + ]} + > + + ]} + > + ]} + > -
diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 9c6461023..2029c51f5 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -14,7 +14,7 @@ const JobSearchSelect = ( if (value !== option && onChange) { onChange(option); } - }, [option, onChange]); + }, [value, option, onChange]); return ( - + diff --git a/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.new.component.jsx b/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.new.component.jsx index be7b471e2..39d1b8e26 100644 --- a/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.new.component.jsx +++ b/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.new.component.jsx @@ -1,7 +1,8 @@ -import { DatePicker, Form, Input, Checkbox } from "antd"; +import { Checkbox, Form, Input } from "antd"; import React, { useContext } from "react"; import { useTranslation } from "react-i18next"; import JobCreateContext from "../../pages/jobs-create/jobs-create.context"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; export default function JobsCreateVehicleInfoNewComponent() { @@ -22,10 +23,11 @@ export default function JobsCreateVehicleInfoNewComponent() { selectedid: null, }, }); - }}> + }} + > {t("jobs.labels.create.newvehicle")} - + + ]} + > @@ -48,7 +51,8 @@ export default function JobsCreateVehicleInfoNewComponent() { required: state.vehicle.new, message: t("general.validation.required"), }, - ]}> + ]} + > + ]} + > @@ -73,7 +78,8 @@ export default function JobsCreateVehicleInfoNewComponent() { required: state.vehicle.new, message: t("general.validation.required"), }, - ]}> + ]} + > + ]} + > @@ -98,7 +105,8 @@ export default function JobsCreateVehicleInfoNewComponent() { required: state.vehicle.new, message: t("general.validation.required"), }, - ]}> + ]} + > + ]} + > @@ -117,72 +126,84 @@ export default function JobsCreateVehicleInfoNewComponent() { + name={["vehicle", "data", "v_type"]} + > + name={["vehicle", "data", "v_trimcode"]} + > + name={["vehicle", "data", "v_tone"]} + > + name={["vehicle", "data", "v_bstyle"]} + > + name={["vehicle", "data", "v_stage"]} + > - + name={["vehicle", "data", "v_prod_dt"]} + > + + name={["vehicle", "data", "v_paint_codes"]} + > + name={["vehicle", "data", "v_options"]} + > + name={["vehicle", "data", "trim_color"]} + > + name={["vehicle", "data", "v_mldgcode"]} + > + name={["vehicle", "data", "v_makecode"]} + > + name={["vehicle", "data", "v_engine"]} + > @@ -190,7 +211,8 @@ export default function JobsCreateVehicleInfoNewComponent() { + name={["vehicle", "data", "v_cond"]} + > diff --git a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx b/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx index 7942b79ce..defe02ec8 100644 --- a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx +++ b/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx @@ -1,15 +1,14 @@ -import { Col, Form, Input, Row, Divider, Select } from "antd"; +import { Col, Divider, Form, Row, Select } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; -import CurrencyInput from "../form-items-formatted/currency-form-item.component"; -import JobTotalsTable from "../job-totals-table/job-totals-table.component"; -import FormRow from "../layout-form-row/layout-form-row.component"; -import CurrencyFormatter from "../../utils/CurrencyFormatter"; -import { DateTimeFormatter } from "../../utils/DateFormatter"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import FieldInputNumberCalculator from "../field-input-number-calculator/field-input-number-calculator.component"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; +import CurrencyInput from "../form-items-formatted/currency-form-item.component"; +import JobTotalsTable from "../job-totals-table/job-totals-table.component"; +import FormRow from "../layout-form-row/layout-form-row.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, diff --git a/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx b/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx index 89dbd8792..6c2694a5a 100644 --- a/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx +++ b/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx @@ -1,6 +1,7 @@ -import { DatePicker, Form, Input } from "antd"; +import { Form, Input } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; import FormItemPhone from "../form-items-formatted/phone-form-item.component"; import Car from "../job-damage-visual/job-damage-visual.component"; @@ -13,47 +14,48 @@ export default function JobsDetailInsurance({ job, form }) { return (
- + - + - + - + - + - + - + + ]} + > - + - + - + @@ -68,60 +70,65 @@ export default function JobsDetailInsurance({ job, form }) { t("jobs.errors.nodamage") )}
- + - - + + - + - + - + - + + ]} + > - - + + + name="selling_dealer" + > + name="servicing_dealer" + > + name="selling_dealer_contact" + > + name="servicing_dealer_contact" + > TODO: Adding servicing/selling dealer contact info? diff --git a/client/src/components/notes-preset-button/notes-preset-button.component.jsx b/client/src/components/notes-preset-button/notes-preset-button.component.jsx index 5e1dbc943..87412ec8c 100644 --- a/client/src/components/notes-preset-button/notes-preset-button.component.jsx +++ b/client/src/components/notes-preset-button/notes-preset-button.component.jsx @@ -4,7 +4,6 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; -import { setMessage } from "../../redux/messaging/messaging.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; const mapStateToProps = createStructuredSelector({ diff --git a/client/src/components/parts-order-line-backorder-button/parts-order-line-backorder-button.component.jsx b/client/src/components/parts-order-line-backorder-button/parts-order-line-backorder-button.component.jsx index af70564b6..be4414e1d 100644 --- a/client/src/components/parts-order-line-backorder-button/parts-order-line-backorder-button.component.jsx +++ b/client/src/components/parts-order-line-backorder-button/parts-order-line-backorder-button.component.jsx @@ -1,12 +1,13 @@ +import { useMutation } from "@apollo/react-hooks"; +import { Button, notification, Popover } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Button, notification, DatePicker, Popover } from "antd"; -import { useMutation } from "@apollo/react-hooks"; -import { MUTATION_BACKORDER_PART_LINE } from "../../graphql/parts-orders.queries"; -import { selectBodyshop } from "../../redux/user/user.selectors"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { logImEXEvent } from "../../firebase/firebase.utils"; +import { MUTATION_BACKORDER_PART_LINE } from "../../graphql/parts-orders.queries"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -74,7 +75,7 @@ export function PartsOrderLineBackorderButton({ const popContent = (
- setEta(e)} /> + setEta(e)} /> diff --git a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx index 540cd6334..6ec341edc 100644 --- a/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx +++ b/client/src/components/parts-order-list-table/parts-order-list-table.component.jsx @@ -209,11 +209,10 @@ export function PartsOrderListTableComponent({ ]; return ( -
+
- + {t("parts_orders.labels.inthisorder")} diff --git a/client/src/components/shop-employees/shop-employees-form.component.jsx b/client/src/components/shop-employees/shop-employees-form.component.jsx index b8a202e10..4e7d3c673 100644 --- a/client/src/components/shop-employees/shop-employees-form.component.jsx +++ b/client/src/components/shop-employees/shop-employees-form.component.jsx @@ -1,18 +1,11 @@ -import { - Button, - DatePicker, - Form, - Input, - InputNumber, - Select, - Switch, -} from "antd"; +import { Button, Form, Input, InputNumber, Select, Switch } from "antd"; import moment from "moment"; import React, { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -47,95 +40,105 @@ export function ShopEmployeesFormComponent({ termination_date: selectedEmployee.termination_date ? moment(selectedEmployee.termination_date) : null, - }}> - + ]} + > + ]} + > + ]} + > + ]} + > + valuePropName="checked" + name="active" + > + name="flat_rate" + valuePropName="checked" + > - + ]} + > + - + name="termination_date" + > + { //TODO Make this a picklist. } + ]} + > diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx index 8d4b5dc48..c4ba56d87 100644 --- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx +++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx @@ -1,7 +1,8 @@ -import { DatePicker, Form, InputNumber, Input, Select } from "antd"; +import { Form, Input, InputNumber, Select } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import EmployeeSearchSelect from "../employee-search-select/employee-search-select.component"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import JobSearchSelect from "../job-search-select/job-search-select.component"; import LaborAllocationsTable from "../labor-allocations-table/labor-allocations-table.component"; @@ -19,14 +20,15 @@ export default function TimeTicketModalComponent({
+ ]} + > { @@ -39,14 +41,15 @@ export default function TimeTicketModalComponent({ /> + ]} + >
@@ -54,65 +57,71 @@ export default function TimeTicketModalComponent({
- + ]} + > + + ]} + > + ]} + > + ]} + > + ]} + >
diff --git a/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx b/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx index aa6b05381..55a06d689 100644 --- a/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx +++ b/client/src/components/vehicle-detail-form/vehicle-detail-form.component.jsx @@ -1,6 +1,7 @@ -import { Button, DatePicker, Form, Input, InputNumber } from "antd"; +import { Button, Form, Input, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; +import FormDatePicker from "../form-date-picker/form-date-picker.component"; import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; @@ -9,15 +10,16 @@ export default function VehicleDetailFormComponent({ form }) { return (
-
+
-
+
@@ -25,57 +27,62 @@ export default function VehicleDetailFormComponent({ form }) { + ]} + > + ]} + > + ]} + > + ]} + > + ]} + > @@ -83,75 +90,78 @@ export default function VehicleDetailFormComponent({ form }) { + ]} + > + ]} + > - + - + - + - + - + - - + + { //TODO Add handling for paint code json } + name="v_paint_codes" + > - + - + - + - + - + - + diff --git a/client/src/components/vendor-search-select/vendor-search-select.component.jsx b/client/src/components/vendor-search-select/vendor-search-select.component.jsx index bb0a663d2..b254963aa 100644 --- a/client/src/components/vendor-search-select/vendor-search-select.component.jsx +++ b/client/src/components/vendor-search-select/vendor-search-select.component.jsx @@ -14,7 +14,7 @@ const VendorSearchSelect = ( if (value !== option && onChange) { onChange(option); } - }, [option, onChange]); + }, [value, option, onChange]); return (