fix(ui): update frontend dashboard to strictly consume snake_case fields following camelCase removal

This commit is contained in:
Riz Ashraf committed 2026-09-26 09:06:39 +01:00
1 parent 05e3e53217
commit e8d7ded32a
1 file changed
+12 -12
+12 -12
View File
@@ -617,7 +617,7 @@
if (!entity) return; if (!entity) return;
document.getElementById('inspector-title').innerText = entity.name; document.getElementById('inspector-title').innerText = entity.name;
document.getElementById('inspector-type').innerText = entity.entityType; document.getElementById('inspector-type').innerText = entity.entity_type;
document.getElementById('inspector-namespace').innerText = entity.namespace || 'global'; document.getElementById('inspector-namespace').innerText = entity.namespace || 'global';
const obsHtml = (entity.observations || []).map(o => `<li>${o}</li>`).join(''); const obsHtml = (entity.observations || []).map(o => `<li>${o}</li>`).join('');
@@ -625,8 +625,8 @@
const rels = rawRelations.filter(r => r.from === nodeId || r.to === nodeId); const rels = rawRelations.filter(r => r.from === nodeId || r.to === nodeId);
const relHtml = rels.map(r => { const relHtml = rels.map(r => {
if (r.from === nodeId) return `<li>→ <em>${r.relationType}</em> → <strong>${r.to}</strong></li>`; if (r.from === nodeId) return `<li>→ <em>${r.relation_type}</em> → <strong>${r.to}</strong></li>`;
return `<li>← <em>${r.relationType}</em> ← <strong>${r.from}</strong></li>`; return `<li>← <em>${r.relation_type}</em> ← <strong>${r.from}</strong></li>`;
}).join(''); }).join('');
document.getElementById('inspector-relations').innerHTML = relHtml || '<li><em>No direct relations.</em></li>'; document.getElementById('inspector-relations').innerHTML = relHtml || '<li><em>No direct relations.</em></li>';
@@ -658,16 +658,16 @@
const nodeIds = new Set(); const nodeIds = new Set();
for (const [name, entity] of Object.entries(rawEntities)) { for (const [name, entity] of Object.entries(rawEntities)) {
allTypes.add(entity.entityType); allTypes.add(entity.entity_type);
// If filters are active, only show matching types // If filters are active, only show matching types
if (activeFilters.size > 0 && !activeFilters.has(entity.entityType)) continue; if (activeFilters.size > 0 && !activeFilters.has(entity.entity_type)) continue;
const color = getColorForType(entity.entityType); const color = getColorForType(entity.entity_type);
newNodes.push({ newNodes.push({
id: name, id: name,
label: name, label: name,
title: `${name}\nType: ${entity.entityType}`, title: `${name}\nType: ${entity.entity_type}`,
color: { background: color.bg || color.background, border: color.border }, color: { background: color.bg || color.background, border: color.border },
font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#eee' : '#333' } font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#eee' : '#333' }
}); });
@@ -677,10 +677,10 @@
rawRelations.forEach(r => { rawRelations.forEach(r => {
if (nodeIds.has(r.from) && nodeIds.has(r.to)) { if (nodeIds.has(r.from) && nodeIds.has(r.to)) {
newEdges.push({ newEdges.push({
id: r.from + '-' + r.to + '-' + r.relationType, id: r.from + '-' + r.to + '-' + r.relation_type,
from: r.from, from: r.from,
to: r.to, to: r.to,
label: r.relationType, label: r.relation_type,
arrows: 'to', arrows: 'to',
font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#aaa' : '#666', strokeWidth: 0 } font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#aaa' : '#666', strokeWidth: 0 }
}); });
@@ -749,7 +749,7 @@
function buildTaskTreeHTML(tasks, parentId, depth = 0) { function buildTaskTreeHTML(tasks, parentId, depth = 0) {
let html = ''; let html = '';
const children = tasks.filter(t => { const children = tasks.filter(t => {
const pid = t.parentId || t.parent_id; const pid = t.parent_id;
if (!parentId) return !pid; // If looking for root, return tasks with no parent if (!parentId) return !pid; // If looking for root, return tasks with no parent
return pid === parentId; return pid === parentId;
}); });
@@ -806,12 +806,12 @@
html += `<strong>${t.title}</strong>${t.description}`; html += `<strong>${t.title}</strong>${t.description}`;
const criteria = t.acceptanceCriteria || t.acceptance_criteria || []; const criteria = t.acceptance_criteria || [];
if (criteria.length > 0) { if (criteria.length > 0) {
html += `<ul style="margin:8px 0 0 0; padding-left:20px; font-size: 0.9em; color: var(--text-secondary);">`; html += `<ul style="margin:8px 0 0 0; padding-left:20px; font-size: 0.9em; color: var(--text-secondary);">`;
let unmetCriteria = false; let unmetCriteria = false;
criteria.forEach(c => { criteria.forEach(c => {
const isMet = c.isMet || c.is_met; const isMet = c.is_met;
if (!isMet) unmetCriteria = true; if (!isMet) unmetCriteria = true;
const check = isMet ? '☑' : '☐'; const check = isMet ? '☑' : '☐';
const strike = isMet ? 'text-decoration: line-through;' : ''; const strike = isMet ? 'text-decoration: line-through;' : '';