-
-
-
-
-
-
+
+
+
+
+
+
-
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts
index 5a0bf49..7cb7fa7 100644
--- a/src/app/screens/preferences/preferences.component.ts
+++ b/src/app/screens/preferences/preferences.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Subscription } from 'rxjs';
@@ -9,7 +9,7 @@ import { LanguagePreferencesService } from '../../providers/language-preferences
templateUrl: './preferences.component.html',
styleUrls: ['./preferences.component.scss']
})
-export class PreferencesComponent implements OnInit {
+export class PreferencesComponent implements OnInit, OnDestroy {
preferencesVisible: Boolean;
preferencesTabSelectedIndex: any;
@@ -31,11 +31,12 @@ export class PreferencesComponent implements OnInit {
// Ici il faut récupérer le language courant de l'appli
// Donc comme ça c'est bon mais dans l'app.component.ts faut gérer avec le LocalStorage
- this.dropdownLanguageValue = this.translate.getDefaultLang();
+ this.dropdownLanguageValue = this.translate.getDefaultLang(); // renvoie 'fr' ou 'en'
this.languageSubscription = this.langPrefService.preferencesSubject.subscribe(
- (dropdownLanguageValue) => {
- this.dropdownLanguageValue = dropdownLanguageValue;
+ (preference) => {
+ console.log(preference);
+ this.dropdownLanguageValue = preference;
}
);
this.langPrefService.emitPreferencesSubject();
@@ -49,17 +50,19 @@ export class PreferencesComponent implements OnInit {
switchLanguage(language: String) {
this.langPrefService.setLanguage(language);
- if (language === 'Français') {
- // this.translate.use('fr');
- this.translate.setDefaultLang(this.translate.getLangs()[0]);
+ // if (language === 'Français') {
+ // // this.translate.use('fr');
+ // this.translate.setDefaultLang(this.translate.getLangs()[0]);
- } else {
- // this.translate.use('en');
- this.translate.setDefaultLang(this.translate.getLangs()[1]);
+ // } else {
+ // // this.translate.use('en');
+ // this.translate.setDefaultLang(this.translate.getLangs()[1]);
- }
+ // }
}
-
+ ngOnDestroy() {
+ this.languageSubscription.unsubscribe();
+ }
}
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index 9be3143..f99738b 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -5,6 +5,8 @@
"TAGS": "Tags",
"TAG": "Tag",
"LANGUE": "Language",
+ "FRENCH": "French",
+ "ENGLISH": "English",
"FONT_SIZES": "Font sizes",
"CHECKBOX": "CheckBox",
"UN_CHECKBOX": "Unchecked checkbox",
diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json
index bdc95cd..2e2187b 100644
--- a/src/assets/i18n/fr.json
+++ b/src/assets/i18n/fr.json
@@ -5,6 +5,8 @@
"TAGS": "Balises",
"TAG": "Balise",
"LANGUE": "Langage",
+ "FRENCH": "Français",
+ "ENGLISH": "Anglais",
"FONT_SIZES": "Tailles de texte",
"CHECKBOX": "Case à cocher",
"UN_CHECKBOX": "Case décochée",
From e7eb36d127fb6eb7a2776dcaa217e066a2e56ee8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?=
Date: Sat, 16 Feb 2019 18:42:23 +0100
Subject: [PATCH 038/160] feat(module): ajout du module keytar
---
package.json | 1 +
src/app/app.component.ts | 2 +-
src/app/providers/electron.service.ts | 5 +-
src/app/screens/home/home.component.html | 13 +++-
src/app/screens/home/home.component.ts | 19 ++++-
yarn.lock | 98 ++++++++++++++++++++++--
6 files changed, 126 insertions(+), 12 deletions(-)
diff --git a/package.json b/package.json
index cdb6578..7f6f08c 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,7 @@
"git-url-parse": "^11.1.2",
"jquery": "^3.3.1",
"karma-htmlfile-reporter": "^0.3.8",
+ "keytar": "^4.4.0",
"mocha": "^5.2.0",
"mocha-sinon": "^2.1.0",
"monaco-editor": "^0.14.3",
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 0163400..780e174 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -13,7 +13,7 @@ export class AppComponent {
private translate: TranslateService) {
this.translate.addLangs(['fr', 'en']);
- this.translate.setDefaultLang(this.translate.getLangs()[1]);
+ this.translate.setDefaultLang(this.translate.getLangs()[0]);
console.log('AppConfig', AppConfig);
if (electronService.isElectron()) {
diff --git a/src/app/providers/electron.service.ts b/src/app/providers/electron.service.ts
index c3f2033..0c41f5a 100644
--- a/src/app/providers/electron.service.ts
+++ b/src/app/providers/electron.service.ts
@@ -19,6 +19,7 @@ export class ElectronService {
fs: typeof fs;
path: typeof path;
shell: typeof shell;
+ keytar: any;
constructor() {
// Conditional imports
@@ -32,6 +33,8 @@ export class ElectronService {
this.fs = window.require('fs');
this.path = window.require('path');
this.process = window.require('process');
+ this.keytar = this.remote.require('keytar');
+ console.log(this.keytar);
}
}
@@ -43,7 +46,7 @@ export class ElectronService {
const PATH = this.remote.dialog.showOpenDialog({
properties: ['openDirectory']
});
- if (path !== undefined) {
+ if (PATH !== undefined) {
return PATH[0];
}
return null;
diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html
index f98bf65..622cec4 100644
--- a/src/app/screens/home/home.component.html
+++ b/src/app/screens/home/home.component.html
@@ -56,11 +56,11 @@
-
+
-
@@ -68,7 +68,12 @@
+
+
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts
index d5eb135..300bab4 100644
--- a/src/app/screens/home/home.component.ts
+++ b/src/app/screens/home/home.component.ts
@@ -1,6 +1,8 @@
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ToastrService } from 'ngx-toastr';
+import { ElectronService } from '../../providers/electron.service';
+import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-home',
@@ -14,7 +16,8 @@ export class HomeComponent implements OnInit {
cloneUrl: String;
cloneFolder: String;
- constructor(public router: Router, private toastr: ToastrService) { }
+ constructor(public router: Router, private toastr: ToastrService,
+ private electronService: ElectronService, private translate: TranslateService) { }
ngOnInit() {
@@ -48,4 +51,18 @@ export class HomeComponent implements OnInit {
this.toastr.info(this.searchInputValue.toString());
}
+ cloneBrowse() {
+ const BROWSEPATH = this.electronService.browse();
+ if (BROWSEPATH !== null) {
+ this.cloneFolder = BROWSEPATH;
+ }
+ }
+
+ clone() {
+ if (this.electronService.fs.existsSync(this.cloneFolder.toString())) {
+ } else {
+ this.toastr.error(this.translate.instant('ERROR'), this.translate.instant('NO_FOLDER'));
+ }
+ }
+
}
diff --git a/yarn.lock b/yarn.lock
index 9091bc5..64b3191 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -292,6 +292,28 @@
semver "5.5.1"
semver-intersect "1.4.0"
+"@shiftkey/prebuild-install@5.2.4":
+ version "5.2.4"
+ resolved "https://registry.yarnpkg.com/@shiftkey/prebuild-install/-/prebuild-install-5.2.4.tgz#5197ecda934e8b38e0f1609165413ffc2f722d98"
+ integrity sha512-42L/pSGD/+diCg8SwhZaXjDlkAWV10u42UozyG7rqDdyPW7HDp2/j/RYRZ3x0sXFf7hAUtLYvI9HdACWdjyfVw==
+ dependencies:
+ detect-libc "^1.0.3"
+ expand-template "^2.0.3"
+ github-from-package "0.0.0"
+ minimist "^1.2.0"
+ mkdirp "^0.5.1"
+ napi-build-utils "^1.0.1"
+ node-abi "^2.2.0"
+ noop-logger "^0.1.1"
+ npmlog "^4.0.1"
+ os-homedir "^1.0.1"
+ pump "^2.0.1"
+ rc "^1.2.7"
+ simple-get "^2.7.0"
+ tar-fs "^1.13.0"
+ tunnel-agent "^0.6.0"
+ which-pm-runs "^1.0.0"
+
"@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.3.0.tgz#50a2754016b6f30a994ceda6d9a0a8c36adda849"
@@ -2448,6 +2470,13 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
+decompress-response@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
+ integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
+ dependencies:
+ mimic-response "^1.0.0"
+
deep-eql@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
@@ -2596,7 +2625,7 @@ detect-indent@~5.0.0:
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d"
integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50=
-detect-libc@^1.0.2:
+detect-libc@^1.0.2, detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
@@ -3218,6 +3247,11 @@ expand-range@^1.8.1:
dependencies:
fill-range "^2.1.0"
+expand-template@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
+ integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
+
express@^4.16.2:
version "4.16.4"
resolved "https://registry.yarnpkg.com/express/-/express-4.16.4.tgz#fddef61926109e24c515ea97fd2f1bdbf62df12e"
@@ -3826,6 +3860,11 @@ git-url-parse@^11.1.2:
dependencies:
git-up "^4.0.0"
+github-from-package@0.0.0:
+ version "0.0.0"
+ resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
+ integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=
+
glob-base@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
@@ -5225,6 +5264,14 @@ karma@^3.1.4:
tmp "0.0.33"
useragent "2.3.0"
+keytar@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.4.0.tgz#5fa6627863dcc5b249b2266d6d6a2c62150006ca"
+ integrity sha512-IX6rvzrXVCWwQDGxf0FmF1IYDU2UuKsTPl1rhMCvoFfvkpRyKQYHYNqmKISwTseh/JVk4VPRlLsP4L3J25odBg==
+ dependencies:
+ "@shiftkey/prebuild-install" "5.2.4"
+ nan "2.12.1"
+
killable@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
@@ -5800,6 +5847,11 @@ mimic-fn@^1.0.0:
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==
+mimic-response@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
+ integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
+
mini-css-extract-plugin@0.4.4:
version "0.4.4"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.4.tgz#c10410a004951bd3cedac1da69053940fccb625d"
@@ -5999,7 +6051,7 @@ mute-stream@0.0.7, mute-stream@~0.0.4:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
-nan@^2.10.0, nan@^2.9.2:
+nan@2.12.1, nan@^2.10.0, nan@^2.9.2:
version "2.12.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552"
integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==
@@ -6021,6 +6073,11 @@ nanomatch@^1.2.9:
snapdragon "^0.8.1"
to-regex "^3.0.1"
+napi-build-utils@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.1.tgz#1381a0f92c39d66bf19852e7873432fc2123e508"
+ integrity sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==
+
needle@^2.2.1:
version "2.2.4"
resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e"
@@ -6092,6 +6149,13 @@ nise@^1.4.8:
path-to-regexp "^1.7.0"
text-encoding "^0.6.4"
+node-abi@^2.2.0:
+ version "2.7.1"
+ resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.7.1.tgz#a8997ae91176a5fbaa455b194976e32683cda643"
+ integrity sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==
+ dependencies:
+ semver "^5.4.1"
+
node-fetch-npm@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7"
@@ -6220,6 +6284,11 @@ node-sass@4.10.0:
stdout-stream "^1.4.0"
"true-case-path" "^1.0.2"
+noop-logger@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2"
+ integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=
+
"nopt@2 || 3", nopt@3.x:
version "3.0.6"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
@@ -6478,7 +6547,7 @@ npm@5.1.0:
wrappy "~1.0.2"
write-file-atomic "~2.1.0"
-"npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.0, npmlog@^4.0.2, npmlog@~4.1.2:
+"npmlog@0 || 1 || 2 || 3 || 4", "npmlog@2 || ^3.1.0 || ^4.0.0", npmlog@^4.0.0, npmlog@^4.0.1, npmlog@^4.0.2, npmlog@~4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
@@ -6667,7 +6736,7 @@ os-browserify@^0.3.0:
resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27"
integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=
-os-homedir@^1.0.0:
+os-homedir@^1.0.0, os-homedir@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
@@ -8271,6 +8340,20 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=
+simple-concat@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6"
+ integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=
+
+simple-get@^2.7.0:
+ version "2.8.1"
+ resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d"
+ integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==
+ dependencies:
+ decompress-response "^3.3.0"
+ once "^1.3.1"
+ simple-concat "^1.0.0"
+
simple-git@^1.107.0:
version "1.107.0"
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.107.0.tgz#12cffaf261c14d6f450f7fdb86c21ccee968b383"
@@ -8981,7 +9064,7 @@ tapable@^1.0.0, tapable@^1.1.0:
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.1.tgz#4d297923c5a72a42360de2ab52dadfaaec00018e"
integrity sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==
-tar-fs@^1.15.3:
+tar-fs@^1.13.0, tar-fs@^1.15.3:
version "1.16.3"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509"
integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==
@@ -9853,6 +9936,11 @@ which-module@^2.0.0:
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=
+which-pm-runs@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb"
+ integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=
+
which@1, which@^1.1.1, which@^1.2.1, which@^1.2.12, which@^1.2.9, which@^1.3.0, which@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
From 396458c9993e56d89f57fda06b456778cb61b5c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?=
Date: Sat, 16 Feb 2019 19:04:36 +0100
Subject: [PATCH 039/160] fix(.travil.yml): fix du fichier travis
---
.travis.yml | 1 +
src/app/screens/home/home.component.ts | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 56e5ad3..8faa57e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,7 @@ before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
+ - sudo apt-get install libsecret-1-dev
- npm set progress=false
- npm install
- npm run electron:linux
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts
index 300bab4..70009e9 100644
--- a/src/app/screens/home/home.component.ts
+++ b/src/app/screens/home/home.component.ts
@@ -64,5 +64,4 @@ export class HomeComponent implements OnInit {
this.toastr.error(this.translate.instant('ERROR'), this.translate.instant('NO_FOLDER'));
}
}
-
}
From 3b7f19c7c10b5a931d802b47bcb4f4b74efe2b64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?=
Date: Sat, 16 Feb 2019 22:29:07 +0100
Subject: [PATCH 040/160] refactor(readme): refactor du readme
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index 2887315..3603059 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,14 @@ Pour assurer le fonctionnement de cette application depuis n'importe quel OS, il
Nous utiliserons aussi yarn.
+Pour la gestion des mots de passes, il est nécessaire d'avoir installé le package `libsecret` sur Linux.
+Selon la distribution, il faut lancer les commandes suivantes :
+
+- Debian/Ubuntu: `sudo apt-get install libsecret-1-dev`
+- Red Hat-based: `sudo yum install libsecret-devel`
+- Arch Linux: `sudo pacman -S libsecret`
+
+
### Installation de Node.js
**Windows et macOS**
From 8e408f0184223e4c2edd0b987e738e23b9c1675b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?=
Date: Sat, 16 Feb 2019 22:46:53 +0100
Subject: [PATCH 041/160] refactor(dropdown): le model de la dropdown est l'id
---
.../dropdown/dropdown.component.html | 2 +-
src/app/screens/toolbox/toolbox.component.ts | 20 +++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/app/components/dropdown/dropdown.component.html b/src/app/components/dropdown/dropdown.component.html
index d741cfe..3d2b056 100644
--- a/src/app/components/dropdown/dropdown.component.html
+++ b/src/app/components/dropdown/dropdown.component.html
@@ -1,4 +1,4 @@
diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts
index a084317..a89b756 100644
--- a/src/app/screens/toolbox/toolbox.component.ts
+++ b/src/app/screens/toolbox/toolbox.component.ts
@@ -54,7 +54,7 @@ export class ToolboxComponent implements OnInit {
this.inputMinMaxValueNumber = 0;
this.max = 10;
this.min = 0;
- this.dropdownValue = 'Orange';
+ this.dropdownValue = 'banana';
this.colorList = [
'dark-blue',
@@ -121,17 +121,17 @@ export class ToolboxComponent implements OnInit {
];
this.dataDropdownExample = [
- {key: 'Orange', value: 'Orange'},
- {key: 'Banane', value: 'Banane'},
- {key: 'Cerise', value: 'Cerise'},
- {key: 'Poire', value: 'Poire'},
+ {key: 'orange', value: 'Orange'},
+ {key: 'banana', value: 'Banane'},
+ {key: 'cherry', value: 'Cerise'},
+ {key: 'pear', value: 'Poire'},
];
this.dataDropdownExampleTwo = [
- {key: 'Carotte', value: 'Carotte'},
- {key: 'Poireau', value: 'Poireau'},
- {key: 'Courge', value: 'Courge'},
- {key: 'Patate', value: 'Patate'},
+ {key: 'carrot', value: 'Carotte'},
+ {key: 'leek', value: 'Poireau'},
+ {key: 'squash', value: 'Courge'},
+ {key: 'potato', value: 'Patate'},
];
this.contextMenuFirstObject = [
@@ -251,7 +251,7 @@ export class ToolboxComponent implements OnInit {
}
testAleatDropdown() {
- this.dropdownValue = this.dataDropdownExample[Math.floor(Math.random() * 4)].value;
+ this.dropdownValue = this.dataDropdownExample[Math.floor(Math.random() * 4)].key;
}
showMessage(message: string) {
From b82ecd22b991e620a6676ec214732789422a9b08 Mon Sep 17 00:00:00 2001
From: Martin Blondel
Date: Sat, 16 Feb 2019 22:49:08 +0100
Subject: [PATCH 042/160] refactor(open): avancement open
---
src/app/app.module.ts | 3 ++-
src/app/providers/electron.service.ts | 2 +-
src/app/providers/git.service.ts | 19 +++++++++++++++++++
src/app/screens/home/home.component.html | 2 +-
src/app/screens/home/home.component.ts | 20 ++++++++++++--------
5 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index c8cdb84..9bd0087 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -20,6 +20,7 @@ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { ElectronService } from './providers/electron.service';
+import { GitService } from './providers/git.service';
import { WebviewDirective } from './directives/webview.directive';
@@ -96,7 +97,7 @@ export function HttpLoaderFactory(http: HttpClient) {
useBootstrap4: true
})
],
- providers: [ElectronService, EditorPreferencesService],
+ providers: [ElectronService, GitService, EditorPreferencesService],
bootstrap: [AppComponent]
})
export class AppModule { }
diff --git a/src/app/providers/electron.service.ts b/src/app/providers/electron.service.ts
index c3f2033..152fa60 100644
--- a/src/app/providers/electron.service.ts
+++ b/src/app/providers/electron.service.ts
@@ -43,7 +43,7 @@ export class ElectronService {
const PATH = this.remote.dialog.showOpenDialog({
properties: ['openDirectory']
});
- if (path !== undefined) {
+ if (PATH !== undefined) {
return PATH[0];
}
return null;
diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts
index 3c89176..6bfc393 100644
--- a/src/app/providers/git.service.ts
+++ b/src/app/providers/git.service.ts
@@ -31,4 +31,23 @@ export class GitService {
isRepo(currentPath: string) {
return gitPromise(currentPath).checkIsRepo();
}
+
+ /**
+ * Fonction permettant de changer le chemin courant
+ * @param newPath le nouveau chemin
+ */
+ async setPath(newPath) {
+ if (await this.isRepo(newPath)) {
+ this.path = newPath;
+ this.electronService.process.chdir(this.path);
+ this.git.cwd(this.path);
+ this.gitP.cwd(this.path);
+ this.emitPathSubject();
+ // A traduir
+ return new ServiceResult(true, 'Succès', 'Répo ouvert');
+ } else {
+ return new ServiceResult(false, 'Echec', 'Répo pas ouvert');
+
+ }
+ }
}
diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html
index 8cb5b25..8182076 100644
--- a/src/app/screens/home/home.component.html
+++ b/src/app/screens/home/home.component.html
@@ -41,7 +41,7 @@
-