feature/IO-3587-Commision-Cut - Improved local email / Test Plans
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -142,8 +142,6 @@ docker_data
|
||||
/CLAUDE.md
|
||||
/COPILOT.md
|
||||
/GEMINI.md
|
||||
/_reference/select-component-test-plan.md
|
||||
|
||||
/.cursorrules
|
||||
/AGENTS.md
|
||||
/AI_CONTEXT.md
|
||||
@@ -151,4 +149,3 @@ docker_data
|
||||
/COPILOT.md
|
||||
/.github/copilot-instructions.md
|
||||
/GEMINI.md
|
||||
/_reference/select-component-test-plan.md
|
||||
|
||||
@@ -46,8 +46,7 @@ app.get("/api/messages", async (req, res) => {
|
||||
|
||||
app.get("/api/messages/:id/raw", async (req, res) => {
|
||||
try {
|
||||
const messages = await fetchSesMessages();
|
||||
const message = messages.find((candidate) => resolveMessageId(candidate) === req.params.id);
|
||||
const message = await findSesMessageById(req.params.id);
|
||||
|
||||
if (!message) {
|
||||
res.status(404).type("text/plain").send("Message not found");
|
||||
@@ -61,6 +60,42 @@ app.get("/api/messages/:id/raw", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/api/messages/:id/attachments/:index", async (req, res) => {
|
||||
try {
|
||||
const attachmentIndex = Number.parseInt(req.params.index, 10);
|
||||
|
||||
if (!Number.isInteger(attachmentIndex) || attachmentIndex < 0) {
|
||||
res.status(400).type("text/plain").send("Attachment index must be a non-negative integer");
|
||||
return;
|
||||
}
|
||||
|
||||
const parsed = await parseSesMessageById(req.params.id);
|
||||
|
||||
if (!parsed) {
|
||||
res.status(404).type("text/plain").send("Message not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const attachment = parsed.attachments?.[attachmentIndex];
|
||||
|
||||
if (!attachment) {
|
||||
res.status(404).type("text/plain").send("Attachment not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const filename = resolveAttachmentFilename(attachment, attachmentIndex);
|
||||
const content = Buffer.isBuffer(attachment.content) ? attachment.content : Buffer.from(attachment.content || "");
|
||||
|
||||
res.setHeader("Content-Type", attachment.contentType || "application/octet-stream");
|
||||
res.setHeader("Content-Disposition", buildAttachmentDisposition(filename));
|
||||
res.setHeader("Content-Length", String(content.length));
|
||||
res.send(content);
|
||||
} catch (error) {
|
||||
console.error("Error downloading attachment:", error);
|
||||
res.status(502).type("text/plain").send(`Unable to download attachment: ${error.message}`);
|
||||
}
|
||||
});
|
||||
|
||||
async function loadMessages() {
|
||||
const startedAt = Date.now();
|
||||
const sesMessages = await fetchSesMessages();
|
||||
@@ -98,6 +133,21 @@ async function fetchSesMessages() {
|
||||
return Array.isArray(data.messages) ? data.messages : [];
|
||||
}
|
||||
|
||||
async function findSesMessageById(id) {
|
||||
const messages = await fetchSesMessages();
|
||||
return messages.find((message, index) => resolveMessageId(message, index) === id) || null;
|
||||
}
|
||||
|
||||
async function parseSesMessageById(id) {
|
||||
const message = await findSesMessageById(id);
|
||||
|
||||
if (!message) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return simpleParser(message.RawData || "");
|
||||
}
|
||||
|
||||
async function toMessageViewModel(message, index) {
|
||||
const id = resolveMessageId(message, index);
|
||||
|
||||
@@ -120,8 +170,9 @@ async function toMessageViewModel(message, index) {
|
||||
messageId: parsed.messageId || "",
|
||||
rawSizeBytes: Buffer.byteLength(message.RawData || "", "utf8"),
|
||||
attachmentCount: parsed.attachments.length,
|
||||
attachments: parsed.attachments.map((attachment) => ({
|
||||
filename: attachment.filename || "Unnamed attachment",
|
||||
attachments: parsed.attachments.map((attachment, attachmentIndex) => ({
|
||||
index: attachmentIndex,
|
||||
filename: resolveAttachmentFilename(attachment, attachmentIndex),
|
||||
contentType: attachment.contentType || "application/octet-stream",
|
||||
size: attachment.size || 0
|
||||
})),
|
||||
@@ -159,6 +210,45 @@ function resolveMessageId(message, index = 0) {
|
||||
return message.Id || `${message.Timestamp || "unknown"}-${message.Source || "unknown"}-${index}`;
|
||||
}
|
||||
|
||||
function resolveAttachmentFilename(attachment, index = 0) {
|
||||
if (attachment?.filename) {
|
||||
return attachment.filename;
|
||||
}
|
||||
|
||||
return `attachment-${index + 1}${attachmentExtension(attachment?.contentType)}`;
|
||||
}
|
||||
|
||||
function attachmentExtension(contentType) {
|
||||
const normalized = String(contentType || "")
|
||||
.split(";")[0]
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
|
||||
return (
|
||||
{
|
||||
"application/json": ".json",
|
||||
"application/pdf": ".pdf",
|
||||
"application/zip": ".zip",
|
||||
"image/gif": ".gif",
|
||||
"image/jpeg": ".jpg",
|
||||
"image/png": ".png",
|
||||
"image/webp": ".webp",
|
||||
"text/calendar": ".ics",
|
||||
"text/csv": ".csv",
|
||||
"text/html": ".html",
|
||||
"text/plain": ".txt"
|
||||
}[normalized] || ""
|
||||
);
|
||||
}
|
||||
|
||||
function buildAttachmentDisposition(filename) {
|
||||
const fallback = String(filename || "attachment")
|
||||
.replace(/[^\x20-\x7e]/g, "_")
|
||||
.replace(/["\\]/g, "_");
|
||||
|
||||
return `attachment; filename="${fallback}"; filename*=UTF-8''${encodeURIComponent(filename || "attachment")}`;
|
||||
}
|
||||
|
||||
function normalizeTimestamp(value) {
|
||||
if (!value) {
|
||||
return "";
|
||||
@@ -254,11 +344,11 @@ function renderHtml() {
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">LocalStack SES</p>
|
||||
<h1>Email Viewer</h1>
|
||||
<p class="lede">A faster local inbox for generated emails with live refresh, manual refresh, search, and raw MIME inspection.</p>
|
||||
<p class="lede">Compact inbox for generated emails with live polling, search, and raw MIME inspection.</p>
|
||||
</div>
|
||||
<div class="hero-controls">
|
||||
<div class="row">
|
||||
<button id="refreshButton" class="primary" type="button">Refresh now</button>
|
||||
<button id="refreshButton" class="primary" type="button">Refresh</button>
|
||||
<label class="chip"><input id="autoToggle" type="checkbox" checked> Live refresh</label>
|
||||
<label class="chip">Every
|
||||
<select id="intervalSelect">
|
||||
@@ -271,12 +361,12 @@ function renderHtml() {
|
||||
</label>
|
||||
</div>
|
||||
<div class="row">
|
||||
<input id="searchInput" class="search" type="search" placeholder="Search subject, addresses, preview, attachment..." autocomplete="off">
|
||||
<input id="searchInput" class="search" type="search" placeholder="Search subject, sender, preview..." autocomplete="off">
|
||||
<button id="clearSearchButton" class="ghost" type="button">Clear</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button id="expandAllButton" class="ghost" type="button">Expand all</button>
|
||||
<button id="collapseAllButton" class="ghost" type="button">Collapse all</button>
|
||||
<button id="expandAllButton" class="ghost" type="button">Open all</button>
|
||||
<button id="collapseAllButton" class="ghost" type="button">Close all</button>
|
||||
<span id="statusChip" class="status">Waiting for first refresh...</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -301,77 +391,80 @@ function renderHtml() {
|
||||
|
||||
function renderStyles() {
|
||||
return `
|
||||
:root{--panel:rgba(255,255,255,.86);--panel-strong:#fff;--ink:#1f2933;--muted:#607080;--line:rgba(31,41,51,.12);--accent:#cf6d3c;--ok:#1f8f65;--warn:#9d5f00;--bad:#b33a3a;--shadow:0 18px 48px rgba(35,43,53,.12);}
|
||||
:root{--panel:rgba(255,255,255,.82);--panel-strong:#fff;--card-shell:linear-gradient(180deg,rgba(255,246,236,.98),rgba(255,252,247,.99));--card-body:#fffdf9;--ink:#1f2933;--muted:#607080;--line:rgba(31,41,51,.12);--card-line:rgba(207,109,60,.24);--accent:#cf6d3c;--accent-soft:rgba(207,109,60,.1);--ok:#1f8f65;--warn:#9d5f00;--bad:#b33a3a;--shadow:0 12px 28px rgba(35,43,53,.08);--card-shadow:0 18px 34px rgba(122,78,34,.12);}
|
||||
*{box-sizing:border-box}
|
||||
html,body{margin:0;min-height:100%}
|
||||
body{background:radial-gradient(circle at top left,rgba(207,109,60,.18),transparent 28%),radial-gradient(circle at top right,rgba(31,143,101,.14),transparent 24%),linear-gradient(180deg,#f8f5ef,#efe7da);color:var(--ink);font:16px/1.5 "Aptos","Segoe UI Variable Display","Segoe UI",system-ui,sans-serif}
|
||||
body{background:radial-gradient(circle at top left,rgba(207,109,60,.18),transparent 28%),radial-gradient(circle at top right,rgba(31,143,101,.12),transparent 24%),linear-gradient(180deg,#f8f5ef,#efe7da);color:var(--ink);font:15px/1.45 "Aptos","Segoe UI Variable Display","Segoe UI",system-ui,sans-serif}
|
||||
button,input,select,textarea{font:inherit}
|
||||
button{cursor:pointer}
|
||||
.page{max-width:1440px;margin:0 auto;padding:24px}
|
||||
.hero{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:24px;margin-bottom:24px}
|
||||
.hero-copy,.hero-controls,.stat,.card{background:var(--panel);backdrop-filter:blur(16px);border:1px solid var(--line);box-shadow:var(--shadow)}
|
||||
.hero-copy,.hero-controls{border-radius:24px;padding:24px}
|
||||
.eyebrow{margin:0 0 8px;color:var(--accent);font-size:.8rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase}
|
||||
h1{margin:0;font-size:clamp(2.2rem,5vw,4rem);line-height:.95;letter-spacing:-.05em}
|
||||
.lede{margin:16px 0 0;max-width:60ch;color:var(--muted)}
|
||||
.hero-controls{display:grid;gap:12px}
|
||||
.row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
|
||||
.page{max-width:1360px;margin:0 auto;padding:18px}
|
||||
.hero{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(320px,.95fr);gap:14px;margin-bottom:14px}
|
||||
.hero-copy,.hero-controls,.stat{background:var(--panel);backdrop-filter:blur(14px);border:1px solid var(--line);box-shadow:var(--shadow)}
|
||||
.card{background:var(--card-shell);border:1px solid var(--card-line);box-shadow:var(--card-shadow)}
|
||||
.hero-copy,.hero-controls{border-radius:18px;padding:18px}
|
||||
.eyebrow{margin:0 0 6px;color:var(--accent);font-size:.76rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase}
|
||||
h1{margin:0;font-size:clamp(1.9rem,4vw,3.1rem);line-height:.98;letter-spacing:-.05em}
|
||||
.lede{margin:10px 0 0;max-width:54ch;color:var(--muted);font-size:.96rem}
|
||||
.hero-controls{display:grid;gap:10px}
|
||||
.row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
||||
.primary,.ghost,.mini,.tab{border-radius:999px;border:1px solid transparent;transition:transform .12s ease,background-color .12s ease,border-color .12s ease}
|
||||
.primary,.ghost{min-height:44px;padding:0 18px;font-weight:700}
|
||||
.mini,.tab{min-height:34px;padding:0 12px;font-weight:600}
|
||||
.primary,.ghost{min-height:38px;padding:0 14px;font-weight:700}
|
||||
.mini,.tab{min-height:30px;padding:0 10px;font-weight:600}
|
||||
.primary{background:var(--accent);color:#fff7f2}
|
||||
.ghost,.mini{background:rgba(255,255,255,.76);border-color:var(--line);color:var(--ink)}
|
||||
.tab{background:transparent;color:var(--muted)}
|
||||
.tab.active{background:#fff;border-color:var(--line);color:var(--ink)}
|
||||
.tab.active{background:#fff;border-color:rgba(207,109,60,.18);color:var(--ink)}
|
||||
.primary:hover,.ghost:hover,.mini:hover,.tab:hover{transform:translateY(-1px)}
|
||||
.chip{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 16px;border-radius:999px;background:rgba(255,255,255,.76);border:1px solid var(--line);font-weight:600}
|
||||
.chip{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 12px;border-radius:999px;background:rgba(255,255,255,.76);border:1px solid var(--line);font-weight:600;font-size:.92rem}
|
||||
.chip input{margin:0;accent-color:var(--accent)}
|
||||
.chip select{border:none;background:transparent;outline:none;color:var(--ink)}
|
||||
.search{flex:1 1 320px;min-height:48px;padding:0 16px;border-radius:16px;border:1px solid var(--line);background:rgba(255,255,255,.82);color:var(--ink);outline:none}
|
||||
.status{display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border-radius:999px;background:rgba(255,255,255,.76);border:1px solid var(--line);color:var(--muted);font-weight:600}
|
||||
.search{flex:1 1 260px;min-height:40px;padding:0 14px;border-radius:14px;border:1px solid var(--line);background:rgba(255,255,255,.82);color:var(--ink);outline:none}
|
||||
.status{display:inline-flex;align-items:center;min-height:34px;padding:0 12px;border-radius:999px;background:rgba(255,255,255,.76);border:1px solid var(--line);color:var(--muted);font-size:.9rem;font-weight:600}
|
||||
.status.ok{color:var(--ok);border-color:rgba(31,143,101,.22);background:rgba(31,143,101,.08)}
|
||||
.status.warn{color:var(--warn);border-color:rgba(157,95,0,.22);background:rgba(157,95,0,.08)}
|
||||
.status.bad{color:var(--bad);border-color:rgba(179,58,58,.22);background:rgba(179,58,58,.08)}
|
||||
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px}
|
||||
.stat{border-radius:18px;padding:18px}
|
||||
.stat span{display:block;margin-bottom:10px;color:var(--muted);font-size:.82rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
|
||||
.stat strong{display:block;font-size:clamp(2rem,4vw,2.6rem);line-height:1;letter-spacing:-.05em}
|
||||
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
|
||||
.stat{border-radius:16px;padding:14px}
|
||||
.stat span{display:block;margin-bottom:8px;color:var(--muted);font-size:.74rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
|
||||
.stat strong{display:block;font-size:clamp(1.6rem,3vw,2rem);line-height:1;letter-spacing:-.05em}
|
||||
.stat strong.small{font-size:1.1rem;line-height:1.3;letter-spacing:-.02em}
|
||||
.stat small{display:block;margin-top:10px;color:var(--muted);font-size:.95rem}
|
||||
.banner,.empty{margin:0 0 18px;padding:16px 18px;border-radius:16px;border:1px solid var(--line);background:rgba(255,255,255,.82)}
|
||||
.stat small{display:block;margin-top:8px;color:var(--muted);font-size:.85rem}
|
||||
.banner,.empty{margin:0 0 12px;padding:12px 14px;border-radius:14px;border:1px solid var(--line);background:rgba(255,255,255,.82)}
|
||||
.banner{color:var(--bad);border-color:rgba(179,58,58,.24);background:rgba(179,58,58,.08)}
|
||||
.list{display:grid;gap:18px}
|
||||
.card{overflow:hidden;border-radius:18px}
|
||||
.card.new{border-color:rgba(31,143,101,.28);box-shadow:var(--shadow),0 0 0 1px rgba(31,143,101,.12)}
|
||||
.summary{list-style:none;display:grid;gap:12px;padding:20px;cursor:pointer}
|
||||
.list{display:grid;gap:12px}
|
||||
.card{overflow:hidden;border-radius:16px}
|
||||
.card.new{border-color:rgba(31,143,101,.3);box-shadow:var(--card-shadow),0 0 0 1px rgba(31,143,101,.12)}
|
||||
.summary{list-style:none;display:grid;gap:8px;padding:14px 16px;cursor:pointer;background:linear-gradient(180deg,rgba(255,250,244,.88),rgba(255,246,238,.96))}
|
||||
.summary::-webkit-details-marker{display:none}
|
||||
.top,.tags,.toolbar,.actions,.attachments{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
|
||||
.top,.tags,.toolbar,.actions,.attachments{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
||||
.top{justify-content:space-between}
|
||||
.head{min-width:0;flex:1 1 320px}
|
||||
.head h2{margin:0;font-size:clamp(1.1rem,2vw,1.45rem);line-height:1.2;letter-spacing:-.03em;word-break:break-word}
|
||||
.meta{margin:6px 0 0;color:var(--muted);font-size:.95rem;word-break:break-word}
|
||||
.time,.tag{display:inline-flex;align-items:center;min-height:28px;padding:0 12px;border-radius:999px;font-size:.84rem;font-weight:700}
|
||||
.head h2{margin:0;font-size:clamp(1rem,1.6vw,1.22rem);line-height:1.18;letter-spacing:-.03em;word-break:break-word}
|
||||
.meta{margin:4px 0 0;color:var(--muted);font-size:.88rem;word-break:break-word}
|
||||
.time,.tag{display:inline-flex;align-items:center;min-height:24px;padding:0 10px;border-radius:999px;font-size:.76rem;font-weight:700}
|
||||
.time{background:rgba(31,41,51,.06)}
|
||||
.tag{background:rgba(31,41,51,.06);color:var(--muted)}
|
||||
.tag{background:var(--accent-soft);color:#8d5632}
|
||||
.tag.new{background:rgba(31,143,101,.1);color:var(--ok)}
|
||||
.tag.bad{background:rgba(179,58,58,.1);color:var(--bad)}
|
||||
.preview{margin:0}
|
||||
.body{display:grid;gap:16px;padding:18px 20px 20px;border-top:1px solid var(--line);background:var(--panel-strong)}
|
||||
.toolbar{justify-content:space-between;align-items:flex-start}
|
||||
.tabs{display:inline-flex;gap:6px;padding:6px;border-radius:999px;background:rgba(31,41,51,.05)}
|
||||
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
|
||||
.metaCard{padding:14px 16px;border-radius:14px;background:rgba(31,41,51,.035);border:1px solid rgba(31,41,51,.08)}
|
||||
.metaCard dt{margin:0 0 6px;color:var(--muted);font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
|
||||
.preview{margin:0;color:#324150;font-size:.94rem}
|
||||
.body{display:grid;gap:12px;padding:12px 16px 16px;border-top:1px solid rgba(207,109,60,.14);background:var(--card-body)}
|
||||
.toolbar{justify-content:space-between;align-items:center}
|
||||
.tabs{display:inline-flex;gap:4px;padding:4px;border-radius:999px;background:rgba(207,109,60,.08)}
|
||||
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px}
|
||||
.metaCard{padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.78);border:1px solid rgba(207,109,60,.12)}
|
||||
.metaCard dt{margin:0 0 4px;color:var(--muted);font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
|
||||
.metaCard dd{margin:0;word-break:break-word}
|
||||
.attachments{gap:8px}
|
||||
.attachment{padding:9px 12px;border-radius:12px;background:rgba(255,255,255,.72);border:1px solid var(--line);font-size:.92rem}
|
||||
.panel{overflow:hidden;border-radius:14px;border:1px solid var(--line);background:#fff}
|
||||
iframe{width:100%;min-height:720px;border:none;background:#fff}
|
||||
pre{margin:0;padding:16px;white-space:pre-wrap;word-break:break-word;overflow:auto;font:13px/1.55 "Cascadia Code","Consolas",monospace;color:#102030;background:linear-gradient(180deg,rgba(207,109,60,.04),transparent 140px),#fff}
|
||||
.placeholder,.inlineError{padding:16px}
|
||||
.attachments{gap:6px}
|
||||
.attachment{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:10px;background:rgba(255,248,240,.96);border:1px solid rgba(207,109,60,.12);font-size:.84rem}
|
||||
.attachmentLink{color:#8d5632;text-decoration:none;transition:transform .12s ease,background-color .12s ease,border-color .12s ease}
|
||||
.attachmentLink:hover{transform:translateY(-1px);background:#fff;border-color:rgba(207,109,60,.28)}
|
||||
.panel{overflow:hidden;border-radius:12px;border:1px solid rgba(207,109,60,.14);background:#fff}
|
||||
iframe{width:100%;min-height:560px;border:none;background:#fff}
|
||||
pre{margin:0;padding:12px;white-space:pre-wrap;word-break:break-word;overflow:auto;font:12.5px/1.45 "Cascadia Code","Consolas",monospace;color:#102030;background:linear-gradient(180deg,rgba(207,109,60,.04),transparent 140px),#fff}
|
||||
.placeholder,.inlineError{padding:12px}
|
||||
.inlineError{color:var(--bad)}
|
||||
@media (max-width:1080px){.hero{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
|
||||
@media (max-width:720px){.page{padding:16px}.stats{grid-template-columns:1fr}.primary,.ghost,.chip{width:100%;justify-content:center}.toolbar,.row{align-items:stretch}iframe{min-height:560px}}
|
||||
@media (max-width:720px){.page{padding:12px}.stats{grid-template-columns:1fr}.primary,.ghost,.chip{width:100%;justify-content:center}.toolbar,.row{align-items:stretch}iframe{min-height:420px}}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -402,7 +495,8 @@ function clientApp(config) {
|
||||
knownIds: new Set(),
|
||||
openIds: new Set(),
|
||||
views: {},
|
||||
raw: {}
|
||||
raw: {},
|
||||
listSignature: ""
|
||||
};
|
||||
|
||||
const el = {
|
||||
@@ -531,6 +625,8 @@ function clientApp(config) {
|
||||
return;
|
||||
}
|
||||
|
||||
let shouldRenderList = false;
|
||||
|
||||
state.loading = true;
|
||||
state.source = source;
|
||||
state.error = "";
|
||||
@@ -548,19 +644,23 @@ function clientApp(config) {
|
||||
const payload = await response.json();
|
||||
const messages = Array.isArray(payload.messages) ? payload.messages : [];
|
||||
const nextIds = new Set(messages.map((message) => message.id));
|
||||
const nextSignature = computeListSignature(messages);
|
||||
|
||||
state.newIds = state.updatedAt
|
||||
? new Set(messages.filter((message) => !state.knownIds.has(message.id)).map((message) => message.id))
|
||||
: new Set();
|
||||
shouldRenderList = nextSignature !== state.listSignature;
|
||||
state.newIds =
|
||||
state.updatedAt && shouldRenderList
|
||||
? new Set(messages.filter((message) => !state.knownIds.has(message.id)).map((message) => message.id))
|
||||
: state.newIds;
|
||||
state.knownIds = nextIds;
|
||||
state.messages = messages;
|
||||
state.duration = payload.fetchDurationMs || 0;
|
||||
state.parseErrors = payload.parseErrors || 0;
|
||||
state.newest = payload.latestMessageTimestamp || "";
|
||||
state.updatedAt = Date.now();
|
||||
state.listSignature = nextSignature;
|
||||
|
||||
pruneState();
|
||||
applyFilter();
|
||||
applyFilter(shouldRenderList);
|
||||
setStatus(`Updated ${messages.length} message${messages.length === 1 ? "" : "s"}.`, "ok");
|
||||
} catch (error) {
|
||||
state.error = error.message || "Unknown refresh error";
|
||||
@@ -568,7 +668,7 @@ function clientApp(config) {
|
||||
} finally {
|
||||
state.loading = false;
|
||||
scheduleRefresh();
|
||||
renderAll();
|
||||
renderAll({ renderList: shouldRenderList });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,12 +690,28 @@ function clientApp(config) {
|
||||
});
|
||||
}
|
||||
|
||||
function applyFilter() {
|
||||
function applyFilter(shouldRenderList = true) {
|
||||
const search = state.search.trim().toLowerCase();
|
||||
state.filtered = !search
|
||||
? [...state.messages]
|
||||
: state.messages.filter((message) => haystack(message).includes(search));
|
||||
renderAll();
|
||||
renderAll({ renderList: shouldRenderList });
|
||||
}
|
||||
|
||||
function computeListSignature(messages) {
|
||||
return messages
|
||||
.map((message) =>
|
||||
[
|
||||
message.id,
|
||||
message.timestampMs || 0,
|
||||
message.rawSizeBytes || 0,
|
||||
message.attachmentCount || 0,
|
||||
message.hasHtml ? 1 : 0,
|
||||
message.preview || "",
|
||||
message.parseError || ""
|
||||
].join("::")
|
||||
)
|
||||
.join("|");
|
||||
}
|
||||
|
||||
function haystack(message) {
|
||||
@@ -624,11 +740,14 @@ function clientApp(config) {
|
||||
state.timer = window.setTimeout(() => refreshMessages("auto"), state.interval);
|
||||
}
|
||||
|
||||
function renderAll() {
|
||||
function renderAll(options = {}) {
|
||||
const { renderList: shouldRenderList = true } = options;
|
||||
renderStats();
|
||||
renderFetch();
|
||||
renderStatus();
|
||||
renderList();
|
||||
if (shouldRenderList) {
|
||||
renderList();
|
||||
}
|
||||
renderLiveClock();
|
||||
}
|
||||
|
||||
@@ -814,7 +933,7 @@ function clientApp(config) {
|
||||
? `<div class="attachments">${message.attachments
|
||||
.map((attachment) => {
|
||||
const size = attachment.size ? `, ${formatBytes(attachment.size)}` : "";
|
||||
return `<span class="attachment">${escapeHtml(attachment.filename)} (${escapeHtml(attachment.contentType)}${escapeHtml(size)})</span>`;
|
||||
return `<a class="attachment attachmentLink" href="/api/messages/${encodeURIComponent(message.id)}/attachments/${attachment.index}" download="${escapeHtml(attachment.filename)}" title="Download ${escapeHtml(attachment.filename)}">${escapeHtml(attachment.filename)} (${escapeHtml(attachment.contentType)}${escapeHtml(size)})</a>`;
|
||||
})
|
||||
.join("")}</div>`
|
||||
: ""
|
||||
|
||||
647
_reference/testPlans/select-component-test-plan.md
Normal file
647
_reference/testPlans/select-component-test-plan.md
Normal file
@@ -0,0 +1,647 @@
|
||||
# Ant Design Select.Option Deprecation - Manual Testing Plan
|
||||
**Branch:** `feature/IO-3544-Ant-Select-Deprecation`
|
||||
**Base Branch:** `master-AIO`
|
||||
**Jira:** IO-3544
|
||||
|
||||
## Overview
|
||||
This branch migrates all Ant Design `<Select.Option>` components to the new `options` prop pattern (required for Ant Design v5+). The deprecated `Select.Option` child component pattern has been replaced with the `options` array prop.
|
||||
|
||||
## What Changed
|
||||
- **Old Pattern:** `<Select><Select.Option value="x">Label</Select.Option></Select>`
|
||||
- **New Pattern:** `<Select options={[{ value: "x", label: "Label" }]} />`
|
||||
- Search filtering updated from `optionFilterProp: "children"` to `optionFilterProp: "label"` or custom props
|
||||
- Custom filter functions updated to use `option.label` instead of `option.props.children`
|
||||
- Complex components with custom rendered content (tags, icons, styled elements) now use `label` prop with JSX
|
||||
|
||||
## Code Review Findings ✅
|
||||
**Validation completed on representative samples:**
|
||||
- ✅ Search functionality properly migrated (showSearch object syntax correct)
|
||||
- ✅ Custom rendered content (tags, badges, icons) preserved in label prop
|
||||
- ✅ Labor type selectors correctly implement all 14 types
|
||||
- ✅ Vendor search with favorites and discount tags working correctly
|
||||
- ✅ Employee selectors with flat_rate/straight_time tags properly structured
|
||||
- ✅ Job search with owner display and status tags correctly migrated
|
||||
- ✅ CiecaSelect utility updated to return options array format
|
||||
- ✅ Performance optimizations added (useMemo in jobs-convert-button)
|
||||
- ✅ Custom optionFilterProp values used where needed (e.g., "name", "search")
|
||||
|
||||
## Testing Strategy
|
||||
For each select component below, verify:
|
||||
1. ✅ **Options Display:** All options appear correctly
|
||||
2. ✅ **Selection:** Can select an option and value is saved
|
||||
3. ✅ **Search/Filter:** Search functionality works (if applicable)
|
||||
4. ✅ **Visual Rendering:** Labels, tags, and custom content display properly (especially vendor discounts, employee tags, job status badges)
|
||||
5. ✅ **Form Integration:** Value persists and submits correctly
|
||||
6. ✅ **Custom Search Props:** Components using custom optionFilterProp (name, search) work correctly
|
||||
|
||||
---
|
||||
|
||||
## Component Test Cases
|
||||
|
||||
### 1. Employee Assignment & Allocation
|
||||
**Files Modified:**
|
||||
- `allocations-assignment.component.jsx`
|
||||
- `allocations-bulk-assignment.component.jsx`
|
||||
- `labor-allocations-adjustment-edit.component.jsx`
|
||||
- `employee-search-select.component.jsx`
|
||||
- `employee-search-select-email.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Job Line Allocation:** Assign employee to job line
|
||||
- Navigate to a job → Job Lines tab
|
||||
- Click allocate hours to an employee
|
||||
- Verify employee dropdown shows full names
|
||||
- Search for employee by name
|
||||
- Verify selection saves
|
||||
|
||||
- [ ] **Bulk Assignment:** Assign multiple job lines to employee
|
||||
- Select multiple job lines
|
||||
- Open bulk assignment modal
|
||||
- Verify employee selector works
|
||||
- Verify employee number, name, and tags (flat rate/straight time) display
|
||||
|
||||
- [ ] **Labor Allocations Adjustment:** Edit labor allocations
|
||||
- Navigate to labor allocations
|
||||
- Edit adjustment form
|
||||
- Verify employee dropdowns work with search
|
||||
|
||||
- [ ] **Employee Search Select with Email:**
|
||||
- Test in any form using employee email selector (uses custom `optionFilterProp: "search"`)
|
||||
- Search by employee number, first name, or last name
|
||||
- Verify employee number, name display correctly
|
||||
- **Critical:** Verify green tag shows "Flat Rate" or "Straight Time"
|
||||
- Verify blue email tag displays when showEmail=true
|
||||
- Test that search matches against concatenated string
|
||||
|
||||
---
|
||||
|
||||
### 2. Job Management
|
||||
**Files Modified:**
|
||||
- `job-search-select.component.jsx`
|
||||
- `jobs-create-jobs-info.component.jsx`
|
||||
- `jobs-detail-general.component.jsx`
|
||||
- `jobs-detail-header-actions.component.jsx`
|
||||
- `jobs-convert-button.component.jsx`
|
||||
- `jobs-close-lines.component.jsx`
|
||||
- `job-3rd-party-modal.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Job Search Select:** Search and select jobs
|
||||
- Any form with job selector (e.g., linking jobs, referencing jobs)
|
||||
- Search by RO number, customer name, or vehicle (uses `filterOption: false` with custom search)
|
||||
- **Critical:** Verify job label shows: `[CLM_NO |] RO_NUMBER | Owner Name | Year Make Model`
|
||||
- **Critical:** Verify status tag displays (e.g., "OPEN", "CLOSED")
|
||||
- Verify loading spinner appears during search
|
||||
- Test with claim numbers visible (clm_no prop)
|
||||
- Verify selection works
|
||||
|
||||
- [ ] **Create Job Form:**
|
||||
- Navigate to Create New Job
|
||||
- Test all dropdowns in job info section:
|
||||
- Job type selection
|
||||
- Status selection
|
||||
- Department/class selection
|
||||
- Estimator selection
|
||||
- File handler selection
|
||||
- Verify options display and selection works
|
||||
|
||||
- [ ] **Job Detail General Tab:**
|
||||
- Open any job → General tab
|
||||
- Test select dropdowns:
|
||||
- Status select
|
||||
- Department/class select
|
||||
- Estimator select
|
||||
- File handler select
|
||||
- Responsibility center select
|
||||
- Verify all dropdowns work with search
|
||||
|
||||
- [ ] **Job Convert Button:**
|
||||
- Open estimate job
|
||||
- Click convert to RO
|
||||
- Verify conversion type dropdown works
|
||||
- Test all options in conversion modal
|
||||
|
||||
- [ ] **Close Job Lines:**
|
||||
- Open converted job
|
||||
- Go to close/finalize
|
||||
- Test location selector in close lines modal
|
||||
- Verify cost center dropdowns
|
||||
|
||||
- [ ] **Third Party Modal:**
|
||||
- Open job → Third party integration
|
||||
- Test company/payer selector
|
||||
- Verify dropdown options and selection
|
||||
|
||||
---
|
||||
|
||||
### 3. Job Lines & Labor
|
||||
**Files Modified:**
|
||||
- `job-lines-upsert-modal.component.jsx`
|
||||
- `job-line-bulk-assign.component.jsx`
|
||||
- `job-line-convert-to-labor.component.jsx`
|
||||
- `job-line-dispatch-button.component.jsx`
|
||||
- `job-line-status-popup.component.jsx`
|
||||
- `job-line-team-assignment.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Add/Edit Job Line:**
|
||||
- Open job → Add new line
|
||||
- Test all dropdowns:
|
||||
- **Labor type selector** (LAA, LAB, LAD, LAE, LAF, LAG, LAM, LAR, LAS, LAU, LA1-LA4)
|
||||
- Location selector
|
||||
- Status selector
|
||||
- Skill/category selector
|
||||
- Verify 14 labor type options display correctly
|
||||
- Test search functionality
|
||||
|
||||
- [ ] **Bulk Line Assignment:**
|
||||
- Select multiple job lines
|
||||
- Open bulk assign
|
||||
- Test team assignment dropdown
|
||||
|
||||
- [ ] **Convert to Labor:**
|
||||
- Select part line
|
||||
- Convert to labor
|
||||
- Test labor type dropdown (LAA, LAB, etc.)
|
||||
- Verify all 14 types available
|
||||
|
||||
- [ ] **Line Dispatch:**
|
||||
- Open dispatch modal for job line
|
||||
- Test team/employee selector
|
||||
|
||||
- [ ] **Line Status Popup:**
|
||||
- Change job line status
|
||||
- Verify status dropdown options
|
||||
|
||||
- [ ] **Team Assignment:**
|
||||
- Assign team to job line
|
||||
- Test team selector dropdown
|
||||
|
||||
---
|
||||
|
||||
### 4. Owners & Vehicles
|
||||
**Files Modified:**
|
||||
- `owner-search-select.component.jsx`
|
||||
- `vehicle-search-select.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Owner Search Select:**
|
||||
- Any form with owner selector
|
||||
- Search by owner name
|
||||
- Verify owner options display
|
||||
- Test selection and search
|
||||
|
||||
- [ ] **Vehicle Search Select:**
|
||||
- Any form with vehicle selector
|
||||
- Search by VIN, license plate, or vehicle description
|
||||
- Verify vehicle options display correctly
|
||||
- Test selection works
|
||||
|
||||
---
|
||||
|
||||
### 5. Vendors & Parts
|
||||
**Files Modified:**
|
||||
- `vendor-search-select.component.jsx`
|
||||
- `parts-order-modal.component.jsx`
|
||||
- `parts-receive-modal.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Vendor Search Select:**
|
||||
- Navigate to bills or parts ordering
|
||||
- Test vendor selector
|
||||
- Search for vendor by name (uses custom `optionFilterProp: "name"`)
|
||||
- **Critical:** Verify favorites (with heart icon) display at top
|
||||
- **Critical:** Verify discount tags show correctly (e.g., "10%")
|
||||
- **Critical:** Verify vendor tags display
|
||||
- Verify phone numbers display if showPhone enabled
|
||||
- Test selection saves discount value to form
|
||||
|
||||
- [ ] **Parts Order Modal:**
|
||||
- Order parts for a job
|
||||
- Test all dropdowns in order form:
|
||||
- Vendor selector
|
||||
- Status selector
|
||||
- Priority selector
|
||||
- Verify options and selection
|
||||
|
||||
- [ ] **Parts Receive Modal:**
|
||||
- Receive parts
|
||||
- Test selectors in receive form
|
||||
- Verify dropdown functionality
|
||||
|
||||
---
|
||||
|
||||
### 6. Bills & Payments
|
||||
**Files Modified:**
|
||||
- `bill-form.component.jsx`
|
||||
- `bill-form-lines.component.jsx`
|
||||
- `bill-form-lines-extended.formitem.component.jsx`
|
||||
- `payment-form.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Bill Entry Form:**
|
||||
- Navigate to Bills → Add New Bill
|
||||
- Test all dropdowns:
|
||||
- Vendor selector
|
||||
- Payment terms selector
|
||||
- GL account selector
|
||||
- Tax code selector
|
||||
- Verify options display
|
||||
|
||||
- [ ] **Bill Lines:**
|
||||
- Add bill line
|
||||
- Test line-level selectors:
|
||||
- Job selector
|
||||
- Job line selector
|
||||
- Account selector
|
||||
- Location selector
|
||||
|
||||
- [ ] **Bill Lines Extended:**
|
||||
- Add extended bill line
|
||||
- Test responsibility center dropdown
|
||||
- Test cost center dropdown
|
||||
|
||||
- [ ] **Payment Form:**
|
||||
- Navigate to Payments → New Payment
|
||||
- Test all dropdowns:
|
||||
- Vendor selector
|
||||
- Payment method selector
|
||||
- Bank account selector
|
||||
- Verify selection works
|
||||
|
||||
---
|
||||
|
||||
### 7. Shop Configuration
|
||||
**Files Modified:**
|
||||
- `shop-info.general.component.jsx`
|
||||
- `shop-info.intake.component.jsx`
|
||||
- `shop-info.responsibilitycenters.component.jsx`
|
||||
- `shop-info.rostatus.component.jsx`
|
||||
- `shop-info.speedprint.component.jsx`
|
||||
- `shop-intellipay-config.component.jsx`
|
||||
- `shop-employees-form.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Shop Info - General:**
|
||||
- Navigate to Shop Settings → General
|
||||
- Test all dropdowns:
|
||||
- Timezone selector
|
||||
- Currency selector
|
||||
- Date format selector
|
||||
- Default options
|
||||
|
||||
- [ ] **Shop Info - Intake:**
|
||||
- Navigate to Shop Settings → Intake
|
||||
- Test intake form selectors
|
||||
- Verify default options work
|
||||
|
||||
- [ ] **Shop Info - Responsibility Centers:**
|
||||
- Navigate to Shop Settings → Responsibility Centers
|
||||
- Test cost center dropdowns
|
||||
- Test location selectors
|
||||
- **Note:** This file had major changes (980 lines modified)
|
||||
|
||||
- [ ] **Shop Info - RO Status:**
|
||||
- Navigate to Shop Settings → RO Status
|
||||
- Test status configuration dropdowns
|
||||
- **Note:** 120 lines modified
|
||||
|
||||
- [ ] **Shop Info - Speed Print:**
|
||||
- Navigate to Shop Settings → Speed Print
|
||||
- Test printer selector
|
||||
- Test template selector
|
||||
|
||||
- [ ] **IntelliPay Config:**
|
||||
- Navigate to Shop Settings → IntelliPay
|
||||
- Test configuration dropdowns (56 lines modified)
|
||||
|
||||
- [ ] **Shop Employees Form:**
|
||||
- Navigate to Shop Settings → Employees → Add/Edit
|
||||
- Test all dropdowns:
|
||||
- Role selector
|
||||
- Department selector
|
||||
- Pay type selector
|
||||
- Verify options display
|
||||
|
||||
---
|
||||
|
||||
### 8. Schedule & Time Tracking
|
||||
**Files Modified:**
|
||||
- `schedule-job-modal.component.jsx`
|
||||
- `schedule-manual-event.component.jsx`
|
||||
- `tech-job-clock-in-form.component.jsx`
|
||||
- `tech-job-clock-out-button.component.jsx`
|
||||
- `time-ticket-modal.component.jsx`
|
||||
- `time-ticket-shift-form.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Schedule Job Modal:**
|
||||
- Navigate to Schedule → Add Appointment
|
||||
- Test all dropdowns:
|
||||
- Job selector
|
||||
- Employee selector
|
||||
- Time slot selector
|
||||
- Duration selector
|
||||
|
||||
- [ ] **Schedule Manual Event:**
|
||||
- Add manual event to schedule
|
||||
- Test event type dropdown
|
||||
- Test employee selector
|
||||
|
||||
- [ ] **Tech Clock In Form:**
|
||||
- Navigate to Tech Portal
|
||||
- Clock in to job
|
||||
- Test job selector
|
||||
- Test operation selector
|
||||
|
||||
- [ ] **Tech Clock Out:**
|
||||
- Clock out from job
|
||||
- Test reason selector (if applicable)
|
||||
- Verify dropdown works
|
||||
|
||||
- [ ] **Time Ticket Modal:**
|
||||
- Enter/edit time ticket
|
||||
- Test all dropdowns:
|
||||
- Employee selector
|
||||
- Job selector
|
||||
- Operation selector
|
||||
|
||||
- [ ] **Time Ticket Shift Form:**
|
||||
- Manage shift
|
||||
- Test shift type selector
|
||||
- Test employee selector
|
||||
|
||||
---
|
||||
|
||||
### 9. Contracts & Courtesy Cars
|
||||
**Files Modified:**
|
||||
- `contract-convert-to-ro.component.jsx`
|
||||
- `contract-status-select.component.jsx`
|
||||
- `courtesy-car-readiness-select.component.jsx`
|
||||
- `courtesy-car-status-select.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Contract Convert to RO:**
|
||||
- Open contract
|
||||
- Convert to RO
|
||||
- Test conversion options dropdown
|
||||
|
||||
- [ ] **Contract Status Select:**
|
||||
- Change contract status
|
||||
- Test status options:
|
||||
- New
|
||||
- Out
|
||||
- Returned
|
||||
- Verify all 3 status options work
|
||||
|
||||
- [ ] **Courtesy Car Readiness:**
|
||||
- Navigate to Courtesy Cars
|
||||
- Change car readiness
|
||||
- Test readiness options:
|
||||
- Ready
|
||||
- Not Ready
|
||||
- Verify both options work
|
||||
|
||||
- [ ] **Courtesy Car Status:**
|
||||
- Change courtesy car status
|
||||
- Test all status options:
|
||||
- In
|
||||
- In Service
|
||||
- Out
|
||||
- Sold
|
||||
- Lease Return
|
||||
- Unavailable
|
||||
- Verify all 6 status options work
|
||||
|
||||
---
|
||||
|
||||
### 10. Email & Communication
|
||||
**Files Modified:**
|
||||
- `email-overlay.component.jsx`
|
||||
- `chat-tag-ro.component.jsx`
|
||||
- `parts-shop-info-email-presets.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Email Overlay:**
|
||||
- Send email from any feature
|
||||
- Test all dropdowns:
|
||||
- From email selector (current user, shop email, custom emails)
|
||||
- Template selector
|
||||
- Priority selector
|
||||
- Verify custom from emails display correctly
|
||||
|
||||
- [ ] **Chat Tag RO:**
|
||||
- Open chat
|
||||
- Tag to RO
|
||||
- Test RO selector dropdown
|
||||
|
||||
- [ ] **Parts Shop Email Presets:**
|
||||
- Navigate to Parts Settings → Email Presets
|
||||
- Test preset selector
|
||||
- Verify options display
|
||||
|
||||
---
|
||||
|
||||
### 11. DMS Integration
|
||||
**Files Modified:**
|
||||
- `dms-post-form/cdklike-dms-post-form.jsx`
|
||||
- `dms/dms.container.jsx`
|
||||
- `dms-payables/dms-payables.container.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **DMS Post Form:**
|
||||
- Navigate to DMS posting
|
||||
- Test all dropdowns in post form:
|
||||
- Account selector
|
||||
- Department selector
|
||||
- GL code selector
|
||||
|
||||
- [ ] **DMS Container:**
|
||||
- Navigate to DMS section
|
||||
- Test filter dropdowns
|
||||
- Verify selection works
|
||||
|
||||
- [ ] **DMS Payables:**
|
||||
- Navigate to DMS Payables
|
||||
- Test payables filter selectors
|
||||
|
||||
---
|
||||
|
||||
### 12. Production & Admin
|
||||
**Files Modified:**
|
||||
- `production-list-config-manager.component.jsx`
|
||||
- `jobs-admin-class.component.jsx`
|
||||
- `jobs-close/jobs-close.component.jsx`
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **Production List Config:**
|
||||
- Navigate to Production Board → Configure
|
||||
- Test column configuration dropdown
|
||||
- Verify display settings work
|
||||
|
||||
- [ ] **Jobs Admin Class:**
|
||||
- Navigate to Admin → Jobs
|
||||
- Change job class/department
|
||||
- Test class selector dropdown
|
||||
|
||||
- [ ] **Jobs Close Page:**
|
||||
- Navigate to Jobs → Close/Export
|
||||
- Test filter dropdowns:
|
||||
- Status filter
|
||||
- Date range
|
||||
- Department filter
|
||||
- Verify selections work
|
||||
|
||||
---
|
||||
|
||||
### 13. Miscellaneous Components
|
||||
**Files Modified:**
|
||||
- `Ciecaselect.jsx` (utility component - 75 lines modified)
|
||||
|
||||
**Test Scenarios:**
|
||||
- [ ] **CIECA Select Utility:**
|
||||
- Used in bill-form-lines-extended for labor type adjustments
|
||||
- Returns options array with 14 labor types (LAA-LAU, LA1-LA4)
|
||||
- Returns 10 part types (PAA, PAC, PAL, PAG, PAM, PAP, PAN, PAO, PAR, PAS) when parts=true
|
||||
- Verify function returns properly formatted options array
|
||||
- Test in any form using DMS integration with CIECA codes
|
||||
|
||||
---
|
||||
|
||||
## Cross-Component Testing
|
||||
|
||||
### Search Functionality
|
||||
Test search across all searchable selects:
|
||||
- [ ] Employee search (by name, employee number)
|
||||
- [ ] Job search (by RO number, customer name, vehicle)
|
||||
- [ ] Vendor search (by name)
|
||||
- [ ] Vehicle search (by VIN, plate, make/model)
|
||||
- [ ] Owner search (by name)
|
||||
|
||||
### Multi-Select Components
|
||||
If any components use `mode="multiple"`:
|
||||
- [ ] Verify multi-select works
|
||||
- [ ] Verify tags display correctly
|
||||
- [ ] Verify removal of selections works
|
||||
|
||||
### Disabled State
|
||||
- [ ] Test dropdowns in disabled state
|
||||
- [ ] Verify disabled styling matches original
|
||||
|
||||
### Form Validation
|
||||
- [ ] Test required field validation on selects
|
||||
- [ ] Verify error messages display correctly
|
||||
- [ ] Test form submission with select values
|
||||
|
||||
---
|
||||
|
||||
## Regression Testing Priority
|
||||
|
||||
### High Priority (Critical User Flows)
|
||||
1. ✅ Create new job with all required fields
|
||||
2. ✅ Add job lines with labor types
|
||||
3. ✅ Assign employees to job lines
|
||||
4. ✅ Order parts with vendor selection
|
||||
5. ✅ Enter bills with vendor and account selection
|
||||
6. ✅ Close and export jobs
|
||||
|
||||
### Medium Priority
|
||||
7. Convert estimate to RO
|
||||
8. Schedule appointments
|
||||
9. Clock in/out (tech portal)
|
||||
10. Update shop configuration
|
||||
11. Manage courtesy cars
|
||||
|
||||
### Low Priority (Admin Functions)
|
||||
12. DMS integration posting
|
||||
13. Production board configuration
|
||||
14. Admin job modifications
|
||||
|
||||
---
|
||||
|
||||
## Browser Testing
|
||||
Test in:
|
||||
- [ ] Chrome (latest)
|
||||
- [ ] Firefox (latest)
|
||||
- [ ] Safari (if applicable)
|
||||
- [ ] Edge (latest)
|
||||
|
||||
---
|
||||
|
||||
## Known Changed Components Summary
|
||||
**Total Files Modified:** 54 client files + 1 server file
|
||||
|
||||
**Labor Type Selectors (14 options):**
|
||||
- LAA, LAB, LAD, LAE, LAF, LAG, LAM, LAR, LAS, LAU, LA1, LA2, LA3, LA4
|
||||
- Found in: job-lines-upsert-modal, job-line-convert-to-labor, bill-form-lines
|
||||
|
||||
**Most Complex Changes:**
|
||||
- `shop-info.responsibilitycenters.component.jsx` (980 lines changed)
|
||||
- `vendor-search-select.component.jsx` (120 lines changed)
|
||||
- `shop-info.rostatus.component.jsx` (120 lines changed)
|
||||
- `jobs-convert-button.component.jsx` (198 lines changed)
|
||||
- `Ciecaselect.jsx` (75 lines changed)
|
||||
|
||||
---
|
||||
|
||||
## Internal Code Review Results ✅
|
||||
|
||||
**Files Validated (Sample):**
|
||||
1. ✅ `allocations-assignment.component.jsx` - Simple employee selector with search
|
||||
2. ✅ `contract-status-select.component.jsx` - Static 3-option select
|
||||
3. ✅ `courtesy-car-status-select.component.jsx` - Static 6-option select
|
||||
4. ✅ `job-lines-upsert-modal.component.jsx` - 14 labor type options inline
|
||||
5. ✅ `email-overlay.component.jsx` - From email with custom emails array
|
||||
6. ✅ `employee-search-select-email.component.jsx` - Complex with tags and custom search prop
|
||||
7. ✅ `bill-form-lines-extended.formitem.component.jsx` - CiecaSelect utility usage
|
||||
8. ✅ `vendor-search-select.component.jsx` - Complex with favorites, tags, discount, phone
|
||||
9. ✅ `job-search-select.component.jsx` - Complex with owner display, status tags, loading states
|
||||
10. ✅ `Ciecaselect.jsx` - Utility function returning options array
|
||||
|
||||
**Validation Checklist:**
|
||||
- [x] All `Select.Option` patterns removed
|
||||
- [x] Replaced with `options` array prop
|
||||
- [x] `showSearch` uses object syntax `{{ optionFilterProp: "label" }}`
|
||||
- [x] Custom `optionFilterProp` used where needed ("name", "search", etc.)
|
||||
- [x] Complex rendered content preserved in `label` prop with JSX
|
||||
- [x] Tags, icons, badges, and styled elements working correctly
|
||||
- [x] Search functionality using correct property references
|
||||
- [x] Labor types: All 14 types present (LAA, LAB, LAD, LAE, LAF, LAG, LAM, LAR, LAS, LAU, LA1, LA2, LA3, LA4)
|
||||
- [x] Part types: All 10 types in CiecaSelect (PAA, PAC, PAL, PAG, PAM, PAP, PAN, PAO, PAR, PAS)
|
||||
- [x] Custom filterOption functions updated (option.label vs option.props.children)
|
||||
- [x] Performance optimizations added (useMemo for large option lists)
|
||||
- [x] labelRender custom rendering preserved where used
|
||||
- [x] optionLabelProp used correctly for display vs value
|
||||
|
||||
**Known Complex Patterns Verified:**
|
||||
1. **Vendor Select:** Favorites with heart icon, discount tags, phone display, custom search by "name"
|
||||
2. **Employee Select:** Flat rate/straight time tags, custom search by "search" prop (employee number + name)
|
||||
3. **Job Select:** Owner display function, status tags, loading states, conditional claim number display
|
||||
4. **Email Overlay:** Multiple from addresses (user email, shop email, custom md_from_emails array)
|
||||
5. **Bill Lines Extended:** Conditional DMS vs responsibility centers, CiecaSelect utility
|
||||
|
||||
**No Issues Found** - All migrations follow the correct pattern.
|
||||
|
||||
---
|
||||
|
||||
## Testing Notes
|
||||
- Focus on components with search functionality - filtering logic changed from `children` to `label`
|
||||
- Pay attention to components with custom rendered content (tags, badges, formatted text)
|
||||
- Verify `optionFilterProp` works correctly for custom search fields
|
||||
- Test components that map over arrays to generate options
|
||||
- Check components with conditional option rendering
|
||||
|
||||
---
|
||||
|
||||
## Sign-Off
|
||||
- [ ] All high priority tests passed
|
||||
- [ ] All medium priority tests passed
|
||||
- [ ] All low priority tests passed
|
||||
- [ ] No console errors observed
|
||||
- [ ] Visual appearance matches original
|
||||
- [ ] Performance is acceptable (no lag in large dropdowns)
|
||||
|
||||
**Tested By:** _________________
|
||||
**Date:** _________________
|
||||
**Environment:** _________________
|
||||
**Notes:** _________________
|
||||
Reference in New Issue
Block a user