From 4b7bbe686acc3eca08014f2dee37840c26e7dec3 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 28 Jun 2021 13:38:09 -0700 Subject: [PATCH] IO-1222 Add preview to schedule view. --- bodyshop_translations.babel | 21 +++++ .../schedule-event.component.jsx | 20 ++++- .../scheduler-calendar-wrapper.component.jsx | 82 ++++++++++--------- .../schedule-calendar.component.jsx | 1 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 7 files changed, 87 insertions(+), 40 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index fbcd25a81..922f4c878 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -301,6 +301,27 @@ + + preview + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + reschedule false diff --git a/client/src/components/job-at-change/schedule-event.component.jsx b/client/src/components/job-at-change/schedule-event.component.jsx index 41bdb24d6..6e1b0b11d 100644 --- a/client/src/components/job-at-change/schedule-event.component.jsx +++ b/client/src/components/job-at-change/schedule-event.component.jsx @@ -2,7 +2,7 @@ import { Button, Popover, Space } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; -import { Link } from "react-router-dom"; +import { Link, useHistory, useLocation } from "react-router-dom"; import { setModalContext } from "../../redux/modals/modals.actions"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import PhoneFormatter from "../../utils/PhoneFormatter"; @@ -11,6 +11,8 @@ import { TemplateList } from "../../utils/TemplateConstants"; import DataLabel from "../data-label/data-label.component"; import ScheduleAtChange from "./job-at-change.component"; import ScheduleEventColor from "./schedule-event.color.component"; +import queryString from "query-string"; + const mapDispatchToProps = (dispatch) => ({ setScheduleContext: (context) => dispatch(setModalContext({ context: context, modal: "schedule" })), @@ -24,6 +26,8 @@ export function ScheduleEventComponent({ }) { const { t } = useTranslation(); const [visible, setVisible] = useState(false); + const history = useHistory(); + const searchParams = queryString.parse(useLocation().search); const blockContent = (
@@ -88,6 +92,20 @@ export function ScheduleEventComponent({ ) : null} + {event.job ? ( + + ) : null}