Fixes Tutorial Bug, loading schemas breaking the JSON format at http interface
This commit is contained in:
1 parent
0e60a2f323
commit
c7c1214e43
4 files changed
+9
-20
No files matched your search
+1
-1
@@ -6,7 +6,7 @@ global.env = ENVIRONMENT_MODULE
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
|
||||
console.log("A Superalgos Client cannot be started. Reason: the port " + port + " is being used by another application.")
|
||||
console.log("A Superalgos Client cannot be started. Reason: the port configured migth be being used by another application.")
|
||||
return
|
||||
}
|
||||
console.log('[ERROR] Client -> client-> uncaughtException -> err.message = ' + err.message)
|
||||
|
||||
@@ -1608,7 +1608,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
function onFilesReady(files) {
|
||||
|
||||
let schemaArray = []
|
||||
// let fileList = fs.readdirSync(filePath + '/' + folder)
|
||||
for (let k = 0; k < files.length; k++) {
|
||||
let name = files[k]
|
||||
let nameSplitted = name.split(folder)
|
||||
@@ -1619,17 +1618,19 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
let fileToRead = filePath + folder + fileName
|
||||
|
||||
let fileContent = fs.readFileSync(fileToRead)
|
||||
let schemaDocument = JSON.parse(fileContent)
|
||||
let schemaDocument
|
||||
try {
|
||||
schemaDocument = JSON.parse(fileContent)
|
||||
} catch (err) {
|
||||
console.log('[ERROR] httpInterface -> sendSchema -> Error Parsing JSON File: ' + fileToRead + ' .Error = ' + err.stack)
|
||||
respondWithContent("[]", httpResponse)
|
||||
return
|
||||
}
|
||||
schemaArray.push(schemaDocument)
|
||||
}
|
||||
let schema = JSON.stringify(schemaArray)
|
||||
respondWithContent(schema, httpResponse)
|
||||
}
|
||||
|
||||
// console.log(filePath + '/' + folder)
|
||||
|
||||
|
||||
|
||||
} catch (err) {
|
||||
if (err.message.indexOf('no such file or directory') < 0) {
|
||||
console.log('Could not send Schema:', filePath, schemaType)
|
||||
|
||||
@@ -1177,10 +1177,6 @@ function newEducationTutorialSpace() {
|
||||
/* The current node is not referencing any page at the Docs */
|
||||
return
|
||||
}
|
||||
|
||||
/* Beta 9 to Beta 10 Migration Code */
|
||||
let project = nodeConfig.docs.project
|
||||
if (project === "Superalgos") { project === "Foundations" }
|
||||
|
||||
let schemaDocument = SCHEMAS_BY_PROJECT.get(nodeConfig.docs.project).map.docsTutorialSchema.get(nodeConfig.docs.type)
|
||||
|
||||
|
||||
-8
@@ -30,12 +30,8 @@
|
||||
{
|
||||
"language": "FR",
|
||||
"text": "Si vous accédez au Client à partir de la même machine, vous pouvez cliquer sur Suivant et passer cette étape maintenant!",
|
||||
<<<<<<< HEAD:Projects/Superalgos/Schemas/Docs-Tutorials/W/Welcome/Welcome-to-Superalgos/welcome-to-superalgos-010-tutorial-step-accessing-remotely.json
|
||||
"updated": 1623958262097,
|
||||
"style": "Definition"
|
||||
=======
|
||||
"updated": 1623958262097
|
||||
>>>>>>> 5d109c271da2e554958b5bf4e5c8a5b3a1893517:Projects/Foundations/Schemas/Docs-Tutorials/W/Welcome/Welcome-to-Superalgos/welcome-to-superalgos-010-tutorial-step-accessing-remotely.json
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -65,12 +61,8 @@
|
||||
{
|
||||
"language": "FR",
|
||||
"text": "Si vous accédez au Client à partir d'une connectio a distance, vous devez ajuster la configuration du nœud de réseau avant de poursuivre.",
|
||||
<<<<<<< HEAD:Projects/Superalgos/Schemas/Docs-Tutorials/W/Welcome/Welcome-to-Superalgos/welcome-to-superalgos-010-tutorial-step-accessing-remotely.json
|
||||
"updated": 1623958370168,
|
||||
"style": "Text"
|
||||
=======
|
||||
"updated": 1623958370168
|
||||
>>>>>>> 5d109c271da2e554958b5bf4e5c8a5b3a1893517:Projects/Foundations/Schemas/Docs-Tutorials/W/Welcome/Welcome-to-Superalgos/welcome-to-superalgos-010-tutorial-step-accessing-remotely.json
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user