diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 1a32097df..c6ab7bc49 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -8103,6 +8103,27 @@ + + filehandlers + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + insurancecos false @@ -17491,6 +17512,27 @@ + + changefilehandler + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + changelaborrate false diff --git a/client/src/components/jobs-detail-change-estimator/jobs-detail-change-estimator.component.jsx b/client/src/components/jobs-detail-change-estimator/jobs-detail-change-estimator.component.jsx index 58666581e..61035b23e 100644 --- a/client/src/components/jobs-detail-change-estimator/jobs-detail-change-estimator.component.jsx +++ b/client/src/components/jobs-detail-change-estimator/jobs-detail-change-estimator.component.jsx @@ -1,7 +1,6 @@ import { DownOutlined } from "@ant-design/icons"; import { Dropdown, Menu } from "antd"; import React from "react"; -import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; @@ -11,8 +10,6 @@ const mapStateToProps = createStructuredSelector({ }); export function JobsDetailChangeEstimator({ disabled, form, bodyshop }) { - const { t } = useTranslation(); - const handleClick = ({ item, key, keyPath }) => { const est = item.props.value; form.setFieldsValue(est); @@ -37,7 +34,7 @@ export function JobsDetailChangeEstimator({ disabled, form, bodyshop }) { href=" #" onClick={(e) => e.preventDefault()} > - {t("jobs.actions.changestimator")} + ); diff --git a/client/src/components/jobs-detail-change-filehandler/jobs-detail-change-filehandler.component.jsx b/client/src/components/jobs-detail-change-filehandler/jobs-detail-change-filehandler.component.jsx new file mode 100644 index 000000000..998f74125 --- /dev/null +++ b/client/src/components/jobs-detail-change-filehandler/jobs-detail-change-filehandler.component.jsx @@ -0,0 +1,43 @@ +import { DownOutlined } from "@ant-design/icons"; +import { Dropdown, Menu } from "antd"; +import React from "react"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); + +export function JobsDetailChangeFilehandler({ disabled, form, bodyshop }) { + const handleClick = ({ item, key, keyPath }) => { + const est = item.props.value; + form.setFieldsValue(est); + }; + + const menu = ( +
+ + {bodyshop.md_filehandlers.map((est, idx) => ( + + {`${est.ins_ct_fn} ${est.ins_ct_ln}`} + + ))} + +
+ ); + + return ( + + e.preventDefault()} + > + + + + ); +} + +export default connect(mapStateToProps, null)(JobsDetailChangeFilehandler); diff --git a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx index b251d2467..b29041955 100644 --- a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx +++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx @@ -6,6 +6,7 @@ import { InputNumber, Row, Select, + Space, Switch, } from "antd"; import React from "react"; @@ -23,7 +24,7 @@ import FormItemPhone, { import Car from "../job-damage-visual/job-damage-visual.component"; import JobsDetailChangeEstimator from "../jobs-detail-change-estimator/jobs-detail-change-estimator.component"; import FormRow from "../layout-form-row/layout-form-row.component"; - +import JobsDetailChangeFileHandler from "../jobs-detail-change-filehandler/jobs-detail-change-filehandler.component"; const mapStateToProps = createStructuredSelector({ jobRO: selectJobReadOnly, bodyshop: selectBodyshop, @@ -85,7 +86,15 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) { - + + {t("jobs.fields.ins_ct_ln")} + + + } + name="ins_ct_ln" + > @@ -135,7 +144,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) { label={t("jobs.fields.referral_source_extra")} name="referral_source_extra" > - + - + + {t("jobs.fields.est_ct_fn")} + + + } + name="est_ct_fn" + > 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 94382bf8f..4264f4272 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 @@ -7,7 +7,6 @@ import { Drawer, Grid, Input, - notification, PageHeader, Popconfirm, Space, diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index 867148a3b..0c405a024 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -848,6 +848,88 @@ export default function ShopInfoGeneral({ form }) { }} + + + {(fields, { add, remove, move }) => { + return ( +
+ {fields.map((field, index) => ( + + + + + + + + + + PhoneItemFormatterValidation(getFieldValue, [ + field.name, + "ins_ph", + ]), + ]} + > + + + + + + + { + remove(field.name); + }} + /> + + + + + ))} + + + +
+ ); + }} +
+
{(fields, { add, remove, move }) => { diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index 41b2123fb..e18015324 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -98,6 +98,7 @@ export const QUERY_BODYSHOP = gql` md_ded_notes pbs_configuration pbs_serialnumber + md_filehandlers employees { id active @@ -192,6 +193,7 @@ export const UPDATE_SHOP = gql` md_ded_notes pbs_configuration pbs_serialnumber + md_filehandlers employees { id first_name diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 29f3a029b..fbb2e7b75 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -503,6 +503,7 @@ "emaillater": "Email Later", "employees": "Employees", "estimators": "Estimators", + "filehandlers": "File Handlers", "insurancecos": "Insurance Companies", "intakechecklist": "Intake Checklist", "jobstatuses": "Job Statuses", @@ -1091,6 +1092,7 @@ "addtoscoreboard": "Add to Scoreboard", "allocate": "Allocate", "autoallocate": "Auto Allocate", + "changefilehandler": "Change File Handler", "changelaborrate": "Change Labor Rate", "changestatus": "Change Status", "changestimator": "Change Estimator", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 0f46842b9..fb36a8bf6 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -503,6 +503,7 @@ "emaillater": "", "employees": "", "estimators": "", + "filehandlers": "", "insurancecos": "", "intakechecklist": "", "jobstatuses": "", @@ -1091,6 +1092,7 @@ "addtoscoreboard": "", "allocate": "", "autoallocate": "", + "changefilehandler": "", "changelaborrate": "", "changestatus": "Cambiar Estado", "changestimator": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 527771fb9..9d582c0c4 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -503,6 +503,7 @@ "emaillater": "", "employees": "", "estimators": "", + "filehandlers": "", "insurancecos": "", "intakechecklist": "", "jobstatuses": "", @@ -1091,6 +1092,7 @@ "addtoscoreboard": "", "allocate": "", "autoallocate": "", + "changefilehandler": "", "changelaborrate": "", "changestatus": "Changer le statut", "changestimator": "", diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index a1141fff0..96c7835f8 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -828,6 +828,7 @@ - md_classes - md_ded_notes - md_estimators + - md_filehandlers - md_hour_split - md_ins_cos - md_jobline_presets @@ -906,6 +907,7 @@ - md_classes - md_ded_notes - md_estimators + - md_filehandlers - md_hour_split - md_ins_cos - md_jobline_presets diff --git a/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/down.sql b/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/down.sql new file mode 100644 index 000000000..053577ff3 --- /dev/null +++ b/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."bodyshops" add column "md_filehandlers" jsonb +-- null default jsonb_build_array(); diff --git a/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/up.sql b/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/up.sql new file mode 100644 index 000000000..90475a5c5 --- /dev/null +++ b/hasura/migrations/1636504628309_alter_table_public_bodyshops_add_column_md_filehandlers/up.sql @@ -0,0 +1,2 @@ +alter table "public"."bodyshops" add column "md_filehandlers" jsonb + null default jsonb_build_array();