diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json
index 48be20546..79a6ee466 100644
--- a/Projects/ProjectsSchema.json
+++ b/Projects/ProjectsSchema.json
@@ -197,6 +197,11 @@
"name": "Folders",
"propertyName": "folders",
"functionName": "newSuperalgosUtilitiesFolders"
+ },
+ {
+ "name": "Strings",
+ "propertyName": "strings",
+ "functionName": "newSuperalgosUtilitiesStrings"
}
],
"spaces": [
diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
index f6ee3d533..163be6e8e 100644
--- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
+++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js
@@ -619,7 +619,7 @@ function newSuperalgosDocSpace() {
function autoGeneratedHtml() {
generateMenuItems()
- //generateMenuProperties()
+ generateChildrenNodesProperties()
function generateMenuItems() {
/*
@@ -627,89 +627,92 @@ function newSuperalgosDocSpace() {
*/
let paragraph
let key = 'auto-generated-paragraph-' + paragraphIndex
- if (nodeAppDefinition !== undefined && nodeAppDefinition.menuItems !== undefined) {
- paragraph = {
- style: "Title",
- text: "" + nodeAppDefinition.type + " node menu"
- }
- renderParagraph(paragraph, key)
- paragraphIndex++
+ if (nodeAppDefinition === undefined || nodeAppDefinition.menuItems === undefined) { return }
+
+ paragraph = {
+ style: "Title",
+ text: "" + nodeAppDefinition.type + " node menu"
+ }
+ renderParagraph(paragraph, key)
+ paragraphIndex++
+ paragraph = {
+ style: "Text",
+ text: "Each type of node, might have a menu defined so that users can interact with the node. There is no fixed set of menu items. Instead each menu item is defined at each node's definition. Each menu item defined carries a set of properties that allow the system to execute some action when the menu item is clicked by users. The " + nodeAppDefinition.type + " node has the following menu items:"
+ }
+ renderParagraph(paragraph, key)
+ paragraphIndex++
+ for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
+ let menuItem = nodeAppDefinition.menuItems[i]
+
+ HTML = HTML + ''
+ HTML = HTML + '
'
+
paragraph = {
style: "Text",
- text: "The " + nodeAppDefinition.type + " node has the following menu items:"
+ text: 'The ' + menuItem.label + ' menu item has the following properties:'
}
renderParagraph(paragraph, key)
paragraphIndex++
- for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
- let menuItem = nodeAppDefinition.menuItems[i]
-
- HTML = HTML + ''
- HTML = HTML + '
'
+ for (const property in menuItem) {
paragraph = {
- style: "Text",
- text: 'The ' + menuItem.label + ' menu item has the following properties:'
+ style: "List",
+ text: property + ": " + menuItem[property]
}
renderParagraph(paragraph, key)
paragraphIndex++
-
- for (const property in menuItem) {
- paragraph = {
- style: "List",
- text: property + ": " + menuItem[property]
- }
- renderParagraph(paragraph, key)
- paragraphIndex++
- }
-
- HTML = HTML + '
'
}
+
+ HTML = HTML + '
'
}
}
- function generateMenuProperties() {
+ function generateChildrenNodesProperties() {
/*
- Properties
+ Children Nodes Properties
*/
let paragraph
let key = 'auto-generated-paragraph-' + paragraphIndex
- if (nodeAppDefinition !== undefined && nodeAppDefinition.menuItems !== undefined) {
- paragraph = {
- style: "Title",
- text: "" + nodeAppDefinition.type + " node menu"
- }
- renderParagraph(paragraph, key)
- paragraphIndex++
+
+ if (nodeAppDefinition === undefined || nodeAppDefinition.childrenNodesProperties === undefined) { return }
+
+ paragraph = {
+ style: "Title",
+ text: "" + nodeAppDefinition.type + " children nodes"
+ }
+ renderParagraph(paragraph, key)
+ paragraphIndex++
+ paragraph = {
+ style: "Text",
+ text: "Each type of node might have children. If they do, a reference to the children will be present at run-time at one or more properties of the node object. There is no generic childrenNodes property with an array of children nodes. Instead what we can find is that each node definition defines which properties will hold those children references. The property names that will be used for that are the ones listed here. The " + nodeAppDefinition.type + " node has the following children nodes properties:"
+ }
+ renderParagraph(paragraph, key)
+ paragraphIndex++
+ for (let i = 0; i < nodeAppDefinition.childrenNodesProperties.length; i++) {
+ let childrenNodesProperty = nodeAppDefinition.childrenNodesProperties[i]
+
+ let name = UI.projects.superalgos.utilities.strings.fromCamelCaseToUpperWithSpaces(childrenNodesProperty.name)
+
+ HTML = HTML + ''
+
paragraph = {
style: "Text",
- text: "The " + nodeAppDefinition.type + " node has the following menu items:"
+ text: 'The ' + name + ' children node property has in turn the following properties:'
}
renderParagraph(paragraph, key)
paragraphIndex++
- for (let i = 0; i < nodeAppDefinition.menuItems.length; i++) {
- let menuItem = nodeAppDefinition.menuItems[i]
-
- HTML = HTML + ''
- HTML = HTML + '
'
+ for (const property in childrenNodesProperty) {
paragraph = {
- style: "Text",
- text: 'The ' + menuItem.label + ' menu item has the following properties:'
+ style: "List",
+ text: property + ": " + childrenNodesProperty[property]
}
renderParagraph(paragraph, key)
paragraphIndex++
-
- for (const property in menuItem) {
- paragraph = {
- style: "List",
- text: property + ": " + menuItem[property]
- }
- renderParagraph(paragraph, key)
- paragraphIndex++
- }
-
- HTML = HTML + '
'
}
+
+ HTML = HTML + '
'
}
}
}
@@ -1008,7 +1011,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase3) !== undefined) {
if (cleanPhrase3 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase3, '->' + 'Node' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase3.replace(cleanPhrase3, '->' + 'Node' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase3 + ' '
}
@@ -1018,7 +1021,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase2) !== undefined) {
if (cleanPhrase2 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase2, '->' + 'Node' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase2.replace(cleanPhrase2, '->' + 'Node' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase2 + ' '
}
@@ -1028,7 +1031,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.docSchema.get(cleanPhrase1) !== undefined) {
if (cleanPhrase1 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase1, '->' + 'Node' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase1.replace(cleanPhrase1, '->' + 'Node' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase1 + ' '
}
@@ -1049,7 +1052,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase3) !== undefined) {
if (cleanPhrase3 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase3, '->' + 'Concept' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase3.replace(cleanPhrase3, '->' + 'Concept' + '|' + cleanPhrase3 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase3 + ' '
}
@@ -1059,7 +1062,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase2) !== undefined) {
if (cleanPhrase2 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase2, '->' + 'Concept' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase2.replace(cleanPhrase2, '->' + 'Concept' + '|' + cleanPhrase2 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase2 + ' '
}
@@ -1069,7 +1072,7 @@ function newSuperalgosDocSpace() {
}
if (SCHEMAS_BY_PROJECT.get(project).map.conceptSchema.get(cleanPhrase1) !== undefined) {
if (cleanPhrase1 !== excludeNodesAndConceptTypes) {
- taggedText = taggedText + phrase4.replace(cleanPhrase1, '->' + 'Concept' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
+ taggedText = taggedText + phrase1.replace(cleanPhrase1, '->' + 'Concept' + '|' + cleanPhrase1 + '|' + project + '->') + ' '
} else {
taggedText = taggedText + cleanPhrase1 + ' '
}
diff --git a/Projects/Superalgos/UI/Utilities/Strings.js b/Projects/Superalgos/UI/Utilities/Strings.js
new file mode 100644
index 000000000..7ed70bcf1
--- /dev/null
+++ b/Projects/Superalgos/UI/Utilities/Strings.js
@@ -0,0 +1,12 @@
+function newSuperalgosUtilitiesStrings() {
+ thisObject = {
+ fromCamelCaseToUpperWithSpaces: fromCamelCaseToUpperWithSpaces
+ }
+
+ return thisObject
+
+ function fromCamelCaseToUpperWithSpaces(text) {
+ let result = text.replace( /([A-Z])/g, " $1" );
+ return result.charAt(0).toUpperCase() + result.slice(1);
+ }
+}
\ No newline at end of file