fix top priority tests
This commit is contained in:
+27
-9
@@ -165,7 +165,8 @@ export default function App() {
|
||||
const [settingsOpen, setSettingsOpen] = useState(false)
|
||||
const [settings, setSettings] = useState(DEFAULT_SETTINGS)
|
||||
const [dualDeviceWeekendWeekSelections, setDualDeviceWeekendWeekSelections] = useState({})
|
||||
const [topPriority, setTopPriority] = useState('')
|
||||
const [topPriorityDut, setTopPriorityDut] = useState('')
|
||||
const [topPriorityRef, setTopPriorityRef] = useState('')
|
||||
const [lowestPriority, setLowestPriority] = useState('')
|
||||
const [startDateOverride, setStartDateOverride] = useState('')
|
||||
const [failedTests, setFailedTests] = useState([])
|
||||
@@ -298,7 +299,8 @@ export default function App() {
|
||||
const result = await api.compileSchedule({
|
||||
start_date: effectiveStartDate || null,
|
||||
dual_device_weekend_start_dates: dualDeviceWindowStartDates,
|
||||
top_priority_tests: topPriority.split(',').map(s => s.trim()).filter(Boolean),
|
||||
top_priority_tests_dut: topPriorityDut.split(',').map(s => s.trim()).filter(Boolean),
|
||||
top_priority_tests_ref: topPriorityRef.split(',').map(s => s.trim()).filter(Boolean),
|
||||
lowest_priority_tests: lowestPriority.split(',').map(s => s.trim()).filter(Boolean),
|
||||
rule: settings.testExclusion ?? '',
|
||||
})
|
||||
@@ -326,12 +328,26 @@ export default function App() {
|
||||
}
|
||||
|
||||
function handleRerunDecision(_rerunDuringDay) {
|
||||
setTopPriority(prev => {
|
||||
const existing = prev.split(',').map(s => s.trim()).filter(Boolean)
|
||||
const incoming = failedTests.map(t => t.test_id)
|
||||
const merged = [...new Set([...existing, ...incoming])]
|
||||
const appendUnique = (currentValue, incomingValues) => {
|
||||
const existing = currentValue.split(',').map(s => s.trim()).filter(Boolean)
|
||||
const merged = [...new Set([...existing, ...incomingValues])]
|
||||
return merged.join(', ')
|
||||
})
|
||||
}
|
||||
|
||||
const dutIncoming = failedTests
|
||||
.filter(test => test.device === 'CGW453')
|
||||
.map(test => test.test_id)
|
||||
const refIncoming = failedTests
|
||||
.filter(test => test.device === 'CGW452')
|
||||
.map(test => test.test_id)
|
||||
|
||||
if (dutIncoming.length > 0) {
|
||||
setTopPriorityDut(prev => appendUnique(prev, dutIncoming))
|
||||
}
|
||||
if (refIncoming.length > 0) {
|
||||
setTopPriorityRef(prev => appendUnique(prev, refIncoming))
|
||||
}
|
||||
|
||||
setFailedTests([])
|
||||
}
|
||||
|
||||
@@ -390,8 +406,10 @@ export default function App() {
|
||||
completionDate={completionDate}
|
||||
startDateOverride={startDateOverride}
|
||||
onStartDateOverrideChange={setStartDateOverride}
|
||||
topPriority={topPriority}
|
||||
onTopPriorityChange={setTopPriority}
|
||||
topPriorityDut={topPriorityDut}
|
||||
onTopPriorityDutChange={setTopPriorityDut}
|
||||
topPriorityRef={topPriorityRef}
|
||||
onTopPriorityRefChange={setTopPriorityRef}
|
||||
lowestPriority={lowestPriority}
|
||||
onLowestPriorityChange={setLowestPriority}
|
||||
onRemakeSchedule={handleRemakeSchedule}
|
||||
|
||||
@@ -18,8 +18,10 @@ export default function RightPanel({
|
||||
completionDate,
|
||||
startDateOverride,
|
||||
onStartDateOverrideChange,
|
||||
topPriority,
|
||||
onTopPriorityChange,
|
||||
topPriorityDut,
|
||||
onTopPriorityDutChange,
|
||||
topPriorityRef,
|
||||
onTopPriorityRefChange,
|
||||
lowestPriority,
|
||||
onLowestPriorityChange,
|
||||
onRemakeSchedule,
|
||||
@@ -48,12 +50,25 @@ export default function RightPanel({
|
||||
{/* Top priority */}
|
||||
<div>
|
||||
<label className="block text-[11px] font-semibold uppercase tracking-wider text-gray-500 mb-1.5">
|
||||
Top Priority Tests
|
||||
Top Priority Tests (DUT - CGW453)
|
||||
</label>
|
||||
<textarea
|
||||
rows={3}
|
||||
value={topPriority}
|
||||
onChange={(e) => onTopPriorityChange(e.target.value)}
|
||||
value={topPriorityDut}
|
||||
onChange={(e) => onTopPriorityDutChange(e.target.value)}
|
||||
placeholder="P2PRXAX001, COERXBE002…"
|
||||
className="w-full bg-gray-900 border border-gray-600 rounded-md px-2.5 py-1.5 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-blue-500 resize-none font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[11px] font-semibold uppercase tracking-wider text-gray-500 mb-1.5">
|
||||
Top Priority Tests (REF - CGW452)
|
||||
</label>
|
||||
<textarea
|
||||
rows={3}
|
||||
value={topPriorityRef}
|
||||
onChange={(e) => onTopPriorityRefChange(e.target.value)}
|
||||
placeholder="P2PRXAX001, COERXBE002…"
|
||||
className="w-full bg-gray-900 border border-gray-600 rounded-md px-2.5 py-1.5 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-blue-500 resize-none font-mono"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user