diff --git a/client/package.json b/client/package.json index 9853f1465..46275f81a 100644 --- a/client/package.json +++ b/client/package.json @@ -18,6 +18,7 @@ "react-apollo": "^3.1.3", "react-dom": "^16.12.0", "react-i18next": "^11.2.7", + "react-icons": "^3.8.0", "react-moment": "^0.9.7", "react-number-format": "^4.3.1", "react-router-dom": "^5.1.2", diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index bffef01c2..c91f582e0 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -72,7 +72,6 @@ class AppContainer extends Component { const token = localStorage.getItem("token"); // return the headers to the context so httpLink can read them if (token) { - console.log("checking if token should refresh."); if (shouldRefreshToken) { refreshToken(); } diff --git a/client/src/App/App.js b/client/src/App/App.js index 5f000622c..36c1a3956 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -94,15 +94,15 @@ export default () => {
- Suspended Loading...
}> - - + TODO: Suspense Loading}> + + HookCurrentUser.data.currentUser ? ( - + ) : ( ) @@ -110,7 +110,7 @@ export default () => { /> diff --git a/client/src/assets/car.svg b/client/src/assets/car.svg new file mode 100644 index 000000000..761be63c9 --- /dev/null +++ b/client/src/assets/car.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/src/components/job-tombstone/job-tombstone.component.jsx b/client/src/components/job-tombstone/job-tombstone.component.jsx index 368591854..64732411f 100644 --- a/client/src/components/job-tombstone/job-tombstone.component.jsx +++ b/client/src/components/job-tombstone/job-tombstone.component.jsx @@ -1,4 +1,5 @@ import React, { useState } from "react"; +import { Link } from "react-router-dom"; import AlertComponent from "../alert/alert.component"; import { Form, @@ -9,12 +10,15 @@ import { Typography, PageHeader, Descriptions, - Tag + Tag, + notification, + Avatar } from "antd"; import { UPDATE_JOB } from "../../graphql/jobs.queries"; import { useMutation } from "@apollo/react-hooks"; import FormItemPhone from "../form-items-formatted/phone-form-item.component"; import { useTranslation } from "react-i18next"; +import CarImage from "../../assets/car.svg"; const formItemLayout = { labelCol: { @@ -33,22 +37,27 @@ function JobTombstone({ job, ...otherProps }) { const { t } = useTranslation(); if (!job) { - return ( - - ); + return ; } const handleSubmit = e => { e.preventDefault(); otherProps.form.validateFieldsAndScroll((err, values) => { + if (err) { + notification["error"]({ + message: t("jobs.errors.validationtitle"), + description: t("jobs.errors.validation") + }); + } if (!err) { mutationUpdateJob({ variables: { jobId: jobContext.id, job: values } - }).then(r => console.log("result", r)); + }).then(r => + notification["success"]({ + message: t("jobs.successes.savetitle") + }) + ); } }); }; @@ -59,13 +68,21 @@ function JobTombstone({ job, ...otherProps }) { }; const { getFieldDecorator } = otherProps.form; + + const tombstoneTitle = ( +
+ + {t("jobs.fields.ro_number") + " " + jobContext.ro_number ?? "0"} +
+ ); + return (
]}> - - + + + + {jobContext.vehicle?.v_model_yr ?? t("general.labels.na")}{" "} + {jobContext.vehicle?.v_make_desc ?? t("general.labels.na")}{" "} + {jobContext.vehicle?.v_model_desc ?? t("general.labels.na")} |{" "} + {jobContext.vehicle?.plate_no ?? t("general.labels.na")} + + + + + {jobContext.est_number} + + + $ {jobContext.claim_total?.toFixed(2)} - + + $ {jobContext.deductible?.toFixed(2)} @@ -93,17 +124,13 @@ function JobTombstone({ job, ...otherProps }) { Information - - {getFieldDecorator("ro_number", { - initialValue: jobContext.ro_number - })()} - - - - {getFieldDecorator("est_number", { - initialValue: jobContext.est_number - })()} - +{ + // + // {getFieldDecorator("est_number", { + // initialValue: jobContext.est_number + // })()} + // + } diff --git a/client/src/components/white-board-card/white-board-card.component.jsx b/client/src/components/white-board-card/white-board-card.component.jsx index bd9e6b0a0..9f89797a2 100644 --- a/client/src/components/white-board-card/white-board-card.component.jsx +++ b/client/src/components/white-board-card/white-board-card.component.jsx @@ -4,6 +4,7 @@ import { Menu, Dropdown, Card, Icon, Avatar, Row, Col } from "antd"; import { useTranslation } from "react-i18next"; import styled from "styled-components"; import Moment from "react-moment"; +import CarImage from "../../assets/car.svg"; //The following styled div is required because of a smooth-dnd style used by react-trello to prevent wrapping of columns. const WrappedSpan = styled.span` @@ -80,11 +81,7 @@ export default function WhiteBoardCard({ metadata }) { ]}> - + @@ -103,12 +100,14 @@ export default function WhiteBoardCard({ metadata }) { - {t("general.labels.in")} - {metadata.actual_in} + {t("general.labels.in")}: + {metadata.actual_in} - {t("general.labels.out")} - {metadata.scheduled_completion} + {t("general.labels.out")}: + + {metadata.scheduled_completion} + diff --git a/client/src/components/white-board-kanban/white-board-kanban.component.jsx b/client/src/components/white-board-kanban/white-board-kanban.component.jsx index a230e2d62..f249819e4 100644 --- a/client/src/components/white-board-kanban/white-board-kanban.component.jsx +++ b/client/src/components/white-board-kanban/white-board-kanban.component.jsx @@ -11,6 +11,7 @@ export default function WhiteBoardKanBan({ data, eventBus }) { Uh oh, we couldn't find the page you're looking for.; +} diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index caf984bc5..5b3049124 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -8,16 +8,32 @@ }, "labels": { "in": "In", - "out": "Out" + "out": "Out", + "na": "N/A", + "save": "Save" } }, "jobs": { "labels": { - "no_owner": "No Owner" + "no_owner": "No Owner", + "vehicle_info": "Vehicle" }, "fields": { - "ro_number": "RO #" + "ro_number": "RO #", + "est_number": "Estimate Number", + "claim_total": "Claim Total", + "deductible": "Deductible" + }, + "successes": { + "save": "Record Saved", + "savetitle": "Record saved succesfully." + }, + "errors": { + "noaccess": "This job does not exist or you do not have access to it.", + "validationtitle": "Validation Error", + "validation": "Please ensure all fields are entered correctly.", + "saving": "Error encountered while saving record." } }, diff --git a/client/yarn.lock b/client/yarn.lock index 1fe35c63a..277d11d56 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -10296,6 +10296,13 @@ react-i18next@^11.2.7: "@babel/runtime" "^7.3.1" html-parse-stringify2 "2.0.1" +react-icons@^3.8.0: + version "3.8.0" + resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-3.8.0.tgz#229de5904809696c9f46932bd9b6126b2522866e" + integrity sha512-rA/8GRKjPulft8BSBSMsHkE1AGPqJ7LjNsyk0BE7XjG70Iz62zOled2SJk7LDo8x9z86a3xOstDlKlMZ4pAy7A== + dependencies: + camelcase "^5.0.0" + react-is@^16.12.0, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6, react-is@^16.9.0: version "16.12.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"