feature/IO-3499-React-19: Manual Appointment in Schedule, Email Form console error
This commit is contained in:
@@ -32,6 +32,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [sending, setSending] = useState(false);
|
const [sending, setSending] = useState(false);
|
||||||
const [rawHtml, setRawHtml] = useState("");
|
const [rawHtml, setRawHtml] = useState("");
|
||||||
|
const [htmlSize, setHtmlSize] = useState(0);
|
||||||
const [pdfCopytoAttach, setPdfCopytoAttach] = useState({
|
const [pdfCopytoAttach, setPdfCopytoAttach] = useState({
|
||||||
filename: null,
|
filename: null,
|
||||||
pdf: null
|
pdf: null
|
||||||
@@ -151,6 +152,13 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
if (modalVisible) render();
|
if (modalVisible) render();
|
||||||
}, [modalVisible]);
|
}, [modalVisible]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const html = form.getFieldValue("html");
|
||||||
|
if (html) {
|
||||||
|
setHtmlSize(new Blob([html]).size);
|
||||||
|
}
|
||||||
|
}, [form, rawHtml]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
destroyOnHidden
|
destroyOnHidden
|
||||||
@@ -169,7 +177,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
disabled:
|
disabled:
|
||||||
selectedMedia &&
|
selectedMedia &&
|
||||||
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
|
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
|
||||||
10485760 - new Blob([form.getFieldValue("html")]).size ||
|
10485760 - htmlSize ||
|
||||||
selectedMedia.filter((s) => s.isSelected).length > 10)
|
selectedMedia.filter((s) => s.isSelected).length > 10)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -195,7 +203,7 @@ export function EmailOverlayContainer({ emailConfig, modalVisible, toggleEmailOv
|
|||||||
disabled={
|
disabled={
|
||||||
selectedMedia &&
|
selectedMedia &&
|
||||||
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
|
(selectedMedia.filter((s) => s.isSelected).reduce((acc, val) => (acc = acc + val.size), 0) >=
|
||||||
10485760 - new Blob([form.getFieldValue("html")]).size ||
|
10485760 - htmlSize ||
|
||||||
selectedMedia.filter((s) => s.isSelected).length > 10)
|
selectedMedia.filter((s) => s.isSelected).length > 10)
|
||||||
}
|
}
|
||||||
type="primary"
|
type="primary"
|
||||||
|
|||||||
@@ -120,6 +120,13 @@ export function ScheduleEventComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handleConvert = async (values) => {
|
const handleConvert = async (values) => {
|
||||||
|
if (!event.job?.id) {
|
||||||
|
notification.error({
|
||||||
|
title: t("appointments.errors.nojob")
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const res = await mutationUpdateJob({
|
const res = await mutationUpdateJob({
|
||||||
variables: {
|
variables: {
|
||||||
jobId: event.job.id,
|
jobId: event.job.id,
|
||||||
@@ -397,21 +404,21 @@ export function ScheduleEventComponent({
|
|||||||
(HasFeatureAccess({ featureName: "checklist", bodyshop }) ? (
|
(HasFeatureAccess({ featureName: "checklist", bodyshop }) ? (
|
||||||
<Link
|
<Link
|
||||||
to={{
|
to={{
|
||||||
pathname: `/manage/jobs/${event.job && event.job.id}/intake`,
|
pathname: `/manage/jobs/${event.job.id}/intake`,
|
||||||
search: `?appointmentId=${event.id}`
|
search: `?appointmentId=${event.id}`
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button disabled={event.arrived}>{t("appointments.actions.intake")}</Button>
|
<Button disabled={event.arrived}>{t("appointments.actions.intake")}</Button>
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<Popover //open={open}
|
<Popover
|
||||||
content={popMenu}
|
content={popMenu}
|
||||||
open={popOverVisible}
|
open={popOverVisible}
|
||||||
onOpenChange={setPopOverVisible}
|
onOpenChange={setPopOverVisible}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (event.job?.id) {
|
if (event.job?.id) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
getJobDetails({ id: event.job.id });
|
getJobDetails({ variables: { id: event.job.id } });
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
getPopupContainer={(trigger) => trigger.parentNode}
|
getPopupContainer={(trigger) => trigger.parentNode}
|
||||||
@@ -434,37 +441,36 @@ export function ScheduleEventComponent({
|
|||||||
return baseColor;
|
return baseColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
const RegularEvent = event.isintake ? (
|
const RegularEvent =
|
||||||
<Space
|
event.isintake && event.job ? (
|
||||||
wrap
|
<Space
|
||||||
size="small"
|
wrap
|
||||||
style={{
|
size="small"
|
||||||
backgroundColor: getEventBackground()
|
style={{
|
||||||
}}
|
backgroundColor: getEventBackground()
|
||||||
>
|
}}
|
||||||
{event.note && <AlertFilled className="production-alert" />}
|
>
|
||||||
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
{event.note && <AlertFilled className="production-alert" />}
|
||||||
<OwnerNameDisplay ownerObject={event.job} />
|
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
||||||
{`${(event.job && event.job.v_model_yr) || ""} ${
|
<OwnerNameDisplay ownerObject={event.job} />
|
||||||
(event.job && event.job.v_make_desc) || ""
|
{`${event.job.v_model_yr || ""} ${event.job.v_make_desc || ""} ${event.job.v_model_desc || ""}`}
|
||||||
} ${(event.job && event.job.v_model_desc) || ""}`}
|
{`(${event.job.labhrs?.aggregate?.sum?.mod_lb_hrs || "0"} / ${
|
||||||
{`(${(event.job && event.job.labhrs.aggregate.sum.mod_lb_hrs) || "0"} / ${
|
event.job.larhrs?.aggregate?.sum?.mod_lb_hrs || "0"
|
||||||
(event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
|
})`}
|
||||||
})`}
|
{event.job.alt_transport && <div style={{ margin: ".1rem" }}>{event.job.alt_transport}</div>}
|
||||||
{event.job && event.job.alt_transport && <div style={{ margin: ".1rem" }}>{event.job.alt_transport}</div>}
|
{event.job.comment && `C: ${event.job.comment}`}
|
||||||
{event?.job?.comment && `C: ${event.job.comment}`}
|
</Space>
|
||||||
</Space>
|
) : (
|
||||||
) : (
|
<div
|
||||||
<div
|
style={{
|
||||||
style={{
|
height: "100%",
|
||||||
height: "100%",
|
width: "100%",
|
||||||
width: "100%",
|
backgroundColor: getEventBackground()
|
||||||
backgroundColor: getEventBackground()
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<strong>{`${event.title || ""}`}</strong>
|
||||||
<strong>{`${event.title || ""}`}</strong>
|
</div>
|
||||||
</div>
|
);
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
|
|||||||
Reference in New Issue
Block a user