From edba734605882e432b9f6d09c40acb832a15b610 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 23 Mar 2020 13:41:27 -0700 Subject: [PATCH] BOD-53 added owner popover for tag on detail. --- bodyshop_translations.babel | 21 +++++++++++++ .../job-detail-cards.damage.component.jsx | 7 ++++- .../jobs-detail-header.component.jsx | 25 +++++++++------- .../owner-tag-popover.component.jsx | 30 +++++++++++++++++++ .../jobs-create/jobs-create.container.jsx | 2 +- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 8 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 client/src/components/owner-tag-popover/owner-tag-popover.component.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 49e212e03..8ec8d4156 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -4240,6 +4240,27 @@ + + nodamage + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + nodates false 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 ca274dcc7..86a95f94f 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 @@ -8,7 +8,12 @@ export default function JobDetailCardsDamageComponent({ loading, data }) { const { area_of_damage } = data; return ( - + {area_of_damage ? ( + + ) : t("jobs.errors.nodamage")} ); } diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 2d516b2c5..6cc987680 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -1,5 +1,16 @@ import { DownCircleFilled } from "@ant-design/icons"; -import { Avatar, Badge, Button, Checkbox, Descriptions, Dropdown, Menu, notification, PageHeader, Tag } from "antd"; +import { + Avatar, + Badge, + Button, + Checkbox, + Descriptions, + Dropdown, + Menu, + notification, + PageHeader, + Tag +} from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import Moment from "react-moment"; @@ -10,6 +21,7 @@ import CarImage from "../../assets/car.svg"; import { selectBodyshop } from "../../redux/user/user.selectors"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import BarcodePopup from "../barcode-popup/barcode-popup.component"; +import OwnerTagPopoverComponent from "../owner-tag-popover/owner-tag-popover.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -100,16 +112,7 @@ export default connect( tags={ {job.status ? {job.status} : null} - - {job.owner ? ( - - {`${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || - ""}`} - - ) : ( - t("jobs.errors.noowner") - )} - + {job.vehicle ? ( diff --git a/client/src/components/owner-tag-popover/owner-tag-popover.component.jsx b/client/src/components/owner-tag-popover/owner-tag-popover.component.jsx new file mode 100644 index 000000000..513ded7f7 --- /dev/null +++ b/client/src/components/owner-tag-popover/owner-tag-popover.component.jsx @@ -0,0 +1,30 @@ +import { Button, Col, Popover, Row, Tag } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; + +export default function OwnerTagPopoverComponent({ job }) { + const { t } = useTranslation(); + const content = ( +
+ The Content + + Claim Info + Owner Info + + + + +
+ ); + + return ( + + + {job.owner + ? `${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}` + : t("jobs.errors.noowner")} + + + ); +} diff --git a/client/src/pages/jobs-create/jobs-create.container.jsx b/client/src/pages/jobs-create/jobs-create.container.jsx index b12ee2a93..d6ee278d3 100644 --- a/client/src/pages/jobs-create/jobs-create.container.jsx +++ b/client/src/pages/jobs-create/jobs-create.container.jsx @@ -33,7 +33,7 @@ function JobsCreateContainer({ bodyshop }) { variables: { id: state.owner.selectedid } }); } - }, [state.owner.selectedid]); + }, [state.owner.selectedid, loadOwner]); const runInsertJob = job => { console.log("Job To Save", job); diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 384a32028..1decfdd9d 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -312,6 +312,7 @@ "creating": "Error encountered while creating job. {{error}}", "deleted": "Error deleting job.", "noaccess": "This job does not exist or you do not have access to it.", + "nodamage": "No damage points on estimate.", "nodates": "No dates specified for this job.", "nojobselected": "No job is selected.", "noowner": "No owner associated.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 20022889c..0a04706da 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -312,6 +312,7 @@ "creating": "", "deleted": "Error al eliminar el trabajo.", "noaccess": "Este trabajo no existe o no tiene acceso a él.", + "nodamage": "", "nodates": "No hay fechas especificadas para este trabajo.", "nojobselected": "No hay trabajo seleccionado.", "noowner": "Ningún propietario asociado.", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index cb31d9d0c..db3fa913c 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -312,6 +312,7 @@ "creating": "", "deleted": "Erreur lors de la suppression du travail.", "noaccess": "Ce travail n'existe pas ou vous n'y avez pas accès.", + "nodamage": "", "nodates": "Aucune date spécifiée pour ce travail.", "nojobselected": "Aucun travail n'est sélectionné.", "noowner": "Aucun propriétaire associé.",