Added basic bucketed smart scheduling BOD-4
This commit is contained in:
@@ -3,11 +3,12 @@ import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { auth } from "../../firebase/firebase.utils";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||
import EmailInput from "../form-items-formatted/email-form-item.component";
|
||||
import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.container";
|
||||
import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import moment from "moment";
|
||||
|
||||
export default function ScheduleJobModalComponent({
|
||||
existingAppointments,
|
||||
@@ -41,7 +42,7 @@ export default function ScheduleJobModalComponent({
|
||||
return (
|
||||
<Row gutter={[32, 32]}>
|
||||
<Col span={14}>
|
||||
<div className='imex-flex-row imex-flex-row__flex-space-around'>
|
||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||
<strong>{t("appointments.fields.time")}</strong>
|
||||
<DateTimePicker
|
||||
value={appData.start}
|
||||
@@ -53,15 +54,20 @@ export default function ScheduleJobModalComponent({
|
||||
{t("appointments.actions.smartscheduling")}
|
||||
</Button>
|
||||
</div>
|
||||
<div className='imex-flex-row imex-flex-row__flex-space-around'>
|
||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||
{appData.smartDates.map((d, idx) => (
|
||||
<Button
|
||||
className='imex-flex-row__margin'
|
||||
className="imex-flex-row__margin"
|
||||
key={idx}
|
||||
onClick={() => {
|
||||
setAppData({ ...appData, start: d });
|
||||
}}>
|
||||
<DateTimeFormatter>{d}</DateTimeFormatter>
|
||||
console.log("new Date(d)", new Date(d));
|
||||
setAppData({
|
||||
...appData,
|
||||
start: new moment(d).add(8, "hours"),
|
||||
});
|
||||
}}
|
||||
>
|
||||
<DateFormatter>{d}</DateFormatter>
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
@@ -75,7 +81,8 @@ export default function ScheduleJobModalComponent({
|
||||
defaultChecked={appData.notifyCustomer}
|
||||
onChange={(e) =>
|
||||
setAppData({ ...appData, notifyCustomer: e.target.checked })
|
||||
}>
|
||||
}
|
||||
>
|
||||
{t("jobs.labels.appointmentconfirmation")}
|
||||
</Checkbox>
|
||||
<EmailInput
|
||||
|
||||
@@ -53,7 +53,7 @@ export function ScheduleJobModalContainer({
|
||||
start: null,
|
||||
smartDates: [],
|
||||
});
|
||||
}, [job, , setAppData]);
|
||||
}, [job, setAppData]);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -158,7 +158,8 @@ export function ScheduleJobModalContainer({
|
||||
okButtonProps={{
|
||||
disabled: appData.start ? false : true,
|
||||
loading: loading,
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<ScheduleJobModalComponent
|
||||
existingAppointments={existingAppointments}
|
||||
appData={appData}
|
||||
|
||||
Reference in New Issue
Block a user