From 5efb21ada716f2a6da0d5135ca84363cf31593e8 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 17 Aug 2020 10:11:56 -0700 Subject: [PATCH] Added detail for departing jos ons chedule BOD-254 --- bodyshop_translations.babel | 84 +++++++++++++++++ .../schedule-calendar-header.component.js | 90 ++++++++++++++----- .../shop-info/shop-info.component.jsx | 12 +++ client/src/graphql/appointments.queries.js | 2 + client/src/graphql/bodyshop.queries.js | 2 + client/src/translations/en_us/common.json | 4 + client/src/translations/es/common.json | 4 + client/src/translations/fr/common.json | 4 + .../down.yaml | 5 ++ .../up.yaml | 6 ++ .../down.yaml | 61 +++++++++++++ .../up.yaml | 62 +++++++++++++ .../down.yaml | 55 ++++++++++++ .../up.yaml | 56 ++++++++++++ hasura/migrations/metadata.yaml | 2 + 15 files changed, 427 insertions(+), 22 deletions(-) create mode 100644 hasura/migrations/1597681392700_alter_table_public_bodyshops_add_column_prodtargethrs/down.yaml create mode 100644 hasura/migrations/1597681392700_alter_table_public_bodyshops_add_column_prodtargethrs/up.yaml create mode 100644 hasura/migrations/1597681402689_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1597681402689_update_permission_user_public_table_bodyshops/up.yaml create mode 100644 hasura/migrations/1597681427500_update_permission_user_public_table_bodyshops/down.yaml create mode 100644 hasura/migrations/1597681427500_update_permission_user_public_table_bodyshops/up.yaml diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index f5d11cc77..fbdb90c09 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -526,6 +526,27 @@ + + completingjobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + history false @@ -547,6 +568,27 @@ + + nocompletingjobs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + nodateselected false @@ -1463,6 +1505,27 @@ + + prodtargethrs + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + responsibilitycenter false @@ -6732,6 +6795,27 @@ + + hours + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + in false diff --git a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js index a3e77cee0..dce6eb8c1 100644 --- a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js +++ b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js @@ -1,20 +1,23 @@ import Icon from "@ant-design/icons"; -import { Statistic } from "antd"; +import { Popover, Statistic } from "antd"; import React from "react"; +import { useTranslation } from "react-i18next"; import { MdFileDownload, MdFileUpload } from "react-icons/md"; import { connect } from "react-redux"; +import { Link } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import { selectScheduleLoad, selectScheduleLoadCalculating, } from "../../redux/application/application.selectors"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import ScheduleBlockDay from "../schedule-block-day/schedule-block-day.component"; -const ShopTargetHrs = 100; - const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser + bodyshop: selectBodyshop, load: selectScheduleLoad, calculating: selectScheduleLoadCalculating, }); @@ -24,6 +27,7 @@ const mapDispatchToProps = (dispatch) => ({ }); export function ScheduleCalendarHeaderComponent({ + bodyshop, label, refetch, date, @@ -31,28 +35,70 @@ export function ScheduleCalendarHeaderComponent({ calculating, ...otherProps }) { + const { t } = useTranslation(); const loadData = load[date.toISOString().substr(0, 10)]; - const LoadComponent = loadData ? ( -
- - {(loadData.hoursIn || 0) && loadData.hoursIn.toFixed(2)} - - {(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)} - + const popContent = () => ( +
e.stopPropagation()}> + + + {loadData && loadData.jobsOut ? ( + loadData.jobsOut.map((j) => ( + + + + + + )) + ) : ( + + + + )} + +
+ {j.ro_number} + + {`(${( + j.labhrs.aggregate.sum.mod_lb_hrs + + j.larhrs.aggregate.sum.mod_lb_hrs + ).toFixed(1)} ${t("general.labels.hours")})`} + + + {j.scheduled_completion} + +
{t("appointments.labels.nocompletingjobs")}
+ ); + + const LoadComponent = loadData ? ( + +
+ + {(loadData.hoursIn || 0) && loadData.hoursIn.toFixed(2)} + + {(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)} + +
+
) : null; return ( diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index 6adc46e42..db9af532c 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -153,6 +153,18 @@ export default function ShopInfoComponent({ form, saveLoading }) { > + + +