IO-2932-Scheduling-Lag-on-AIO:
Bump React-Big-Calendar Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -2,11 +2,10 @@ import { AlertFilled } from "@ant-design/icons";
|
|||||||
import { Button, Divider, Dropdown, Form, Input, notification, Popover, Select, Space } from "antd";
|
import { Button, Divider, Dropdown, Form, Input, notification, Popover, Select, Space } from "antd";
|
||||||
import parsePhoneNumber from "libphonenumber-js";
|
import parsePhoneNumber from "libphonenumber-js";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
import queryString from "query-string";
|
import React, { useCallback, useMemo, useState } from "react";
|
||||||
import React, { useState, useCallback, useMemo } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { openChatByPhone, setMessage } from "../../redux/messaging/messaging.actions";
|
import { openChatByPhone, setMessage } from "../../redux/messaging/messaging.actions";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
@@ -46,8 +45,8 @@ export function ScheduleEventComponent({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const location = useLocation();
|
const [searchParams] = useSearchParams();
|
||||||
const searchParams = queryString.parse(location.search);
|
|
||||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
const [title, setTitle] = useState(event.title);
|
const [title, setTitle] = useState(event.title);
|
||||||
|
|
||||||
@@ -79,12 +78,9 @@ export function ScheduleEventComponent({
|
|||||||
}, [handleCancel, event.id]);
|
}, [handleCancel, event.id]);
|
||||||
|
|
||||||
const handlePreviewClick = useCallback(() => {
|
const handlePreviewClick = useCallback(() => {
|
||||||
navigate({
|
const params = new URLSearchParams(searchParams);
|
||||||
search: queryString.stringify({
|
params.set("selected", event.job?.id);
|
||||||
...searchParams,
|
navigate({ search: `?${params.toString()}` });
|
||||||
selected: event.job.id
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}, [navigate, searchParams, event.job.id]);
|
}, [navigate, searchParams, event.job.id]);
|
||||||
|
|
||||||
const handleSendEmailReminder = useCallback(() => {
|
const handleSendEmailReminder = useCallback(() => {
|
||||||
@@ -187,8 +183,9 @@ export function ScheduleEventComponent({
|
|||||||
[title, handleTitleBlur, handleUnblock, event.arrived, t]
|
[title, handleTitleBlur, handleUnblock, event.arrived, t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const popoverContent = useMemo(
|
const popoverContent = useMemo(() => {
|
||||||
() => (
|
console.log("hit");
|
||||||
|
return (
|
||||||
<div style={{ maxWidth: "40vw" }}>
|
<div style={{ maxWidth: "40vw" }}>
|
||||||
{!event.isintake ? (
|
{!event.isintake ? (
|
||||||
<Space>
|
<Space>
|
||||||
@@ -301,17 +298,16 @@ export function ScheduleEventComponent({
|
|||||||
) : null}
|
) : null}
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
),
|
);
|
||||||
[
|
}, [
|
||||||
event,
|
event,
|
||||||
t,
|
t,
|
||||||
handlePreviewClick,
|
handlePreviewClick,
|
||||||
reminderMenu,
|
reminderMenu,
|
||||||
bodyshop.md_lost_sale_reasons,
|
bodyshop.md_lost_sale_reasons,
|
||||||
handleCancelFormFinish,
|
handleCancelFormFinish,
|
||||||
handleRescheduleClick
|
handleRescheduleClick
|
||||||
]
|
]);
|
||||||
);
|
|
||||||
|
|
||||||
const RegularEvent = useMemo(
|
const RegularEvent = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user