From bf5138016797086b51d6342027a6a37f1dc77382 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 14 Nov 2024 11:19:09 -0800 Subject: [PATCH 1/2] IO-3031 View Day when Scheduling Signed-off-by: Allan Carr --- .vscode/settings.json | 13 ++++ .../form-date-time-picker.component.jsx | 74 ++++++++++++++----- .../schedule-job-modal.component.jsx | 6 +- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 6 files changed, 73 insertions(+), 23 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index dd6a1330b..626931a53 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,18 @@ "pattern": "**/IMEX.xml", "systemId": "logs/IMEX.xsd" } + ], + "cSpell.words": [ + "antd", + "appointmentconfirmation", + "appt", + "bodyshop", + "IMEX", + "labhrs", + "larhrs", + "ownr", + "promanager", + "smartscheduling", + "touchtime" ] } diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index c9bbc0dd2..3f7948d52 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -1,4 +1,4 @@ -import { DatePicker } from "antd"; +import { DatePicker, Space, TimePicker } from "antd"; import PropTypes from "prop-types"; import React, { useCallback, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -20,6 +20,7 @@ const DateTimePicker = ({ onlyFuture, onlyToday, isDateOnly = false, + isSeparatedTime: isSeparatedTime = false, bodyshop, ...restProps }) => { @@ -87,24 +88,56 @@ const DateTimePicker = ({ return (
- + {isSeparatedTime && ( + + + {value && ( + { + handleChange(value); + onBlur(); + }} + placeholder={t("general.labels.time")} + {...restProps} + /> + )} + + )} + {!isSeparatedTime && ( + + )}
); }; @@ -116,7 +149,8 @@ DateTimePicker.propTypes = { id: PropTypes.string, onlyFuture: PropTypes.bool, onlyToday: PropTypes.bool, - isDateOnly: PropTypes.bool + isDateOnly: PropTypes.bool, + isSeparatedTime: PropTypes.bool }; export default connect(mapStateToProps, null)(DateTimePicker); diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx index ea942e5d2..abc01afbd 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx @@ -1,6 +1,5 @@ import { Button, Col, Form, Input, Row, Select, Space, Switch, Typography } from "antd"; import axios from "axios"; -import dayjs from "../../utils/day"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -8,13 +7,14 @@ import { createStructuredSelector } from "reselect"; import { calculateScheduleLoad } from "../../redux/application/application.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; import { DateFormatter } from "../../utils/DateFormatter"; +import dayjs from "../../utils/day"; +import InstanceRenderManager from "../../utils/instanceRenderMgr"; import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component"; import EmailInput from "../form-items-formatted/email-form-item.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container"; import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component"; import "./schedule-job-modal.scss"; -import InstanceRenderManager from "../../utils/instanceRenderMgr"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -84,7 +84,7 @@ export function ScheduleJobModalComponent({ } ]} > - + Date: Thu, 14 Nov 2024 11:52:47 -0800 Subject: [PATCH 2/2] IO-3031 Adjust prop Signed-off-by: Allan Carr --- .../form-date-time-picker/form-date-time-picker.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index 3f7948d52..649e02f9a 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -20,7 +20,7 @@ const DateTimePicker = ({ onlyFuture, onlyToday, isDateOnly = false, - isSeparatedTime: isSeparatedTime = false, + isSeparatedTime = false, bodyshop, ...restProps }) => {