From f82967c88d84843aae784575912570aa307179d1 Mon Sep 17 00:00:00 2001 From: Matheus Paiva Date: Fri, 26 Feb 2016 17:23:18 -0300 Subject: [PATCH 1/3] :bug: Changed mergetool.{program}.cmd string for windows The ['] character was breaking the alterGitConfig method execution. Tests are nedded to validade this fix --- app/core/git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/git.js b/app/core/git.js index 22ca141..b4352d2 100644 --- a/app/core/git.js +++ b/app/core/git.js @@ -741,7 +741,7 @@ Git.prototype.alterGitConfig = function (path, opts) { concatConfig('merge.tool', opts.mergeTool); if (wos.isWindows()) { - concatConfig(`mergetool.${opts.mergeTool}.cmd`, `'${opts.mergeTool}.exe $PWD/$LOCAL $PDW/$MERGED $PWD/$REMOTE'`); + concatConfig(`mergetool.${opts.mergeTool}.cmd`, `\"${opts.mergeTool}.exe $PWD/$LOCAL $PDW/$MERGED $PWD/$REMOTE\"`); concatConfig(`mergetool.${opts.mergeTool}.trustExitCode`, 'true'); } else { concatConfig(`mergetool.${opts.mergeTool}.cmd`, `'${opts.mergeTool} "$LOCAL" "$MERGED" "$REMOTE"'`); From d02c2e63488fd070b26285169ee16e76b701342f Mon Sep 17 00:00:00 2001 From: Matheus Paiva Date: Mon, 29 Feb 2016 13:17:54 -0300 Subject: [PATCH 2/3] Improved no global git configs message Now app notifications can be closed --- app/frontend/global/notification.js | 14 ++++++++++++++ app/frontend/modules/settings-page.js | 6 ++++-- language/en.json | 2 ++ language/pt-BR.json | 2 ++ resources/sass/all.scss | 16 ++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/app/frontend/global/notification.js b/app/frontend/global/notification.js index 17aaf08..6335b64 100644 --- a/app/frontend/global/notification.js +++ b/app/frontend/global/notification.js @@ -21,6 +21,7 @@ class GPNotification { this.showLoad = opts.showLoad; this.notificationElement = null; this.autoclose = opts.autoclose; + this.closable = opts.closable; } pop() { @@ -56,6 +57,19 @@ class GPNotification { } this.notificationElement.innerHTML += `
${bodyText || titleText}
`; + + if (this.closable) { + let closeBtn = document.createElement('button'); + + closeBtn.className = 'close-button'; + closeBtn.title = MSGS['Close']; + closeBtn.innerHTML = ''; + closeBtn.onclick = function () { + this.close(); + }.bind(this); + + this.notificationElement.appendChild(closeBtn); + } container.appendChild(this.notificationElement); diff --git a/app/frontend/modules/settings-page.js b/app/frontend/modules/settings-page.js index a657b8f..75297c6 100644 --- a/app/frontend/modules/settings-page.js +++ b/app/frontend/modules/settings-page.js @@ -1,3 +1,5 @@ +'use strict'; + (function () { angular.module('settings', []).directive('settingsPage', function () { @@ -36,9 +38,9 @@ this.getGlobalGitConfigs = function () { GIT.getGlobalConfigs(function (err, configs) { - + if (err) { - alert(err.message); + new GPNotification(MSGS['It seems that a git username and email are not set globally. You can fix this accessing the Settings menu'], { closable: true }).pop(); } else { this.globalGitConfigs = configs; } diff --git a/language/en.json b/language/en.json index 8a07cfb..aa93c2f 100644 --- a/language/en.json +++ b/language/en.json @@ -98,6 +98,8 @@ "It happends with me all the time too. But lets's try find your project again!": "It happends with me all the time too. But let's try find your project again!", "Start adding, clonning or creating some awesome things": "Start adding, clonning or creating some awesome things", "Nothing for me here.\n The folder {folder} is not a git project": "Nothing for me here.\n The folder {folder} is not a git project", + "Close": "Close", + "It seems that a git username and email are not set globally. You can fix this accessing the Settings menu": "It seems that a git username and email are not set globally. You can fix this accessing the Settings menu", "Error counting commits. Error: ": "Error counting commits. Error: ", "Error adding files. Error:": "Error adding files. Error:", diff --git a/language/pt-BR.json b/language/pt-BR.json index f26033d..2cc947d 100644 --- a/language/pt-BR.json +++ b/language/pt-BR.json @@ -98,6 +98,8 @@ "It happends with me all the time too. But lets's try find your project again!": "Isso acontece comigo o tempo todo. Mas vamos tentar achar o seu projeto de novo!", "Start adding, clonning or creating some awesome things": "Comece adicionando, clonando ou criando coisas incríveis", "Nothing for me here.\n The folder {folder} is not a git project": "Nada pra mim aqui.\n A pasta {folder} não é um projeto git", + "Close": "Fechar", + "It seems that a git username and email are not set globally. You can fix this accessing the Settings menu": "Parece que um usuário e email git não estão definidos globalmente. Você pode corrigir isso acessando o menu de Configurações", "Error counting commits. Error: ": "Erro contando commits. Erro: ", "Error adding files. Error:": "Erro adicionando arquivos. Erro:", diff --git a/resources/sass/all.scss b/resources/sass/all.scss index 6ed3b93..8f465f6 100644 --- a/resources/sass/all.scss +++ b/resources/sass/all.scss @@ -579,6 +579,22 @@ body { .content { flex: 1 1 auto; } + + .close-button { + padding: 0; + padding-left: 20px; + padding-right: 10px; + color: #FFF; + background-color: #404040; + border: 0; + box-shadow: none; + cursor: pointer; + transition: color ease 0.2s; + + &:hover { + color: rgba(255, 255, 255, 0.7); + } + } } /* Header of the application */ From a51b68d1f96bca2d20d9d3929d6613aea13fbab2 Mon Sep 17 00:00:00 2001 From: Matheus Paiva Date: Mon, 29 Feb 2016 15:33:15 -0300 Subject: [PATCH 3/3] Closes #38, Closes #39 Now the version of the application is available on the settings menu --- app/frontend/global/notification.js | 2 +- app/frontend/modules/settings-page.js | 2 ++ app/frontend/view/content/settings-page.html | 7 +++++++ language/en.json | 3 ++- language/pt-BR.json | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/frontend/global/notification.js b/app/frontend/global/notification.js index 6335b64..c2d6708 100644 --- a/app/frontend/global/notification.js +++ b/app/frontend/global/notification.js @@ -62,7 +62,7 @@ class GPNotification { let closeBtn = document.createElement('button'); closeBtn.className = 'close-button'; - closeBtn.title = MSGS['Close']; + closeBtn.title = MSGS.Close; closeBtn.innerHTML = ''; closeBtn.onclick = function () { this.close(); diff --git a/app/frontend/modules/settings-page.js b/app/frontend/modules/settings-page.js index 75297c6..d48cc12 100644 --- a/app/frontend/modules/settings-page.js +++ b/app/frontend/modules/settings-page.js @@ -26,6 +26,8 @@ { code: 'en', description: 'English'}, { code: 'pt-BR', description: 'Portuguese (Brazil)'} ]; + + this.appVersion = require('./package').version; this.hideSettingsPage = function () { this.showSettingsPage = false; diff --git a/app/frontend/view/content/settings-page.html b/app/frontend/view/content/settings-page.html index d6013c2..280005d 100644 --- a/app/frontend/view/content/settings-page.html +++ b/app/frontend/view/content/settings-page.html @@ -140,6 +140,13 @@
  • {{ MSGS.SettingsPage["GitPie is an open source git client that have the goal to be the most simple and nice client for any project and for any people"] }}
  • + +
  • +
    {{ MSGS.SettingsPage.Version }}
    +
      +
    • {{ settingsCtrl.appVersion }}
    • +
    +
  • {{ MSGS.SettingsPage.License }}
    diff --git a/language/en.json b/language/en.json index aa93c2f..e4727e6 100644 --- a/language/en.json +++ b/language/en.json @@ -145,7 +145,8 @@ "Navigate between repositories top to bottom": "Navigate between repositories top to bottom", "Navigate between repositories bottom to top": "Navigate between repositories bottom to top", "Add focus on the \"Search repositories\" field": "Add focus on the \"Search repositories\" field", - "Close modal windows and header menus": "Close modal windows and header menus" + "Close modal windows and header menus": "Close modal windows and header menus", + "Version": "Version" }, "Authentication required": "Authentication required", diff --git a/language/pt-BR.json b/language/pt-BR.json index 2cc947d..3a6e32b 100644 --- a/language/pt-BR.json +++ b/language/pt-BR.json @@ -145,7 +145,8 @@ "Navigate between repositories top to bottom": "Navega entre os repositórios de cima para baixo", "Navigate between repositories bottom to top": "Navega entre os repositórios de baixo para cima", "Add focus on the \"Search repositories\" field": "Adiciona foco no campo \"Procurar repositórios\"", - "Close modal windows and header menus": "Fecha janelas modais e menus de cabeçalho" + "Close modal windows and header menus": "Fecha janelas modais e menus de cabeçalho", + "Version": "Versão" }, "Authentication required": "Autenticação requerida",