Skip to content

Commit 3c35882

Browse files
pwt-cdclaude
andcommitted
FIX: Add missing entities to ERD Navigator configuration
- Add BioramPathway and BioramReporting to compliance_reporting area - Add IdentificationMethod to core_traceability area - Add MoistureContent to measurement_verification area - Add entity_display configurations with appropriate emojis and positions - Resolves "Entity not properly configured" errors for all 36 BOOST entities - Maintains schema-driven architecture without hardcoding entity names 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 466a676 commit 3c35882

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

erd-navigator/erd-config.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"core_traceability": {
99
"color": "#16A34A",
1010
"label": "Core Traceability",
11-
"entities": ["TraceableUnit", "ProcessingHistory", "LocationHistory", "BiometricIdentifier"]
11+
"entities": ["TraceableUnit", "ProcessingHistory", "LocationHistory", "BiometricIdentifier", "IdentificationMethod"]
1212
},
1313
"material_supply_chain": {
1414
"color": "#A16207",
@@ -23,7 +23,7 @@
2323
"measurement_verification": {
2424
"color": "#EAB308",
2525
"label": "Measurement & Verification",
26-
"entities": ["MeasurementRecord", "Claim", "VerificationStatement"]
26+
"entities": ["MeasurementRecord", "Claim", "VerificationStatement", "MoistureContent"]
2727
},
2828
"geographic_tracking": {
2929
"color": "#9333EA",
@@ -33,7 +33,7 @@
3333
"compliance_reporting": {
3434
"color": "#DC2626",
3535
"label": "Compliance & Reporting",
36-
"entities": ["LcfsPathway", "LcfsReporting", "ProductGroup", "EnergyCarbonData", "DataReconciliation", "MassBalanceAccount"]
36+
"entities": ["LcfsPathway", "LcfsReporting", "BioramPathway", "BioramReporting", "ProductGroup", "EnergyCarbonData", "DataReconciliation", "MassBalanceAccount"]
3737
}
3838
},
3939
"entity_display": {
@@ -164,6 +164,22 @@
164164
"Equipment": {
165165
"emoji": "🔧",
166166
"position": {"x": 1900, "y": 2000}
167+
},
168+
"BioramPathway": {
169+
"emoji": "🛤️",
170+
"position": {"x": 2400, "y": 2300}
171+
},
172+
"BioramReporting": {
173+
"emoji": "📋",
174+
"position": {"x": 2700, "y": 2600}
175+
},
176+
"IdentificationMethod": {
177+
"emoji": "🔬",
178+
"position": {"x": 1600, "y": 800}
179+
},
180+
"MoistureContent": {
181+
"emoji": "💧",
182+
"position": {"x": 3600, "y": 100}
167183
}
168184
},
169185
"manual_relationships": [

erd-navigator/index.html

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,11 +768,23 @@ <h3>❓ Questions & Answers</h3>
768768

769769
// Entity positions are now managed exclusively through the ERD config file
770770

771+
// Determine schema path based on environment (local vs GitHub Pages)
772+
function getSchemaBasePath() {
773+
// Check if we're on GitHub Pages or local development
774+
const hostname = window.location.hostname;
775+
if (hostname === 'carbondirect.github.io' || hostname.endsWith('.github.io')) {
776+
return '../schema'; // GitHub Pages path
777+
} else {
778+
return '../drafts/current/schema'; // Local development path
779+
}
780+
}
781+
771782
// Auto-discovery functions - uses manifest file for reliable cross-platform discovery
772783
async function discoverSchemaDirectories() {
773784
try {
785+
const schemaBasePath = getSchemaBasePath();
774786
// Try manifest file first (recommended approach)
775-
const manifestResponse = await fetch('../drafts/current/schema/directories.json');
787+
const manifestResponse = await fetch(`${schemaBasePath}/directories.json`);
776788
if (manifestResponse.ok) {
777789
const manifest = await manifestResponse.json();
778790
console.log(`Loaded ${manifest.total_entities} schema directories from manifest (updated: ${manifest.last_updated})`);
@@ -782,7 +794,7 @@ <h3>❓ Questions & Answers</h3>
782794
console.warn('Manifest file not found, falling back to directory discovery');
783795

784796
// Fallback to raw directory listing (local development)
785-
const response = await fetch('../drafts/current/schema/');
797+
const response = await fetch(`${schemaBasePath}/`);
786798
const text = await response.text();
787799
const parser = new DOMParser();
788800
const doc = parser.parseFromString(text, 'text/html');
@@ -810,7 +822,8 @@ <h3>❓ Questions & Answers</h3>
810822
// Schema loading functions
811823
async function loadSchemaFile(entityName) {
812824
try {
813-
const schemaPath = `../drafts/current/schema/${entityName.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}/validation_schema.json?cb=${Date.now()}`;
825+
const schemaBasePath = getSchemaBasePath();
826+
const schemaPath = `${schemaBasePath}/${entityName.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}/validation_schema.json?cb=${Date.now()}`;
814827
const response = await fetch(schemaPath);
815828
if (!response.ok) {
816829
console.warn(`Could not load schema for ${entityName}: ${response.status}`);

0 commit comments

Comments
 (0)