From c412f3bc961f16a844bd64e0e68664b9592570e9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 10 Jan 2021 16:27:26 +0100 Subject: [PATCH] All bugs fixed - DELETE UPDATE CREATE docs pages --- Client/httpInterface.js | 4 ++-- .../Schemas/Docs-Concepts/vaina2.json | 12 ----------- .../Schemas/Docs-Concepts/vaina3.json | 12 ----------- .../Schemas/Docs-Concepts/vaina4.json | 12 ----------- .../Schemas/Docs-Concepts/vaina5.json | 12 ----------- .../docs-message-deleting-succeed.json | 16 +++++++++++++++ .../UI/Spaces/Docs-Space/CommandInterface.js | 10 +++++----- .../UI/Spaces/Docs-Space/DocumentPage.js | 20 ++++++++++++++++++- 8 files changed, 42 insertions(+), 56 deletions(-) delete mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/vaina2.json delete mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/vaina3.json delete mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/vaina4.json delete mode 100644 Projects/Superalgos/Schemas/Docs-Concepts/vaina5.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/docs-message-deleting-succeed.json diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 43fb9fcff..d9bdeb903 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -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) diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/vaina2.json b/Projects/Superalgos/Schemas/Docs-Concepts/vaina2.json deleted file mode 100644 index 6613643c8..000000000 --- a/Projects/Superalgos/Schemas/Docs-Concepts/vaina2.json +++ /dev/null @@ -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." - } - ] -} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/vaina3.json b/Projects/Superalgos/Schemas/Docs-Concepts/vaina3.json deleted file mode 100644 index d37e3b588..000000000 --- a/Projects/Superalgos/Schemas/Docs-Concepts/vaina3.json +++ /dev/null @@ -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." - } - ] -} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/vaina4.json b/Projects/Superalgos/Schemas/Docs-Concepts/vaina4.json deleted file mode 100644 index 749222ced..000000000 --- a/Projects/Superalgos/Schemas/Docs-Concepts/vaina4.json +++ /dev/null @@ -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." - } - ] -} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Concepts/vaina5.json b/Projects/Superalgos/Schemas/Docs-Concepts/vaina5.json deleted file mode 100644 index 378f42ffe..000000000 --- a/Projects/Superalgos/Schemas/Docs-Concepts/vaina5.json +++ /dev/null @@ -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." - } - ] -} \ No newline at end of file diff --git a/Projects/Superalgos/Schemas/Docs-Topics/docs-message-deleting-succeed.json b/Projects/Superalgos/Schemas/Docs-Topics/docs-message-deleting-succeed.json new file mode 100644 index 000000000..3beb3d0cd --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/docs-message-deleting-succeed.json @@ -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 + } + ] +} \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index 2050a64c5..4752226e1 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -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) { diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js index 717dc2b5e..aba0a3fb8 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js @@ -137,6 +137,24 @@ function newSuperalgosDocsDocumentPage() { let titleLabel = thisObject.docsSchemaDocument.type HTML = HTML + '

' + titleLabel + '

' + 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