diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts index c394685..097df9c 100644 --- a/BACKEND/app/services/line_connection.ts +++ b/BACKEND/app/services/line_connection.ts @@ -2026,20 +2026,21 @@ Ports Missing/Down: ${missing.length}\n\n` let verdictBd = '#a7f3d0' let verdictTx = '#065f46' - if (!physicalPass && !aiPass) { - verdictLabel = 'CRITICAL ISSUES' - verdictMsg = 'Physical failures + AI detected problems' - verdictBg = '#fef2f2' - verdictBd = '#fecaca' - verdictTx = '#991b1b' - } else if (!physicalPass) { + // if (!physicalPass && !aiPass) { + // verdictLabel = 'CRITICAL ISSUES' + // verdictMsg = 'Physical failures + AI detected problems' + // verdictBg = '#fef2f2' + // verdictBd = '#fecaca' + // verdictTx = '#991b1b' + // } else + if (!physicalPass) { verdictLabel = 'PHYSICAL INCOMPLETE' verdictMsg = `${missing.length} port(s) untested${isSkipped ? ' — testing skipped' : ''}` verdictBg = '#fef2f2' verdictBd = '#fecaca' verdictTx = '#991b1b' } else if (!aiPass) { - verdictLabel = `AI: ${summaryStatus}` + verdictLabel = summaryStatus === 'FAIL' ? 'CRITICAL ISSUES' : `AI: ${summaryStatus}` verdictMsg = summaryStatus === 'FAIL' ? 'AI analysis failed — review required' @@ -2110,12 +2111,12 @@ Ports Missing/Down: ${missing.length}\n\n` const missingParts: string[] = [] if (missingPoE.length) { missingParts.push( - `
Missing PoE (${missingPoE.length}):
${missingPoE.map((p) => escapeHtml(physicalTest.normalizePortName(p.name))).join(', ')}
` + `
Untested PoE (${missingPoE.length}):
${missingPoE.map((p) => escapeHtml(physicalTest.normalizePortName(p.name))).join(', ')}
` ) } if (missingSFP.length) { missingParts.push( - `
Missing SFP (${missingSFP.length}):
${missingSFP.map((p) => escapeHtml(physicalTest.normalizePortName(p.name))).join(', ')}
` + `
Untested SFP (${missingSFP.length}):
${missingSFP.map((p) => escapeHtml(physicalTest.normalizePortName(p.name))).join(', ')}
` ) } if (isSkipped) { @@ -2327,7 +2328,7 @@ Ports Missing/Down: ${missing.length}\n\n`
Receiving & Inspection Notes
${dataIncomingBySN?.packagePo?.receivedBy?.fullName || 'Unknown'} · ${dataIncomingBySN?.packagePo?.receivedDate ? momentTZ(dataIncomingBySN?.packagePo?.receivedDate).tz(timeZone).format('DD MMM YYYY, HH:mm') : ''}
-
+
⚠ Warning from Warehouse

${dataIncomingBySN?.packagePo?.notes || ''}

${serialInfo?.notes || ''}

diff --git a/FRONTEND/src/components/Modal/ModalConfirmSkipTestPort.tsx b/FRONTEND/src/components/Modal/ModalConfirmSkipTestPort.tsx index 318fbbb..73a9824 100644 --- a/FRONTEND/src/components/Modal/ModalConfirmSkipTestPort.tsx +++ b/FRONTEND/src/components/Modal/ModalConfirmSkipTestPort.tsx @@ -7,6 +7,8 @@ import { TextInput, Button, ScrollArea, + Radio, + Group, } from "@mantine/core"; import type { TLine, TStation } from "../../untils/types"; import type { Socket } from "socket.io-client"; @@ -21,6 +23,7 @@ interface Props { interface PropsLines { id: number | undefined; note: string; + reasonType?: string; pid?: string; sn?: string; vid?: string; @@ -48,10 +51,13 @@ export default function ModalConfirmSkipTestPort({ pid: line?.inventory?.pid, sn: line?.inventory?.sn, vid: line?.inventory?.vid, + reasonType: prev?.find((el) => el.id === line.id) + ? prev?.find((el) => el.id === line.id)?.reasonType || "" + : "", note: prev?.find((el) => el.id === line.id) ? prev?.find((el) => el.id === line.id)?.note || "" : "", - })) + })), ); } }, [listLines]); @@ -99,39 +105,80 @@ export default function ModalConfirmSkipTestPort({ - - setDataLines( - dataLines.map((el) => - el.id === line.id - ? { - ...el, - note: e.target.value, - isError: false, - } - : el + + + setDataLines( + dataLines.map((el) => + el.id === line.id + ? { + ...el, + reasonType: "no_poe", + note: "", + isError: false, + } + : el, + ), ) - ) - } - error={ - line.isError - ? "Please enter the reason for skip test ports" - : "" - } - /> + } + /> + + setDataLines( + dataLines.map((el) => + el.id === line.id + ? { + ...el, + reasonType: "other", + isError: false, + } + : el, + ), + ) + } + /> + + {line.reasonType === "other" && ( + + setDataLines( + dataLines.map((el) => + el.id === line.id + ? { + ...el, + note: e.target.value, + isError: false, + } + : el, + ), + ) + } + error={ + line.isError + ? "Please enter the reason for skip test ports" + : "" + } + /> + )}