fixed compatibility issue
This commit is contained in:
@@ -64,7 +64,7 @@ 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
|
||||
Top Priority Tests
|
||||
</label>
|
||||
<textarea
|
||||
rows={3}
|
||||
|
||||
@@ -5,6 +5,24 @@ const STATUS_STYLES = {
|
||||
invalid: 'bg-yellow-800/60 text-yellow-200 border-yellow-600',
|
||||
}
|
||||
|
||||
function formatConfig(config) {
|
||||
if (!config || typeof config !== 'object') return '—'
|
||||
const entries = Object.entries(config)
|
||||
if (entries.length === 0) return '—'
|
||||
const formattedEntries = entries
|
||||
.map(([band, data]) => {
|
||||
if (!data || typeof data !== 'object') return null
|
||||
const testpoint = data.test_point || data['Test Point']
|
||||
const sta = data.sta || data.STA
|
||||
// Only display if both testpoint and sta are present
|
||||
if (!testpoint || !sta) return null
|
||||
return `${band}: ${testpoint}→${sta}`
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
return formattedEntries.length > 0 ? formattedEntries.join('; ') : '—'
|
||||
}
|
||||
|
||||
export default function TestCard({ test }) {
|
||||
const style = STATUS_STYLES[test.status] ?? STATUS_STYLES.pending
|
||||
|
||||
@@ -18,10 +36,11 @@ export default function TestCard({ test }) {
|
||||
</div>
|
||||
{/* Hover tooltip */}
|
||||
<div className="absolute z-50 bottom-full left-0 mb-1 hidden group-hover:block min-w-max">
|
||||
<div className="bg-gray-800 border border-gray-600 rounded-md px-2.5 py-1.5 text-xs text-gray-200 shadow-lg">
|
||||
<div className="bg-gray-800 border border-gray-600 rounded-md px-2.5 py-1.5 text-xs text-gray-200 shadow-lg max-w-md">
|
||||
<p><span className="text-gray-400">Type:</span> {test.test_type ?? '—'}</p>
|
||||
<p><span className="text-gray-400">Rotation:</span> {test.rotation ?? '—'}</p>
|
||||
<p><span className="text-gray-400">Device:</span> {test.device ?? '—'}</p>
|
||||
<p className="mt-1 pt-1 border-t border-gray-600"><span className="text-gray-400">Config:</span> {formatConfig(test.config)}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user