diff --git a/Client/httpInterface.js b/Client/httpInterface.js index abe8f07af..82729ce58 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -612,7 +612,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } respondWithDocsObject(docs, result.error) - return } @@ -629,7 +628,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE console.log('respond with docs ') respondWithDocsObject(docs, error) - return } respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse) @@ -786,15 +784,25 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE case 'Checkout': { try { const currentBranch = unescape(requestParameters[3]) + let error + checkout() async function checkout() { - let result = await doGit() + await doGit() - if (result === true) { + if (error === undefined) { respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse) } else { - respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse) + let docs = { + project: 'Superalgos', + category: 'Topic', + type: 'Switching Branches - Current Branch Not Changed', + anchor: undefined, + placeholder: {} + } + + respondWithDocsObject(docs, error) } } @@ -811,9 +819,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } catch (err) { console.log('[ERROR] Error changing current branch to ' + currentBranch) console.log(err.stack) - return false + error = err } - return true } } catch (err) { diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-current-branch-not-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-current-branch-not-changed.json index 981b84428..ffd107fd1 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-current-branch-not-changed.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-current-branch-not-changed.json @@ -7,10 +7,75 @@ "updated": 1610543788194 }, "paragraphs": [ + { + "style": "Text", + "text": "More detailed info of what caused this failure to switch can be found below.", + "updated": 1611155878425 + }, + { + "style": "Title", + "text": "Error Info" + }, + { + "style": "Text", + "text": "In the following section you will find the specific information received when this error occured." + }, { "style": "Note", - "text": "More detailed info of what caused this failure to switch can be find at the Client's Console.", - "updated": 1610543823314 + "text": "You will only see it if you opened this page as a result of the error actually happening.", + "updated": 1611155956953 + }, + { + "style": "Subtitle", + "text": "Error Message" + }, + { + "style": "Text", + "text": "The following is the Error Message of the Exception that occured at the Client:" + }, + { + "style": "Placeholder", + "text": "errorMessage" + }, + { + "style": "Subtitle", + "text": "Error Stack" + }, + { + "style": "Text", + "text": "The following is the Error Stack of the Exception that occured at the Client:" + }, + { + "style": "Placeholder", + "text": "errorStack" + }, + { + "style": "Subtitle", + "text": "Error Code" + }, + { + "style": "Text", + "text": "The follwing is the Error Code of the Exception that occured at the Client:" + }, + { + "style": "Placeholder", + "text": "errorCode" + }, + { + "style": "Subtitle", + "text": "Error Details" + }, + { + "style": "Text", + "text": "The follwing are all the Error details of the Exception that occured at the Client:" + }, + { + "style": "Placeholder", + "text": "errorDetails" + }, + { + "style": "Text", + "text": "" } ] } \ No newline at end of file diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index 43dc552c2..5b5a66d26 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -21,7 +21,7 @@ function newSuperalgosDocSpace() { paragraphMap: undefined, // Here we will store a map of paragraphs from the Docs Node, Concept, Topics, Tutorials, Reviews or Books Schema in order to find it when we need to update them. textArea: undefined, changeLanguage: changeLanguage, - changeActiveBranch: changeActiveBranch, + changeCurrentBranch: changeCurrentBranch, changeContributionsBranch: changeContributionsBranch, enterEditMode: enterEditMode, exitEditMode: exitEditMode, @@ -183,7 +183,7 @@ function newSuperalgosDocSpace() { initialize() } - function changeActiveBranch(branch) { + function changeCurrentBranch(branch) { httpRequest(undefined, 'App/Checkout/' + branch, onResponse) UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Current Branch') @@ -195,7 +195,14 @@ function newSuperalgosDocSpace() { window.localStorage.setItem('Current Branch', branch) UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Changed') } else { - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Not Changed') + UI.projects.superalgos.spaces.docsSpace.navigateTo( + data.docs.project, + data.docs.category, + data.docs.type, + data.docs.anchor, + undefined, + data.docs.placeholder + ) } } } diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js index 08b12d7dd..1e9b119d3 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocumentPage.js @@ -476,13 +476,13 @@ function newSuperalgosDocsDocumentPage() { case "Placeholder": { renderParagraph(paragraph, key) editableParagraphIndex++ - let error = addPlaceholdedParagraph(paragraph.text) - if (error !== undefined) { + let result = addPlaceholdedParagraph(paragraph.text) + if (result !== undefined) { paragraph = { - style: "Error", - text: error + style: "Note", + text: result } - key = 'error-paragraph-' + autoGeneratedParagraphIndex + key = 'note-paragraph-' + autoGeneratedParagraphIndex renderParagraph(paragraph, key) autoGeneratedParagraphIndex++ } @@ -622,14 +622,7 @@ function newSuperalgosDocsDocumentPage() { autoGeneratedParagraphIndex++ return } else { - let paragraph = { - type: "Json", - text: JSON.stringify(UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.placeholder, undefined, 4) - } - let key = 'placeholded-paragraph-' + autoGeneratedParagraphIndex - renderParagraph(paragraph, key) - autoGeneratedParagraphIndex++ - return 'Property ' + propertyName + ' not found at the placeholder object.' + return 'Property ' + propertyName + ' not found at the placeholder object. This means that within the info recieved, this information is not available.' } } } diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js index 435963ea9..f5102f069 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js @@ -98,8 +98,8 @@ function newSuperalgosDocsFooter() { HTML = HTML + '
' + UI.projects.superalgos.utilities.gitBranches.getBranchLabel(UI.projects.superalgos.spaces.docsSpace.currentBranch) + ' branch. Switch to:'
HTML = HTML + ''
HTML = HTML + ''