feature/IO-3499-React-19 -Checkpoint
This commit is contained in:
@@ -108,9 +108,12 @@ export function ChatPopupComponent({ chatVisible, selectedConversation, toggleCh
|
|||||||
hasLoadedConversationsOnceRef.current = true;
|
hasLoadedConversationsOnceRef.current = true;
|
||||||
|
|
||||||
getConversations({ variables: { offset: 0 } }).catch((err) => {
|
getConversations({ variables: { offset: 0 } }).catch((err) => {
|
||||||
console.error(`Error fetching conversations: ${err?.message || ""}`, err);
|
// Ignore abort errors (they're expected when component unmounts)
|
||||||
|
if (err?.name !== "AbortError") {
|
||||||
|
console.error(`Error fetching conversations: ${err?.message || ""}`, err);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, [getConversations]);
|
}, []);
|
||||||
|
|
||||||
const handleManualRefresh = async () => {
|
const handleManualRefresh = async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
|
|||||||
label={t("jobs.fields.comment")}
|
label={t("jobs.fields.comment")}
|
||||||
styles={{ value: { overflow: "hidden", textOverflow: "ellipsis" } }}
|
styles={{ value: { overflow: "hidden", textOverflow: "ellipsis" } }}
|
||||||
>
|
>
|
||||||
<ProductionListColumnComment record={job} />
|
<ProductionListColumnComment record={job} usePortal={true} />
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
{!isPartsEntry && <DataLabel label={t("jobs.fields.ins_co_nm_short")}>{job.ins_co_nm}</DataLabel>}
|
{!isPartsEntry && <DataLabel label={t("jobs.fields.ins_co_nm_short")}>{job.ins_co_nm}</DataLabel>}
|
||||||
<DataLabel label={t("jobs.fields.clm_no")}>{job.clm_no}</DataLabel>
|
<DataLabel label={t("jobs.fields.clm_no")}>{job.clm_no}</DataLabel>
|
||||||
@@ -176,7 +176,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
|
|||||||
</DataLabel>
|
</DataLabel>
|
||||||
)}
|
)}
|
||||||
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
||||||
<ProductionListColumnProductionNote record={job} />
|
<ProductionListColumnProductionNote record={job} usePortal={true} />
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.estimate_sent_approval")}>
|
<DataLabel label={t("jobs.fields.estimate_sent_approval")}>
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { FaRegStickyNote } from "react-icons/fa";
|
|||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
|
||||||
export default function ProductionListColumnComment({ record }) {
|
export default function ProductionListColumnComment({ record, usePortal = false }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [note, setNote] = useState(record.comment || "");
|
const [note, setNote] = useState(record.comment || "");
|
||||||
@@ -43,16 +43,20 @@ export default function ProductionListColumnComment({ record }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<div style={{ width: "30em" }} onMouseDown={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}>
|
<div
|
||||||
|
style={{ width: "30em" }}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
onPointerDown={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
|
id={`job-comment-${record.id}`}
|
||||||
|
name="comment"
|
||||||
rows={5}
|
rows={5}
|
||||||
value={note}
|
value={note}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
autoFocus
|
autoFocus
|
||||||
allowClear
|
allowClear
|
||||||
style={{ marginBottom: "1em" }}
|
style={{ marginBottom: "1em" }}
|
||||||
onMouseDown={(e) => e.stopPropagation()}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<Button onClick={handleSaveNote} type="primary">
|
<Button onClick={handleSaveNote} type="primary">
|
||||||
@@ -63,7 +67,15 @@ export default function ProductionListColumnComment({ record }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover onOpenChange={handleOpenChange} open={open} content={content} trigger="click" fresh>
|
<Popover
|
||||||
|
onOpenChange={handleOpenChange}
|
||||||
|
open={open}
|
||||||
|
content={content}
|
||||||
|
trigger="click"
|
||||||
|
destroyOnHidden
|
||||||
|
styles={{ body: { padding: '12px' } }}
|
||||||
|
{...(usePortal ? { getPopupContainer: (trigger) => trigger.parentElement || document.body } : {})}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
setNoteUpsertContext: (context) => dispatch(setModalContext({ context: context, modal: "noteUpsert" }))
|
setNoteUpsertContext: (context) => dispatch(setModalContext({ context: context, modal: "noteUpsert" }))
|
||||||
});
|
});
|
||||||
|
|
||||||
function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
|
function ProductionListColumnProductionNote({ record, setNoteUpsertContext, usePortal = false }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [note, setNote] = useState(record.production_vars?.note || "");
|
const [note, setNote] = useState(record.production_vars?.note || "");
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
@@ -59,16 +59,20 @@ function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<div style={{ width: "30em" }} onMouseDown={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}>
|
<div
|
||||||
|
style={{ width: "30em" }}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
onPointerDown={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
|
id={`job-production-note-${record.id}`}
|
||||||
|
name="production_note"
|
||||||
rows={5}
|
rows={5}
|
||||||
value={note}
|
value={note}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
autoFocus
|
autoFocus
|
||||||
allowClear
|
allowClear
|
||||||
style={{ marginBottom: "1em" }}
|
style={{ marginBottom: "1em" }}
|
||||||
onMouseDown={(e) => e.stopPropagation()}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
/>
|
/>
|
||||||
<Space>
|
<Space>
|
||||||
<Button onClick={handleSaveNote} type="primary">
|
<Button onClick={handleSaveNote} type="primary">
|
||||||
@@ -92,7 +96,15 @@ function ProductionListColumnProductionNote({ record, setNoteUpsertContext }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover onOpenChange={handleOpenChange} open={open} content={content} trigger="click" fresh>
|
<Popover
|
||||||
|
onOpenChange={handleOpenChange}
|
||||||
|
open={open}
|
||||||
|
content={content}
|
||||||
|
trigger="click"
|
||||||
|
destroyOnHidden
|
||||||
|
styles={{ body: { padding: '12px' } }}
|
||||||
|
{...(usePortal ? { getPopupContainer: (trigger) => trigger.parentElement || document.body } : {})}
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
|||||||
Reference in New Issue
Block a user