This commit is contained in:
Luis Fernando Molina committed 2020-12-24 15:58:49 +01:00
1 parent 67975dcf18
commit ef356b701f
2 files changed
+40 -2

No files matched your search

@@ -11,8 +11,8 @@
"text": "Block #1"
},
{
"style": "Text",
"text": "Vaina Paragraph 1"
"style": "Hierarchy",
"text": "Superalgos->Task->5"
},
{
"style": "Note",
@@ -2960,6 +2960,44 @@ function newSuperalgosDocSpace() {
appSchemaDocument = SCHEMAS_BY_PROJECT.get(project).map.appSchema.get(type)
if (appSchemaDocument === undefined) { return }
if (isNaN(levels) === true) { return }
const MAX_COLUMNS = 10
const MAX_ROWS = 100
let contentMatrix = []
for (let i = 0; i < MAX_ROWS; i++) {
contentMatrix.push(['', '', '', '', '', '', '', '', '', ''])
}
let currentColumn = 0
let currentRow = -1
scanHierarchy(appSchemaDocument, project, currentColumn)
function scanHierarchy(schemaDocument, project, currentColumn) {
if (schemaDocument === undefined) { return }
if (schemaDocument.childrenNodesProperties === undefined) { return }
currentRow++
let matrixValue = schemaDocument.type
let matrixRow = contentMatrix[currentRow]
matrixRow[currentColumn] = matrixValue
for (let i = 0; i < schemaDocument.childrenNodesProperties.length; i++) {
let property = schemaDocument.childrenNodesProperties[i]
let childProject = project
if (property.project !== undefined) {
childProject = property.project
}
let childType = property.childType
let childSchemaDocument = SCHEMAS_BY_PROJECT.get(project).map.appSchema.get(childType)
scanHierarchy(childSchemaDocument, childProject, currentColumn + 1)
}
}
let HTML = ''