feature/IO-3499-React-19: Email breaking bounds in job info / responsive..

This commit is contained in:
Dave
2026-01-19 13:17:39 -05:00
parent ddf4256e58
commit 8bd7e5cc6d
3 changed files with 21 additions and 19 deletions

View File

@@ -13,31 +13,32 @@ export default function DataLabel({
if (!open || (hideIfNull && !children)) return null; if (!open || (hideIfNull && !children)) return null;
return ( return (
<div {...props} style={{ display: "flex" }}> <div {...props} style={{ display: "flex", alignItems: "flex-start" }}>
<div <div
style={{ style={{
// flex: 2, marginRight: ".2rem",
marginRight: ".2rem" flexShrink: 0, // <-- key: don't let the label collapse
whiteSpace: "nowrap" // <-- key: keep "Email:" on one line
}} }}
> >
<Typography.Text type="secondary">{`${label}:`}</Typography.Text> <Typography.Text type="secondary">{`${label}:`}</Typography.Text>
</div> </div>
<div <div
style={{ style={{
flex: 4, flex: 1, // <-- key: take remaining space
minWidth: 0, // <-- key: allow this flex item to shrink
marginLeft: ".3rem", marginLeft: ".3rem",
fontWeight: "bolder", fontWeight: "bolder",
wordWrap: "break-word", overflowWrap: "anywhere", // <-- key: break long tokens (email/vin)
cursor: onValueClick !== undefined ? "pointer" : "" wordBreak: "break-word", // (backup behavior across browsers)
cursor: onValueClick !== undefined ? "pointer" : "",
...(styles?.value ?? {}) // apply your per-field overrides to ALL children types
}} }}
className={valueClassName} className={valueClassName}
onClick={onValueClick} onClick={onValueClick}
> >
{typeof children === "string" ? ( {typeof children === "string" ? <Typography.Text>{children}</Typography.Text> : children}
<Typography.Text style={styles?.value}>{children}</Typography.Text>
) : (
children
)}
</div> </div>
</div> </div>
); );

View File

@@ -86,10 +86,10 @@ export function JobsChangeStatus({ job, bodyshop, jobRO, insertAuditTrail, isPar
const statusMenu = { const statusMenu = {
items: [ items: [
...availableStatuses.map((item) => ({ ...(availableStatuses?.map((item) => ({
key: item, key: item,
label: item label: item
})) })) ?? [])
], ],
onClick: (e) => updateJobStatus(e.key) onClick: (e) => updateJobStatus(e.key)
}; };

View File

@@ -65,8 +65,8 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
const colSpan = { const colSpan = {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 24 }, sm: { span: 24 },
md: { span: isPartsEntry ? 8 : 12 }, md: { span: 12 },
lg: { span: isPartsEntry ? 8 : 6 }, lg: { span: 12 },
xl: { span: isPartsEntry ? 8 : 6 } xl: { span: isPartsEntry ? 8 : 6 }
}; };
@@ -260,19 +260,19 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
<ChatOpenButton type={job.ownr_ph1_ty} phone={job.ownr_ph1} jobid={job.id} /> <ChatOpenButton type={job.ownr_ph1_ty} phone={job.ownr_ph1} jobid={job.id} />
)} )}
</DataLabel> </DataLabel>
<DataLabel key="22" label={t("jobs.fields.ownr_ph2")}> <DataLabel key="3" label={t("jobs.fields.ownr_ph2")}>
{disabled || isPartsEntry ? ( {disabled || isPartsEntry ? (
<PhoneNumberFormatter type={job.ownr_ph2_ty}>{job.ownr_ph2}</PhoneNumberFormatter> <PhoneNumberFormatter type={job.ownr_ph2_ty}>{job.ownr_ph2}</PhoneNumberFormatter>
) : ( ) : (
<ChatOpenButton type={job.ownr_ph2_ty} phone={job.ownr_ph2} jobid={job.id} /> <ChatOpenButton type={job.ownr_ph2_ty} phone={job.ownr_ph2} jobid={job.id} />
)} )}
</DataLabel> </DataLabel>
<DataLabel key="3" label={t("owners.fields.address")}> <DataLabel key="4" label={t("owners.fields.address")}>
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${ {`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
job.ownr_city || "" job.ownr_city || ""
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`} } ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
</DataLabel> </DataLabel>
<DataLabel key="4" label={t("owners.fields.ownr_ea")}> <DataLabel key="5" label={t("owners.fields.ownr_ea")}>
{disabled || isPartsEntry ? ( {disabled || isPartsEntry ? (
<>{job.ownr_ea || ""}</> <>{job.ownr_ea || ""}</>
) : job.ownr_ea ? ( ) : job.ownr_ea ? (
@@ -280,13 +280,14 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
) : null} ) : null}
</DataLabel> </DataLabel>
{job.owner?.tax_number && ( {job.owner?.tax_number && (
<DataLabel key="5" label={t("owners.fields.tax_number")}> <DataLabel key="6" label={t("owners.fields.tax_number")}>
{job.owner?.tax_number || ""} {job.owner?.tax_number || ""}
</DataLabel> </DataLabel>
)} )}
<DataLabel <DataLabel
label={t("owners.fields.note")} label={t("owners.fields.note")}
styles={{ value: { overflow: "hidden", textOverflow: "ellipsis" } }} styles={{ value: { overflow: "hidden", textOverflow: "ellipsis" } }}
key="7"
> >
{job.owner?.note || ""} {job.owner?.note || ""}
</DataLabel> </DataLabel>