From 29fe73b3c8c624afbe42c64886d9d4a5e79a4a85 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 13 Jan 2021 12:05:07 +0100 Subject: [PATCH 1/8] Git Branches Management --- Client/WebServer/index.html | 4 +- Projects/ProjectsSchema.json | 5 +++ ...ching-branches-changing-active-branch.json | 14 ++++++ ...tching-branches-active-branch-changed.json | 14 ++++++ ...branches-contributions-branch-changed.json | 14 ++++++ Projects/Superalgos/UI/Globals/Docs.js | 2 + .../UI/Spaces/Docs-Space/DocsSpace.js | 43 ++++++++++++++++++- .../Superalgos/UI/Spaces/Docs-Space/Footer.js | 29 +++++++------ .../Superalgos/UI/Utilities/GitBranches.js | 26 +++++++++++ 9 files changed, 134 insertions(+), 17 deletions(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-003-switching-branches-contributions-branch-changed.json create mode 100644 Projects/Superalgos/UI/Utilities/GitBranches.js diff --git a/Client/WebServer/index.html b/Client/WebServer/index.html index 17f9b6d59..b7d9789ef 100644 --- a/Client/WebServer/index.html +++ b/Client/WebServer/index.html @@ -56,8 +56,8 @@ onresize="onResize()">

The UI is loading...

-

Superalgos is free, open-source, and is - constantly improving thanks to the involvement of contributors!

+

Superalgos is free, open-source, and is + constantly improving thanks to the involvement of contributors:

Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis, Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index b80865cfd..783631241 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -208,6 +208,11 @@ "propertyName": "languages", "functionName": "newSuperalgosUtilitiesLanguages" }, + { + "name": "Git Branches", + "propertyName": "gitBranches", + "functionName": "newSuperalgosUtilitiesGitBranches" + }, { "name": "Docs", "propertyName": "docs", diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json new file mode 100644 index 000000000..152b81f97 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json @@ -0,0 +1,14 @@ +{ + "topic": "Branches Management Messages", + "pageNumber": "1", + "type": "Switching Branches - Changing Active Branch", + "definition": { + "text": "Write here a summary for this topic page." + }, + "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/branches-management-messages-002-switching-branches-active-branch-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json new file mode 100644 index 000000000..28ac44aaf --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json @@ -0,0 +1,14 @@ +{ + "topic": "Branches Management Messages", + "pageNumber": "2", + "type": "Switching Branches - Active Branch Changed", + "definition": { + "text": "Write here a summary for this topic page." + }, + "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/branches-management-messages-003-switching-branches-contributions-branch-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-003-switching-branches-contributions-branch-changed.json new file mode 100644 index 000000000..0e61c965d --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-003-switching-branches-contributions-branch-changed.json @@ -0,0 +1,14 @@ +{ + "topic": "Branches Management Messages", + "pageNumber": "3", + "type": "Switching Branches - Contributions Branch Changed", + "definition": { + "text": "Write here a summary for this topic page." + }, + "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/UI/Globals/Docs.js b/Projects/Superalgos/UI/Globals/Docs.js index 0fff2b481..63b869099 100644 --- a/Projects/Superalgos/UI/Globals/Docs.js +++ b/Projects/Superalgos/UI/Globals/Docs.js @@ -2,6 +2,8 @@ function newSuperalgosGlobalsDocs() { thisObject = { NEW_PARAGRAPH_TEXT: "Left click and Edit to enter edit mode and change this text. ENTER to write new paragraphs. ESC to exit edit mode.", DEFAULT_LANGUAGE: 'EN', + DEFAULT_ACTIVE_BRANCH: 'master', + DEFAULT_CONTRIBUTIONS_BRANCH: 'develop', DOCS_SPACE_WIDTH: 900 } return thisObject diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index f0a85ed6c..2fbc302a4 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -12,6 +12,8 @@ function newSuperalgosDocSpace() { commandInterface: undefined, contextMenu: undefined, language: undefined, + activeBranch: undefined, + contributionsBranch: undefined, menuLabelsMap: undefined, currentDocumentBeingRendered: undefined, previousDocumentBeingRendered: undefined, @@ -20,6 +22,8 @@ function newSuperalgosDocSpace() { textArea: undefined, setUpWorkspaceSchemas: setUpWorkspaceSchemas, changeLanguage: changeLanguage, + changeActiveBranch: changeActiveBranch, + changeContributionsBranch: changeContributionsBranch, enterEditMode: enterEditMode, exitEditMode: exitEditMode, openSpaceAreaAndNavigateTo: openSpaceAreaAndNavigateTo, @@ -57,6 +61,8 @@ function newSuperalgosDocSpace() { setupSidePanelTab() setUpMenuItemsMap() setupUserLanguage() + setupActiveBranch() + setupContributionsBranch() thisObject.searchEngine = newSuperalgosDocsSearchEngine() thisObject.mainSearchPage = newSuperalgosDocsMainSearchPage() @@ -76,6 +82,30 @@ function newSuperalgosDocSpace() { isInitialized = true + function setupActiveBranch() { + /* + Getting the used preferred languague + */ + if (window.localStorage.getItem('Active Branch') !== null && window.localStorage.getItem('Active Branch') !== undefined && window.localStorage.getItem('Active Branch') !== 'undefined') { + UI.projects.superalgos.spaces.docsSpace.activeBranch = window.localStorage.getItem('Active Branch') + } else { + window.localStorage.setItem('Active Branch', UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH) + UI.projects.superalgos.spaces.docsSpace.activeBranch = UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH + } + } + + function setupContributionsBranch() { + /* + Getting the used preferred languague + */ + if (window.localStorage.getItem('Contributions Branch') !== null && window.localStorage.getItem('Contributions Branch') !== undefined && window.localStorage.getItem('Contributions Branch') !== 'undefined') { + UI.projects.superalgos.spaces.docsSpace.contributionsBranch = window.localStorage.getItem('Contributions Branch') + } else { + window.localStorage.setItem('Contributions Branch', UI.projects.superalgos.globals.docs.DEFAULT_CONTRIBUTIONS_BRANCH) + UI.projects.superalgos.spaces.docsSpace.contributionsBranch = UI.projects.superalgos.globals.docs.DEFAULT_CONTRIBUTIONS_BRANCH + } + } + function setupUserLanguage() { /* Getting the used preferred languague @@ -86,7 +116,6 @@ function newSuperalgosDocSpace() { window.localStorage.setItem('Docs Language', UI.projects.superalgos.globals.docs.DEFAULT_LANGUAGE) UI.projects.superalgos.spaces.docsSpace.language = UI.projects.superalgos.globals.docs.DEFAULT_LANGUAGE } - } function setupSidePanelTab() { @@ -155,6 +184,18 @@ function newSuperalgosDocSpace() { initialize() } + function changeActiveBranch(branch) { + UI.projects.superalgos.spaces.docsSpace.activeBranch = branch + window.localStorage.setItem('Active Branch', UI.projects.superalgos.spaces.docsSpace.activeBranch) + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Active Branch') + } + + function changeContributionsBranch(branch) { + UI.projects.superalgos.spaces.docsSpace.contributionsBranch = branch + window.localStorage.setItem('Contributions Branch', UI.projects.superalgos.spaces.docsSpace.contributionsBranch) + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Contributions Branch Changed') + } + function changeLanguage(pLanguage) { UI.projects.superalgos.spaces.docsSpace.language = pLanguage window.localStorage.setItem('Docs Language', UI.projects.superalgos.spaces.docsSpace.language) diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js index b1b942071..9aaf741cf 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js @@ -1,6 +1,6 @@ function newSuperalgosDocsFooter() { let thisObject = { - addFooter: addFooter, + addFooter: addFooter, initialize: initialize, finalize: finalize } @@ -16,7 +16,6 @@ function newSuperalgosDocsFooter() { } function addFooter() { - let languageLabel = UI.projects.superalgos.utilities.languages.getLaguageLabel(UI.projects.superalgos.spaces.docsSpace.language) let HTML = '' @@ -33,11 +32,11 @@ function newSuperalgosDocsFooter() { HTML = HTML + '

' @@ -54,7 +53,7 @@ function newSuperalgosDocsFooter() { HTML = HTML + '' diff --git a/Projects/Superalgos/UI/Utilities/GitBranches.js b/Projects/Superalgos/UI/Utilities/GitBranches.js new file mode 100644 index 000000000..de134c51b --- /dev/null +++ b/Projects/Superalgos/UI/Utilities/GitBranches.js @@ -0,0 +1,26 @@ +function newSuperalgosUtilitiesGitBranches() { + thisObject = { + getBranchLabel: getBranchLabel + } + + return thisObject + + function getBranchLabel(branch) { + let branchLabel + switch (branch) { + case 'master': { + branchLabel = 'Master' + break + } + case 'develop': { + branchLabel = 'Develop' + break + } + case 'bug-fixes': { + branchLabel = 'Bug Fixes' + break + } + } + return branchLabel + } +} \ No newline at end of file From 8b247f7af9c48b8f15e573216df49a696bf351b0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 13 Jan 2021 12:55:04 +0100 Subject: [PATCH 2/8] Final implementations of Git Branches --- Client/httpInterface.js | 59 ++++++++++++++++--- ...ng-branches-active-branch-not-changed.json | 14 +++++ .../UI/Spaces/Docs-Space/CommandInterface.js | 13 +++- .../UI/Spaces/Docs-Space/DocsSpace.js | 13 +++- 4 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json diff --git a/Client/httpInterface.js b/Client/httpInterface.js index e5858d785..20ab62b55 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -533,6 +533,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE const commitMessage = unescape(requestParameters[3]) const username = unescape(requestParameters[4]) const token = unescape(requestParameters[5]) + const activeBranch = unescape(requestParameters[6]) + const contributionsBranch = unescape(requestParameters[7]) contribute() @@ -553,7 +555,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE await git.add('./*') await git.commit(commitMessage) - await git.push('origin', 'in-app-documentation') + await git.push('origin', branch) } async function doGithub() { @@ -567,8 +569,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE const repo = 'Superalgos' const owner = 'Superalgos' - const head = username + ':in-app-documentation' - const base = 'in-app-documentation' + const head = username + ':' + contributionsBranch + const base = activeBranch const title = 'Contribution: ' + commitMessage try { @@ -604,10 +606,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } case 'Update': { try { - const message = unescape(requestParameters[3]) - const username = unescape(requestParameters[4]) - const token = unescape(requestParameters[5]) - + const activeBranch = unescape(requestParameters[3]) update() async function update() { @@ -629,7 +628,51 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } const git = simpleGit(options) - return await git.pull('upstream', 'in-app-documentation') + return await git.pull('upstream', activeBranch) + } + + } catch (err) { + console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.') + console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack) + console.log('[ERROR] httpInterface -> App -> Update -> commitMessage = ' + commitMessage) + console.log('[ERROR] httpInterface -> App -> Update -> username = ' + username) + console.log('[ERROR] httpInterface -> App -> Update -> token = ' + token) + + let error = { + result: 'Fail Because', + message: err.message, + stack: err.stack + } + respondWithContent(JSON.stringify(error), httpResponse) + } + break + } + + case 'Checkout': { + try { + const activeBranch = unescape(requestParameters[3]) + checkout() + + async function checkout() { + let message = await doGit() + + let customResponse = { + result: global.CUSTOM_OK_RESPONSE.result, + message: message + } + respondWithContent(JSON.stringify(customResponse), httpResponse) + } + + async function doGit() { + const simpleGit = require('simple-git'); + const options = { + baseDir: process.cwd(), + binary: 'git', + maxConcurrentProcesses: 6, + } + const git = simpleGit(options) + + return await git.checkoutBranch(activeBranch) } } catch (err) { diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json new file mode 100644 index 000000000..aee7e57d3 --- /dev/null +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json @@ -0,0 +1,14 @@ +{ + "topic": "Branches Management Messages", + "pageNumber": "4", + "type": "Switching Branches - Active Branch Not Changed", + "definition": { + "text": "Write here a summary for this topic page." + }, + "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/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index f0c57fa66..cb51ff863 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -62,7 +62,16 @@ function newSuperalgosDocsCommmandInterface() { return } - httpRequest(undefined, 'App/Contribute/' + message + '/' + config.username + '/' + config.token, onResponse) + httpRequest( + undefined, + 'App/Contribute/' + + message + '/' + + config.username + '/' + + config.token + '/' + + UI.projects.superalgos.spaces.docsSpace.activeBranch + '/' + + UI.projects.superalgos.spaces.docsSpace.contributionBranch + , onResponse) + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Creating Pull Request') return @@ -112,7 +121,7 @@ function newSuperalgosDocsCommmandInterface() { return } - httpRequest(undefined, 'App/Update/' + message + '/' + config.username + '/' + config.token, onResponse) + httpRequest(undefined, 'App/Update/' + UI.projects.superalgos.spaces.docsSpace.activeBranch, onResponse) UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Updating Your Local App') return diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index 2fbc302a4..28ba785f7 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -185,9 +185,20 @@ function newSuperalgosDocSpace() { } function changeActiveBranch(branch) { - UI.projects.superalgos.spaces.docsSpace.activeBranch = branch window.localStorage.setItem('Active Branch', UI.projects.superalgos.spaces.docsSpace.activeBranch) + httpRequest(undefined, 'App/Checkout/' + UI.projects.superalgos.spaces.docsSpace.activeBranch, onResponse) UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Active Branch') + + function onResponse(err, data) { + /* Lets check the result of the call through the http interface */ + data = JSON.parse(data) + if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) { + UI.projects.superalgos.spaces.docsSpace.activeBranch = branch + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Active Branch Changed') + } else { + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Active Branch Not Changed') + } + } } function changeContributionsBranch(branch) { From 76a0a8c764b89d5865ac4297d43bf292d36f13aa Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 13 Jan 2021 12:59:04 +0100 Subject: [PATCH 3/8] Refactoring Active for Current Branch --- Client/httpInterface.js | 12 +++++----- ...ching-branches-changing-active-branch.json | 2 +- ...tching-branches-active-branch-changed.json | 2 +- ...ng-branches-active-branch-not-changed.json | 2 +- .../UI/Spaces/Docs-Space/CommandInterface.js | 4 ++-- .../UI/Spaces/Docs-Space/DocsSpace.js | 22 +++++++++---------- .../Superalgos/UI/Spaces/Docs-Space/Footer.js | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 20ab62b55..8f1f0ea72 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -533,7 +533,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE const commitMessage = unescape(requestParameters[3]) const username = unescape(requestParameters[4]) const token = unescape(requestParameters[5]) - const activeBranch = unescape(requestParameters[6]) + const currentBranch = unescape(requestParameters[6]) const contributionsBranch = unescape(requestParameters[7]) contribute() @@ -570,7 +570,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE const repo = 'Superalgos' const owner = 'Superalgos' const head = username + ':' + contributionsBranch - const base = activeBranch + const base = currentBranch const title = 'Contribution: ' + commitMessage try { @@ -606,7 +606,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } case 'Update': { try { - const activeBranch = unescape(requestParameters[3]) + const currentBranch = unescape(requestParameters[3]) update() async function update() { @@ -628,7 +628,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } const git = simpleGit(options) - return await git.pull('upstream', activeBranch) + return await git.pull('upstream', currentBranch) } } catch (err) { @@ -650,7 +650,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE case 'Checkout': { try { - const activeBranch = unescape(requestParameters[3]) + const currentBranch = unescape(requestParameters[3]) checkout() async function checkout() { @@ -672,7 +672,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } const git = simpleGit(options) - return await git.checkoutBranch(activeBranch) + return await git.checkoutBranch(currentBranch) } } catch (err) { diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json index 152b81f97..f7e156ef7 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-001-switching-branches-changing-active-branch.json @@ -1,7 +1,7 @@ { "topic": "Branches Management Messages", "pageNumber": "1", - "type": "Switching Branches - Changing Active Branch", + "type": "Switching Branches - Changing Current Branch", "definition": { "text": "Write here a summary for this topic page." }, diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json index 28ac44aaf..c3a73e05b 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-002-switching-branches-active-branch-changed.json @@ -1,7 +1,7 @@ { "topic": "Branches Management Messages", "pageNumber": "2", - "type": "Switching Branches - Active Branch Changed", + "type": "Switching Branches - Current Branch Changed", "definition": { "text": "Write here a summary for this topic page." }, diff --git a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json index aee7e57d3..23ad5bb16 100644 --- a/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json +++ b/Projects/Superalgos/Schemas/Docs-Topics/branches-management-messages-004-switching-branches-active-branch-not-changed.json @@ -1,7 +1,7 @@ { "topic": "Branches Management Messages", "pageNumber": "4", - "type": "Switching Branches - Active Branch Not Changed", + "type": "Switching Branches - Current Branch Not Changed", "definition": { "text": "Write here a summary for this topic page." }, diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js index cb51ff863..4f5b7a9cb 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/CommandInterface.js @@ -68,7 +68,7 @@ function newSuperalgosDocsCommmandInterface() { message + '/' + config.username + '/' + config.token + '/' + - UI.projects.superalgos.spaces.docsSpace.activeBranch + '/' + + UI.projects.superalgos.spaces.docsSpace.currentBranch + '/' + UI.projects.superalgos.spaces.docsSpace.contributionBranch , onResponse) @@ -121,7 +121,7 @@ function newSuperalgosDocsCommmandInterface() { return } - httpRequest(undefined, 'App/Update/' + UI.projects.superalgos.spaces.docsSpace.activeBranch, onResponse) + httpRequest(undefined, 'App/Update/' + UI.projects.superalgos.spaces.docsSpace.currentBranch, onResponse) UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Updating Your Local App') return diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js index 28ba785f7..3da8b4def 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/DocsSpace.js @@ -12,7 +12,7 @@ function newSuperalgosDocSpace() { commandInterface: undefined, contextMenu: undefined, language: undefined, - activeBranch: undefined, + currentBranch: undefined, contributionsBranch: undefined, menuLabelsMap: undefined, currentDocumentBeingRendered: undefined, @@ -86,11 +86,11 @@ function newSuperalgosDocSpace() { /* Getting the used preferred languague */ - if (window.localStorage.getItem('Active Branch') !== null && window.localStorage.getItem('Active Branch') !== undefined && window.localStorage.getItem('Active Branch') !== 'undefined') { - UI.projects.superalgos.spaces.docsSpace.activeBranch = window.localStorage.getItem('Active Branch') + if (window.localStorage.getItem('Current Branch') !== null && window.localStorage.getItem('Current Branch') !== undefined && window.localStorage.getItem('Current Branch') !== 'undefined') { + UI.projects.superalgos.spaces.docsSpace.currentBranch = window.localStorage.getItem('Current Branch') } else { - window.localStorage.setItem('Active Branch', UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH) - UI.projects.superalgos.spaces.docsSpace.activeBranch = UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH + window.localStorage.setItem('Current Branch', UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH) + UI.projects.superalgos.spaces.docsSpace.currentBranch = UI.projects.superalgos.globals.docs.DEFAULT_ACTIVE_BRANCH } } @@ -185,18 +185,18 @@ function newSuperalgosDocSpace() { } function changeActiveBranch(branch) { - window.localStorage.setItem('Active Branch', UI.projects.superalgos.spaces.docsSpace.activeBranch) - httpRequest(undefined, 'App/Checkout/' + UI.projects.superalgos.spaces.docsSpace.activeBranch, onResponse) - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Active Branch') + window.localStorage.setItem('Current Branch', UI.projects.superalgos.spaces.docsSpace.currentBranch) + httpRequest(undefined, 'App/Checkout/' + UI.projects.superalgos.spaces.docsSpace.currentBranch, onResponse) + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Current Branch') function onResponse(err, data) { /* Lets check the result of the call through the http interface */ data = JSON.parse(data) if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) { - UI.projects.superalgos.spaces.docsSpace.activeBranch = branch - UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Active Branch Changed') + UI.projects.superalgos.spaces.docsSpace.currentBranch = 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 - Active Branch Not Changed') + UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Not Changed') } } } diff --git a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js index 9aaf741cf..a568c2074 100644 --- a/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js +++ b/Projects/Superalgos/UI/Spaces/Docs-Space/Footer.js @@ -94,8 +94,8 @@ function newSuperalgosDocsFooter() { HTML = HTML + '
' HTML = HTML + '