Topics Schema Implemented

This commit is contained in:
Luis Fernando Molina committed 2020-12-16 12:53:19 +01:00
1 parent b5f9ba479a
commit 1a06a5e08c
3 files changed
+85 -17

No files matched your search

+24 -2
View File
@@ -41,12 +41,14 @@ function newAppPostLoader() {
array: {
appSchema: [],
docsNodeSchema: [],
docsConceptSchema: []
docsConceptSchema: [],
docsTopicSchema: []
},
map: {
appSchema: new Map(),
docsNodeSchema: new Map(),
docsConceptSchema: new Map()
docsConceptSchema: new Map(),
docsTopicSchema: new Map()
}
}
SCHEMAS_BY_PROJECT.set(project, schemas)
@@ -110,6 +112,26 @@ function newAppPostLoader() {
webServerResponses++
if (webServerResponses === totalWebServerCalls) { startCanvas() }
}
totalWebServerCalls++
httpRequest(undefined, 'Schema/' + project + '/DocsTopicSchema', onResponseTopicSchema)
function onResponseTopicSchema(err, schema) {
try {
schemas.array.docsTopicSchema = JSON.parse(schema)
for (let j = 0; j < schemas.array.docsTopicSchema.length; j++) {
let nodeDefinition = schemas.array.docsTopicSchema[j]
let key = nodeDefinition.type
schemas.map.docsTopicSchema.set(key, nodeDefinition)
}
} catch (err) {
console.log(err.stack)
}
webServerResponses++
if (webServerResponses === totalWebServerCalls) { startCanvas() }
}
}
}