All bugs fixed - DELETE UPDATE CREATE docs pages

This commit is contained in:
Luis Fernando Molina committed 2021-01-10 16:27:26 +01:00
1 parent ff2dd2275d
commit c412f3bc96
8 files changed
+42 -56

No files matched your search

+2 -2
View File
@@ -462,9 +462,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
console.log('[ERROR] httpInterface -> Docs -> Save -> err.stack = ' + err.stack)
}
} else {
if (schemaDocument.edited === true || schemaDocument.created === true) {
if (schemaDocument.updated === true || schemaDocument.created === true) {
try {
schemaDocument.edited = undefined
schemaDocument.updated = undefined
schemaDocument.created = undefined
let fileContent = JSON.stringify(schemaDocument, undefined, 4)
fs.writeFileSync(filePath + '/' + fileName, fileContent)
@@ -1,12 +0,0 @@
{
"type": "Vaina2",
"definition": {
"text": "Write here the summary / definition of this Concept."
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
}
]
}
@@ -1,12 +0,0 @@
{
"type": "Vaina3",
"definition": {
"text": "Write here the summary / definition of this Concept."
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
}
]
}
@@ -1,12 +0,0 @@
{
"type": "Vaina4",
"definition": {
"text": "Write here the summary / definition of this Concept."
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
}
]
}
@@ -1,12 +0,0 @@
{
"type": "Vaina5",
"definition": {
"text": "Write here the summary / definition of this Concept."
},
"paragraphs": [
{
"style": "Text",
"text": "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode."
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "Docs Commands Messages",
"pageNumber": "3",
"type": "Docs Message Deleting Succeed",
"definition": {
"text": "The docs.delete command you executed successfuly deleted the page you requested.",
"updated": 1610292270590
},
"paragraphs": [
{
"style": "Important",
"text": "The page was flagged to be deleted. It will be removed from the in-memory collection of pages once you run the Docs Save Command. Even after that it will still be indexed at the Docs Search Engine Index. To remove it from the index you need to execute Docs Reindex Command. The Docs Save Command will instruct the Client to delete it from it's disk.",
"updated": 1610292163004
}
]
}
@@ -396,7 +396,7 @@ function newSuperalgosDocsCommmandInterface() {
documents = []
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema.length; i++) {
docsSchemaDocument = SCHEMAS_BY_PROJECT.get(project).array.docsNodeSchema[i]
docsSchemaDocument.edited = undefined
docsSchemaDocument.updated = undefined
docsSchemaDocument.created = undefined
if (docsSchemaDocument.deleted === true) {
@@ -411,7 +411,7 @@ function newSuperalgosDocsCommmandInterface() {
documents = []
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema.length; i++) {
docsSchemaDocument = SCHEMAS_BY_PROJECT.get(project).array.docsConceptSchema[i]
docsSchemaDocument.edited = undefined
docsSchemaDocument.updated = undefined
docsSchemaDocument.created = undefined
if (docsSchemaDocument.deleted === true) {
@@ -426,7 +426,7 @@ function newSuperalgosDocsCommmandInterface() {
documents = []
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema.length; i++) {
docsSchemaDocument = SCHEMAS_BY_PROJECT.get(project).array.docsTopicSchema[i]
docsSchemaDocument.edited = undefined
docsSchemaDocument.updated = undefined
docsSchemaDocument.created = undefined
if (docsSchemaDocument.deleted === true) {
@@ -441,7 +441,7 @@ function newSuperalgosDocsCommmandInterface() {
documents = []
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsTutorialSchema.length; i++) {
docsSchemaDocument = SCHEMAS_BY_PROJECT.get(project).array.docsTutorialSchema[i]
docsSchemaDocument.edited = undefined
docsSchemaDocument.updated = undefined
docsSchemaDocument.created = undefined
if (docsSchemaDocument.deleted === true) {
@@ -456,7 +456,7 @@ function newSuperalgosDocsCommmandInterface() {
documents = []
for (let i = 0; i < SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema.length; i++) {
docsSchemaDocument = SCHEMAS_BY_PROJECT.get(project).array.docsBookSchema[i]
docsSchemaDocument.edited = undefined
docsSchemaDocument.updated = undefined
docsSchemaDocument.created = undefined
if (docsSchemaDocument.deleted === true) {
@@ -137,6 +137,24 @@ function newSuperalgosDocsDocumentPage() {
let titleLabel = thisObject.docsSchemaDocument.type
HTML = HTML + '<div id="docs-main-title-div" class="docs-title-table"><div class="docs-table-cell"><h2 class="docs-h2" id="' + UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type.toLowerCase().replace(' ', '-') + '" > ' + titleLabel + '</h2></div><div id="projectImageDiv" class="docs-image-container"/></div></div>'
if (thisObject.docsSchemaDocument.deleted === true) {
let key = 'auto-generated-flag-paragraph'
let paragraph = {
style: "Warning",
text: "This page is flagged to be deleted. Next time you execute Docs Save Command this content will be deleted from the Client's disk. If you don't really want to delete this page, the way to avoiding it is by reloading the UI by pressing F5."
}
renderParagraph(paragraph, key)
} else {
if (thisObject.docsSchemaDocument.created === true || thisObject.docsSchemaDocument.updated === true) {
let key = 'auto-generated-flag-paragraph'
let paragraph = {
style: "Important",
text: "This page is flagged to be created / updated. Next time you execute Docs Save Command this content will be saved at the Client's disk. The changes will be applied to the Docs Search Engine Index only after you manually run the Docs Reindex Command."
}
renderParagraph(paragraph, key)
}
}
addDefinitionTable(thisObject.docsSchemaDocument, 'definition-editable-', UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.category, UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.project, UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.type)
let editableParagraphIndex = 0
@@ -1835,7 +1853,7 @@ function newSuperalgosDocsDocumentPage() {
function exitEditMode() {
/* This will make the Client to save this in a file overwritting the previous version*/
thisObject.docsSchemaDocument.edited = true
thisObject.docsSchemaDocument.updated = true
/* We will update the paragraph that was being edited*/
let editing