diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 935ef11e6..7745bf1aa 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/assets/unfolded_car.svg b/client/src/assets/unfolded_car.svg index 326293fd1..db3a4d87f 100644 --- a/client/src/assets/unfolded_car.svg +++ b/client/src/assets/unfolded_car.svg @@ -1,6 +1,4 @@ - - - - + id="svg166" + sodipodi:docname="unfolded_car.svg" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + id="metadata172"> image/svg+xml - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x diff --git a/client/src/assets/unfolded_car_clean.svg b/client/src/assets/unfolded_car_clean.svg new file mode 100644 index 000000000..3eb1c2892 --- /dev/null +++ b/client/src/assets/unfolded_car_clean.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + + diff --git a/client/src/components/allocations-assignment/allocations-assignment.component.jsx b/client/src/components/allocations-assignment/allocations-assignment.component.jsx new file mode 100644 index 000000000..f3f3a0a8a --- /dev/null +++ b/client/src/components/allocations-assignment/allocations-assignment.component.jsx @@ -0,0 +1,76 @@ +import { Select, Button, Popover, InputNumber } 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"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop +}); + +export default connect( + mapStateToProps, + null +)(function AllocationsAssignmentComponent({ + bodyshop, + handleAssignment, + assignment, + setAssignment, + visibilityState, + maxHours +}) { + const { t } = useTranslation(); + + const onChange = e => { + console.log("e", e); + setAssignment({ ...assignment, employeeid: e }); + }; + + const [visibility, setVisibility] = visibilityState; + + const popContent = ( +
+ + setAssignment({ ...assignment, hours: e })} + /> + + + +
+ ); + + return ( + + + + ); +}); diff --git a/client/src/components/allocations-assignment/allocations-assignment.container.jsx b/client/src/components/allocations-assignment/allocations-assignment.container.jsx new file mode 100644 index 000000000..3369d6904 --- /dev/null +++ b/client/src/components/allocations-assignment/allocations-assignment.container.jsx @@ -0,0 +1,38 @@ +import React, { useState } from "react"; +import AllocationsAssignmentComponent from "./allocations-assignment.component"; +import { useMutation } from "react-apollo"; +import { INSERT_ALLOCATION } from "../../graphql/allocations.queries"; +import { useTranslation } from "react-i18next"; +import { notification } from "antd"; + +export default function AllocationsAssignmentContainer({ jobLineId, hours }) { + const visibilityState = useState(false); + const { t } = useTranslation(); + const [assignment, setAssignment] = useState({ + joblineid: jobLineId, + hours: parseFloat(hours), + employeeid: null + }); + const [insertAllocation] = useMutation(INSERT_ALLOCATION); + + const handleAssignment = () => { + insertAllocation({ variables: { alloc: { ...assignment } } }).then(r => { + notification["success"]({ + message: t("employees.successes.save") + }); + //TODO: Better way to reset the field decorators? + visibilityState[1](false); + //refetch().then(r => form.resetFields()); + }); + }; + + return ( + + ); +} diff --git a/client/src/components/barcode-popup/barcode-popup.component.jsx b/client/src/components/barcode-popup/barcode-popup.component.jsx new file mode 100644 index 000000000..7daceb4dc --- /dev/null +++ b/client/src/components/barcode-popup/barcode-popup.component.jsx @@ -0,0 +1,22 @@ +import { Tag, Popover } from "antd"; +import React from "react"; +import Barcode from "react-barcode"; +import { useTranslation } from "react-i18next"; +export default function BarcodePopupComponent({ value }) { + const { t } = useTranslation(); + return ( +
+ + } + > + {t("general.labels.barcode")} + +
+ ); +} diff --git a/client/src/components/chat-window/chat-window.component.jsx b/client/src/components/chat-window/chat-window.component.jsx index 0ec7f9120..fa5f3539d 100644 --- a/client/src/components/chat-window/chat-window.component.jsx +++ b/client/src/components/chat-window/chat-window.component.jsx @@ -1,5 +1,10 @@ import React from "react"; -import { Drawer } from "antd"; -export default function ChatWindowComponent({ ...drawerProps }) { - return Chat Windows and more; + +export default function ChatWindowComponent({ toggleChatVisible }) { + return ( +
+ This is a chat + window! +
+ ); } diff --git a/client/src/components/chat-window/chat-window.container.jsx b/client/src/components/chat-window/chat-window.container.jsx index 9b4244119..09b3f7152 100644 --- a/client/src/components/chat-window/chat-window.container.jsx +++ b/client/src/components/chat-window/chat-window.container.jsx @@ -1,4 +1,3 @@ -import { Layout } from "antd"; import React from "react"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; @@ -18,17 +17,8 @@ export default connect( mapStateToProps, mapDispatchToProps )(function ChatWindowContainer({ chatVisible, toggleChatVisible }) { - return ( - toggleChatVisible()} - > - - - ); + if (chatVisible) + return ; + + return
toggleChatVisible()}>Chat
; }); diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 0114f278e..478789c1e 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -72,6 +72,12 @@ export default ({ + + + {t("menus.header.shop")} + + + diff --git a/client/src/components/job-damage-visual/job-damage-visual.component.jsx b/client/src/components/job-damage-visual/job-damage-visual.component.jsx new file mode 100644 index 000000000..3af1910ab --- /dev/null +++ b/client/src/components/job-damage-visual/job-damage-visual.component.jsx @@ -0,0 +1,735 @@ +import React from "react"; +export default ({ dmg1, dmg2 }) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + // + // x + // + } + + +); diff --git a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx index fea7c0ed0..ca274dcc7 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.damage.component.jsx @@ -1,18 +1,14 @@ import React from "react"; import { useTranslation } from "react-i18next"; import CardTemplate from "./job-detail-cards.template.component"; -import UnfoldedCar from "../../assets/unfolded_car.svg"; +import Car from "../job-damage-visual/job-damage-visual.component"; export default function JobDetailCardsDamageComponent({ loading, data }) { const { t } = useTranslation(); - + const { area_of_damage } = data; return ( - {data ? ( - - Damaged Area - - ) : null} + ); } diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index a02f0bed8..97ba507a5 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { alphaSort } from "../../utils/sorters"; //import EditableCell from "./job-lines-cell.component"; +import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container"; export default function JobLinesComponent({ jobLines, @@ -97,6 +98,38 @@ export default function JobLinesComponent({ render: (text, record) => ( {record.act_price} ) + }, + { + title: t("joblines.fields.mod_lb_hrs"), + dataIndex: "mod_lb_hrs", + key: "mod_lb_hrs", + sorter: (a, b) => a.mod_lb_hrs - b.mod_lb_hrs, + sortOrder: + state.sortedInfo.columnKey === "mod_lb_hrs" && state.sortedInfo.order + }, + { + title: t("allocations.fields.employee"), + dataIndex: "employee", + key: "employee", + sorter: (a, b) => a.act_price - b.act_price, //TODO Fix employee sorting. + sortOrder: + state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, + render: (text, record) => ( + + {record.allocations && record.allocations.length > 0 + ? record.allocations.map(item => ( +
{`${item.employee.first_name} ${item.employee.last_name} (${item.hours})`}
+ )) + : null} + +
+ ) } ]; diff --git a/client/src/components/jobs-available-new/jobs-available-new.component.jsx b/client/src/components/jobs-available-new/jobs-available-new.component.jsx index b7dd1d880..e411a125c 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.component.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.component.jsx @@ -4,6 +4,8 @@ import { useTranslation } from "react-i18next"; import { DateTimeFormatter } from "../../utils/DateFormatter"; import { alphaSort } from "../../utils/sorters"; import OwnerFindModalContainer from "../owner-find-modal/owner-find-modal.container"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; + export default function JobsAvailableComponent({ loading, data, @@ -77,7 +79,10 @@ export default function JobsAvailableComponent({ key: "clm_amt", sorter: (a, b) => a.clm_amt - b.clm_amt, sortOrder: - state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order + state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order, + render: (text, record) => ( + {record.clm_amt} + ) //width: "12%", //ellipsis: true }, @@ -141,7 +146,8 @@ export default function JobsAvailableComponent({ estData.data.available_jobs_by_pk && estData.data.available_jobs_by_pk.est_data && estData.data.available_jobs_by_pk.est_data.owner && - estData.data.available_jobs_by_pk.est_data.owner.data + estData.data.available_jobs_by_pk.est_data.owner.data && + !estData.data.available_jobs_by_pk.issupplement ? estData.data.available_jobs_by_pk.est_data.owner.data : null; @@ -164,7 +170,7 @@ export default function JobsAvailableComponent({ return (
{ console.log(value); }} diff --git a/client/src/components/jobs-available-new/jobs-available-new.container.jsx b/client/src/components/jobs-available-new/jobs-available-new.container.jsx index 7c1932d9d..e6fd1e37b 100644 --- a/client/src/components/jobs-available-new/jobs-available-new.container.jsx +++ b/client/src/components/jobs-available-new/jobs-available-new.container.jsx @@ -29,14 +29,7 @@ export default withRouter(function JobsAvailableContainer({ const onModalOk = () => { setModalVisible(false); - console.log("selectedOwner", selectedOwner); setInsertLoading(true); - console.log( - "logitest", - estData.data && - estData.data.available_jobs_by_pk && - estData.data.available_jobs_by_pk.est_data - ); if ( !( diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx index a6c44f5df..aaf396f37 100644 --- a/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.component.jsx @@ -3,13 +3,25 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { alphaSort } from "../../utils/sorters"; import { DateTimeFormatter } from "../../utils/DateFormatter"; +import JobsFindModalContainer from "../jobs-find-modal/jobs-find-modal.container"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; + export default function JobsAvailableSupplementComponent({ loading, data, refetch, deleteJob, + updateJob, + onModalOk, + onModalCancel, + modalVisible, + setModalVisible, + selectedJob, + setSelectedJob, deleteAllNewJobs, - estDataLazyLoad + loadEstData, + estData, + importOptionsState }) { const { t } = useTranslation(); @@ -81,7 +93,10 @@ export default function JobsAvailableSupplementComponent({ key: "clm_amt", sorter: (a, b) => a.clm_amt - b.clm_amt, sortOrder: - state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order + state.sortedInfo.columnKey === "clm_amt" && state.sortedInfo.order, + render: (text, record) => ( + {record.clm_amt} + ) //width: "12%", //ellipsis: true }, @@ -127,7 +142,8 @@ export default function JobsAvailableSupplementComponent({