fix(ui): update frontend dashboard to strictly consume snake_case fields following camelCase removal
This commit is contained in:
1 parent
05e3e53217
commit
e8d7ded32a
1 file changed
+12
-12
+12
-12
@@ -617,7 +617,7 @@
|
||||
if (!entity) return;
|
||||
|
||||
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';
|
||||
|
||||
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 relHtml = rels.map(r => {
|
||||
if (r.from === nodeId) return `<li>→ <em>${r.relationType}</em> → <strong>${r.to}</strong></li>`;
|
||||
return `<li>← <em>${r.relationType}</em> ← <strong>${r.from}</strong></li>`;
|
||||
if (r.from === nodeId) return `<li>→ <em>${r.relation_type}</em> → <strong>${r.to}</strong></li>`;
|
||||
return `<li>← <em>${r.relation_type}</em> ← <strong>${r.from}</strong></li>`;
|
||||
}).join('');
|
||||
document.getElementById('inspector-relations').innerHTML = relHtml || '<li><em>No direct relations.</em></li>';
|
||||
|
||||
@@ -658,16 +658,16 @@
|
||||
const nodeIds = new Set();
|
||||
|
||||
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 (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({
|
||||
id: name,
|
||||
label: name,
|
||||
title: `${name}\nType: ${entity.entityType}`,
|
||||
title: `${name}\nType: ${entity.entity_type}`,
|
||||
color: { background: color.bg || color.background, border: color.border },
|
||||
font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#eee' : '#333' }
|
||||
});
|
||||
@@ -677,10 +677,10 @@
|
||||
rawRelations.forEach(r => {
|
||||
if (nodeIds.has(r.from) && nodeIds.has(r.to)) {
|
||||
newEdges.push({
|
||||
id: r.from + '-' + r.to + '-' + r.relationType,
|
||||
id: r.from + '-' + r.to + '-' + r.relation_type,
|
||||
from: r.from,
|
||||
to: r.to,
|
||||
label: r.relationType,
|
||||
label: r.relation_type,
|
||||
arrows: 'to',
|
||||
font: { color: document.documentElement.getAttribute('data-theme') === 'dark' ? '#aaa' : '#666', strokeWidth: 0 }
|
||||
});
|
||||
@@ -749,7 +749,7 @@
|
||||
function buildTaskTreeHTML(tasks, parentId, depth = 0) {
|
||||
let html = '';
|
||||
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
|
||||
return pid === parentId;
|
||||
});
|
||||
@@ -806,12 +806,12 @@
|
||||
|
||||
html += `<strong>${t.title}</strong>${t.description}`;
|
||||
|
||||
const criteria = t.acceptanceCriteria || t.acceptance_criteria || [];
|
||||
const criteria = t.acceptance_criteria || [];
|
||||
if (criteria.length > 0) {
|
||||
html += `<ul style="margin:8px 0 0 0; padding-left:20px; font-size: 0.9em; color: var(--text-secondary);">`;
|
||||
let unmetCriteria = false;
|
||||
criteria.forEach(c => {
|
||||
const isMet = c.isMet || c.is_met;
|
||||
const isMet = c.is_met;
|
||||
if (!isMet) unmetCriteria = true;
|
||||
const check = isMet ? '☑' : '☐';
|
||||
const strike = isMet ? 'text-decoration: line-through;' : '';
|
||||
|
||||
Reference in new issue
Block a user