diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index f1347305d..88008c551 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -19440,6 +19440,27 @@ + + checklistdocuments + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + checklists false @@ -28469,6 +28490,27 @@ + + targets + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + weeklytarget false diff --git a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx index 6d763d311..da46d1841 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx @@ -1,10 +1,10 @@ import { useMutation, useQuery } from "@apollo/client"; -import { Button, Form, PageHeader, Popconfirm } from "antd"; +import { Button, Drawer, Form, Grid, PageHeader, Popconfirm } from "antd"; import moment from "moment"; import queryString from "query-string"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; -import { useLocation } from "react-router-dom"; +import { useLocation, useHistory } from "react-router-dom"; import { INSERT_NEW_BILL_LINES, UPDATE_BILL_LINE, @@ -17,6 +17,7 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; export default function BillDetailEditcontainer() { const search = queryString.parse(useLocation().search); + const history = useHistory(); const { t } = useTranslation(); const [form] = Form.useForm(); const [visible, setVisible] = useState(false); @@ -25,6 +26,22 @@ export default function BillDetailEditcontainer() { const [insertBillLine] = useMutation(INSERT_NEW_BILL_LINES); const [updateBillLine] = useMutation(UPDATE_BILL_LINE); + const selectedBreakpoint = Object.entries(Grid.useBreakpoint()) + .filter((screen) => !!screen[1]) + .slice(-1)[0]; + + const bpoints = { + xs: "100%", + sm: "100%", + md: "100%", + lg: "80%", + xl: "80%", + xxl: "70%", + }; + const drawerPercentage = selectedBreakpoint + ? bpoints[selectedBreakpoint[0]] + : "100%"; + const { loading, error, data, refetch } = useQuery(QUERY_BILL_BY_PK, { variables: { billid: search.billid }, skip: !!!search.billid, @@ -111,47 +128,59 @@ export default function BillDetailEditcontainer() { const exported = data && data.bills_by_pk && data.bills_by_pk.exported; return ( - - form.submit()} - onCancel={() => setVisible(false)} - okButtonProps={{ loading: updateLoading }} - title={t("bills.labels.editadjwarning")} + { + delete search.billid; + history.push({ search: queryString.stringify(search) }); + }} + visible={search.billid} + > + {loading && } + {!loading && ( + <> + form.submit()} + onCancel={() => setVisible(false)} + okButtonProps={{ loading: updateLoading }} + title={t("bills.labels.editadjwarning")} + > + + + } + /> +
- - - } - /> - - - - -
+ + + + + )} +
); } diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx index 01c7a1994..5f748e2d5 100644 --- a/client/src/components/bill-form/bill-form.component.jsx +++ b/client/src/components/bill-form/bill-form.component.jsx @@ -1,16 +1,16 @@ +import { useApolloClient } from "@apollo/client"; import { Button, + Divider, Form, Input, Select, Space, Statistic, Switch, - Typography, Upload, } from "antd"; import React, { useEffect, useState } from "react"; -import { useApolloClient } from "@apollo/client"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; @@ -159,7 +159,6 @@ export function BillFormComponent({ > - + + + + + - - - - - {t("bills.labels.bill_lines")} - + {t("bills.labels.bill_lines")} - + }> { + return { + key: `${field.index}joblinename`, + name: [field.name, "joblineid"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => ( + { + setFieldsValue({ + billlines: getFieldsValue(["billlines"]).billlines.map( + (item, idx) => { + if (idx === index) { + return { + ...item, + line_desc: opt.line_desc, + quantity: opt.part_qty || 1, + actual_price: opt.cost, + cost_center: opt.part_type + ? responsibilityCenters.defaults.costs[opt.part_type] || + null + : null, + }; + } + return item; + } + ), + }); + }} + /> + ), + }, + { + title: t("billlines.fields.line_desc"), + dataIndex: "line_desc", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}line_desc`, + name: [field.name, "line_desc"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => , + }, + { + title: t("billlines.fields.quantity"), + dataIndex: "quantity", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}quantity`, + name: [field.name, "quantity"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => ( + + ), + }, + { + title: t("billlines.fields.actual_price"), + dataIndex: "actual_price", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}actual_price`, + name: [field.name, "actual_price"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => ( + { + setFieldsValue({ + billlines: getFieldsValue("billlines").billlines.map( + (item, idx) => { + console.log("Checking", index, idx); + if (idx === index) { + console.log( + "Found and setting.", + !!item.actual_cost + ? item.actual_cost + : Math.round( + (parseFloat(e.target.value) * (1 - discount) + + Number.EPSILON) * + 100 + ) / 100 + ); + return { + ...item, + actual_cost: !!item.actual_cost + ? item.actual_cost + : Math.round( + (parseFloat(e.target.value) * (1 - discount) + + Number.EPSILON) * + 100 + ) / 100, + }; + } + return item; + } + ), + }); + }} + /> + ), + }, + { + title: t("billlines.fields.actual_cost"), + dataIndex: "actual_cost", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}actual_cost`, + name: [field.name, "actual_cost"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => ( + + ), + additional: (record, index) => ( + + {() => { + const line = getFieldsValue(["billlines"]).billlines[index]; + if (!!!line) return null; + const lineDiscount = ( + 1 - + Math.round((line.actual_cost / line.actual_price) * 100) / 100 + ).toPrecision(2); + + if (lineDiscount - discount === 0) return
; + return ; + }} + + ), + }, + { + title: t("billlines.fields.cost_center"), + dataIndex: "cost_center", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}cost_center`, + name: [field.name, "cost_center"], + rules: [ + { + required: true, + message: t("general.validation.required"), + }, + ], + }; + }, + formInput: (record, index) => ( + + ), + }, + { + title: t("billlines.fields.federal_tax_applicable"), + dataIndex: "applicable_taxes.federal", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}fedtax`, + valuePropName: "checked", + initialValue: true, + name: [field.name, "applicable_taxes", "federal"], + }; + }, + formInput: (record, index) => , + }, + { + title: t("billlines.fields.state_tax_applicable"), + dataIndex: "applicable_taxes.state", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}statetax`, + valuePropName: "checked", + name: [field.name, "applicable_taxes", "state"], + }; + }, + formInput: (record, index) => , + }, + { + title: t("billlines.fields.local_tax_applicable"), + dataIndex: "applicable_taxes.local", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}localtax`, + valuePropName: "checked", + name: [field.name, "applicable_taxes", "local"], + }; + }, + formInput: (record, index) => , + }, + + { + title: t("billlines.fields.location"), + dataIndex: "location", + editable: true, + formItemProps: (field) => { + return { + key: `${field.index}location`, + name: [field.name, "location"], + }; + }, + formInput: (record, index) => ( + + ), + }, + { + title: t("billlines.labels.deductedfromlbr"), + dataIndex: "deductedfromlbr", + editable: true, + formItemProps: (field) => { + return { + valuePropName: "checked", + key: `${field.index}deductedfromlbr`, + name: [field.name, "deductedfromlbr"], + }; + }, + formInput: (record, index) => , + additional: (record, index) => ( + + {() => { + if (getFieldValue(["billlines", record.name, "deductedfromlbr"])) + return ( +
+ + + + + + +
+ ); + return ; + }} +
+ ), + }, + ]; + + const mergedColumns = columns.map((col) => { + if (!col.editable) return col; + return { + ...col, + onCell: (record) => ({ + record, + formItemProps: col.formItemProps, + formInput: col.formInput, + additional: col.additional, + dataIndex: col.dataIndex, + title: col.title, + }), + }; + }); + return ( {(fields, { add, remove, move }) => { return ( -
- {fields.map((field, index) => ( - -
-
- - - { - setFieldsValue({ - billlines: getFieldsValue([ - "billlines", - ]).billlines.map((item, idx) => { - if (idx === index) { - return { - ...item, - line_desc: opt.line_desc, - quantity: opt.part_qty || 1, - actual_price: opt.cost, - cost_center: opt.part_type - ? responsibilityCenters.defaults.costs[ - opt.part_type - ] || null - : null, - }; - } - return item; - }), - }); - }} - /> - - - - - - - - - - { - setFieldsValue({ - billlines: getFieldsValue( - "billlines" - ).billlines.map((item, idx) => { - if (idx === index) { - return { - ...item, - actual_cost: !!item.actual_cost - ? item.actual_cost - : Math.round( - (parseFloat(e.target.value) * - (1 - discount) + - Number.EPSILON) * - 100 - ) / 100, - }; - } - return item; - }), - }); - }} - /> - -
- - - - - {() => { - const line = getFieldsValue(["billlines"]) - .billlines[index]; - if (!!!line) return null; - const lineDiscount = ( - 1 - - Math.round( - (line.actual_cost / line.actual_price) * 100 - ) / - 100 - ).toPrecision(2); - - if (lineDiscount - discount === 0) return
; - return ; - }} - -
- - - - - - - - - - - - - - - - - - - - - - {() => { - if ( - getFieldValue([ - "billlines", - field.name, - "deductedfromlbr", - ]) - ) - return ( -
- - - - - - -
- ); - return ; - }} -
- - - { - remove(field.name); - }} - /> -
- -
- - ))} + <> + + ); + + return ( + + ); +}; diff --git a/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx b/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx index bf9836d77..c03725a09 100644 --- a/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx +++ b/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx @@ -3,6 +3,7 @@ import { Form } from "antd"; import { useTranslation } from "react-i18next"; import AlertComponent from "../alert/alert.component"; import { Prompt, useLocation } from "react-router-dom"; +import "./form-fields-changed.styles.scss"; export default function FormsFieldChanged({ form }) { const { t } = useTranslation(); @@ -11,13 +12,17 @@ export default function FormsFieldChanged({ form }) { form.resetFields(); }; const loc = useLocation(); - if (!form.isFieldsTouched()) return <>; + //if (!form.isFieldsTouched()) return <>; return ( - + {() => { if (form.isFieldsTouched()) return ( -
+ { @@ -42,7 +47,7 @@ export default function FormsFieldChanged({ form }) {
} /> - + ); return
; }} diff --git a/client/src/components/form-fields-changed-alert/form-fields-changed.styles.scss b/client/src/components/form-fields-changed-alert/form-fields-changed.styles.scss new file mode 100644 index 000000000..155407907 --- /dev/null +++ b/client/src/components/form-fields-changed-alert/form-fields-changed.styles.scss @@ -0,0 +1,7 @@ +.form-fields-changed { + .ant-form-item-control { + .ant-form-item-control-input { + min-height: unset !important; + } + } +} diff --git a/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx b/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx index fa77be251..1c4bf21e6 100644 --- a/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx +++ b/client/src/components/form-list-move-arrows/form-list-move-arrows.component.jsx @@ -1,4 +1,5 @@ import { DownOutlined, UpOutlined } from "@ant-design/icons"; +import { Space } from "antd"; import React from "react"; export default function FormListMoveArrows({ move, index, total }) { const upDisabled = index === 0; @@ -13,9 +14,9 @@ export default function FormListMoveArrows({ move, index, total }) { }; return ( -
+ -
+ ); } diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx index 49c2e0f61..1e5596371 100644 --- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx @@ -1,5 +1,5 @@ import { useMutation } from "@apollo/client"; -import { Button, Form, notification, Switch } from "antd"; +import { Button, Card, Form, notification, Switch } from "antd"; import queryString from "query-string"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -112,94 +112,98 @@ export function JobChecklistForm({ }; return ( -
fi.value) - .reduce((acc, fi) => { - acc[fi.name] = fi.value; - return acc; - }, {}), - }} + form.submit()}> + {t("general.actions.submit")} + + ) + } > - {t("checklist.labels.checklist")} + fi.value) + .reduce((acc, fi) => { + acc[fi.name] = fi.value; + return acc; + }, {}), + }} + > + - - - {type === "intake" && ( -
- - - - - - - - - -
- )} - {type === "deliver" && ( -
- - - - - - -
- )} - {!readOnly && ( - - )} - + {type === "intake" && ( +
+ + + + + + + + + +
+ )} + {type === "deliver" && ( +
+ + + + + + +
+ )} + +
); } diff --git a/client/src/components/job-checklist/components/job-checklist-template-list/job-checklist-template-list.component.jsx b/client/src/components/job-checklist/components/job-checklist-template-list/job-checklist-template-list.component.jsx index 2d0cb3064..fa8322650 100644 --- a/client/src/components/job-checklist/components/job-checklist-template-list/job-checklist-template-list.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-template-list/job-checklist-template-list.component.jsx @@ -1,5 +1,5 @@ import { PrinterFilled } from "@ant-design/icons"; -import { Button, List } from "antd"; +import { Button, Card, List } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; @@ -44,10 +44,14 @@ export default function JobIntakeTemplateList({ templates }) { }; return ( -
- + + {t("checklist.actions.printall")} + + } + > )} /> -
+ ); } diff --git a/client/src/components/job-checklist/job-checklist.component.jsx b/client/src/components/job-checklist/job-checklist.component.jsx index 0d4f48ff7..fda70881e 100644 --- a/client/src/components/job-checklist/job-checklist.component.jsx +++ b/client/src/components/job-checklist/job-checklist.component.jsx @@ -6,11 +6,11 @@ export default function JobIntakeComponent({ checklistConfig, type, job }) { const { form, templates } = checklistConfig; return ( - -
+ + - + diff --git a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx index 86eadafd7..40ee4dc45 100644 --- a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx +++ b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx @@ -1,5 +1,5 @@ import { DeleteFilled, PlusCircleFilled } from "@ant-design/icons"; -import { Button, Popover, Select, Spin } from "antd"; +import { Button, Col, Popover, Row, Select, Space, Spin } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -40,35 +40,42 @@ export function JobEmployeeAssignments({ }; const popContent = ( -
- - - -
+ +
+ + + + + + + + + ); return ( diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index 43b581252..b301bc6f3 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -1,5 +1,13 @@ import { useMutation } from "@apollo/client"; -import { Button, Form, notification, Popover, Select, Switch } from "antd"; +import { + Button, + Form, + notification, + Popover, + Select, + Space, + Switch, +} from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -100,12 +108,14 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO }) { > - - + + + + ); diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx index 80c75af77..9f41556dd 100644 --- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx +++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.component.jsx @@ -117,7 +117,9 @@ function JobsDocumentsComponent({ galleryImages={galleryImages} deletionCallback={billsCallback || refetch} /> - + {!billId && ( + + )} diff --git a/client/src/components/jobs-notes/jobs.notes.component.jsx b/client/src/components/jobs-notes/jobs.notes.component.jsx index 1629ac560..e8354b026 100644 --- a/client/src/components/jobs-notes/jobs.notes.component.jsx +++ b/client/src/components/jobs-notes/jobs.notes.component.jsx @@ -5,7 +5,7 @@ import { EyeInvisibleFilled, WarningFilled, } from "@ant-design/icons"; -import { Button, Card, Table } from "antd"; +import { Button, Card, Space, Table } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -82,7 +82,7 @@ export function JobNotesComponent({ key: "actions", width: 150, render: (text, record) => ( - + - + ), }, ]; diff --git a/client/src/components/note-upsert-modal/note-upsert-modal.component.jsx b/client/src/components/note-upsert-modal/note-upsert-modal.component.jsx index 564421cf8..28e824bdd 100644 --- a/client/src/components/note-upsert-modal/note-upsert-modal.component.jsx +++ b/client/src/components/note-upsert-modal/note-upsert-modal.component.jsx @@ -1,4 +1,4 @@ -import { Form, Input, Switch } from "antd"; +import { Col, Form, Input, Row, Switch } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import NotesPresetButton from "../notes-preset-button/notes-preset-button.component"; @@ -7,37 +7,45 @@ export default function NoteUpsertModalComponent({ form }) { const { t } = useTranslation(); return ( -
- - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + ); } diff --git a/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx b/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx index e74bc992e..9d732ea40 100644 --- a/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx +++ b/client/src/components/note-upsert-modal/note-upsert-modal.container.jsx @@ -90,7 +90,12 @@ export function NoteUpsertModalContainer({ }} destroyOnClose > - + diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index a5360b19f..ec7c8fd37 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -1,3 +1,4 @@ +import { Card } from "antd"; import moment from "moment"; import React from "react"; import { connect } from "react-redux"; @@ -68,7 +69,7 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { }, []); return ( -
+ -
+ ); } diff --git a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx index 7475e7fd9..36b4a028b 100644 --- a/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx +++ b/client/src/components/scoreboard-day-stats/scoreboard-day-stats.component.jsx @@ -26,18 +26,22 @@ export function ScoreboardDayStats({ bodyshop, date, entries }) { }, 0); return ( -
- - bodyHrs ? "red" : "green" }} - value={bodyHrs.toFixed(1)} - /> - paintHrs ? "red" : "green" }} - value={paintHrs.toFixed(1)} - /> - -
+ + bodyHrs ? "red" : "green" }} + label="B" + value={bodyHrs.toFixed(1)} + /> + paintHrs ? "red" : "green" }} + label="P" + value={paintHrs.toFixed(1)} + /> + ); } export default connect(mapStateToProps, mapDispatchToProps)(ScoreboardDayStats); diff --git a/client/src/components/scoreboard-display/scoreboard-display.component.jsx b/client/src/components/scoreboard-display/scoreboard-display.component.jsx index 8cd6655d4..6c126c736 100644 --- a/client/src/components/scoreboard-display/scoreboard-display.component.jsx +++ b/client/src/components/scoreboard-display/scoreboard-display.component.jsx @@ -1,6 +1,6 @@ +import { Col, Row } from "antd"; import React from "react"; import ScoreboardChart from "../scoreboard-chart/scoreboard-chart.component"; -import ScoreboardJobsList from "../scoreboard-jobs-list/scoreboard-jobs-list.component"; import ScoreboardLastDays from "../scoreboard-last-days/scoreboard-last-days.component"; import ScoreboardTargetsTable from "../scoreboard-targets-table/scoreboard-targets-table.component"; @@ -20,11 +20,18 @@ export default function ScoreboardDisplayComponent({ scoreboardSubscription }) { }); return ( -
- - - - -
+ +
+ + + + + + + + + + + ); } diff --git a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx index 99ed3773e..9b96febaf 100644 --- a/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx +++ b/client/src/components/scoreboard-targets-table/scoreboard-targets-table.component.jsx @@ -1,11 +1,13 @@ import { CalendarOutlined } from "@ant-design/icons"; -import { Col, Row, Statistic } from "antd"; +import { Card, Col, Row, Statistic } 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"; +import ScoreboardJobsList from "../scoreboard-jobs-list/scoreboard-jobs-list.component"; import * as Util from "./scoreboard-targets-table.util"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -16,11 +18,14 @@ const mapDispatchToProps = (dispatch) => ({ const rowGutter = [16, 16]; const statSpans = { xs: 24, sm: 6 }; -export function ScoreboardTargetsTable({ bodyshop }) { +export function ScoreboardTargetsTable({ bodyshop, scoreBoardlist }) { const { t } = useTranslation(); return ( -
+ } + >
@@ -70,7 +75,7 @@ export function ScoreboardTargetsTable({ bodyshop }) { @@ -100,7 +105,7 @@ export function ScoreboardTargetsTable({ bodyshop }) { - + ); } export default connect( diff --git a/client/src/components/vendors-form/vendors-form.component.jsx b/client/src/components/vendors-form/vendors-form.component.jsx index 3118ae96c..f934b6b3a 100644 --- a/client/src/components/vendors-form/vendors-form.component.jsx +++ b/client/src/components/vendors-form/vendors-form.component.jsx @@ -1,9 +1,11 @@ import { DeleteFilled } from "@ant-design/icons"; import { Button, + Divider, Form, Input, InputNumber, + PageHeader, Select, Space, Switch, @@ -27,18 +29,31 @@ export default function VendorsFormComponent({ const { getFieldValue } = form; return (
- - - - + + + + + + + + } + /> - - - + - + @@ -125,16 +133,14 @@ export default function VendorsFormComponent({ - - {t("vendors.labels.preferredmakes")} - + {t("vendors.labels.preferredmakes")} {(fields, { add, remove }) => { return (
{fields.map((field, index) => ( -
+ -
+
))} diff --git a/client/src/components/vendors-form/vendors-form.container.jsx b/client/src/components/vendors-form/vendors-form.container.jsx index 2f3b9f1f4..746b875b5 100644 --- a/client/src/components/vendors-form/vendors-form.container.jsx +++ b/client/src/components/vendors-form/vendors-form.container.jsx @@ -119,6 +119,7 @@ function VendorsFormContainer({ refetch, bodyshop }) { if (loading) return ; if (error) return ; + return (
{ - return ( -
- - - - { - setSearchText(e.target.value); - }} - value={searchText} - enterButton - /> -
- ); - }} - pagination={{ position: "top" }} - columns={columns} - rowKey="id" - onChange={handleTableChange} - dataSource={filteredVendors} - rowSelection={{ - onSelect: handleOnRowClick, - type: "radio", - selectedRowKeys: [selectedvendor], - }} - onRow={(record, rowIndex) => { - return { - onClick: (event) => { - handleOnRowClick(record); - }, - }; - }} - /> + + + + { + setSearchText(e.target.value); + }} + value={searchText} + enterButton + /> + + } + > +
+ + + {formInput && formInput(record, record.key)} + + {additional && additional(record, record.key)} + + + + {formInput && formInput(record, record.key)} + +
{ + return { + onClick: (event) => { + handleOnRowClick(record); + }, + }; + }} + /> + ); } diff --git a/client/src/components/vendors-list/vendors-list.container.jsx b/client/src/components/vendors-list/vendors-list.container.jsx index 14d2c9292..771433a18 100644 --- a/client/src/components/vendors-list/vendors-list.container.jsx +++ b/client/src/components/vendors-list/vendors-list.container.jsx @@ -1,10 +1,10 @@ -import React from "react"; import { useQuery } from "@apollo/client"; +import queryString from "query-string"; +import React from "react"; +import { useHistory, useLocation } from "react-router-dom"; import AlertComponent from "../../components/alert/alert.component"; import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries"; import VendorsListComponent from "./vendors-list.component"; -import queryString from "query-string"; -import { useHistory, useLocation } from "react-router-dom"; export default function VendorsListContainer() { const { loading, error, data, refetch } = useQuery(QUERY_ALL_VENDORS); diff --git a/client/src/pages/scoreboard/scoreboard.page.component.jsx b/client/src/pages/scoreboard/scoreboard.page.component.jsx deleted file mode 100644 index 2483346fa..000000000 --- a/client/src/pages/scoreboard/scoreboard.page.component.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from "react"; -import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component"; - -export default function ProductionBoardComponent({ scoreboardSubscription }) { - return ( -
- -
- ); -} diff --git a/client/src/pages/scoreboard/scoreboard.page.container.jsx b/client/src/pages/scoreboard/scoreboard.page.container.jsx index 7d108bdfc..3f17416aa 100644 --- a/client/src/pages/scoreboard/scoreboard.page.container.jsx +++ b/client/src/pages/scoreboard/scoreboard.page.container.jsx @@ -7,7 +7,7 @@ import { setSelectedHeader, } from "../../redux/application/application.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import ScoreboardPageComponent from "./scoreboard.page.component"; +import ScoreboardDisplay from "../../components/scoreboard-display/scoreboard-display.component"; import { useSubscription } from "@apollo/client"; import { SUBSCRIPTION_SCOREBOARD } from "../../graphql/scoreboard.queries"; import moment from "moment"; @@ -45,9 +45,7 @@ export function ScoreboardContainer({ setBreadcrumbs, setSelectedHeader }) { return ( - + ); } diff --git a/client/src/pages/shop-vendor/shop-vendor.page.component.jsx b/client/src/pages/shop-vendor/shop-vendor.page.component.jsx index c0166034e..6eb6e2064 100644 --- a/client/src/pages/shop-vendor/shop-vendor.page.component.jsx +++ b/client/src/pages/shop-vendor/shop-vendor.page.component.jsx @@ -1,28 +1,45 @@ -import { Col, Row } from "antd"; +import { Drawer, Grid } from "antd"; +import queryString from "query-string"; import React from "react"; +import { useHistory, useLocation } from "react-router-dom"; import VendorsFormContainer from "../../components/vendors-form/vendors-form.container"; import VendorsListContainer from "../../components/vendors-list/vendors-list.container"; -const listSpan = { - md: { span: 24 }, - lg: { span: 8 }, -}; -const formSapn = { - md: { span: 24 }, - lg: { span: 16 }, -}; - export default function ShopVendorPageComponent() { + const search = queryString.parse(useLocation().search); + const { selectedvendor } = search; + const history = useHistory(); + + const selectedBreakpoint = Object.entries(Grid.useBreakpoint()) + .filter((screen) => !!screen[1]) + .slice(-1)[0]; + + const bpoints = { + xs: "100%", + sm: "100%", + md: "100%", + lg: "50%", + xl: "50%", + xxl: "45%", + }; + const drawerPercentage = selectedBreakpoint + ? bpoints[selectedBreakpoint[0]] + : "100%"; + return (
- -
- - - - - - + + + { + delete search.selectedvendor; + history.push({ search: queryString.stringify(search) }); + }} + visible={selectedvendor} + > + + ); } diff --git a/client/src/pages/temporary-docs/temporary-docs.component.jsx b/client/src/pages/temporary-docs/temporary-docs.component.jsx index f862fc850..d54898375 100644 --- a/client/src/pages/temporary-docs/temporary-docs.component.jsx +++ b/client/src/pages/temporary-docs/temporary-docs.component.jsx @@ -12,14 +12,11 @@ export default function TemporaryDocsComponent() { if (error) return ; return ( -
-
Buttons to move and assign things.
- -
+ ); } diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 2ae91a9db..1168f070f 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1175,6 +1175,7 @@ }, "changeclass": "Changing the job's class can have fundamental impacts to already exported accounting items. Are you sure you want to do this?", "checklistcompletedby": "Checklist completed by {{by}} at {{at}}", + "checklistdocuments": "Checklist Documents", "checklists": "Checklists", "closeconfirm": "Are you sure you want to close this job? This cannot be easily undone.", "cost": "Cost", @@ -1723,6 +1724,7 @@ "asoftodaytarget": "As of Today", "dailytarget": "Daily", "monthlytarget": "Monthly", + "targets": "Targets", "weeklytarget": "Weekly", "workingdays": "Working Days / Month" }, diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 6d6092ebb..53d5ea7dd 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1175,6 +1175,7 @@ }, "changeclass": "", "checklistcompletedby": "", + "checklistdocuments": "", "checklists": "", "closeconfirm": "", "cost": "", @@ -1723,6 +1724,7 @@ "asoftodaytarget": "", "dailytarget": "", "monthlytarget": "", + "targets": "", "weeklytarget": "", "workingdays": "" }, diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 69288eb7e..1f21fe26d 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1175,6 +1175,7 @@ }, "changeclass": "", "checklistcompletedby": "", + "checklistdocuments": "", "checklists": "", "closeconfirm": "", "cost": "", @@ -1723,6 +1724,7 @@ "asoftodaytarget": "", "dailytarget": "", "monthlytarget": "", + "targets": "", "weeklytarget": "", "workingdays": "" },