Concepts and Topics with Images at the definition

This commit is contained in:
Luis Fernando Molina committed 2020-12-30 10:58:42 +01:00
1 parent b2dd8252a4
commit 15cd349c05
13 files changed
+58 -51

No files matched your search

+4 -4
View File
@@ -122,10 +122,10 @@
<img src="Icons/Superalgos/docs-note-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toJavascript()">
<img src="Icons/Superalgos/docs-javascript-code-style.png" class="menu-img">
<img src="Icons/Superalgos/docs-js-code-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toYouTubeVideo()">
<img src="Icons/Superalgos/docs-youtube-style.png" class="menu-img">
<img src="Icons/Superalgos/docs-youtube-video-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toBlock()">
<img src="Icons/Superalgos/docs-block-style.png" class="menu-img">
@@ -142,7 +142,7 @@
<img src="Icons/Superalgos/docs-list-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toSuccess()">
<img src="Icons/Superalgos/docs-sucess-style.png" class="menu-img">
<img src="Icons/Superalgos/docs-success-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toJson()">
<img src="Icons/Superalgos/docs-json-code-style.png" class="menu-img">
@@ -182,7 +182,7 @@
<img src="Icons/Superalgos/docs-action-delete-paragraph.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toWebPageLink()">
<img src="Icons/Superalgos/docs-link-style.png" class="menu-img">
<img src="Icons/Superalgos/docs-web-page-link-style.png" class="menu-img">
</div>
<div class="menu-item" onClick="window.contextMenu.toAnchor()">
<img src="Icons/Superalgos/docs-anchor-style.png" class="menu-img">
@@ -38,7 +38,7 @@
try {
/* Context Variables */
let contextVariables = {
lastBandFile: undefined, // Datetime of the last file files sucessfully produced by this process.
lastBandFile: undefined, // Datetime of the last file files successfully produced by this process.
firstTradeFile: undefined, // Datetime of the first trade file in the whole market history.
maxBandFile: undefined // Datetime of the last file available to be used as an input of this process.
};
@@ -36,7 +36,7 @@
try {
/* Context Variables */
let contextVariables = {
lastCandleFile: undefined, // Datetime of the last file files sucessfully produced by this process.
lastCandleFile: undefined, // Datetime of the last file files successfully produced by this process.
firstTradeFile: undefined, // Datetime of the first trade file in the whole market history.
maxCandleFile: undefined // Datetime of the last file available to be used as an input of this process.
};
@@ -50,7 +50,7 @@
try {
/* Context Variables */
let contextVariables = {
lastCandleFile: undefined, // Datetime of the last file files sucessfully produced by this process.
lastCandleFile: undefined, // Datetime of the last file files successfully produced by this process.
firstTradeFile: undefined, // Datetime of the first trade file in the whole market history.
maxCandleFile: undefined // Datetime of the last file available to be used as an input of this process.
};
@@ -41,7 +41,7 @@
/* Context Variables */
let contextVariables = {
lastFile: undefined, // Datetime of the last file files sucessfully produced by this process.
lastFile: undefined, // Datetime of the last file files successfully produced by this process.
dateBeginOfMarket: undefined, // Datetime of the first trade file in the whole market history.
dateEndOfMarket: undefined // Datetime of the last file available to be used as an input of this process.
};
@@ -60,7 +60,7 @@
/* Context Variables */
let contextVariables = {
lastFile: undefined, // Datetime of the last file files sucessfully produced by this process.
lastFile: undefined, // Datetime of the last file files successfully produced by this process.
dateBeginOfMarket: undefined, // Datetime of the first trade file in the whole market history.
dateEndOfMarket: undefined // Datetime of the last file available to be used as an input of this process.
};
@@ -40,18 +40,25 @@ function newSuperalgosDesignSpace() {
/* Take types-icons relationships defined at the schema */
for (let i = 0; i < PROJECTS_ARRAY.length; i++) {
let project = PROJECTS_ARRAY[i]
let appSchema = SCHEMAS_BY_PROJECT.get(project).array.appSchema
for (let j = 0; j < appSchema.length; j++) {
let schemaDocument = appSchema[j]
let iconName = schemaDocument.icon
if (iconName === undefined) {
iconName = schemaDocument.type.toLowerCase()
iconName = iconName.split(" ").join("-")
}
let icon = thisObject.getIconByProjectAndName(project, iconName)
if (icon !== undefined) {
let key = project + '-' + schemaDocument.type
thisObject.iconsByProjectAndType.set(key, icon)
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.appSchema)
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema)
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema)
addSchemaTypes(SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema)
function addSchemaTypes(schema) {
for (let j = 0; j < schema.length; j++) {
let schemaDocument = schema[j]
let iconName = schemaDocument.icon
if (iconName === undefined) {
iconName = schemaDocument.type.toLowerCase()
iconName = iconName.split(" ").join("-")
}
let icon = thisObject.getIconByProjectAndName(project, iconName)
if (icon !== undefined) {
let key = project + '-' + schemaDocument.type
thisObject.iconsByProjectAndType.set(key, icon)
}
}
}
}
@@ -1972,27 +1972,24 @@ function newSuperalgosDocSpace() {
let definitionText = getTextBasedOnLanguage(docsSchemaDocument.definition)
definitionText = definitionText + addWarningIfTranslationIsOutdated(docsSchemaDocument.definition)
if (category === 'Topic' || category === 'Concept') {
/* We will test if we can draw an image here or not*/
let testElement = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndType(project, type)
if ((category === 'Topic' || category === 'Concept') && testElement === undefined) {
HTML = HTML + '<div id="definition-summary-editable-paragraph" class="docs-summary"><b>Summary:</b> ' + addToolTips(definitionText) + '</div>'
} else {
HTML = HTML + '<div class="docs-definition-table">'
if (category === 'Node') {
let imageItem = {
div: 'definition-image-div-' + definitionImagesArray.length,
project: project,
category: category,
type: type
}
definitionImagesArray.push(imageItem)
HTML = HTML + '<div id="' + imageItem.div + '" class="docs-image-container"></div>'
let imageItem = {
div: 'definition-image-div-' + definitionImagesArray.length,
project: project,
category: category,
type: type
}
definitionImagesArray.push(imageItem)
HTML = HTML + '<div id="' + imageItem.div + '" class="docs-image-container"></div>'
HTML = HTML + '<div id="' + idPrefix + 'paragraph" class="docs-font-normal"><strong>' + addToolTips(definitionText) + '</strong></div>'
HTML = HTML + '</div>'
}
}
@@ -2180,11 +2177,14 @@ function newSuperalgosDocSpace() {
for (let i = 0; i < definitionImagesArray.length; i++) {
let imageItem = definitionImagesArray[i]
let appSchemaDocument = SCHEMAS_BY_PROJECT.get(imageItem.project).map.appSchema.get(imageItem.type)
let imageElement
if (appSchemaDocument.icon === undefined) {
if (appSchemaDocument !== undefined && appSchemaDocument.icon === undefined) {
/*
We are checking this because there is a possibility that a different icon is specified
for this Node Type, in that case we would override the default that is that the icon name is
equal to the Node Type.
*/
let imageName = appSchemaDocument.type.toLowerCase().replaceAll(' ', '-')
imageElement = UI.projects.superalgos.spaces.designSpace.getIconByProjectAndName(imageItem.project, imageName)
} else {
@@ -3608,12 +3608,12 @@ function newSuperalgosDocSpace() {
function addCodeToCamelCase(text) {
let expandedText = text
.replaceAll('{',' { ')
.replaceAll('}',' } ')
.replaceAll('(',' ( ')
.replaceAll(')',' ) ')
.replaceAll('[',' [ ')
.replaceAll(']',' ] ')
.replaceAll('{', ' { ')
.replaceAll('}', ' } ')
.replaceAll('(', ' ( ')
.replaceAll(')', ' ) ')
.replaceAll('[', ' [ ')
.replaceAll(']', ' ] ')
let splittedText = expandedText.split(' ')
let result = ''
for (let i = 0; i < splittedText.length; i++) {
@@ -3628,12 +3628,12 @@ function newSuperalgosDocSpace() {
}
}
result = result
.replaceAll(' { ','{')
.replaceAll(' } ','}')
.replaceAll(' ( ','(')
.replaceAll(' ) ',')')
.replaceAll(' [ ','[')
.replaceAll(' ] ',']')
.replaceAll(' { ', '{')
.replaceAll(' } ', '}')
.replaceAll(' ( ', '(')
.replaceAll(' ) ', ')')
.replaceAll(' [ ', '[')
.replaceAll(' ] ', ']')
return result
}
+1 -1
View File
@@ -87,7 +87,7 @@
let botId = TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + "." + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.config.codeName + "." + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName;
if (err.result === TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE.result) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[INFO] start -> onInitializeReady -> whenStartFinishes -> Bot execution finished sucessfully.");
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[INFO] start -> onInitializeReady -> whenStartFinishes -> Bot execution finished successfully.");
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME, "[INFO] start -> onInitializeReady -> whenStartFinishes -> Bot Id = " + botId);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.persist()
} else {