From d80b836848f011516c5484bfb3bf1b21f2bd3d6a Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 11 Feb 2019 23:50:45 +0100 Subject: [PATCH 001/160] =?UTF-8?q?feat(button-bar):=20D=C3=A9but=20de=20l?= =?UTF-8?q?a=20button=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/home/home.component.html | 35 +++++++++++++++++++ src/app/components/home/home.component.scss | 32 +++++++++++++++++ src/app/components/home/home.component.ts | 20 +++++++++++ .../components/toolbox/toolbox.component.ts | 6 ++-- src/assets/i18n/en.json | 5 ++- src/assets/i18n/fr.json | 5 ++- 6 files changed, 99 insertions(+), 4 deletions(-) diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index 2d08a6a..0a5b67a 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -1 +1,36 @@ + + +
+ +
+ Folder > Projet > Branche +
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ \ No newline at end of file diff --git a/src/app/components/home/home.component.scss b/src/app/components/home/home.component.scss index e69de29..a74c95a 100644 --- a/src/app/components/home/home.component.scss +++ b/src/app/components/home/home.component.scss @@ -0,0 +1,32 @@ +@import '../../../variables.scss'; + +.gh-button-bar { + @include wX-hX(100%, 50px); + @include bg-color($light-grey); + color: $white; + + &-project { + @include hX(50px); + line-height: 50px; + float: left; + text-align: left; + } + + &-more { + @include hX(50px); + line-height: 50px; + float: right; + text-align: right; + } + + &-actions { + @include hX(50px); + margin: 0 auto; + display: inline-block; + text-align: center; + } +} + +.cursor-pointer { + cursor: pointer; +} \ No newline at end of file diff --git a/src/app/components/home/home.component.ts b/src/app/components/home/home.component.ts index f56c8c1..3f9682a 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/components/home/home.component.ts @@ -12,4 +12,24 @@ export class HomeComponent implements OnInit { ngOnInit() { } + pullButtonClicked() { + console.log('Bouton pull cliqué'); + } + + pushButtonClicked() { + console.log('Bouton push cliqué'); + } + + branchButtonClicked() { + console.log('Bouton branche cliqué'); + } + + openTerminal() { + console.log('on ouvre le terminal'); + } + + openPreferences() { + console.log('on ouvre les préférences'); + } + } diff --git a/src/app/components/toolbox/toolbox.component.ts b/src/app/components/toolbox/toolbox.component.ts index 31d53ee..1738e6e 100644 --- a/src/app/components/toolbox/toolbox.component.ts +++ b/src/app/components/toolbox/toolbox.component.ts @@ -109,7 +109,9 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-spinner', isFab: false }, { icon: 'fa-upload', isFab: false }, { icon: 'fa-download', isFab: false }, - { icon: 'fa-sign-out-alt', isFab: false} + { icon: 'fa-sign-out-alt', isFab: false}, + { icon: 'fa-code-branch', isFab: false}, + { icon: 'fa-cog', isFab: false} ]; this.dataDropdownExample = [ @@ -196,7 +198,7 @@ export class ToolboxComponent implements OnInit { setLoading() { this.loading = !this.loading; } - + openRegularModal() { this.modalRegularVisible = true; } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 127db76..669e17b 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -62,5 +62,8 @@ "CLICK": { "RIGHT": "Right click", "LEFT": "Left click" - } + }, + "BRANCH": "Branch", + "PUSH": "Push", + "PULL": "Pull" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index b47ea4a..9f8f225 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -62,5 +62,8 @@ "CLICK": { "RIGHT": "Clic droit", "LEFT": "Clic gauche" - } + }, + "BRANCH": "Branche", + "PUSH": "Push", + "PULL": "Pull" } \ No newline at end of file From 3811f6745a71f51c1a72b286ea98c757f09d6f06 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Tue, 12 Feb 2019 14:57:46 +0100 Subject: [PATCH 002/160] refactor(button-bar): Changement du type de colonnes --- src/app/components/home/home.component.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index 0a5b67a..d79bd96 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -2,18 +2,18 @@
-
+
Folder > Projet > Branche
-
+
-
+
From eccca38fbd73cf42a96f229209e0bd7469e5291a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 12 Feb 2019 15:56:13 +0100 Subject: [PATCH 003/160] refactor(button-bar): petits changements --- src/app/components/home/home.component.html | 14 +++++++------- src/app/components/home/home.component.scss | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index d79bd96..1a0a10e 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -5,13 +5,6 @@
Folder > Projet > Branche
- -
-
- - -
-
@@ -30,6 +23,13 @@
+ +
+
+ + +
+
diff --git a/src/app/components/home/home.component.scss b/src/app/components/home/home.component.scss index a74c95a..06ff812 100644 --- a/src/app/components/home/home.component.scss +++ b/src/app/components/home/home.component.scss @@ -12,19 +12,19 @@ text-align: left; } - &-more { - @include hX(50px); - line-height: 50px; - float: right; - text-align: right; - } - &-actions { @include hX(50px); margin: 0 auto; display: inline-block; text-align: center; } + + &-more { + @include hX(50px); + line-height: 50px; + float: right; + text-align: right; + } } .cursor-pointer { From 3b21fc3dd72f7552cf93634fd3cef9baa7d67533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 12 Feb 2019 18:13:28 +0100 Subject: [PATCH 004/160] refactor(button-bar): Changement css --- src/app/app-routing.module.ts | 9 +- src/app/app.module.ts | 8 +- .../components/dropdown/dropdown.component.ts | 10 +- src/app/components/home/home.component.scss | 32 ------ .../home/home.component.html | 16 ++- src/app/screens/home/home.component.scss | 107 ++++++++++++++++++ .../home/home.component.spec.ts | 0 .../home/home.component.ts | 5 +- .../preferences/preferences.component.html | 20 ++++ .../preferences/preferences.component.scss | 1 + .../preferences/preferences.component.spec.ts | 25 ++++ .../preferences/preferences.component.ts | 26 +++++ .../toolbox/toolbox.component.html | 0 .../toolbox/toolbox.component.scss | 0 .../toolbox/toolbox.component.spec.ts | 0 .../toolbox/toolbox.component.ts | 4 +- src/assets/i18n/en.json | 8 +- src/assets/i18n/fr.json | 10 +- src/styles.scss | 4 + 19 files changed, 233 insertions(+), 52 deletions(-) delete mode 100644 src/app/components/home/home.component.scss rename src/app/{components => screens}/home/home.component.html (75%) create mode 100644 src/app/screens/home/home.component.scss rename src/app/{components => screens}/home/home.component.spec.ts (100%) rename src/app/{components => screens}/home/home.component.ts (81%) create mode 100644 src/app/screens/preferences/preferences.component.html create mode 100644 src/app/screens/preferences/preferences.component.scss create mode 100644 src/app/screens/preferences/preferences.component.spec.ts create mode 100644 src/app/screens/preferences/preferences.component.ts rename src/app/{components => screens}/toolbox/toolbox.component.html (100%) rename src/app/{components => screens}/toolbox/toolbox.component.scss (100%) rename src/app/{components => screens}/toolbox/toolbox.component.spec.ts (100%) rename src/app/{components => screens}/toolbox/toolbox.component.ts (99%) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 4bae517..c5a27d6 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,8 +1,9 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; -import { ToolboxComponent } from './components/toolbox/toolbox.component'; -import { HomeComponent } from './components/home/home.component'; +import { ToolboxComponent } from './screens/toolbox/toolbox.component'; +import { HomeComponent } from './screens/home/home.component'; +import { PreferencesComponent } from './screens/preferences/preferences.component'; const ROUTES: Routes = [ { @@ -17,6 +18,10 @@ const ROUTES: Routes = [ { path: 'toolbox', component: ToolboxComponent + }, + { + path: 'preferences', + component: PreferencesComponent } ]; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 926dda2..c8cdb84 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -31,8 +31,8 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ToastrModule } from 'ngx-toastr'; import { EditorPreferencesService } from './providers/editor-preferences.service'; import { FooterComponent } from './components/footer/footer.component'; -import { HomeComponent } from './components/home/home.component'; -import { ToolboxComponent } from './components/toolbox/toolbox.component'; +import { HomeComponent } from './screens/home/home.component'; +import { ToolboxComponent } from './screens/toolbox/toolbox.component'; import { ContainerComponent } from './components/container/container.component'; import { CheckboxComponent } from './components/checkbox/checkbox.component'; import { ButtonComponent } from './components/button/button.component'; @@ -43,6 +43,7 @@ import { LoaderComponent } from './components/loader/loader.component'; import { ModalComponent } from './components/modal/modal.component'; import { InputNumberComponent } from './components/input-number/input-number.component'; import { CopyButtonComponent } from './components/copy-button/copy-button.component'; +import { PreferencesComponent } from './screens/preferences/preferences.component'; // AoT requires an exported function for factories @@ -67,7 +68,8 @@ export function HttpLoaderFactory(http: HttpClient) { LoaderComponent, ModalComponent, InputNumberComponent, - CopyButtonComponent + CopyButtonComponent, + PreferencesComponent ], imports: [ ReactiveFormsModule, diff --git a/src/app/components/dropdown/dropdown.component.ts b/src/app/components/dropdown/dropdown.component.ts index 797c7bf..4131753 100644 --- a/src/app/components/dropdown/dropdown.component.ts +++ b/src/app/components/dropdown/dropdown.component.ts @@ -38,11 +38,13 @@ export class DropdownComponent implements OnInit { } isSelected(opt) { - var valeur = this.getOptKey(opt); - if (valeur === this.currentValue) { - return 'selected'; + const VALUE = this.getOptKey(opt); + const SELECTED = 'selected'; + const EMPTY = ''; + if (VALUE === this.currentValue) { + return SELECTED; } - return ''; + return EMPTY; } getOptValue(option: any) { diff --git a/src/app/components/home/home.component.scss b/src/app/components/home/home.component.scss deleted file mode 100644 index 06ff812..0000000 --- a/src/app/components/home/home.component.scss +++ /dev/null @@ -1,32 +0,0 @@ -@import '../../../variables.scss'; - -.gh-button-bar { - @include wX-hX(100%, 50px); - @include bg-color($light-grey); - color: $white; - - &-project { - @include hX(50px); - line-height: 50px; - float: left; - text-align: left; - } - - &-actions { - @include hX(50px); - margin: 0 auto; - display: inline-block; - text-align: center; - } - - &-more { - @include hX(50px); - line-height: 50px; - float: right; - text-align: right; - } -} - -.cursor-pointer { - cursor: pointer; -} \ No newline at end of file diff --git a/src/app/components/home/home.component.html b/src/app/screens/home/home.component.html similarity index 75% rename from src/app/components/home/home.component.html rename to src/app/screens/home/home.component.html index 1a0a10e..3678bc7 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -2,8 +2,20 @@
-
- Folder > Projet > Branche +
+ +
diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss new file mode 100644 index 0000000..0af4575 --- /dev/null +++ b/src/app/screens/home/home.component.scss @@ -0,0 +1,107 @@ +@import '../../../variables.scss'; + +.gh-button-bar { + @include wX-hX(100%, 50px); + @include bg-color($light-grey); + color: $white; + + &-project { + @include hX(50px); + line-height: 50px; + float: left; + text-align: left; + padding-left: 0; + + & .gh-folder { + @include hX(50px); + display: inline-block; + background:yellow; + } + + & .gh-project { + @include hX(50px); + display: inline-block; + background-color: green; + } + + & .gh-branch { + @include hX(50px); + display: inline-block; + background-color: rebeccapurple; + } + } + + &-actions { + @include hX(50px); + margin: 0 auto; + display: inline-block; + text-align: center; + } + + &-more { + @include hX(50px); + line-height: 50px; + float: right; + text-align: right; + } +} + +.gh-breadcrumbs { + color:red; + list-style: none; + overflow: hidden; + font-size: 16px; + + & ul { + padding-left: 0; + + & li { + float: left; + + & a { + color: white; + text-decoration: none; + padding-left: 65px; + background: hsla(34,85%,35%,1); + position: relative; + display: block; + float: left; + + &::after { + content: " "; + display: block; + width: 0; + height: 0; + border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */ + border-bottom: 50px solid transparent; + border-left: 30px solid hsla(34,85%,35%,1); + position: absolute; + top: 50%; + margin-top: -50px; + left: 100%; + z-index: 2; + } + + &::before { + content: " "; + display: block; + width: 0; + height: 0; + border-top: 50px solid transparent; + border-bottom: 50px solid transparent; + border-left: 30px solid white; + position: absolute; + top: 50%; + margin-top: -50px; + margin-left: 1px; + left: 100%; + z-index: 1; + } + } + } + } +} + +.cursor-pointer { + cursor: pointer; +} \ No newline at end of file diff --git a/src/app/components/home/home.component.spec.ts b/src/app/screens/home/home.component.spec.ts similarity index 100% rename from src/app/components/home/home.component.spec.ts rename to src/app/screens/home/home.component.spec.ts diff --git a/src/app/components/home/home.component.ts b/src/app/screens/home/home.component.ts similarity index 81% rename from src/app/components/home/home.component.ts rename to src/app/screens/home/home.component.ts index 3f9682a..a298288 100644 --- a/src/app/components/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-home', @@ -7,7 +8,7 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { - constructor() { } + constructor(public router: Router) { } ngOnInit() { } @@ -29,7 +30,7 @@ export class HomeComponent implements OnInit { } openPreferences() { - console.log('on ouvre les préférences'); + this.router.navigate(['preferences']); } } diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html new file mode 100644 index 0000000..9691f35 --- /dev/null +++ b/src/app/screens/preferences/preferences.component.html @@ -0,0 +1,20 @@ + + + + + +
+ + {{ 'EXIT_PREFERENCES' | translate }} +
+
+
+ + + {{ 'GENERAL' | translate }} + + + {{ 'EDITOR' | translate }} + {{ 'UI' | translate }} +
+
\ No newline at end of file diff --git a/src/app/screens/preferences/preferences.component.scss b/src/app/screens/preferences/preferences.component.scss new file mode 100644 index 0000000..9404d21 --- /dev/null +++ b/src/app/screens/preferences/preferences.component.scss @@ -0,0 +1 @@ +@import '../../../variables.scss'; \ No newline at end of file diff --git a/src/app/screens/preferences/preferences.component.spec.ts b/src/app/screens/preferences/preferences.component.spec.ts new file mode 100644 index 0000000..07d1818 --- /dev/null +++ b/src/app/screens/preferences/preferences.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PreferencesComponent } from './preferences.component'; + +describe('PreferencesComponent', () => { + let component: PreferencesComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PreferencesComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PreferencesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts new file mode 100644 index 0000000..bcb3449 --- /dev/null +++ b/src/app/screens/preferences/preferences.component.ts @@ -0,0 +1,26 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-preferences', + templateUrl: './preferences.component.html', + styleUrls: ['./preferences.component.scss'] +}) +export class PreferencesComponent implements OnInit { + + preferencesVisible: Boolean; + preferencesTabSelectedIndex: any; + + constructor(public router: Router) { } + + ngOnInit() { + this.preferencesVisible = true; + this.preferencesTabSelectedIndex = 1; + } + + checkIfCloseModal(event) { + if (event.index === 0) { + this.router.navigate(['home']); + } + } +} diff --git a/src/app/components/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html similarity index 100% rename from src/app/components/toolbox/toolbox.component.html rename to src/app/screens/toolbox/toolbox.component.html diff --git a/src/app/components/toolbox/toolbox.component.scss b/src/app/screens/toolbox/toolbox.component.scss similarity index 100% rename from src/app/components/toolbox/toolbox.component.scss rename to src/app/screens/toolbox/toolbox.component.scss diff --git a/src/app/components/toolbox/toolbox.component.spec.ts b/src/app/screens/toolbox/toolbox.component.spec.ts similarity index 100% rename from src/app/components/toolbox/toolbox.component.spec.ts rename to src/app/screens/toolbox/toolbox.component.spec.ts diff --git a/src/app/components/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts similarity index 99% rename from src/app/components/toolbox/toolbox.component.ts rename to src/app/screens/toolbox/toolbox.component.ts index f483515..25ac960 100644 --- a/src/app/components/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -214,8 +214,8 @@ export class ToolboxComponent implements OnInit { this.toastr.info(this.modalInputValue.toString()); } - checkIfCloseModal($event) { - if ($event.index === 0) { + checkIfCloseModal(event) { + if (event.index === 0) { this.modalTabSelectedIndex = 1; this.modalFullscreenVisible = false; } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 6bda9c3..b74b2ff 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -63,8 +63,12 @@ "RIGHT": "Right click", "LEFT": "Left click" }, - "COPY": "Copy" + "COPY": "Copy", "BRANCH": "Branch", + "PULL": "Pull", "PUSH": "Push", - "PULL": "Pull" + "EXIT_PREFERENCES": "Exit preferences", + "GENERAL": "General", + "EDITOR": "Editor", + "UI": "User Interface" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 6d7db05..8f5ea19 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -63,8 +63,12 @@ "RIGHT": "Clic droit", "LEFT": "Clic gauche" }, - "COPY": "Copier" - "PULL": "Pull" - "PUSH": "Push", + "COPY": "Copier", "BRANCH": "Branche", + "PULL": "Tirer", + "PUSH": "Pousser", + "EXIT_PREFERENCES": "Sortir des préferences", + "GENERAL": "Général", + "EDITOR": "Editeur", + "UI": "Interface Utilisateur" } \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index 09a1bd8..1d76dbf 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -52,6 +52,10 @@ body { color: $white; } +.section-title { + font-size: 32px; +} + .gh-label-input { color: $white; padding: $gap-md $gap-md 0 $gap-md; From 3485ca5d5ef9d352acfe0f913d4351b6b5b05091 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Tue, 12 Feb 2019 23:36:46 +0100 Subject: [PATCH 005/160] =?UTF-8?q?feat(button-bar):=20Cr=C3=A9ation=20des?= =?UTF-8?q?=20diff=C3=A9rents=20menus=20de=20la=20button=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/modal/modal.component.scss | 2 +- src/app/screens/home/home.component.html | 36 ++++++----- src/app/screens/home/home.component.scss | 60 +++++++++---------- src/app/screens/home/home.component.ts | 15 ++++- .../preferences/preferences.component.html | 45 ++++++++------ src/app/screens/toolbox/toolbox.component.ts | 3 +- src/assets/i18n/en.json | 6 +- src/assets/i18n/fr.json | 6 +- src/styles.scss | 2 +- src/variables.scss | 2 +- 10 files changed, 105 insertions(+), 72 deletions(-) diff --git a/src/app/components/modal/modal.component.scss b/src/app/components/modal/modal.component.scss index fbdef13..ede94b3 100644 --- a/src/app/components/modal/modal.component.scss +++ b/src/app/components/modal/modal.component.scss @@ -28,7 +28,7 @@ } &__title { - background: $blue-grey; + background: $light-grey; font-weight: bold; @include hX(50px); line-height: 50px; diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 3678bc7..fdfd601 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -4,33 +4,25 @@
-
-
-
-
@@ -38,11 +30,25 @@
- +
+ +
+ +
+ + + + {{ 'OPEN' | translate }} + + {{ 'CLONE' | translate }} + {{ 'INIT' | translate }} + + + \ No newline at end of file diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 0af4575..20494c1 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -11,24 +11,6 @@ float: left; text-align: left; padding-left: 0; - - & .gh-folder { - @include hX(50px); - display: inline-block; - background:yellow; - } - - & .gh-project { - @include hX(50px); - display: inline-block; - background-color: green; - } - - & .gh-branch { - @include hX(50px); - display: inline-block; - background-color: rebeccapurple; - } } &-actions { @@ -43,11 +25,15 @@ line-height: 50px; float: right; text-align: right; + + & .searchInput { + width: 175px; + display: inline-block; + } } } .gh-breadcrumbs { - color:red; list-style: none; overflow: hidden; font-size: 16px; @@ -59,22 +45,22 @@ float: left; & a { - color: white; - text-decoration: none; - padding-left: 65px; - background: hsla(34,85%,35%,1); + color: $white; + text-decoration: none; + padding-left: 45px; + background: $blue-grey; // A MODIFIER ? (blue-grey = light grey wtf) position: relative; display: block; float: left; + cursor: pointer; &::after { content: " "; - display: block; - width: 0; - height: 0; - border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */ + display: block; + @include wX-hX(0, 0); + border-top: 50px solid transparent; border-bottom: 50px solid transparent; - border-left: 30px solid hsla(34,85%,35%,1); + border-left: 30px solid $blue-grey; position: absolute; top: 50%; margin-top: -50px; @@ -85,19 +71,29 @@ &::before { content: " "; display: block; - width: 0; - height: 0; + @include wX-hX(0, 0); border-top: 50px solid transparent; border-bottom: 50px solid transparent; - border-left: 30px solid white; + border-left: 30px solid $light-grey; position: absolute; top: 50%; margin-top: -50px; - margin-left: 1px; + margin-left: 2px; left: 100%; z-index: 1; } } + + &:first-child { + a { + padding-left: 10px; + @include bg-color($light-grey); + + &::before, &::after { + border-left: 30px solid $light-grey; + } + } + } } } } diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index a298288..10d8d17 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { ToastrService } from 'ngx-toastr'; @Component({ selector: 'app-home', @@ -8,9 +9,13 @@ import { Router } from '@angular/router'; }) export class HomeComponent implements OnInit { - constructor(public router: Router) { } + projectModalVisible: Boolean; + searchInputValue: String; + + constructor(public router: Router, private toastr: ToastrService) { } ngOnInit() { + } pullButtonClicked() { @@ -33,4 +38,12 @@ export class HomeComponent implements OnInit { this.router.navigate(['preferences']); } + openProjectModal() { + this.projectModalVisible = true; + } + + displaySearchInputValue() { + this.toastr.info(this.searchInputValue.toString()); + } + } diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 9691f35..b3037d9 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -1,20 +1,29 @@ - - - - -
- - {{ 'EXIT_PREFERENCES' | translate }} -
-
-
- - - {{ 'GENERAL' | translate }} - - - {{ 'EDITOR' | translate }} - {{ 'UI' | translate }} -
+ + + + +
+ + {{ 'EXIT_PREFERENCES' | translate }} +
+
+
+ + + {{ 'GENERAL' | translate }} + + + + + {{ 'EDITOR' | translate }} + + + + + {{ 'UI' | translate }} + + +
\ No newline at end of file diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 25ac960..b04d854 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -114,7 +114,8 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-download', isFab: false }, { icon: 'fa-sign-out-alt', isFab: false}, { icon: 'fa-code-branch', isFab: false}, - { icon: 'fa-cog', isFab: false} + { icon: 'fa-cog', isFab: false}, + { icon: 'fa-search', isFab: false} ]; this.dataDropdownExample = [ diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index b74b2ff..4ec8af5 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -70,5 +70,9 @@ "EXIT_PREFERENCES": "Exit preferences", "GENERAL": "General", "EDITOR": "Editor", - "UI": "User Interface" + "UI": "User Interface", + "REPOSITORY_MANAGEMENT": "Repository management", + "OPEN": "Open", + "CLONE": "Clone", + "INIT": "Init" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 8f5ea19..b67f5fc 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -70,5 +70,9 @@ "EXIT_PREFERENCES": "Sortir des préferences", "GENERAL": "Général", "EDITOR": "Editeur", - "UI": "Interface Utilisateur" + "UI": "Interface Utilisateur", + "REPOSITORY_MANAGEMENT": "Gestion du répertoire", + "OPEN": "Ouvrir", + "CLONE": "Cloner", + "INIT": "Initialiser" } \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index 1d76dbf..deef015 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -75,7 +75,7 @@ body { .mat-tab { &-header { - background: $blue-grey; + background: $light-grey; border-right: 1px solid $dark; &-pagination { diff --git a/src/variables.scss b/src/variables.scss index 1e140da..24854cc 100644 --- a/src/variables.scss +++ b/src/variables.scss @@ -13,7 +13,7 @@ $light-red: #963D3E; $disabled-red: #382C32; $dark-grey: #2C2E34; $light-grey: #373841; -$blue-grey: #373841; +$blue-grey: #3E4453; $white: #fff; $muted-white: #C9CACC; $dark: #222328; From 1ae2a70a1fe7698b3f52dae068eb6aa113bd114b Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Wed, 13 Feb 2019 00:27:13 +0100 Subject: [PATCH 006/160] refactor(button-bar): Retrait des commentaires inutiles --- src/app/screens/home/home.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 20494c1..c343653 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -48,7 +48,7 @@ color: $white; text-decoration: none; padding-left: 45px; - background: $blue-grey; // A MODIFIER ? (blue-grey = light grey wtf) + background: $blue-grey; position: relative; display: block; float: left; From e1dba2a646723fab955caa3a77900303b3f6638a Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Wed, 13 Feb 2019 00:38:52 +0100 Subject: [PATCH 007/160] =?UTF-8?q?refactor(button-bar):=20Modification=20?= =?UTF-8?q?ic=C3=B4ne=20projet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index fdfd601..7b2162c 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -4,7 +4,7 @@
diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index c343653..533940c 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -90,7 +90,7 @@ @include bg-color($light-grey); &::before, &::after { - border-left: 30px solid $light-grey; + border-left: 16px solid $light-grey; } } } From 387b38466718b79259b2770484b2e524ca073992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 13 Feb 2019 17:19:07 +0100 Subject: [PATCH 008/160] =?UTF-8?q?maintain(test):=20int=C3=A9gration=20de?= =?UTF-8?q?s=20TU=20+=20Coverage=20+=20template=20de=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 10 +++- e2e/app.e2e-spec.ts | 15 ------ e2e/app.po.ts | 8 ---- e2e/protractor.conf.js | 37 --------------- e2e/tsconfig.e2e.json | 12 ----- package.json | 4 +- src/app/app.component.spec.ts | 33 ------------- .../button/button.component.spec.ts | 25 ---------- .../checkbox/checkbox.component.spec.ts | 25 ---------- .../container/container.component.spec.ts | 25 ---------- .../copy-button/copy-button.component.spec.ts | 25 ---------- .../dropdown/dropdown.component.spec.ts | 25 ---------- .../footer/footer.component.spec.ts | 25 ---------- .../icon-button/icon-button.component.spec.ts | 25 ---------- .../input-number.component.spec.ts | 25 ---------- .../components/input/input.component.spec.ts | 47 +++++++++++++++++-- .../loader/loader.component.spec.ts | 25 ---------- .../components/modal/modal.component.spec.ts | 45 ++++++++++++++++-- src/app/components/modal/modal.component.ts | 1 + src/app/screens/home/home.component.spec.ts | 25 ---------- .../preferences/preferences.component.spec.ts | 25 ---------- .../screens/toolbox/toolbox.component.spec.ts | 25 ---------- src/karma.conf.js | 8 +++- yarn.lock | 12 +++++ 25 files changed, 116 insertions(+), 417 deletions(-) delete mode 100644 e2e/app.e2e-spec.ts delete mode 100644 e2e/app.po.ts delete mode 100644 e2e/protractor.conf.js delete mode 100644 e2e/tsconfig.e2e.json delete mode 100644 src/app/app.component.spec.ts delete mode 100644 src/app/components/button/button.component.spec.ts delete mode 100644 src/app/components/checkbox/checkbox.component.spec.ts delete mode 100644 src/app/components/container/container.component.spec.ts delete mode 100644 src/app/components/copy-button/copy-button.component.spec.ts delete mode 100644 src/app/components/dropdown/dropdown.component.spec.ts delete mode 100644 src/app/components/footer/footer.component.spec.ts delete mode 100644 src/app/components/icon-button/icon-button.component.spec.ts delete mode 100644 src/app/components/input-number/input-number.component.spec.ts delete mode 100644 src/app/components/loader/loader.component.spec.ts delete mode 100644 src/app/screens/home/home.component.spec.ts delete mode 100644 src/app/screens/preferences/preferences.component.spec.ts delete mode 100644 src/app/screens/toolbox/toolbox.component.spec.ts diff --git a/.gitignore b/.gitignore index 5964d03..ceb01d9 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ npm-debug.log testem.log /typings package-lock.json +/units # e2e /e2e/*.js diff --git a/README.md b/README.md index e1dd2fb..c470dec 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Installer les dépendances |`node_modules/`| Dossier contenant les modules natifs et installés. | |`release/`| Dossier contenant la release après génération. | |`tests/`| Dossier contenant les fichiers de test. | +|`units/units.html`| Fichier de rapport des tests unitaires. | |`src/styles.scss`| Feuille de style globale. | |`src/variables.scss`| Feuille des variables de style. | |`src/assets/`| Dossier contenant les fichiers de traduction. | @@ -106,11 +107,18 @@ Comme expliqué plus haut, nous avons utilisé le kit de démarrage. Le fichier |`yarn electron:linux`| Sous Linux, build l'application et crée un `.AppImage`. | |`yarn electron:windows`| Sous Windows, build l'application et crée un `.exe`, exécutable pour les systèmes en 32 et 64 bits. | |`yarn electron:mac`| Sous macOS, build l'application et crée un `.dmg` contenant le `.app`. | +|`yarn test:unit`| Lance les tests unitaires | +|`yarn test:unit:coverage`| Lance les tests unitaires et le couvrage de code | |`yarn test:e2e`| Lance les tests end-to-end (e2e) | ⚠️ Il faut supprimer le dossier release avant d'en regénérer un autre ⚠️ -## Lancer les tests +## Lancer les tests unitaires + +Il est nécessaire d'avoir installé chrome auparavant sur son ordinateur pour lancer les tests unitaires. +Une fois cette condition réalisée, il suffit de lancé `yarn test:unit`. Le rapport est alors disponible dans `units/units.html`. + +## Lancer les tests end-to-end Comme expliqué ci-dessus, la commande `yarn test:e2e` lance les tests end-to-end. Cependant, il est nécessaire de créer une release avant de lancer cette commande. diff --git a/e2e/app.e2e-spec.ts b/e2e/app.e2e-spec.ts deleted file mode 100644 index a481968..0000000 --- a/e2e/app.e2e-spec.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { GitHarponPage } from './app.po'; -import { browser, element, by } from 'protractor'; - -describe('git-harpon App', () => { - let page: AngularElectronPage; - - beforeEach(() => { - page = new AngularElectronPage(); - }); - - it('should display message saying App works !', () => { - page.navigateTo('/'); - expect(element(by.css('app-home h1')).getText()).toMatch('App works !'); - }); -}); diff --git a/e2e/app.po.ts b/e2e/app.po.ts deleted file mode 100644 index a4151f3..0000000 --- a/e2e/app.po.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { browser, element, by } from 'protractor'; - -/* tslint:disable */ -export class GitHarponPage { - navigateTo(route: string) { - return browser.get(route); - } -} diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js deleted file mode 100644 index e46f106..0000000 --- a/e2e/protractor.conf.js +++ /dev/null @@ -1,37 +0,0 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/lib/config.ts - -const { SpecReporter } = require('jasmine-spec-reporter'); - -exports.config = { - allScriptsTimeout: 25000, - delayBrowserTimeInSeconds: 0, - specs: [ - './**/*.e2e-spec.ts' - ], - capabilities: { - 'browserName': 'chrome', - chromeOptions: { - args: ["--no-sandbox", "--headless", "--disable-gpu"] - } - }, - chromeOnly: true, - directConnect: true, - baseUrl: 'http://localhost:4200/', - framework: 'jasmine2', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 30000, - print: function () { }, - realtimeFailure: true - }, - useAllAngular2AppRoots: true, - beforeLaunch: function () { - require('ts-node').register({ - project: 'e2e/tsconfig.e2e.json' - }); - }, - onPrepare() { - jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); - } -}; diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json deleted file mode 100644 index ac7a373..0000000 --- a/e2e/tsconfig.e2e.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/e2e", - "module": "commonjs", - "target": "es5", - "types":[ - "jasmine", - "node" - ] - } -} diff --git a/package.json b/package.json index 9712f21..dc9f830 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,9 @@ "electron:linux": "npm run build:prod && npx electron-builder build --linux", "electron:windows": "npm run build:prod && npx electron-builder build --windows", "electron:mac": "npm run build:prod && npx electron-builder build --mac", - "test": "npm run postinstall:web && ng test", "e2e": "npm run postinstall:web && ng e2e", + "test:unit": "npm run postinstall:web && ng test", + "test:unit:coverage": "npm run postinstall:web && ng test --watch=false --code-coverage", "test:e2e": "mocha --timeout 15000 tests/test.js" }, "dependencies": { @@ -42,6 +43,7 @@ "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "jquery": "^3.3.1", + "karma-htmlfile-reporter": "^0.3.8", "mocha": "^5.2.0", "mocha-sinon": "^2.1.0", "monaco-editor": "^0.14.3", diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts deleted file mode 100644 index e8f25b5..0000000 --- a/src/app/app.component.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { TestBed, async } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AppComponent } from './app.component'; -import { TranslateModule } from '@ngx-translate/core'; -import { ElectronService } from './providers/electron.service'; - -describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ - AppComponent - ], - providers: [ - ElectronService - ], - imports: [ - RouterTestingModule, - TranslateModule.forRoot() - ] - }).compileComponents(); - })); - - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); -}); - -class TranslateServiceStub { - setDefaultLang(lang: string): void { - } -} diff --git a/src/app/components/button/button.component.spec.ts b/src/app/components/button/button.component.spec.ts deleted file mode 100644 index 794fc67..0000000 --- a/src/app/components/button/button.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ButtonComponent } from './button.component'; - -describe('ButtonComponent', () => { - let component: ButtonComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ButtonComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ButtonComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/checkbox/checkbox.component.spec.ts b/src/app/components/checkbox/checkbox.component.spec.ts deleted file mode 100644 index be613b0..0000000 --- a/src/app/components/checkbox/checkbox.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CheckboxComponent } from './checkbox.component'; - -describe('CheckboxComponent', () => { - let component: CheckboxComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CheckboxComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CheckboxComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/container/container.component.spec.ts b/src/app/components/container/container.component.spec.ts deleted file mode 100644 index f71eaab..0000000 --- a/src/app/components/container/container.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ContainerComponent } from './container.component'; - -describe('ContainerComponent', () => { - let component: ContainerComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ContainerComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ContainerComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/copy-button/copy-button.component.spec.ts b/src/app/components/copy-button/copy-button.component.spec.ts deleted file mode 100644 index 115d714..0000000 --- a/src/app/components/copy-button/copy-button.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { CopyButtonComponent } from './copy-button.component'; - -describe('CopyButtonComponent', () => { - let component: CopyButtonComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ CopyButtonComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(CopyButtonComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/dropdown/dropdown.component.spec.ts b/src/app/components/dropdown/dropdown.component.spec.ts deleted file mode 100644 index e0edf7a..0000000 --- a/src/app/components/dropdown/dropdown.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { DropdownComponent } from './dropdown.component'; - -describe('DropdownComponent', () => { - let component: DropdownComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ DropdownComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(DropdownComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/footer/footer.component.spec.ts b/src/app/components/footer/footer.component.spec.ts deleted file mode 100644 index 2ca6c45..0000000 --- a/src/app/components/footer/footer.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { FooterComponent } from './footer.component'; - -describe('FooterComponent', () => { - let component: FooterComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ FooterComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(FooterComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/icon-button/icon-button.component.spec.ts b/src/app/components/icon-button/icon-button.component.spec.ts deleted file mode 100644 index ccbd621..0000000 --- a/src/app/components/icon-button/icon-button.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { IconButtonComponent } from './icon-button.component'; - -describe('IconButtonComponent', () => { - let component: IconButtonComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ IconButtonComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(IconButtonComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/input-number/input-number.component.spec.ts b/src/app/components/input-number/input-number.component.spec.ts deleted file mode 100644 index 31b9eff..0000000 --- a/src/app/components/input-number/input-number.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { InputNumberComponent } from './input-number.component'; - -describe('InputNumberComponent', () => { - let component: InputNumberComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ InputNumberComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(InputNumberComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/input/input.component.spec.ts b/src/app/components/input/input.component.spec.ts index 0895fab..c2cdb2e 100644 --- a/src/app/components/input/input.component.spec.ts +++ b/src/app/components/input/input.component.spec.ts @@ -1,25 +1,62 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { async, ComponentFixture, TestBed, tick, fakeAsync} from '@angular/core/testing'; import { InputComponent } from './input.component'; +import { FormsModule } from '@angular/forms'; +import { TranslateService } from '@ngx-translate/core'; +import { DebugElement } from '@angular/core'; +import { By } from '@angular/platform-browser'; + +class MockTranslateService { + instant(text: string) { + return text; + } +} describe('InputComponent', () => { let component: InputComponent; let fixture: ComponentFixture; + let inputEl: DebugElement; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ InputComponent ] + declarations: [InputComponent], + imports: [ + FormsModule + ], + providers: [ + { + provide: TranslateService, + useClass: MockTranslateService + } + ] }) - .compileComponents(); + .compileComponents(); })); beforeEach(() => { fixture = TestBed.createComponent(InputComponent); component = fixture.componentInstance; - fixture.detectChanges(); + inputEl = fixture.debugElement.query(By.css('input.gh-input')); }); - it('should create', () => { + it('tests the component creation', () => { expect(component).toBeTruthy(); }); + + it('tests the component value', fakeAsync(() => { + const content = 'axuluphrum'; + component.value = content; + fixture.detectChanges(); + inputEl.nativeElement.dispatchEvent(new Event('input')); + tick(); + fixture.detectChanges(); + expect(inputEl.nativeElement.value).toEqual(content); + })); + + it('tests the getPlaceholderTranslation function', () => { + const content = 'something'; + component.placeholder = content; + const translation = component.getPlaceholderTranslation(); + expect(translation).toBe(component.placeholder.toUpperCase()); + }); }); diff --git a/src/app/components/loader/loader.component.spec.ts b/src/app/components/loader/loader.component.spec.ts deleted file mode 100644 index 35adf49..0000000 --- a/src/app/components/loader/loader.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { LoaderComponent } from './loader.component'; - -describe('LoaderComponent', () => { - let component: LoaderComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ LoaderComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(LoaderComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/components/modal/modal.component.spec.ts b/src/app/components/modal/modal.component.spec.ts index fc32a90..a742caa 100644 --- a/src/app/components/modal/modal.component.spec.ts +++ b/src/app/components/modal/modal.component.spec.ts @@ -1,14 +1,34 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ModalComponent } from './modal.component'; +import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; +import { Observable } from 'rxjs/Observable'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; + + +let translations: any = {"CARDS_TITLE": "This is a test"}; + +class MockTranslateLoader implements TranslateLoader { + getTranslation(lang: string): Observable { + return translations; + } +} + describe('ModalComponent', () => { let component: ModalComponent; let fixture: ComponentFixture; + let modalEl: DebugElement; beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ModalComponent ] + declarations: [ ModalComponent ], + imports: [ + TranslateModule.forRoot({ + loader: {provide: TranslateLoader, useClass: MockTranslateLoader}, + }) + ] }) .compileComponents(); })); @@ -16,10 +36,29 @@ describe('ModalComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ModalComponent); component = fixture.componentInstance; - fixture.detectChanges(); + modalEl = fixture.debugElement.query(By.css('div.gh-modal')); }); - it('should create', () => { + it('tests the component creation', () => { expect(component).toBeTruthy(); }); + + it('tests the visible property with true value', () => { + component.visible = true; + fixture.detectChanges(); + const classList = modalEl.nativeElement.classList; + expect(classList).toContain('visible'); + }); + + it('tests the visible property with false value', () => { + component.visible = false; + fixture.detectChanges(); + const classList = modalEl.nativeElement.classList; + expect(classList.contains('visible')).toBeFalsy(); + }); + + it('tests the openModal function', () => { + component.closeModal(); + expect(component.visible).toBeFalsy(); + }); }); diff --git a/src/app/components/modal/modal.component.ts b/src/app/components/modal/modal.component.ts index 6e406a9..e8b5a46 100644 --- a/src/app/components/modal/modal.component.ts +++ b/src/app/components/modal/modal.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'app-modal', diff --git a/src/app/screens/home/home.component.spec.ts b/src/app/screens/home/home.component.spec.ts deleted file mode 100644 index 490e81b..0000000 --- a/src/app/screens/home/home.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { HomeComponent } from './home.component'; - -describe('HomeComponent', () => { - let component: HomeComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ HomeComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(HomeComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/screens/preferences/preferences.component.spec.ts b/src/app/screens/preferences/preferences.component.spec.ts deleted file mode 100644 index 07d1818..0000000 --- a/src/app/screens/preferences/preferences.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { PreferencesComponent } from './preferences.component'; - -describe('PreferencesComponent', () => { - let component: PreferencesComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ PreferencesComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(PreferencesComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/screens/toolbox/toolbox.component.spec.ts b/src/app/screens/toolbox/toolbox.component.spec.ts deleted file mode 100644 index b249024..0000000 --- a/src/app/screens/toolbox/toolbox.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ToolboxComponent } from './toolbox.component'; - -describe('ToolboxComponent', () => { - let component: ToolboxComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ToolboxComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ToolboxComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/karma.conf.js b/src/karma.conf.js index 886ca1b..b564350 100644 --- a/src/karma.conf.js +++ b/src/karma.conf.js @@ -10,7 +10,8 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require('karma-htmlfile-reporter'), + require('@angular-devkit/build-angular/plugins/karma'), ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser @@ -20,7 +21,10 @@ module.exports = function (config) { reports: [ 'html', 'lcovonly' ], fixWebpackSourcePaths: true }, - reporters: ['progress', 'kjhtml'], + htmlReporter: { + outputFile: '../units/units.html' + }, + reporters: ['progress', 'html'], port: 9876, colors: true, logLevel: config.LOG_INFO, diff --git a/yarn.lock b/yarn.lock index 63d6fa8..e16a0b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5143,6 +5143,13 @@ karma-coverage-istanbul-reporter@2.0.0: istanbul-api "^1.3.1" minimatch "^3.0.4" +karma-htmlfile-reporter@^0.3.8: + version "0.3.8" + resolved "https://registry.yarnpkg.com/karma-htmlfile-reporter/-/karma-htmlfile-reporter-0.3.8.tgz#490f7f5f4fa7115404222f5d6cb72b04108354b4" + integrity sha512-Hd4c/vqPXYjdNYXeDJRMMq2DMMxPxqOR+TPeiLz2qbqO0qCCQMeXwFGhNDFr+GsvYhcOyn7maTbWusUFchS/4A== + dependencies: + xmlbuilder "^10.0.0" + karma-jasmine-html-reporter@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-1.4.0.tgz#1abbd30d4509a8c82b96707ae7d2fa4da459ca19" @@ -9905,6 +9912,11 @@ xmlbuilder@8.2.2: resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" integrity sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M= +xmlbuilder@^10.0.0: + version "10.1.1" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz#8cae6688cc9b38d850b7c8d3c0a4161dcaf475b0" + integrity sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg== + xmlbuilder@^9.0.7, xmlbuilder@~9.0.1: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" From d3834a317e75e7e945ec57d714ca578653252506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 13 Feb 2019 17:22:58 +0100 Subject: [PATCH 009/160] maintain(travis): ajout des TU sur travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7127315..321f2f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ install: - npm run electron:linux script: - npm run test:e2e + - npm run test:unit:coverage notifications: email: false slack: From 7012a6e7255eb3741205ed2a33da85340206eacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 13 Feb 2019 17:32:54 +0100 Subject: [PATCH 010/160] refactor(travis): changement ordre TU/e2e --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 321f2f7..56e5ad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ install: - npm install - npm run electron:linux script: - - npm run test:e2e - npm run test:unit:coverage + - npm run test:e2e notifications: email: false slack: From 19365207fd8fe49d157a18f9948956768113a8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 13 Feb 2019 22:20:02 +0100 Subject: [PATCH 011/160] maintain(models): externalisation des mock dans un dossier models --- src/app/components/input/input.component.spec.ts | 7 +------ src/app/components/modal/modal.component.spec.ts | 12 +----------- src/app/models/MockTranslateLoader.ts | 10 ++++++++++ src/app/models/MockTranslateService.ts | 5 +++++ src/app/models/ServiceResult.ts | 11 +++++++++++ 5 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 src/app/models/MockTranslateLoader.ts create mode 100644 src/app/models/MockTranslateService.ts create mode 100644 src/app/models/ServiceResult.ts diff --git a/src/app/components/input/input.component.spec.ts b/src/app/components/input/input.component.spec.ts index c2cdb2e..3654570 100644 --- a/src/app/components/input/input.component.spec.ts +++ b/src/app/components/input/input.component.spec.ts @@ -5,12 +5,7 @@ import { FormsModule } from '@angular/forms'; import { TranslateService } from '@ngx-translate/core'; import { DebugElement } from '@angular/core'; import { By } from '@angular/platform-browser'; - -class MockTranslateService { - instant(text: string) { - return text; - } -} +import { MockTranslateService } from '../../models/MockTranslateService'; describe('InputComponent', () => { let component: InputComponent; diff --git a/src/app/components/modal/modal.component.spec.ts b/src/app/components/modal/modal.component.spec.ts index a742caa..c6472e6 100644 --- a/src/app/components/modal/modal.component.spec.ts +++ b/src/app/components/modal/modal.component.spec.ts @@ -2,19 +2,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ModalComponent } from './modal.component'; import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { Observable } from 'rxjs/Observable'; import { By } from '@angular/platform-browser'; import { DebugElement } from '@angular/core'; - - -let translations: any = {"CARDS_TITLE": "This is a test"}; - -class MockTranslateLoader implements TranslateLoader { - getTranslation(lang: string): Observable { - return translations; - } -} - +import { MockTranslateLoader } from '../../models/MockTranslateLoader'; describe('ModalComponent', () => { let component: ModalComponent; diff --git a/src/app/models/MockTranslateLoader.ts b/src/app/models/MockTranslateLoader.ts new file mode 100644 index 0000000..e1548a6 --- /dev/null +++ b/src/app/models/MockTranslateLoader.ts @@ -0,0 +1,10 @@ +import { Observable } from 'rxjs/Observable'; +import { TranslateLoader } from '@ngx-translate/core'; + +export class MockTranslateLoader implements TranslateLoader { + translations: any = { 'CARDS_TITLE': 'This is a test' }; + + getTranslation(lang: string): Observable { + return this.translations; + } +} \ No newline at end of file diff --git a/src/app/models/MockTranslateService.ts b/src/app/models/MockTranslateService.ts new file mode 100644 index 0000000..178974f --- /dev/null +++ b/src/app/models/MockTranslateService.ts @@ -0,0 +1,5 @@ +export class MockTranslateService { + instant(text: string) { + return text; + } +} \ No newline at end of file diff --git a/src/app/models/ServiceResult.ts b/src/app/models/ServiceResult.ts new file mode 100644 index 0000000..e1f1e8b --- /dev/null +++ b/src/app/models/ServiceResult.ts @@ -0,0 +1,11 @@ +export class ServiceResult { + success: Boolean; + title: string; + message: string; + + constructor(success: Boolean, title: string, message: string) { + this.success = success; + this.title = title; + this.message = message; + } +} \ No newline at end of file From 054717a4ab9af9605b681655ad4f0c31ed53a1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 13 Feb 2019 22:28:14 +0100 Subject: [PATCH 012/160] refactor(readme): ajout d'une ligne au readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c470dec..2887315 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Installer les dépendances |`node_modules/`| Dossier contenant les modules natifs et installés. | |`release/`| Dossier contenant la release après génération. | |`tests/`| Dossier contenant les fichiers de test. | +|`coverage/`| Dossier contenant le résultat de la couverture de code. | |`units/units.html`| Fichier de rapport des tests unitaires. | |`src/styles.scss`| Feuille de style globale. | |`src/variables.scss`| Feuille des variables de style. | From 70de29799bc545656e02f429cf5d166716e83dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 14 Feb 2019 14:49:10 +0100 Subject: [PATCH 013/160] =?UTF-8?q?feat(gitservice):=20cr=C3=A9ation=20du?= =?UTF-8?q?=20service=20git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index dc9f830..cdb6578 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "bootstrap": "4.1.3", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", + "git-url-parse": "^11.1.2", "jquery": "^3.3.1", "karma-htmlfile-reporter": "^0.3.8", "mocha": "^5.2.0", @@ -54,6 +55,7 @@ "popper.js": "^1.14.7", "rxjs-compat": "^6.3.3", "rxjs-tslint": "^0.1.6", + "simple-git": "^1.107.0", "sinon": "^7.2.3", "spectron": "^5.0.0" }, From d491b3751a76df29dcb3518e29196dc5554add28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 14 Feb 2019 14:50:10 +0100 Subject: [PATCH 014/160] =?UTF-8?q?feat(gitservice):=20cr=C3=A9ation=20du?= =?UTF-8?q?=20service=20git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/models/ServiceResult.ts | 2 +- src/app/providers/electron.service.ts | 12 ++++++ src/app/providers/git.service.ts | 34 +++++++++++++++ yarn.lock | 59 ++++++++++++++++++++++++++- 4 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 src/app/providers/git.service.ts diff --git a/src/app/models/ServiceResult.ts b/src/app/models/ServiceResult.ts index e1f1e8b..def9710 100644 --- a/src/app/models/ServiceResult.ts +++ b/src/app/models/ServiceResult.ts @@ -8,4 +8,4 @@ export class ServiceResult { this.title = title; this.message = message; } -} \ No newline at end of file +} diff --git a/src/app/providers/electron.service.ts b/src/app/providers/electron.service.ts index b61de28..c3f2033 100644 --- a/src/app/providers/electron.service.ts +++ b/src/app/providers/electron.service.ts @@ -6,6 +6,7 @@ import { ipcRenderer, webFrame, remote, shell } from 'electron'; import * as childProcess from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; +import * as process from 'process'; @Injectable() export class ElectronService { @@ -14,6 +15,7 @@ export class ElectronService { webFrame: typeof webFrame; remote: typeof remote; childProcess: typeof childProcess; + process: typeof process; fs: typeof fs; path: typeof path; shell: typeof shell; @@ -29,6 +31,7 @@ export class ElectronService { this.childProcess = window.require('child_process'); this.fs = window.require('fs'); this.path = window.require('path'); + this.process = window.require('process'); } } @@ -36,4 +39,13 @@ export class ElectronService { return window && window.process && window.process.type; } + browse() { + const PATH = this.remote.dialog.showOpenDialog({ + properties: ['openDirectory'] + }); + if (path !== undefined) { + return PATH[0]; + } + return null; + } } diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts new file mode 100644 index 0000000..3c89176 --- /dev/null +++ b/src/app/providers/git.service.ts @@ -0,0 +1,34 @@ +import { Injectable } from '@angular/core'; +import * as gitPromise from 'simple-git/promise'; +import * as simpleGit from 'simple-git'; +import { Subject } from 'rxjs'; +import { ElectronService } from './electron.service'; +import * as GitUrlParse from 'git-url-parse'; +import { ServiceResult } from '../models/ServiceResult'; + +@Injectable() +export class GitService { + path: any; + pathSubject: Subject; + gitP: any; + git: any; + + constructor(private electronService: ElectronService) { + this.gitP = gitPromise(); + this.git = simpleGit(); + this.pathSubject = new Subject(); + this.path = this.electronService.process.cwd(); + } + + emitPathSubject() { + this.pathSubject.next(this.path); + } + + /** + * Fonction permettant de tester si currentPath est un repo git + * @param currentPath le chemin à tester + */ + isRepo(currentPath: string) { + return gitPromise(currentPath).checkIsRepo(); + } +} diff --git a/yarn.lock b/yarn.lock index e16a0b4..9091bc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2398,7 +2398,7 @@ date-now@^0.1.4: resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -debug@*: +debug@*, debug@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -3811,6 +3811,21 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-up@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.1.tgz#cb2ef086653640e721d2042fe3104857d89007c0" + integrity sha512-LFTZZrBlrCrGCG07/dm1aCjjpL1z9L3+5aEeI9SBhAqSc+kiA9Or1bgZhQFNppJX6h/f5McrvJt1mQXTFm6Qrw== + dependencies: + is-ssh "^1.3.0" + parse-url "^5.0.0" + +git-url-parse@^11.1.2: + version "11.1.2" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.1.2.tgz#aff1a897c36cc93699270587bea3dbcbbb95de67" + integrity sha512-gZeLVGY8QVKMIkckncX+iCq2/L8PlwncvDFKiWkBn9EtCfYDbliRTTp6qzyQ1VMdITUfq7293zDzfpjdiGASSQ== + dependencies: + git-up "^4.0.0" + glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" @@ -4750,6 +4765,13 @@ is-retry-allowed@^1.0.0: resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= +is-ssh@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.1.tgz#f349a8cadd24e65298037a522cf7520f2e81a0f3" + integrity sha512-0eRIASHZt1E68/ixClI8bp2YK2wmBPVWEismTs6M+M099jKgrzl/3E976zIbImSIob48N2/XGe9y7ZiYdImSlg== + dependencies: + protocols "^1.1.0" + is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -6235,6 +6257,11 @@ normalize-range@^0.1.2: resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= +normalize-url@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" + integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== + npm-bundled@^1.0.1: version "1.0.5" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" @@ -6868,6 +6895,24 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-path@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.1.tgz#0ec769704949778cb3b8eda5e994c32073a1adff" + integrity sha512-d7yhga0Oc+PwNXDvQ0Jv1BuWkLVPXcAoQ/WREgd6vNNoKYaW52KI+RdOFjI63wjkmps9yUE8VS4veP+AgpQ/hA== + dependencies: + is-ssh "^1.3.0" + protocols "^1.4.0" + +parse-url@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-5.0.1.tgz#99c4084fc11be14141efa41b3d117a96fcb9527f" + integrity sha512-flNUPP27r3vJpROi0/R3/2efgKkyXqnXwyP1KQ2U0SfFRgdizOdWfvrrvJg1LuOoxs7GQhmxJlq23IpQ/BkByg== + dependencies: + is-ssh "^1.3.0" + normalize-url "^3.3.0" + parse-path "^4.0.0" + protocols "^1.4.0" + parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" @@ -7228,6 +7273,11 @@ proto-list@~1.2.1: resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= +protocols@^1.1.0, protocols@^1.4.0: + version "1.4.7" + resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.7.tgz#95f788a4f0e979b291ffefcf5636ad113d037d32" + integrity sha512-Fx65lf9/YDn3hUX08XUc0J8rSux36rEsyiv21ZGUC1mOyeM3lTRpZLcrm8aAolzS4itwVfm7TAPyxC2E5zd6xg== + protoduck@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-4.0.0.tgz#fe4874d8c7913366cfd9ead12453a22cd3657f8e" @@ -8221,6 +8271,13 @@ 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-git@^1.107.0: + version "1.107.0" + resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.107.0.tgz#12cffaf261c14d6f450f7fdb86c21ccee968b383" + integrity sha512-t4OK1JRlp4ayKRfcW6owrWcRVLyHRUlhGd0uN6ZZTqfDq8a5XpcUdOKiGRNobHEuMtNqzp0vcJNvhYWwh5PsQA== + dependencies: + debug "^4.0.1" + single-line-log@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-1.1.2.tgz#c2f83f273a3e1a16edb0995661da0ed5ef033364" From e9e5c36125b65e88f36cddc95dfaa3ad3e4c8a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 14 Feb 2019 15:57:49 +0100 Subject: [PATCH 015/160] =?UTF-8?q?feat(clone):=20d=C3=A9but=20partie=20ht?= =?UTF-8?q?ml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.ts | 2 +- src/app/screens/home/home.component.html | 28 +++++++++++++++++++- src/app/screens/home/home.component.ts | 2 ++ src/app/screens/toolbox/toolbox.component.ts | 1 + src/assets/i18n/en.json | 7 ++++- src/assets/i18n/fr.json | 7 ++++- 6 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 780e174..0163400 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()[0]); + this.translate.setDefaultLang(this.translate.getLangs()[1]); console.log('AppConfig', AppConfig); if (electronService.isElectron()) { diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 7b2162c..7566397 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -46,7 +46,33 @@ {{ 'OPEN' | translate }} - {{ 'CLONE' | translate }} + + + + {{ 'CLONE.TITLE' | translate }} + +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
{{ 'INIT' | translate }} diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 10d8d17..d5eb135 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -11,6 +11,8 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; + cloneUrl: String; + cloneFolder: String; constructor(public router: Router, private toastr: ToastrService) { } diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index b04d854..72cd6be 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -115,6 +115,7 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-sign-out-alt', isFab: false}, { icon: 'fa-code-branch', isFab: false}, { icon: 'fa-cog', isFab: false}, + { icon: 'fa-globe', isFab: false}, { icon: 'fa-search', isFab: false} ]; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4ec8af5..e0c848b 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -23,6 +23,12 @@ "DESACTIVATE": "Desactivate the loader", "INFO": "Loading..." }, + "CLONE": { + "WHERE": "Where to clone", + "URL": "URL", + "TITLE": "Clone" + }, + "BROWSE": "Browse", "BUTTON": { "PRIMARY": "Primary button", "SUCCESS": "Success button", @@ -73,6 +79,5 @@ "UI": "User Interface", "REPOSITORY_MANAGEMENT": "Repository management", "OPEN": "Open", - "CLONE": "Clone", "INIT": "Init" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index b67f5fc..18a8765 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -23,6 +23,12 @@ "DESACTIVATE": "Désactiver le loader", "INFO": "Chargement..." }, + "CLONE": { + "WHERE": "Où cloner", + "URL": "URL", + "TITLE": "Cloner" + }, + "BROWSE": "Parcourir", "BUTTON": { "PRIMARY": "Bouton primaire", "SUCCESS": "Bouton succès", @@ -73,6 +79,5 @@ "UI": "Interface Utilisateur", "REPOSITORY_MANAGEMENT": "Gestion du répertoire", "OPEN": "Ouvrir", - "CLONE": "Cloner", "INIT": "Initialiser" } \ No newline at end of file From 94958fed0abeaa97fa710728728a6d54d584b740 Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 14 Feb 2019 20:21:35 +0100 Subject: [PATCH 016/160] =?UTF-8?q?feat(open):=20d=C3=A9but=20de=20l'open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/screens/home/home.component.html | 4 +++- src/assets/i18n/en.json | 1 + src/assets/i18n/fr.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 7b2162c..5ca4f4e 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -44,7 +44,9 @@ - {{ 'OPEN' | translate }} + + {{ 'OPEN_REPO' | translate }} + {{ 'CLONE' | translate }} {{ 'INIT' | translate }} diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4ec8af5..97217a2 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -73,6 +73,7 @@ "UI": "User Interface", "REPOSITORY_MANAGEMENT": "Repository management", "OPEN": "Open", + "OPEN_REPO": "Open a Reporitory", "CLONE": "Clone", "INIT": "Init" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index b67f5fc..4c1819c 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -73,6 +73,7 @@ "UI": "Interface Utilisateur", "REPOSITORY_MANAGEMENT": "Gestion du répertoire", "OPEN": "Ouvrir", + "OPEN_REPO": "Ouvrir un Dépôt", "CLONE": "Cloner", "INIT": "Initialiser" } \ No newline at end of file From 0a6ee4574cf68ed8ede6cb408ae13f53dbbede68 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Thu, 14 Feb 2019 21:53:52 +0100 Subject: [PATCH 017/160] =?UTF-8?q?feat(init):=20d=C3=A9but=20html=20et=20?= =?UTF-8?q?css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/screens/home/home.component.html | 41 +++++++++++++++++++- src/app/screens/toolbox/toolbox.component.ts | 1 + src/assets/i18n/en.json | 9 ++++- src/assets/i18n/fr.json | 9 ++++- src/styles.scss | 12 ++++-- 5 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 7b2162c..1bee94e 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -47,7 +47,46 @@ {{ 'OPEN' | translate }} {{ 'CLONE' | translate }} - {{ 'INIT' | translate }} + + + + {{ 'INIT.TAB_TITLE' | translate }} + +
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ {{ initLocation }} +
+
+
+
+ +
+
+
+
diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index b04d854..1a643b1 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -115,6 +115,7 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-sign-out-alt', isFab: false}, { icon: 'fa-code-branch', isFab: false}, { icon: 'fa-cog', isFab: false}, + {icon: 'fa-laptop', isFab: false}, { icon: 'fa-search', isFab: false} ]; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4ec8af5..413271e 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -38,6 +38,7 @@ "GITLAB": "This is GitLab" } }, + "NAME": "Nom", "INFORMATION": "Information", "SUCCESS": "Success", "DANGER": "Danger", @@ -74,5 +75,11 @@ "REPOSITORY_MANAGEMENT": "Repository management", "OPEN": "Open", "CLONE": "Clone", - "INIT": "Init" + "INIT": { + "TITLE": "Init", + "TAB_TITLE": "Initialize a Repo", + "WHERE": "Initialize in" + }, + "FULL_PATH": "Full path", + "BROWSE": "Browse" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index b67f5fc..c394666 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -38,6 +38,7 @@ "GITLAB": "Ceci est GitLab" } }, + "NAME": "Nom", "INFORMATION": "Information", "SUCCESS": "Succès", "DANGER": "Danger", @@ -74,5 +75,11 @@ "REPOSITORY_MANAGEMENT": "Gestion du répertoire", "OPEN": "Ouvrir", "CLONE": "Cloner", - "INIT": "Initialiser" + "INIT": { + "TITLE": "Initialiser", + "TAB_TITLE": "Initialiser un dépôt", + "WHERE": "Initialiser dans" + }, + "FULL_PATH": "Chemin complet", + "BROWSE": "Parcourir" } \ No newline at end of file diff --git a/src/styles.scss b/src/styles.scss index deef015..82be2e1 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -49,7 +49,7 @@ body { } .color-white { - color: $white; + color: $white; } .section-title { @@ -57,9 +57,13 @@ body { } .gh-label-input { - color: $white; - padding: $gap-md $gap-md 0 $gap-md; - padding-right: 0; + color: $white; + padding: $gap-md $gap-md 0 $gap-md; + padding-right: 0; +} + +.text-break-word { + word-wrap: break-word; } .gh-scrollbar { From 9827d6b646a3772f5f9337e0d8eba72eabcb1f63 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Thu, 14 Feb 2019 21:55:54 +0100 Subject: [PATCH 018/160] refactor(init): changement nom bouton submit --- src/app/screens/home/home.component.html | 2 +- src/assets/i18n/en.json | 3 ++- src/assets/i18n/fr.json | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 1bee94e..624ea1f 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -82,7 +82,7 @@
- +
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 413271e..161a4cb 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -81,5 +81,6 @@ "WHERE": "Initialize in" }, "FULL_PATH": "Full path", - "BROWSE": "Browse" + "BROWSE": "Browse", + "CREATE_REPOSITORY": "Create Repository" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index c394666..0330f85 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -81,5 +81,6 @@ "WHERE": "Initialiser dans" }, "FULL_PATH": "Chemin complet", - "BROWSE": "Parcourir" + "BROWSE": "Parcourir", + "CREATE_REPOSITORY": "Créer le répertoire" } \ No newline at end of file From 344e5cd20c7ffd9534cb1a13eb4c8a3537c4488c Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Thu, 14 Feb 2019 22:09:50 +0100 Subject: [PATCH 019/160] =?UTF-8?q?refactor(init):=20pr=C3=A9paration=20de?= =?UTF-8?q?s=20informations=20n=C3=A9cessaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/electron.service.ts | 2 +- src/app/screens/home/home.component.ts | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 10d8d17..740d58a 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 { GitService } from '../../providers/git.service'; +import { ElectronService } from '../../providers/electron.service'; @Component({ selector: 'app-home', @@ -11,8 +13,10 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; + initName: String; + initLocation: String; - constructor(public router: Router, private toastr: ToastrService) { } + constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService) { } ngOnInit() { @@ -46,4 +50,15 @@ export class HomeComponent implements OnInit { this.toastr.info(this.searchInputValue.toString()); } + initBrowse() { + const INITPATH = this.electronService.browse(); + if (INITPATH !== undefined) { + this.initLocation = INITPATH; + } + } + + initSubmit() { + console.log('initName : ' + this.initName); + console.log('initLocation : ' + this.initLocation); + } } From 356a828cfd35113d3aff05a069ed6338aab69501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 15 Feb 2019 14:44:56 +0100 Subject: [PATCH 020/160] =?UTF-8?q?feat(pref-lang):=20d=C3=A9but=20du=20ch?= =?UTF-8?q?angement=20de=20langue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preferences/preferences.component.html | 15 +++++++++++ .../preferences/preferences.component.ts | 26 +++++++++++++++++-- src/assets/i18n/en.json | 1 + src/assets/i18n/fr.json | 1 + 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index b3037d9..5fb74f1 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -14,6 +14,21 @@ {{ 'GENERAL' | translate }} + +
+
+
+ +
+
+ +
+ +
+ +
+ diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index bcb3449..2167c9a 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-preferences', @@ -10,12 +11,25 @@ export class PreferencesComponent implements OnInit { preferencesVisible: Boolean; preferencesTabSelectedIndex: any; + dropdownLanguageValue: String; + dataDropdownLanguage: Array; - constructor(public router: Router) { } + key: String = 'key'; + value: String = 'value'; + + + constructor(public router: Router, private translate: TranslateService) { + } ngOnInit() { this.preferencesVisible = true; this.preferencesTabSelectedIndex = 1; + this.dropdownLanguageValue = 'Français'; + + this.dataDropdownLanguage = [ + {key: 'en', value: 'English'}, + {key: 'fr', value: 'Français'}, + ]; } checkIfCloseModal(event) { @@ -23,4 +37,12 @@ export class PreferencesComponent implements OnInit { this.router.navigate(['home']); } } -} + + switchLanguage() { + if (this.dropdownLanguageValue === 'Français') { + this.translate.use('fr'); + } else { + this.translate.use('en'); + } + } +} \ No newline at end of file diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4ec8af5..9be3143 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -4,6 +4,7 @@ "COLORS": "Colors", "TAGS": "Tags", "TAG": "Tag", + "LANGUE": "Language", "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 b67f5fc..bdc95cd 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -4,6 +4,7 @@ "COLORS": "Couleurs", "TAGS": "Balises", "TAG": "Balise", + "LANGUE": "Langage", "FONT_SIZES": "Tailles de texte", "CHECKBOX": "Case à cocher", "UN_CHECKBOX": "Case décochée", From b126403173494f6495f7e09d759307733728b434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 15 Feb 2019 15:07:18 +0100 Subject: [PATCH 021/160] refactor(modal): agrandissement de la modal md --- src/app/components/modal/modal.component.scss | 4 ++-- src/app/screens/home/home.component.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/modal/modal.component.scss b/src/app/components/modal/modal.component.scss index ede94b3..cc0a359 100644 --- a/src/app/components/modal/modal.component.scss +++ b/src/app/components/modal/modal.component.scss @@ -66,8 +66,8 @@ z-index: 2; &.medium { - @include wX(50%); - left: 25%; + @include wX(60%); + left: 20%; } &.large { diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 7b2162c..fa449b3 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -44,7 +44,7 @@ - {{ 'OPEN' | translate }} + {{ 'OPEN' | translate }} {{ 'CLONE' | translate }} {{ 'INIT' | translate }} From d1bfca3f356b0ed870a146fe06d76e5f2a1f7453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 15 Feb 2019 18:01:36 +0100 Subject: [PATCH 022/160] =?UTF-8?q?maintain(readme):=20mise=20=C3=A0=20jou?= =?UTF-8?q?r=20du=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- package.json | 15 +- yarn.lock | 449 ++++++++++++++++++++++----------------------------- 3 files changed, 205 insertions(+), 263 deletions(-) diff --git a/README.md b/README.md index 2887315..133f16c 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ Cette application a été réalisée par des étudiants de Master 1 Génie de l' Pour cela, nous avons utilisé : - Angular v7.1.4 -- Electron v2.0.7 -- Electron Builder v20.28.1 +- Electron v4.0.0 +- Electron Builder v20.36.1 - Bootstrap 4 - le [kit de démarrage](https://github.com/maximegris/angular-electron) de maximegris diff --git a/package.json b/package.json index cdb6578..42eb1a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,13 @@ { "name": "git-harpon", - "version": "1.0.0", + "version": "1.1.0", + "description": "Open-source GUI for git", + "author": { + "name": "GitHarpon", + "email": "githarpon@gmail.com", + "url": "https://github.com/GitHarpon" + }, + "license": "SEE LICENSE IN LICENSE.md", "keywords": [ "angular", "angular 7", @@ -80,9 +87,9 @@ "@types/node": "^10.12.18", "codelyzer": "^4.5.0", "core-js": "^2.6.1", - "electron": "2.0.7", - "electron-builder": "20.28.1", - "electron-reload": "1.2.2", + "electron": "4.0.0", + "electron-builder": "20.36.1", + "electron-reload": "1.3.0", "jasmine-core": "^3.3.0", "jasmine-spec-reporter": "^4.2.1", "karma": "^3.1.4", diff --git a/yarn.lock b/yarn.lock index 9091bc5..93eb294 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"7zip-bin@~4.0.2": - version "4.0.2" - resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-4.0.2.tgz#6abbdc22f33cab742053777a26db2e25ca527179" - integrity sha512-XtGk+IF57pr852UK1AhQJXqmm1WmSgS5uISL+LPs0z/iAxXouMvdlLJrHPeukP6gd7yR2rDTMSMkHNODgwIq7A== +"7zip-bin@~4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/7zip-bin/-/7zip-bin-4.1.0.tgz#33eff662a5c39c0c2061170cc003c5120743fff0" + integrity sha512-AsnBZN3a8/JcNt+KPkGGODaA4c7l3W5+WpeKgGSbstSLxqWtTXqd1ieJGBQ8IFCtRg8DmmKUcSkIkUc0A4p3YA== "@angular-devkit/architect@0.11.4": version "0.11.4" @@ -605,7 +605,7 @@ ajv@^5.0.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.1.0, ajv@^6.5.2, ajv@^6.5.5: +ajv@^6.1.0, ajv@^6.5.5: version "6.6.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== @@ -690,70 +690,70 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -app-builder-bin@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.1.2.tgz#528ce8e543aa595210c9595f91bdf5638cecd79b" - integrity sha512-PZJspzAqB0+z60OalXChP9I05BzODd/ffDz6RvTmDG3qclr7YrnpqzvPF+T7vGVtk2nN7syuveTQROJfXcB8xA== +app-builder-bin@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-2.5.1.tgz#a5bcff31e4572d8a179bd88a1335bad8e5d62d81" + integrity sha512-Hm+eyyfQCs5N5avLAw3w9Cf1S5TX/t6ecAfHusbzCDh/rLKLKYso2vwDWH4OQZ8uWLnuJwaAUDf3PstRcn0H+A== -app-builder-lib@20.28.1: - version "20.28.1" - resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.28.1.tgz#df3aa47ba8bdbde75a4040f1d5500290f599cf70" - integrity sha512-OjPTarC27/P3312dNu8N6k2X1r6QGr/q243+bM+DnXddZ6qZQQDsxJz5ONW8b1chRErTUZDRaKQ8RdAYjUIbxw== +app-builder-lib@20.36.1: + version "20.36.1" + resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.36.1.tgz#7e8f3219723d8fff1b1574879e73c83c25e7ad4c" + integrity sha512-zzefYaj02ZzxcZh0qv0njt9T8zfrfyjdGSoJEG0cfwWwxUHriDqNOp0o9X+/J8GKgZiBbFGoqauRc5A8kFFP2A== dependencies: - "7zip-bin" "~4.0.2" - app-builder-bin "2.1.2" + "7zip-bin" "~4.1.0" + app-builder-bin "2.5.1" async-exit-hook "^2.0.1" - bluebird-lst "^1.0.5" - builder-util "6.1.1" - builder-util-runtime "4.4.1" + bluebird-lst "^1.0.6" + builder-util "9.3.0" + builder-util-runtime "8.0.1" chromium-pickle-js "^0.2.0" - debug "^3.1.0" + debug "^4.1.0" ejs "^2.6.1" - electron-osx-sign "0.4.10" - electron-publish "20.28.0" - fs-extra-p "^4.6.1" + electron-osx-sign "0.4.11" + electron-publish "20.36.0" + fs-extra-p "^7.0.0" hosted-git-info "^2.7.1" - is-ci "^1.1.0" + is-ci "^1.2.1" isbinaryfile "^3.0.3" js-yaml "^3.12.0" lazy-val "^1.0.3" minimatch "^3.0.4" normalize-package-data "^2.4.0" plist "^3.0.1" - read-config-file "3.1.2" + read-config-file "3.2.0" sanitize-filename "^1.6.1" - semver "^5.5.0" - temp-file "^3.1.3" + semver "^5.6.0" + temp-file "^3.2.0" -app-builder-lib@~20.28.0: - version "20.28.4" - resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.28.4.tgz#0bee3366364c65d17a2aaab75b30bb10df76ece5" - integrity sha512-RY4/NJs1HCFWAOpLMivuDzbesU5VyaZVKuQllxgCNZ56+ihgO5aGexla2DVjG/bBQleWfF3DPnEsF3sbZPlpHw== +app-builder-lib@~20.36.0: + version "20.36.2" + resolved "https://registry.yarnpkg.com/app-builder-lib/-/app-builder-lib-20.36.2.tgz#9bc2fb3191eb81afe9af2bc35e9384d3bf7b6f01" + integrity sha512-5FxLnWI13t0LLmh2QjmPx3KW/xhj67su7UxdCzQgULsUmYurdPx8yAOb9YxoX+RpR08inqt+H3GBOJlqSSrVgg== dependencies: - "7zip-bin" "~4.0.2" - app-builder-bin "2.1.2" + "7zip-bin" "~4.1.0" + app-builder-bin "2.5.1" async-exit-hook "^2.0.1" - bluebird-lst "^1.0.5" - builder-util "6.1.3" - builder-util-runtime "4.4.1" + bluebird-lst "^1.0.6" + builder-util "9.3.0" + builder-util-runtime "8.0.2" chromium-pickle-js "^0.2.0" - debug "^3.1.0" + debug "^4.1.0" ejs "^2.6.1" - electron-osx-sign "0.4.10" - electron-publish "20.28.3" - fs-extra-p "^4.6.1" + electron-osx-sign "0.4.11" + electron-publish "20.36.0" + fs-extra-p "^7.0.0" hosted-git-info "^2.7.1" - is-ci "^1.2.0" + is-ci "^1.2.1" isbinaryfile "^3.0.3" js-yaml "^3.12.0" lazy-val "^1.0.3" minimatch "^3.0.4" normalize-package-data "^2.4.0" plist "^3.0.1" - read-config-file "3.1.2" + read-config-file "3.2.0" sanitize-filename "^1.6.1" - semver "^5.5.1" - temp-file "^3.1.3" + semver "^5.6.0" + temp-file "^3.2.0" app-root-path@^2.1.0: version "2.1.0" @@ -965,7 +965,7 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -async-each@^1.0.0: +async-each@^1.0.0, async-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" integrity sha1-GdOGodntxufByF04iu28xW0zYC0= @@ -1128,11 +1128,6 @@ base64-arraybuffer@0.1.5: resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz#73926771923b5a19747ad666aa5cd4bf9c6e9ce8" integrity sha1-c5JncZI7Whl0etZmqlzUv5xunOg= -base64-js@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" - integrity sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE= - base64-js@^1.0.2, base64-js@^1.2.3: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" @@ -1217,7 +1212,7 @@ blocking-proxy@^1.0.0: dependencies: minimist "^1.2.0" -bluebird-lst@^1.0.5, bluebird-lst@^1.0.6: +bluebird-lst@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/bluebird-lst/-/bluebird-lst-1.0.6.tgz#89bc4de0a357373605c8781f293f7b06d454f869" integrity sha512-CBWFoPuUPpcvMUxfyr8DKdI5d4kjxFl1h39+VbKxP3KJWJHEsLtuT4pPLkjpxCGU6Ask21tvbnftWXdqIxYldQ== @@ -1311,7 +1306,7 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -braces@^2.3.0, braces@^2.3.1: +braces@^2.3.0, braces@^2.3.1, braces@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -1467,55 +1462,53 @@ buffer@^5.1.0: base64-js "^1.0.2" ieee754 "^1.1.4" -builder-util-runtime@4.4.1, builder-util-runtime@^4.4.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.4.1.tgz#2770d03241e51fde46acacc7ed3ed8a9f45f02cb" - integrity sha512-8L2pbL6D3VdI1f8OMknlZJpw0c7KK15BRz3cY77AOUElc4XlCv2UhVV01jJM7+6Lx7henaQh80ALULp64eFYAQ== +builder-util-runtime@8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.0.1.tgz#8427401f2fdd6c7b14336f80325627e141d4e7a8" + integrity sha512-3wGQP2vOIKAyQw3iDwsR1knv/c6cBIpUDdtES2j7H14vPDrvv62/5/y8uDgRhbw9FGfBLJoRNAWR0I58oMu9zw== dependencies: - bluebird-lst "^1.0.5" - debug "^3.1.0" - fs-extra-p "^4.6.1" + bluebird-lst "^1.0.6" + debug "^4.1.0" + fs-extra-p "^7.0.0" sax "^1.2.4" -builder-util@6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-6.1.1.tgz#2c419674eb168fc4184124933e65657d19d2d3ec" - integrity sha512-n+ah8X8H+DU1YPQHCW9ayLb2g8+KENtRfPtIei0UiqP7p+pURKzL3/sMsxmu4S7mbGQBHV8R6PMu/axBjxy+Ow== +builder-util-runtime@8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.0.2.tgz#9d638a266ca3aa25ced1cff4df74c8fd97dd78cf" + integrity sha512-46AjyMQ1/yBvGnXWmqNGlg8te7jCPCs7TJ0zDC2+4vV/t5iZp2dR1H9UfVpcBxlvBq3dlAOmwb9fz1d9xZN1+Q== dependencies: - "7zip-bin" "~4.0.2" - app-builder-bin "2.1.2" - bluebird-lst "^1.0.5" - builder-util-runtime "^4.4.1" - chalk "^2.4.1" - debug "^3.1.0" - fs-extra-p "^4.6.1" - is-ci "^1.1.0" - js-yaml "^3.12.0" - lazy-val "^1.0.3" - semver "^5.5.0" - source-map-support "^0.5.8" - stat-mode "^0.2.2" - temp-file "^3.1.3" + bluebird-lst "^1.0.6" + debug "^4.1.0" + fs-extra-p "^7.0.0" + sax "^1.2.4" + +builder-util-runtime@^8.0.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.1.1.tgz#f2f6fc43e33d26892bd491667fc746ad69bccc50" + integrity sha512-+ieS4PMB33vVE2S3ZNWBEQJ1zKmAs/agrBdh7XadE1lKLjrH4aXYuOh9OOGdxqIRldhlhNBaF+yKMMEFOdNVig== + dependencies: + bluebird-lst "^1.0.6" + debug "^4.1.1" + fs-extra-p "^7.0.0" + sax "^1.2.4" -builder-util@6.1.3, builder-util@~6.1.0, builder-util@~6.1.3: - version "6.1.3" - resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-6.1.3.tgz#6bd3a5253c99afa31e3574e6fc3b796e218f8cfd" - integrity sha512-MXeARNff9KHlzJYGJcAhLI/tpE57PmUnleaYfL22IE+viRt192Yr3wQL444ztsA+LUHJ8d12moUoG00jh1hfLA== +builder-util@9.3.0, builder-util@~9.3.0: + version "9.3.0" + resolved "https://registry.yarnpkg.com/builder-util/-/builder-util-9.3.0.tgz#1c94c3bd1c9095840d46a59cdf9514852a47ce8a" + integrity sha512-K+kj5vWj4Mk3jOm6kVT9ZwNcECLHe449vdMxYuZpCnn7CSxRm+TeZm9P9ZFCQUID5Hww/Sy4NMFo+VVJh6+Ptw== dependencies: - "7zip-bin" "~4.0.2" - app-builder-bin "2.1.2" - bluebird-lst "^1.0.5" - builder-util-runtime "^4.4.1" + "7zip-bin" "~4.1.0" + app-builder-bin "2.5.1" + bluebird-lst "^1.0.6" + builder-util-runtime "^8.0.1" chalk "^2.4.1" - debug "^3.1.0" - fs-extra-p "^4.6.1" - is-ci "^1.2.0" + debug "^4.1.0" + fs-extra-p "^7.0.0" + is-ci "^1.2.1" js-yaml "^3.12.0" - lazy-val "^1.0.3" - semver "^5.5.1" source-map-support "^0.5.9" stat-mode "^0.2.2" - temp-file "^3.1.3" + temp-file "^3.2.0" builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" @@ -1761,7 +1754,7 @@ chokidar@2.0.4, chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.3: optionalDependencies: fsevents "^1.2.2" -chokidar@^1.4.2, chokidar@^1.5.1: +chokidar@^1.4.2: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= @@ -1777,6 +1770,25 @@ chokidar@^1.4.2, chokidar@^1.5.1: optionalDependencies: fsevents "^1.0.0" +chokidar@^2.0.4: + version "2.1.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.1.tgz#adc39ad55a2adf26548bd2afa048f611091f9184" + integrity sha512-gfw3p2oQV2wEt+8VuMlNsPjCxDxvvgnm/kz+uATu805mWVF8IJN7uz9DN7iBz+RMJISmiVbCOBFs9qBGMjtPfQ== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.0" + optionalDependencies: + fsevents "^1.2.7" + chownr@^1.0.1, chownr@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" @@ -2398,7 +2410,7 @@ date-now@^0.1.4: resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -debug@*, debug@^4.0.1: +debug@*, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -2646,16 +2658,16 @@ dir-glob@^2.0.0: arrify "^1.0.1" path-type "^3.0.0" -dmg-builder@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-5.3.0.tgz#1b902c2438fe5ed8202987caa20efffdac057fcd" - integrity sha512-vzjrc7UmPQ+rb4tH8wbQdMq6Fu9M5chFndzhK2831xIpRsRlNlGEIWMiFRZ/MlboVL0vWxG0/2JCd2YMAevEpA== - dependencies: - app-builder-lib "~20.28.0" - bluebird-lst "^1.0.5" - builder-util "~6.1.0" - fs-extra-p "^4.6.1" - iconv-lite "^0.4.23" +dmg-builder@6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/dmg-builder/-/dmg-builder-6.4.0.tgz#a95a9cb951d8535acc14bde7b1cd3412ccf43c34" + integrity sha512-q84fMrMm9mXh2qH0Sb3+o0gCvfeJRBI+46y+CpQystqgRyB+3bZB11WqCf5d8+qsENhzpi786jR82xbHG1Vvag== + dependencies: + app-builder-lib "~20.36.0" + bluebird-lst "^1.0.6" + builder-util "~9.3.0" + fs-extra-p "^7.0.0" + iconv-lite "^0.4.24" js-yaml "^3.12.0" parse-color "^1.0.0" sanitize-filename "^1.6.1" @@ -2717,7 +2729,7 @@ dotenv@^5.0.1: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== -dotenv@^6.0.0: +dotenv@^6.1.0: version "6.2.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== @@ -2770,24 +2782,24 @@ ejs@~2.5.6: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.5.9.tgz#7ba254582a560d267437109a68354112475b0ce5" integrity sha512-GJCAeDBKfREgkBtgrYSf9hQy9kTb3helv0zGdzqhM7iAkW8FA/ZF97VQDbwFiwIT8MQLLOe5VlPZOEvZAqtUAQ== -electron-builder@20.28.1: - version "20.28.1" - resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-20.28.1.tgz#e87e71b74f3228d21e012d0b60ab7b0a384f5f25" - integrity sha512-OKj107B2fV0ftOFOjQLyuKl6n+R8KJOGgGUrHaW4EI8bwqycTq67bgCc0xwPruHBWDX/Kg3tMYBRLbjUNw+6Qw== +electron-builder@20.36.1: + version "20.36.1" + resolved "https://registry.yarnpkg.com/electron-builder/-/electron-builder-20.36.1.tgz#e6c2607c79d62f07fc8e6f5521d13b337ac5f8a2" + integrity sha512-kySKG59Y07RRDcuurjCYwIdmvVdi5QLbo7untNVTXM1DTjXwYp/hVAgSg+a9tuFZkKWuRJU/ROKEnWVllbQkhQ== dependencies: - app-builder-lib "20.28.1" - bluebird-lst "^1.0.5" - builder-util "6.1.1" - builder-util-runtime "4.4.1" + app-builder-lib "20.36.1" + bluebird-lst "^1.0.6" + builder-util "9.3.0" + builder-util-runtime "8.0.1" chalk "^2.4.1" - dmg-builder "5.3.0" - fs-extra-p "^4.6.1" - is-ci "^1.1.0" + dmg-builder "6.4.0" + fs-extra-p "^7.0.0" + is-ci "^1.2.1" lazy-val "^1.0.3" - read-config-file "3.1.2" + read-config-file "3.2.0" sanitize-filename "^1.6.1" update-notifier "^2.5.0" - yargs "^12.0.1" + yargs "^12.0.2" electron-chromedriver@~3.0.0: version "3.0.0" @@ -2797,21 +2809,6 @@ electron-chromedriver@~3.0.0: electron-download "^4.1.0" extract-zip "^1.6.5" -electron-download@^3.0.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-3.3.0.tgz#2cfd54d6966c019c4d49ad65fbe65cc9cdef68c8" - integrity sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg= - dependencies: - debug "^2.2.0" - fs-extra "^0.30.0" - home-path "^1.0.1" - minimist "^1.2.0" - nugget "^2.0.0" - path-exists "^2.1.0" - rc "^1.1.2" - semver "^5.3.0" - sumchecker "^1.2.0" - electron-download@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8" @@ -2827,63 +2824,50 @@ electron-download@^4.1.0: semver "^5.4.1" sumchecker "^2.0.2" -electron-osx-sign@0.4.10: - version "0.4.10" - resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.10.tgz#be4f3b89b2a75a1dc5f1e7249081ab2929ca3a26" - integrity sha1-vk87ibKnWh3F8eckkIGrKSnKOiY= +electron-osx-sign@0.4.11: + version "0.4.11" + resolved "https://registry.yarnpkg.com/electron-osx-sign/-/electron-osx-sign-0.4.11.tgz#8377732fe7b207969f264b67582ee47029ce092f" + integrity sha512-VVd40nrnVqymvFrY9ZkOYgHJOvexHHYTR3di/SN+mjJ0OWhR1I8BRVj3U+Yamw6hnkZZNKZp52rqL5EFAAPFkQ== dependencies: bluebird "^3.5.0" compare-version "^0.1.2" debug "^2.6.8" isbinaryfile "^3.0.2" minimist "^1.2.0" - plist "^2.1.0" - -electron-publish@20.28.0: - version "20.28.0" - resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-20.28.0.tgz#226ba6ac5729e6b2f46d4b347281f17f8aa7f4a4" - integrity sha512-ZGwzXyWuEGIvaCCGD0tebhjYGf7lxjdmkFAW3oFjRXOBXsBl91elOzOwfRSs/7zUE9mvvE0MnyJeBlqO7SAUvA== - dependencies: - bluebird-lst "^1.0.5" - builder-util "~6.1.0" - builder-util-runtime "^4.4.1" - chalk "^2.4.1" - fs-extra-p "^4.6.1" - lazy-val "^1.0.3" - mime "^2.3.1" + plist "^3.0.1" -electron-publish@20.28.3: - version "20.28.3" - resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-20.28.3.tgz#0cc360ecaffd16e22780ee1630e0bd88fe6395e2" - integrity sha512-/2t5zk9EKgH7p7rFZ+ynTKLmpKGF9bktMP2UR6u4bbPz9w4r3WEUbPOeZ1TLqUCAqdfZECcj4ThjrlcAJTghCA== +electron-publish@20.36.0: + version "20.36.0" + resolved "https://registry.yarnpkg.com/electron-publish/-/electron-publish-20.36.0.tgz#419fe994938af2b158ac4677f72839ad229e05e8" + integrity sha512-LjJ4KoApSLtKyGWotv0B+PoTzpLEdHHXzDF9HLxatPlfoZCmrOexqm7Qiv1ODuYWPac7Zpf2OHitJp8WIOcZRQ== dependencies: - bluebird-lst "^1.0.5" - builder-util "~6.1.3" - builder-util-runtime "^4.4.1" + bluebird-lst "^1.0.6" + builder-util "~9.3.0" + builder-util-runtime "^8.0.1" chalk "^2.4.1" - fs-extra-p "^4.6.1" + fs-extra-p "^7.0.0" lazy-val "^1.0.3" mime "^2.3.1" -electron-reload@1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/electron-reload/-/electron-reload-1.2.2.tgz#621ddb443b9fbba1c5e29a5fdd683322b5c42284" - integrity sha512-dPZrcqjgFR3Gu5TOOVK3GQx63JcB2WJ0hki/4M5tlenDF7epFSnKkcAZyKYwUGEqk1TkUkUUOl7ZyzAK6QNuNQ== +electron-reload@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/electron-reload/-/electron-reload-1.3.0.tgz#1ea8115164ea0daa5a8da998102b03536874f007" + integrity sha512-tN7hMoWnj08dwAmL/19LuEXy+VCgHwf2omKaQ9HsEgSxcORlsAq7F/KaaYKgCE0zS2B5hMTvZ+zXBb7ch4dgng== dependencies: - chokidar "^1.5.1" + chokidar "^2.0.4" electron-to-chromium@^1.3.92: version "1.3.96" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.96.tgz#25770ec99b8b07706dedf3a5f43fa50cb54c4f9a" integrity sha512-ZUXBUyGLeoJxp4Nt6G/GjBRLnyz8IKQGexZ2ndWaoegThgMGFO1tdDYID5gBV32/1S83osjJHyfzvanE/8HY4Q== -electron@2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.7.tgz#f7ce410433298e319032ce31f0e6ffd709ff052c" - integrity sha512-MRrDE6mrp+ZrIBpZM27pxbO2yEDKYfkmc6Ll79BtedMNEZsY4+oblupeDJL6RM6meUIp82KMo63W7fP65Tb89Q== +electron@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.0.tgz#6ccb40cc8bf2d49954dcea73b97ae7ad12ee04b3" + integrity sha512-3XPG/3IXlvnT1oe1K6zEushoD0SKbP8xwdrL10EWGe6k2iOV4hSHqJ8vWnR8yZ7VbSXmBRfomEFDNAo/q/cwKw== dependencies: "@types/node" "^8.0.24" - electron-download "^3.0.1" + electron-download "^4.1.0" extract-zip "^1.0.3" elliptic@^6.0.0: @@ -3021,7 +3005,7 @@ es-to-primitive@^1.1.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-promise@^4.0.3, es6-promise@^4.0.5: +es6-promise@^4.0.3: version "4.2.5" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== @@ -3616,14 +3600,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra-p@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/fs-extra-p/-/fs-extra-p-4.6.1.tgz#6156e0cc98097f415fcd17029578fc41c78b5092" - integrity sha512-IsTMbUS0svZKZTvqF4vDS9c/L7Mw9n8nZQWWeSzAGacOSe+8CzowhUN0tdZEZFIJNP5HC7L9j3MMikz/G4hDeQ== - dependencies: - bluebird-lst "^1.0.5" - fs-extra "^6.0.1" - fs-extra-p@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/fs-extra-p/-/fs-extra-p-7.0.0.tgz#da9a72df71dc77fb938162025a5fc658713c98ab" @@ -3632,17 +3608,6 @@ fs-extra-p@^7.0.0: bluebird-lst "^1.0.6" fs-extra "^7.0.0" -fs-extra@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" - integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= - dependencies: - graceful-fs "^4.1.2" - jsonfile "^2.1.0" - klaw "^1.0.0" - path-is-absolute "^1.0.0" - rimraf "^2.2.8" - fs-extra@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" @@ -3652,15 +3617,6 @@ fs-extra@^4.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-extra@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b" - integrity sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA== - dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" - fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" @@ -3709,6 +3665,14 @@ fsevents@^1.0.0, fsevents@^1.2.2: nan "^2.9.2" node-pre-gyp "^0.10.0" +fsevents@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + fstream-ignore@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" @@ -3969,7 +3933,7 @@ got@^6.7.1: unzip-response "^2.0.1" url-parse-lax "^1.0.0" -graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@~4.1.11: +graceful-fs@^4.1.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@~4.1.11: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== @@ -4158,11 +4122,6 @@ hoek@4.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== -home-path@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/home-path/-/home-path-1.0.6.tgz#d549dc2465388a7f8667242c5b31588d29af29fc" - integrity sha512-wo+yjrdAtoXt43Vy92a+0IPCYViiyLAHyp0QVS4xL/tfvVz5sXIW1ubLZk3nhVkD92fQpUMKX+fzMjr5F489vw== - hosted-git-info@^2.1.4, hosted-git-info@^2.4.2, hosted-git-info@^2.6.0, hosted-git-info@^2.7.1: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" @@ -4285,7 +4244,7 @@ iconv-lite@0.4.23: dependencies: safer-buffer ">= 2.1.2 < 3" -iconv-lite@^0.4.17, iconv-lite@^0.4.23, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -4542,7 +4501,7 @@ is-callable@^1.1.3, is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-ci@^1.0.10, is-ci@^1.1.0, is-ci@^1.2.0: +is-ci@^1.0.10, is-ci@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== @@ -5092,12 +5051,12 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -jsonfile@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" - integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= - optionalDependencies: - graceful-fs "^4.1.6" +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" jsonfile@^4.0.0: version "4.0.0" @@ -5254,13 +5213,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -klaw@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" - integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= - optionalDependencies: - graceful-fs "^4.1.9" - latest-version@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" @@ -6252,6 +6204,11 @@ normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" @@ -6496,7 +6453,7 @@ npx@10.2.0: libnpx "10.2.0" npm "5.1.0" -nugget@^2.0.0, nugget@^2.0.1: +nugget@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0" integrity sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA= @@ -6957,7 +6914,7 @@ path-dirname@^1.0.0: resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= -path-exists@^2.0.0, path-exists@^2.1.0: +path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= @@ -7098,15 +7055,6 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -plist@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/plist/-/plist-2.1.0.tgz#57ccdb7a0821df21831217a3cad54e3e146a1025" - integrity sha1-V8zbeggh3yGDEhejytVOPhRqECU= - dependencies: - base64-js "1.2.0" - xmlbuilder "8.2.2" - xmldom "0.1.x" - plist@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/plist/-/plist-3.0.1.tgz#a9b931d17c304e8912ef0ba3bdd6182baf2e1f8c" @@ -7487,7 +7435,7 @@ raw-loader@0.5.1: resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" integrity sha1-DD0L6u2KAclm2Xh793goElKpeao= -rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.2.1, rc@^1.2.7: +rc@^1.0.1, rc@^1.1.6, rc@^1.2.1, rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== @@ -7511,19 +7459,19 @@ read-cmd-shim@~1.0.1: dependencies: graceful-fs "^4.1.2" -read-config-file@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/read-config-file/-/read-config-file-3.1.2.tgz#9b299cb7a2bcec1511a4c22e71620df0a2e3b896" - integrity sha512-QCATYzlYHvmWps/W/eP7rcKuhYRYZg5XKeXFxSJRIXvn+KSw1+Ntz2et1aBz5TrEpawGrxWZ7zBipj+/v0xwWQ== +read-config-file@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/read-config-file/-/read-config-file-3.2.0.tgz#50a2756a9a128ab9dcbe087e2724c512e3d0ccd1" + integrity sha512-i1QRc5jy4sHm9YBGb6ArA5SU1mDrc5wu2mnm3r9gPnm+LVZhBGbpTCKqAXyvV4TJHnBR3Yaaww+9b3DyRZcfww== dependencies: - ajv "^6.5.2" + ajv "^6.5.5" ajv-keywords "^3.2.0" - bluebird-lst "^1.0.5" - dotenv "^6.0.0" + bluebird-lst "^1.0.6" + dotenv "^6.1.0" dotenv-expand "^4.2.0" - fs-extra-p "^4.6.1" + fs-extra-p "^7.0.0" js-yaml "^3.12.0" - json5 "^1.0.1" + json5 "^2.1.0" lazy-val "^1.0.3" read-installed@~4.0.3: @@ -7658,7 +7606,7 @@ readdir-scoped-modules@^1.0.0: graceful-fs "^4.1.2" once "^1.3.0" -readdirp@^2.0.0: +readdirp@^2.0.0, readdirp@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== @@ -8113,7 +8061,7 @@ semver-intersect@1.4.0: dependencies: semver "^5.0.0" -"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.0, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: +"semver@2 >=2.2.1 || 3.x || 4 || 5", "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", "semver@^2.3.0 || 3.x || 4 || 5", semver@^5.0.0, semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== @@ -8495,7 +8443,7 @@ source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@0.5.9, source-map-support@^0.5.3, source-map-support@^0.5.5, source-map-support@^0.5.8, source-map-support@^0.5.9, source-map-support@~0.5.6: +source-map-support@0.5.9, source-map-support@^0.5.3, source-map-support@^0.5.5, source-map-support@^0.5.9, source-map-support@~0.5.6: version "0.5.9" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== @@ -8923,14 +8871,6 @@ stylus@0.54.5: sax "0.5.x" source-map "0.1.x" -sumchecker@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-1.3.1.tgz#79bb3b4456dd04f18ebdbc0d703a1d1daec5105d" - integrity sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0= - dependencies: - debug "^2.2.0" - es6-promise "^4.0.5" - sumchecker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e" @@ -9026,7 +8966,7 @@ tar@^4, tar@^4.4.6: safe-buffer "^5.1.2" yallist "^3.0.2" -temp-file@^3.1.3: +temp-file@^3.2.0: version "3.3.2" resolved "https://registry.yarnpkg.com/temp-file/-/temp-file-3.3.2.tgz#69b6daf1bbe23231d0a5d03844e3d96f3f531aaa" integrity sha512-FGKccAW0Mux9hC/2bdUIe4bJRv4OyVo4RpVcuplFird1V/YoplIFbnPZjfzbJSf/qNvRZIRB9/4n/RkI0GziuQ== @@ -9423,7 +9363,7 @@ unzip-response@^2.0.1: resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= -upath@^1.0.5: +upath@^1.0.5, upath@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== @@ -9964,11 +9904,6 @@ xml2js@^0.4.17: sax ">=0.6.0" xmlbuilder "~9.0.1" -xmlbuilder@8.2.2: - version "8.2.2" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" - integrity sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M= - xmlbuilder@^10.0.0: version "10.1.1" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz#8cae6688cc9b38d850b7c8d3c0a4161dcaf475b0" @@ -10117,7 +10052,7 @@ yargs@^11.0.0: y18n "^3.2.1" yargs-parser "^9.0.2" -yargs@^12.0.1: +yargs@^12.0.2: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== From a53a4180cf16add24ca1b4ac78cddb6176d05879 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 15 Feb 2019 18:36:51 +0100 Subject: [PATCH 023/160] =?UTF-8?q?feat(clone):=20avancement=20partie=20HT?= =?UTF-8?q?ML=20et=20d=C3=A9but=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/screens/home/home.component.html | 14 ++++++++++++-- src/app/screens/home/home.component.ts | 13 ++++++++++++- src/assets/i18n/en.json | 8 ++++++-- src/assets/i18n/fr.json | 8 ++++++-- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 5ca4f4e..8cb5b25 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -43,10 +43,20 @@ - + - {{ 'OPEN_REPO' | translate }} + + {{ 'OPEN.REPO' | translate }} +
+ +
+
+ + + {{ 'OPEN.OPENED' | translate }} + +
{{ 'CLONE' | translate }} {{ 'INIT' | translate }} diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 10d8d17..51db6bb 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; +import { ElectronService } from '../../providers/electron.service'; @Component({ selector: 'app-home', @@ -11,8 +12,9 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; + destination: string; - constructor(public router: Router, private toastr: ToastrService) { } + constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService) { } ngOnInit() { @@ -46,4 +48,13 @@ export class HomeComponent implements OnInit { this.toastr.info(this.searchInputValue.toString()); } + browse() { + const NEWPATH = this.electronService.remote.dialog.showOpenDialog({ + properties: ['openDirectory'] + }); + if (NEWPATH !== undefined) { + this.destination = NEWPATH[0]; + } + + } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 97217a2..c9da166 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -72,8 +72,12 @@ "EDITOR": "Editor", "UI": "User Interface", "REPOSITORY_MANAGEMENT": "Repository management", - "OPEN": "Open", - "OPEN_REPO": "Open a Reporitory", + "OPEN": { + "TITLE": "Open", + "REPO": "Open a Reporitory", + "OPENED": "Recently Opened", + "BROWSE": "Browse" + }, "CLONE": "Clone", "INIT": "Init" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 4c1819c..49a2142 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -72,8 +72,12 @@ "EDITOR": "Editeur", "UI": "Interface Utilisateur", "REPOSITORY_MANAGEMENT": "Gestion du répertoire", - "OPEN": "Ouvrir", - "OPEN_REPO": "Ouvrir un Dépôt", + "OPEN": { + "TITLE": "Ouvrir", + "REPO": "Ouvrir un Dépôt", + "OPENED": "Ouvert récemment", + "BROWSE": "Parcourir" + }, "CLONE": "Cloner", "INIT": "Initialiser" } \ No newline at end of file From 923468080be80ab1a6ca713090c84a7a23c0a2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 15 Feb 2019 18:39:03 +0100 Subject: [PATCH 024/160] refactor(modal): ajout d'un loader sur la modale --- src/app/components/modal/modal.component.html | 16 +++++++++------- src/app/components/modal/modal.component.ts | 7 ++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/app/components/modal/modal.component.html b/src/app/components/modal/modal.component.html index c08fac0..7ecc8b0 100644 --- a/src/app/components/modal/modal.component.html +++ b/src/app/components/modal/modal.component.html @@ -1,12 +1,14 @@
-
- {{ title | translate }} -
+ +
+ {{ title | translate }} +
+
+
+ +
+
-
- -
-
\ No newline at end of file diff --git a/src/app/components/modal/modal.component.ts b/src/app/components/modal/modal.component.ts index e8b5a46..099f7cb 100644 --- a/src/app/components/modal/modal.component.ts +++ b/src/app/components/modal/modal.component.ts @@ -12,6 +12,7 @@ export class ModalComponent implements OnInit { @Input() medium: Boolean; @Input() fullscreen: Boolean; @Input() title: String; + @Input() loading: Boolean = false; currentVisible: Boolean; @Output() @@ -27,13 +28,13 @@ export class ModalComponent implements OnInit { this.visibleChange.emit(this.currentVisible); } - constructor() { } - ngOnInit() { } closeModal() { - this.visible = false; + if (!this.loading) { + this.visible = false; + } } } From bc3f77f60bc3ee1977d15ce9d2a95837f4d9b9e4 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Fri, 15 Feb 2019 21:14:18 +0100 Subject: [PATCH 025/160] =?UTF-8?q?refactor(modal):=20Ajout=20d'une=20moda?= =?UTF-8?q?le=20avec=20loader=20=C3=A0=20la=20toolbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/toolbox/toolbox.component.html | 24 +++++++++++++++++++ src/app/screens/toolbox/toolbox.component.ts | 12 ++++++++++ src/assets/i18n/en.json | 3 ++- src/assets/i18n/fr.json | 3 ++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index 0c8e922..b6262b0 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -337,6 +337,21 @@

{{ 'MODAL.WINDOW' | translate }}

'>
+
+
+ +
+
+ +
+
@@ -606,6 +621,15 @@

Dropdowns

+ + + + {{ 'MODAL.FIRST_CONTENT' | translate }} + {{ 'MODAL.SECOND_CONTENT' | translate }} + {{ 'MODAL.THIRD_CONTENT' | translate }} + + + diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index b04d854..a084317 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -19,8 +19,10 @@ export class ToolboxComponent implements OnInit { inputValue: String; inputEmptyValue: String; loading: Boolean; + modalLoading: Boolean; modalRegularVisible: Boolean; modalFullscreenVisible: Boolean; + modalLoadingVisible: Boolean; modalInputValue: String; modalTabSelectedIndex: any; inputValueNumber: number; @@ -211,6 +213,16 @@ export class ToolboxComponent implements OnInit { this.modalFullscreenVisible = true; } + openLoadingModal() { + this.modalLoadingVisible = true; + this.modalLoading = true; + new Promise(resolve => setTimeout(resolve, 3000)) + .then( () => { + this.modalLoading = false; + } + ); + } + displayModalInputValue() { this.toastr.info(this.modalInputValue.toString()); } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4ec8af5..97e8e11 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -48,7 +48,8 @@ "WINDOW": "Modal window", "OPEN": { "REGULAR": "Open the regular modal", - "FULLSCREEN": "Open the fullscreen modal" + "FULLSCREEN": "Open the fullscreen modal", + "LOADING": "Open the modal with loading" }, "EXIT": "Exit", "FIRST_SECTION": "First section", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index b67f5fc..fabae1d 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -48,7 +48,8 @@ "WINDOW": "Fenêtre modale", "OPEN": { "REGULAR": "Ouvrir la modale normale", - "FULLSCREEN": "Ouvrir la modale plein écran" + "FULLSCREEN": "Ouvrir la modale plein écran", + "LOADING": "Ouvrir la modale avec chargement" }, "EXIT": "Sortir", "FIRST_SECTION": "Première section", From 11f8a6578044de85aed55955e7ee4bd81dc9ade0 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Fri, 15 Feb 2019 21:32:26 +0100 Subject: [PATCH 026/160] refactor(modal): suppression du fichier spec --- .../components/modal/modal.component.spec.ts | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/app/components/modal/modal.component.spec.ts diff --git a/src/app/components/modal/modal.component.spec.ts b/src/app/components/modal/modal.component.spec.ts deleted file mode 100644 index c6472e6..0000000 --- a/src/app/components/modal/modal.component.spec.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ModalComponent } from './modal.component'; -import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; -import { By } from '@angular/platform-browser'; -import { DebugElement } from '@angular/core'; -import { MockTranslateLoader } from '../../models/MockTranslateLoader'; - -describe('ModalComponent', () => { - let component: ModalComponent; - let fixture: ComponentFixture; - let modalEl: DebugElement; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ModalComponent ], - imports: [ - TranslateModule.forRoot({ - loader: {provide: TranslateLoader, useClass: MockTranslateLoader}, - }) - ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ModalComponent); - component = fixture.componentInstance; - modalEl = fixture.debugElement.query(By.css('div.gh-modal')); - }); - - it('tests the component creation', () => { - expect(component).toBeTruthy(); - }); - - it('tests the visible property with true value', () => { - component.visible = true; - fixture.detectChanges(); - const classList = modalEl.nativeElement.classList; - expect(classList).toContain('visible'); - }); - - it('tests the visible property with false value', () => { - component.visible = false; - fixture.detectChanges(); - const classList = modalEl.nativeElement.classList; - expect(classList.contains('visible')).toBeFalsy(); - }); - - it('tests the openModal function', () => { - component.closeModal(); - expect(component.visible).toBeFalsy(); - }); -}); From aec1f7ce96e7a521f4a271f88d478c5a2f2ac2f4 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Fri, 15 Feb 2019 22:16:54 +0100 Subject: [PATCH 027/160] =?UTF-8?q?refactor(init):=20chemin=20complet=20aj?= =?UTF-8?q?out=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/screens/home/home.component.html | 8 ++++---- src/app/screens/home/home.component.ts | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 14be1b0..91ff484 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -58,7 +58,7 @@
- +
@@ -66,8 +66,8 @@
- -
+ +
@@ -77,7 +77,7 @@
- {{ initLocation }} + {{ fullPath }}
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 740d58a..5a4ee83 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -12,14 +12,14 @@ import { ElectronService } from '../../providers/electron.service'; export class HomeComponent implements OnInit { projectModalVisible: Boolean; - searchInputValue: String; - initName: String; - initLocation: String; + searchInputValue: string; + initName: string; + initLocation: string; + fullPath: string; constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService) { } ngOnInit() { - } pullButtonClicked() { @@ -55,10 +55,24 @@ export class HomeComponent implements OnInit { if (INITPATH !== undefined) { this.initLocation = INITPATH; } + this.updateFullPath(); + } + + updateFullPath() { + if (this.initLocation !== undefined && this.initLocation !== '') { + this.fullPath = this.initLocation; + + if (this.initName !== undefined && this.initName !== '') { + this.fullPath += '\\' + this.initName; + } + } else { + this.fullPath = ''; + } } initSubmit() { console.log('initName : ' + this.initName); console.log('initLocation : ' + this.initLocation); + } } From 4aad472aef886b30d27d208766fad40e51fbdfa1 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Fri, 15 Feb 2019 22:19:56 +0100 Subject: [PATCH 028/160] refactor(modal): Rajout d'une suppression --- src/app/components/modal/modal.component.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/components/modal/modal.component.ts b/src/app/components/modal/modal.component.ts index 099f7cb..9e6bcfd 100644 --- a/src/app/components/modal/modal.component.ts +++ b/src/app/components/modal/modal.component.ts @@ -28,6 +28,8 @@ export class ModalComponent implements OnInit { this.visibleChange.emit(this.currentVisible); } + constructor() { } + ngOnInit() { } From 432197061907d6be003e3c02a2a2fcec38d205e7 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Fri, 15 Feb 2019 23:42:54 +0100 Subject: [PATCH 029/160] refactor(init): Avancement sur le init --- src/app/app.module.ts | 3 +- src/app/providers/git.service.ts | 4 ++ src/app/screens/home/home.component.ts | 52 ++++++++++++++++++++++---- 3 files changed, 51 insertions(+), 8 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/git.service.ts b/src/app/providers/git.service.ts index 3c89176..0dbe2bd 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -31,4 +31,8 @@ export class GitService { isRepo(currentPath: string) { return gitPromise(currentPath).checkIsRepo(); } + + init(currentPath: string) { + return gitPromise(currentPath).init(); + } } diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 5a4ee83..00c0b8f 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,23 +1,37 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; +import { initNgModule } from '@angular/core/src/view/ng_module'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'] }) -export class HomeComponent implements OnInit { +export class HomeComponent implements OnInit, OnDestroy { projectModalVisible: Boolean; searchInputValue: string; initName: string; initLocation: string; fullPath: string; - - constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService) { } + projectModalLoading: Boolean; + path: any; + pathSubscription: Subscription; + + constructor(public router: Router, private toastr: ToastrService, + private electronService: ElectronService, private gitService: GitService) { + this.pathSubscription = this.gitService.pathSubject.subscribe( + (path: any) => { + this.path = path; + } + ); + this.gitService.emitPathSubject(); + + } ngOnInit() { } @@ -63,7 +77,7 @@ export class HomeComponent implements OnInit { this.fullPath = this.initLocation; if (this.initName !== undefined && this.initName !== '') { - this.fullPath += '\\' + this.initName; + this.fullPath = this.electronService.path.join(this.initLocation, this.initName).toString(); } } else { this.fullPath = ''; @@ -71,8 +85,32 @@ export class HomeComponent implements OnInit { } initSubmit() { - console.log('initName : ' + this.initName); - console.log('initLocation : ' + this.initLocation); + this.projectModalLoading = true; + if (this.initLocation !== undefined && this.initLocation !== '' && this.initName !== undefined && this.initName !== '') { + console.log('initName : ' + this.initName); + console.log('initLocation : ' + this.initLocation); + if (this.electronService.fs.existsSync(this.initLocation)) { + if (this.electronService.fs.existsSync(this.electronService.path.join(this.initLocation, this.initName))) { + // dossier existe déjà avec le nom passé donc on peut init dans le dossier + this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)) + .then( () => { + console.log('init done'); + }); + } else { + // Dossier existe pas encore donc on le créé et on init dedans + this.electronService.fs.mkdirSync(this.electronService.path.join(this.initLocation, this.initName)); + this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)) + .then( () => { + console.log('init done'); + }); + } + } else { + console.log('répertoire n\'existe pas'); + } + } + } + ngOnDestroy() { + this.pathSubscription.unsubscribe(); } } From 08b602d77570826768ad472db6268ac8120ac7e3 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Sat, 16 Feb 2019 01:01:34 +0100 Subject: [PATCH 030/160] refactor(init): Mise en place dans le service git --- src/app/providers/git.service.ts | 15 ++++- src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.ts | 76 +++++++++++++++--------- src/assets/i18n/en.json | 6 +- src/assets/i18n/fr.json | 6 +- 5 files changed, 72 insertions(+), 33 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 0dbe2bd..bfa0c30 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -32,7 +32,18 @@ export class GitService { return gitPromise(currentPath).checkIsRepo(); } - init(currentPath: string) { - return gitPromise(currentPath).init(); + /** + * Fonction permettant d'initialiser un repo git + * @param currentPath le chemin dans lequel doit être initialisé le projet + */ + async init(currentPath: string) { + let RES; + + await gitPromise(currentPath).init() + .then( () => { + RES = new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS'); + }); + + return RES; } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 91ff484..51a0576 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,7 +41,7 @@
- + {{ 'OPEN' | translate }} diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 00c0b8f..946cb84 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -5,6 +5,8 @@ import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; import { initNgModule } from '@angular/core/src/view/ng_module'; import { Subscription } from 'rxjs'; +import { ServiceResult } from '../../models/ServiceResult'; +import { TranslateService } from '@ngx-translate/core'; @Component({ selector: 'app-home', @@ -23,15 +25,16 @@ export class HomeComponent implements OnInit, OnDestroy { pathSubscription: Subscription; constructor(public router: Router, private toastr: ToastrService, - private electronService: ElectronService, private gitService: GitService) { - this.pathSubscription = this.gitService.pathSubject.subscribe( - (path: any) => { - this.path = path; - } - ); - this.gitService.emitPathSubject(); - - } + private electronService: ElectronService, private gitService: GitService, + private translateService: TranslateService) { + this.pathSubscription = this.gitService.pathSubject.subscribe( + (path: any) => { + this.path = path; + } + ); + this.gitService.emitPathSubject(); + + } ngOnInit() { } @@ -73,10 +76,10 @@ export class HomeComponent implements OnInit, OnDestroy { } updateFullPath() { - if (this.initLocation !== undefined && this.initLocation !== '') { + if (this.initLocation) { this.fullPath = this.initLocation; - if (this.initName !== undefined && this.initName !== '') { + if (this.initName) { this.fullPath = this.electronService.path.join(this.initLocation, this.initName).toString(); } } else { @@ -84,30 +87,47 @@ export class HomeComponent implements OnInit, OnDestroy { } } - initSubmit() { + async initSubmit() { this.projectModalLoading = true; - if (this.initLocation !== undefined && this.initLocation !== '' && this.initName !== undefined && this.initName !== '') { - console.log('initName : ' + this.initName); - console.log('initLocation : ' + this.initLocation); + // A DEPLACER DANS LE SERVICE ? (rapide à faire) + // Si les champs sont bien remplis + if (this.initLocation && this.initName) { + // Si l'emplacement existe if (this.electronService.fs.existsSync(this.initLocation)) { - if (this.electronService.fs.existsSync(this.electronService.path.join(this.initLocation, this.initName))) { - // dossier existe déjà avec le nom passé donc on peut init dans le dossier - this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)) - .then( () => { - console.log('init done'); - }); - } else { - // Dossier existe pas encore donc on le créé et on init dedans + if (!this.electronService.fs.existsSync(this.electronService.path.join(this.initLocation, this.initName))) { + // Répertoire existe pas encore donc on le créé et on init dedans this.electronService.fs.mkdirSync(this.electronService.path.join(this.initLocation, this.initName)); - this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)) - .then( () => { - console.log('init done'); - }); } + + const RESULT = await this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)); + if (RESULT.success) { + this.toastr.success(this.translateService.instant(RESULT.message), this.translateService.instant(RESULT.title), { + onActivateTick: true + }); + + // METTRE LE CHEMIN COMME ETANT CELUI PAR DEFAUT + } else { + this.toastr.error(this.translateService.instant('INIT.FAILED'), this.translateService.instant('ERROR'), { + onActivateTick: true + }); + } + + this.projectModalLoading = false; + } else { - console.log('répertoire n\'existe pas'); + this.toastr.error(this.translateService.instant('PATH_NOT_FOUND'), this.translateService.instant('ERROR'), { + onActivateTick: true + }); + + this.projectModalLoading = false; } } + + // On vide les champs et on ferme la modale + this.projectModalVisible = false; + this.initName = ''; + this.initLocation = ''; + this.fullPath = ''; } ngOnDestroy() { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index bc0f7bc..d05ed70 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -42,6 +42,8 @@ "INFORMATION": "Information", "SUCCESS": "Success", "DANGER": "Danger", + "ERROR": "Error", + "PATH_NOT_FOUND": "This path doesn't exist", "UPDATE_VALUE": "Update value", "DISPLAY_VALUE": "Display value", "LABEL": "Label", @@ -79,7 +81,9 @@ "INIT": { "TITLE": "Init", "TAB_TITLE": "Initialize a Repo", - "WHERE": "Initialize in" + "WHERE": "Initialize in", + "SUCCESS": "Init successed", + "FAILED": "Init failed" }, "FULL_PATH": "Full path", "BROWSE": "Browse", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index e621887..5e9d230 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -42,6 +42,8 @@ "INFORMATION": "Information", "SUCCESS": "Succès", "DANGER": "Danger", + "ERROR": "Erreur", + "PATH_NOT_FOUND": "Ce chemin n'existe pas", "UPDATE_VALUE": "Changer la valeur", "DISPLAY_VALUE": "Afficher la valeur", "LABEL": "Label", @@ -79,7 +81,9 @@ "INIT": { "TITLE": "Initialiser", "TAB_TITLE": "Initialiser un dépôt", - "WHERE": "Initialiser dans" + "WHERE": "Initialiser dans", + "SUCCESS": "Initialisation réussie", + "FAILED": "Initialisation échouée" }, "FULL_PATH": "Chemin complet", "BROWSE": "Parcourir", From 84a6a1c26a8a3f07049839dccc69802414155880 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Sat, 16 Feb 2019 01:44:09 +0100 Subject: [PATCH 031/160] =?UTF-8?q?feat(pref-lang):=20D=C3=A9but=20utilisa?= =?UTF-8?q?tion=20des=20services.=20Des=20probl=C3=A8mes=20=C3=A0=20r?= =?UTF-8?q?=C3=A9gler.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 3 +- .../providers/language-preferences.service.ts | 36 +++++++++++++++++++ .../preferences/preferences.component.html | 2 +- .../preferences/preferences.component.ts | 33 +++++++++++++---- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 src/app/providers/language-preferences.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c8cdb84..404aa6f 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 { LanguagePreferencesService } from './providers/language-preferences.service'; import { WebviewDirective } from './directives/webview.directive'; @@ -96,7 +97,7 @@ export function HttpLoaderFactory(http: HttpClient) { useBootstrap4: true }) ], - providers: [ElectronService, EditorPreferencesService], + providers: [ElectronService, EditorPreferencesService, LanguagePreferencesService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts new file mode 100644 index 0000000..1176552 --- /dev/null +++ b/src/app/providers/language-preferences.service.ts @@ -0,0 +1,36 @@ +import { Injectable, OnInit } from '@angular/core'; +import { Subject } from 'rxjs'; + +@Injectable() +export class LanguagePreferencesService { + languages: any[]; + preferences: any; + gitP: any; + git: any; + preferencesSubject = new Subject(); + + constructor() { + this.languages = [ + { value: 'fr', text: 'Français' }, + { value: 'en', text: 'English' }, + ]; + + this.preferences = { + language: this.languages[0].value + }; + this.emitPreferencesSubject(); + } + + emitPreferencesSubject() { + this.preferencesSubject.next(this.preferences); + } + + setLanguage(newLanguage) { + this.gitP.switchLanguage(newLanguage) + .then(() => { + this.preferences.language = newLanguage; + this.emitPreferencesSubject(); + }); + } + +} diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 5fb74f1..1fac848 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -22,7 +22,7 @@
+ [(value)]="dropdownLanguageValue" (click)="switchLanguage(dropdownLanguageValue)">
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index 2167c9a..e4f7751 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -1,6 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; +import { Subscription } from 'rxjs'; +import { LanguagePreferencesService } from '../../providers/language-preferences.service'; @Component({ selector: 'app-preferences', @@ -14,11 +16,19 @@ export class PreferencesComponent implements OnInit { dropdownLanguageValue: String; dataDropdownLanguage: Array; + path: any; + pathSubscription: Subscription; + key: String = 'key'; value: String = 'value'; - constructor(public router: Router, private translate: TranslateService) { + constructor(public router: Router, private translate: TranslateService, + private gitService: LanguagePreferencesService) { + + this.translate.addLangs(['fr', 'en']); + this.translate.setDefaultLang(this.translate.getLangs()[0]); + } ngOnInit() { @@ -27,8 +37,8 @@ export class PreferencesComponent implements OnInit { this.dropdownLanguageValue = 'Français'; this.dataDropdownLanguage = [ - {key: 'en', value: 'English'}, - {key: 'fr', value: 'Français'}, + {key: 'Français', value: 'Français'}, + {key: 'English', value: 'English'}, ]; } @@ -38,11 +48,22 @@ export class PreferencesComponent implements OnInit { } } - switchLanguage() { - if (this.dropdownLanguageValue === 'Français') { + switchLanguage(language: String) { + this.gitService.setLanguage(language); + if (language === 'Français') { this.translate.use('fr'); + // this.translate.getLangs()[0]; } else { this.translate.use('en'); + // this.translate.getLangs()[1]; } + // if (this.dropdownLanguageValue === 'Français') { + // this.translate.use('fr'); + // } else { + // this.translate.use('en'); + // } } -} \ No newline at end of file + + + +} From f35b624737b4669192509dca9af9c990b0d40517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sat, 16 Feb 2019 14:42:22 +0100 Subject: [PATCH 032/160] =?UTF-8?q?test(template):=20r=C3=A9ajout=20d'un?= =?UTF-8?q?=20template=20de=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/modal/modal.component.spec.ts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/app/components/modal/modal.component.spec.ts diff --git a/src/app/components/modal/modal.component.spec.ts b/src/app/components/modal/modal.component.spec.ts new file mode 100644 index 0000000..7d0a247 --- /dev/null +++ b/src/app/components/modal/modal.component.spec.ts @@ -0,0 +1,55 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ModalComponent } from './modal.component'; +import { TranslateLoader, TranslateModule } from '@ngx-translate/core'; +import { By } from '@angular/platform-browser'; +import { DebugElement } from '@angular/core'; +import { MockTranslateLoader } from '../../models/MockTranslateLoader'; +import { LoaderComponent } from '../loader/loader.component'; + +describe('ModalComponent', () => { + const component: ModalComponent; + const fixture: ComponentFixture; + const modalEl: DebugElement; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ModalComponent, LoaderComponent ], + imports: [ + TranslateModule.forRoot({ + loader: {provide: TranslateLoader, useClass: MockTranslateLoader}, + }) + ], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ModalComponent); + component = fixture.componentInstance; + modalEl = fixture.debugElement.query(By.css('div.gh-modal')); + }); + + it('tests the component creation', () => { + expect(component).toBeTruthy(); + }); + + it('tests the visible property with true value', () => { + component.visible = true; + fixture.detectChanges(); + const classList = modalEl.nativeElement.classList; + expect(classList).toContain('visible'); + }); + + it('tests the visible property with false value', () => { + component.visible = false; + fixture.detectChanges(); + const classList = modalEl.nativeElement.classList; + expect(classList.contains('visible')).toBeFalsy(); + }); + + it('tests the openModal function', () => { + component.closeModal(); + expect(component.visible).toBeFalsy(); + }); +}); \ No newline at end of file From 7daa0b430b90908b22c3ed679dc3390b09db187e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sat, 16 Feb 2019 14:49:22 +0100 Subject: [PATCH 033/160] refactor(service): ajout du service aux providers --- src/app/app.module.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c8cdb84..de02b4a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,7 +10,7 @@ import { HttpClientModule, HttpClient } from '@angular/common/http'; import { AppRoutingModule } from './app-routing.module'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgScrollbarModule } from 'ngx-scrollbar'; -import {MatTabsModule, MatIconModule } from '@angular/material'; +import { MatTabsModule, MatIconModule } from '@angular/material'; import { ContextMenuModule } from 'ngx-contextmenu'; import { ClipboardModule } from 'ngx-clipboard'; @@ -44,6 +44,7 @@ import { ModalComponent } from './components/modal/modal.component'; import { InputNumberComponent } from './components/input-number/input-number.component'; import { CopyButtonComponent } from './components/copy-button/copy-button.component'; import { PreferencesComponent } from './screens/preferences/preferences.component'; +import { GitService } from './providers/git.service'; // AoT requires an exported function for factories @@ -96,7 +97,10 @@ export function HttpLoaderFactory(http: HttpClient) { useBootstrap4: true }) ], - providers: [ElectronService, EditorPreferencesService], + providers: [ElectronService, + EditorPreferencesService, + GitService + ], bootstrap: [AppComponent] }) export class AppModule { } From 239426f51bf9910d72828f29587e1448a4917b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sat, 16 Feb 2019 14:50:26 +0100 Subject: [PATCH 034/160] fix(travis): fix du fichier pour travis --- src/app/components/modal/modal.component.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/modal/modal.component.spec.ts b/src/app/components/modal/modal.component.spec.ts index 7d0a247..9913847 100644 --- a/src/app/components/modal/modal.component.spec.ts +++ b/src/app/components/modal/modal.component.spec.ts @@ -8,9 +8,9 @@ import { MockTranslateLoader } from '../../models/MockTranslateLoader'; import { LoaderComponent } from '../loader/loader.component'; describe('ModalComponent', () => { - const component: ModalComponent; - const fixture: ComponentFixture; - const modalEl: DebugElement; + let component: ModalComponent; + let fixture: ComponentFixture; + let modalEl: DebugElement; beforeEach(async(() => { TestBed.configureTestingModule({ From e4cf2f00d061f5297e10c2558056e318dee70d4d Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Sat, 16 Feb 2019 15:19:04 +0100 Subject: [PATCH 035/160] feat(pref-lang): Modifications --- .../providers/language-preferences.service.ts | 9 ++------ .../preferences/preferences.component.ts | 23 ++++++++++++------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 1176552..e2c029a 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -5,8 +5,6 @@ import { Subject } from 'rxjs'; export class LanguagePreferencesService { languages: any[]; preferences: any; - gitP: any; - git: any; preferencesSubject = new Subject(); constructor() { @@ -26,11 +24,8 @@ export class LanguagePreferencesService { } setLanguage(newLanguage) { - this.gitP.switchLanguage(newLanguage) - .then(() => { - this.preferences.language = newLanguage; - this.emitPreferencesSubject(); - }); + this.preferences.language = newLanguage; + this.emitPreferencesSubject(); } } diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index e4f7751..ee18162 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -16,8 +16,7 @@ export class PreferencesComponent implements OnInit { dropdownLanguageValue: String; dataDropdownLanguage: Array; - path: any; - pathSubscription: Subscription; + languageSubscription: Subscription; key: String = 'key'; value: String = 'value'; @@ -34,12 +33,18 @@ export class PreferencesComponent implements OnInit { ngOnInit() { this.preferencesVisible = true; this.preferencesTabSelectedIndex = 1; - this.dropdownLanguageValue = 'Français'; - this.dataDropdownLanguage = [ {key: 'Français', value: 'Français'}, {key: 'English', value: 'English'}, ]; + this.dropdownLanguageValue = this.dataDropdownLanguage[0].key; + + this.languageSubscription = this.gitService.preferencesSubject.subscribe( + (dropdownLanguageValue) => { + this.dropdownLanguageValue = dropdownLanguageValue; + } + ); + this.gitService.emitPreferencesSubject(); } checkIfCloseModal(event) { @@ -51,11 +56,13 @@ export class PreferencesComponent implements OnInit { switchLanguage(language: String) { this.gitService.setLanguage(language); if (language === 'Français') { - this.translate.use('fr'); - // this.translate.getLangs()[0]; + // this.translate.use('fr'); + this.translate.setDefaultLang(this.translate.getLangs()[0]); + } else { - this.translate.use('en'); - // this.translate.getLangs()[1]; + // this.translate.use('en'); + this.translate.setDefaultLang(this.translate.getLangs()[1]); + } // if (this.dropdownLanguageValue === 'Français') { // this.translate.use('fr'); From 988a994e42f698922c7c609f80b0c4fff2269737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sat, 16 Feb 2019 15:38:54 +0100 Subject: [PATCH 036/160] =?UTF-8?q?refacto(pref-lang):=20d=C3=A9but=20du?= =?UTF-8?q?=20refacto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../providers/language-preferences.service.ts | 11 ++++-- .../preferences/preferences.component.html | 2 +- .../preferences/preferences.component.ts | 35 +++++++------------ 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index e2c029a..37390aa 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -1,5 +1,6 @@ import { Injectable, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; +import { TranslateService } from '@ngx-translate/core'; @Injectable() export class LanguagePreferencesService { @@ -7,10 +8,10 @@ export class LanguagePreferencesService { preferences: any; preferencesSubject = new Subject(); - constructor() { + constructor(private translate: TranslateService) { this.languages = [ - { value: 'fr', text: 'Français' }, - { value: 'en', text: 'English' }, + { key: 'fr', value: this.translate.instant('FRENCH') }, + { key: 'en', value: this.translate.instant('ENGLISH') }, ]; this.preferences = { @@ -28,4 +29,8 @@ export class LanguagePreferencesService { this.emitPreferencesSubject(); } + getLanguages() { + return this.languages; + } + } diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 1fac848..53cc836 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -21,7 +21,7 @@
-
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index ee18162..5a0bf49 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -13,38 +13,32 @@ export class PreferencesComponent implements OnInit { preferencesVisible: Boolean; preferencesTabSelectedIndex: any; - dropdownLanguageValue: String; + dropdownLanguageValue: string; dataDropdownLanguage: Array; languageSubscription: Subscription; - key: String = 'key'; - value: String = 'value'; - - constructor(public router: Router, private translate: TranslateService, - private gitService: LanguagePreferencesService) { - - this.translate.addLangs(['fr', 'en']); - this.translate.setDefaultLang(this.translate.getLangs()[0]); - + private langPrefService: LanguagePreferencesService) { } ngOnInit() { this.preferencesVisible = true; this.preferencesTabSelectedIndex = 1; - this.dataDropdownLanguage = [ - {key: 'Français', value: 'Français'}, - {key: 'English', value: 'English'}, - ]; - this.dropdownLanguageValue = this.dataDropdownLanguage[0].key; - this.languageSubscription = this.gitService.preferencesSubject.subscribe( + this.dataDropdownLanguage = this.langPrefService.getLanguages(); + console.log(this.dataDropdownLanguage); + + // 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.languageSubscription = this.langPrefService.preferencesSubject.subscribe( (dropdownLanguageValue) => { this.dropdownLanguageValue = dropdownLanguageValue; } ); - this.gitService.emitPreferencesSubject(); + this.langPrefService.emitPreferencesSubject(); } checkIfCloseModal(event) { @@ -54,7 +48,7 @@ export class PreferencesComponent implements OnInit { } switchLanguage(language: String) { - this.gitService.setLanguage(language); + this.langPrefService.setLanguage(language); if (language === 'Français') { // this.translate.use('fr'); this.translate.setDefaultLang(this.translate.getLangs()[0]); @@ -64,11 +58,6 @@ export class PreferencesComponent implements OnInit { this.translate.setDefaultLang(this.translate.getLangs()[1]); } - // if (this.dropdownLanguageValue === 'Français') { - // this.translate.use('fr'); - // } else { - // this.translate.use('en'); - // } } From 706c92ee4396e8be9b169b1ca6fcb0a76202462e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sat, 16 Feb 2019 16:17:11 +0100 Subject: [PATCH 037/160] refacto(pref-lang): avancement dans le service --- src/app/app.component.ts | 1 + .../providers/language-preferences.service.ts | 16 ++++++---- .../preferences/preferences.component.html | 22 +++++++------- .../preferences/preferences.component.ts | 29 ++++++++++--------- src/assets/i18n/en.json | 2 ++ src/assets/i18n/fr.json | 2 ++ 6 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 780e174..aab83dd 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,6 +13,7 @@ export class AppComponent { private translate: TranslateService) { this.translate.addLangs(['fr', 'en']); + // Ici on doit chercher depuis le local storage (si vide prendre fr du coup) this.translate.setDefaultLang(this.translate.getLangs()[0]); console.log('AppConfig', AppConfig); diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 37390aa..e2bb175 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -5,8 +5,8 @@ import { TranslateService } from '@ngx-translate/core'; @Injectable() export class LanguagePreferencesService { languages: any[]; - preferences: any; - preferencesSubject = new Subject(); + preferences: string; + preferencesSubject = new Subject(); constructor(private translate: TranslateService) { this.languages = [ @@ -14,9 +14,8 @@ export class LanguagePreferencesService { { key: 'en', value: this.translate.instant('ENGLISH') }, ]; - this.preferences = { - language: this.languages[0].value - }; + // Ici ca sera pas forcement ça en fonction du local storage encore uen fois + this.preferences = this.languages[0].value; this.emitPreferencesSubject(); } @@ -25,7 +24,12 @@ export class LanguagePreferencesService { } setLanguage(newLanguage) { - this.preferences.language = newLanguage; + this.preferences = newLanguage; + if (this.preferences === this.translate.instant('FRENCH')) { + this.translate.setDefaultLang('fr'); + } else { + this.translate.setDefaultLang('en'); + } this.emitPreferencesSubject(); } diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 53cc836..c0d1069 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -14,19 +14,17 @@ {{ 'GENERAL' | translate }} - -
-
-
- -
-
- -
- +
+
+ +
+
+ +
+
+
-
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 @@
- + diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 51db6bb..ab6b9cb 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; +import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; @Component({ @@ -12,9 +13,11 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; + projectModalLoading: Boolean; destination: string; - constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService) { } + constructor(public router: Router, private toastr: ToastrService, + private electronService: ElectronService, private gitService: GitService) { } ngOnInit() { @@ -48,13 +51,14 @@ export class HomeComponent implements OnInit { this.toastr.info(this.searchInputValue.toString()); } - browse() { - const NEWPATH = this.electronService.remote.dialog.showOpenDialog({ - properties: ['openDirectory'] - }); - if (NEWPATH !== undefined) { - this.destination = NEWPATH[0]; + async browse() { + this.projectModalLoading = true; + const RESULT = await this.gitService.setPath(this.electronService.browse()); + if (RESULT.success) { + this.toastr.info(RESULT.message, RESULT.title); + } else { + this.toastr.error(RESULT.message, RESULT.title); } - + this.projectModalLoading = false; } } From 49afd9b8856fd37e2905fb09247de57c688b7f27 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Sun, 17 Feb 2019 00:17:56 +0100 Subject: [PATCH 043/160] refactor(open): ouverture d'un repo --- src/app/providers/git.service.ts | 13 +++++++-- src/app/screens/home/home.component.html | 4 +-- src/app/screens/home/home.component.ts | 36 ++++++++++++++++++------ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 6bfc393..756d1a9 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -10,6 +10,8 @@ import { ServiceResult } from '../models/ServiceResult'; export class GitService { path: any; pathSubject: Subject; + repoName: any; + repoNameSubject: Subject; gitP: any; git: any; @@ -17,6 +19,7 @@ export class GitService { this.gitP = gitPromise(); this.git = simpleGit(); this.pathSubject = new Subject(); + this.repoNameSubject = new Subject(); this.path = this.electronService.process.cwd(); } @@ -24,6 +27,10 @@ export class GitService { this.pathSubject.next(this.path); } + emitRepoNameSubject() { + this.repoNameSubject.next(this.repoName); + } + /** * Fonction permettant de tester si currentPath est un repo git * @param currentPath le chemin à tester @@ -36,13 +43,15 @@ export class GitService { * Fonction permettant de changer le chemin courant * @param newPath le nouveau chemin */ - async setPath(newPath) { - if (await this.isRepo(newPath)) { + setPath(newPath) { + if (this.isRepo(newPath)) { this.path = newPath; + this.repoName = this.electronService.path.basename(this.path); this.electronService.process.chdir(this.path); this.git.cwd(this.path); this.gitP.cwd(this.path); this.emitPathSubject(); + this.emitRepoNameSubject(); // A traduir return new ServiceResult(true, 'Succès', 'Répo ouvert'); } else { diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 8182076..c5483e9 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -5,7 +5,7 @@ @@ -49,7 +49,7 @@ {{ 'OPEN.REPO' | translate }}
- +
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index ab6b9cb..92a18be 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -3,6 +3,7 @@ import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-home', @@ -14,10 +15,26 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; projectModalLoading: Boolean; - destination: string; + repoName: any; + repoNameSubscription: Subscription; + path: any; + pathSubscription: Subscription; constructor(public router: Router, private toastr: ToastrService, - private electronService: ElectronService, private gitService: GitService) { } + private electronService: ElectronService, private gitService: GitService) { + this.pathSubscription = this.gitService.pathSubject.subscribe( + (path: any) => { + this.path = path; + } + ); + this.gitService.emitPathSubject(); + this.repoNameSubscription = this.gitService.repoNameSubject.subscribe( + (repoName: any) => { + this.repoName = repoName; + } + ); + this.gitService.emitRepoNameSubject(); + } ngOnInit() { @@ -51,13 +68,16 @@ export class HomeComponent implements OnInit { this.toastr.info(this.searchInputValue.toString()); } - async browse() { + openBrowse() { this.projectModalLoading = true; - const RESULT = await this.gitService.setPath(this.electronService.browse()); - if (RESULT.success) { - this.toastr.info(RESULT.message, RESULT.title); - } else { - this.toastr.error(RESULT.message, RESULT.title); + const NEWPATH = this.electronService.browse(); + if (NEWPATH !== null) { + const RESULT = this.gitService.setPath(NEWPATH); + if (RESULT.success) { + this.toastr.info(RESULT.message, RESULT.title); + } else { + this.toastr.error(RESULT.message, RESULT.title); + } } this.projectModalLoading = false; } From d8c23be0418462b7ee94604bc29477d1137b3a74 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Sun, 17 Feb 2019 17:35:41 +0100 Subject: [PATCH 044/160] feat(open): Ajout local storage --- package.json | 1 + src/app/app.module.ts | 2 + src/app/providers/git.service.ts | 50 ++++++++++++++--- src/app/screens/home/home.component.html | 17 +++++- src/app/screens/home/home.component.scss | 21 ++++++++ src/app/screens/home/home.component.ts | 68 +++++++++++++++--------- src/assets/i18n/en.json | 5 +- src/assets/i18n/fr.json | 5 +- yarn.lock | 34 +++++++++++- 9 files changed, 169 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 42eb1a3..bc10171 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "ngx-clipboard": "^11.1.9", "ngx-contextmenu": "^5.1.1", "ngx-scrollbar": "^4.1.1", + "ngx-store": "^2.1.0", "ngx-toastr": "^9.1.1", "popper.js": "^1.14.7", "rxjs-compat": "^6.3.3", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9bd0087..aa8bdd7 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -28,6 +28,7 @@ import { AppComponent } from './app.component'; import { MonacoEditorWrapperComponent } from './components/monaco-wrapper/monaco-editor-wrapper.component'; import { CommonModule } from '@angular/common'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { WebStorageModule } from 'ngx-store'; import { ToastrModule } from 'ngx-toastr'; import { EditorPreferencesService } from './providers/editor-preferences.service'; @@ -84,6 +85,7 @@ export function HttpLoaderFactory(http: HttpClient) { FormsModule, HttpClientModule, AppRoutingModule, + WebStorageModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 756d1a9..12c43b4 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -5,9 +5,13 @@ import { Subject } from 'rxjs'; import { ElectronService } from './electron.service'; import * as GitUrlParse from 'git-url-parse'; import { ServiceResult } from '../models/ServiceResult'; +import { TranslateService } from '@ngx-translate/core'; +import { LocalStorage } from 'ngx-store'; @Injectable() export class GitService { + @LocalStorage({key: 'recentProject'}) recentProject = []; + recentProjectSubject: Subject; path: any; pathSubject: Subject; repoName: any; @@ -15,12 +19,17 @@ export class GitService { gitP: any; git: any; - constructor(private electronService: ElectronService) { + constructor(private electronService: ElectronService, private translate: TranslateService) { this.gitP = gitPromise(); this.git = simpleGit(); this.pathSubject = new Subject(); this.repoNameSubject = new Subject(); - this.path = this.electronService.process.cwd(); + this.recentProjectSubject = new Subject(); + if (this.recentProject[0].path) { + this.path = this.recentProject[0].path; + } else { + this.path = this.electronService.process.cwd(); + } } emitPathSubject() { @@ -31,6 +40,10 @@ export class GitService { this.repoNameSubject.next(this.repoName); } + emitRecentProjectSubject() { + this.recentProjectSubject.next(this.recentProject.slice()); + } + /** * Fonction permettant de tester si currentPath est un repo git * @param currentPath le chemin à tester @@ -47,16 +60,41 @@ export class GitService { if (this.isRepo(newPath)) { this.path = newPath; this.repoName = this.electronService.path.basename(this.path); + this.emitRepoNameSubject(); this.electronService.process.chdir(this.path); this.git.cwd(this.path); this.gitP.cwd(this.path); this.emitPathSubject(); - this.emitRepoNameSubject(); - // A traduir - return new ServiceResult(true, 'Succès', 'Répo ouvert'); + this.registerProject(this.repoName, this.path); + return new ServiceResult(true, this.translate.instant('SUCCESS'), + this.translate.instant('OPEN.OPENED_REPO')); } else { - return new ServiceResult(false, 'Echec', 'Répo pas ouvert'); + return new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('OPEN.NOT_GIT_REPO')); + } + } + registerProject(repo: any, path: any) { + const PROJECT = { + repo: repo, + path: path + }; + for (let INDEX = 0; INDEX < this.recentProject.length; INDEX++) { + if (this.recentProject[INDEX].repo == PROJECT.repo + && this.recentProject[INDEX].path == PROJECT.path) { + this.recentProject.splice(INDEX, 1); + INDEX--; + } + } + this.recentProject.splice(0, 0, PROJECT); + if (this.recentProject.length >= 5) { + this.recentProject.splice(5, 1); } + this.emitRecentProjectSubject(); + } + + deleteProject(id: number) { + this.recentProject.splice(id, 1); + this.emitRecentProjectSubject(); } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index c5483e9..457113d 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -53,9 +53,24 @@
- + {{ 'OPEN.OPENED' | translate }} +
+
+
+
+ {{project.value.repo}} +
+
+
+
+
+ {{project.value.path}} +
+
+
{{ 'CLONE' | translate }} diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 533940c..15cf9b4 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -100,4 +100,25 @@ .cursor-pointer { cursor: pointer; +} + +.gh-open-recentProject { + &:hover { + @include bg-color($disabled-blue); + cursor: pointer; + } +} + +.gh-open-first { + @include bg-color($disabled-green); + + &:hover { + @include bg-color($disabled-green); + cursor: default; + } +} + +.gh-open-recentPath { + font-size: $fs-small; + color: $muted-white; } \ No newline at end of file diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 92a18be..d5da80b 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,17 +1,17 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; import { Subscription } from 'rxjs'; +import { LocalStorage } from 'ngx-store'; @Component({ selector: 'app-home', templateUrl: './home.component.html', styleUrls: ['./home.component.scss'] }) -export class HomeComponent implements OnInit { - +export class HomeComponent implements OnInit, OnDestroy { projectModalVisible: Boolean; searchInputValue: String; projectModalLoading: Boolean; @@ -19,22 +19,31 @@ export class HomeComponent implements OnInit { repoNameSubscription: Subscription; path: any; pathSubscription: Subscription; + recentProject: any[]; + recentProjectSubscription: Subscription; + constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService, private gitService: GitService) { - this.pathSubscription = this.gitService.pathSubject.subscribe( - (path: any) => { - this.path = path; - } - ); - this.gitService.emitPathSubject(); - this.repoNameSubscription = this.gitService.repoNameSubject.subscribe( - (repoName: any) => { - this.repoName = repoName; - } - ); - this.gitService.emitRepoNameSubject(); - } + this.pathSubscription = this.gitService.pathSubject.subscribe( + (path: any) => { + this.path = path; + } + ); + this.gitService.emitPathSubject(); + this.repoNameSubscription = this.gitService.repoNameSubject.subscribe( + (repoName: any) => { + this.repoName = repoName; + } + ); + this.gitService.emitRepoNameSubject(); + this.recentProjectSubscription = this.gitService.recentProjectSubject.subscribe( + (recentProject: any) => { + this.recentProject = recentProject; + } + ); + this.gitService.emitRecentProjectSubject(); + } ngOnInit() { @@ -69,16 +78,27 @@ export class HomeComponent implements OnInit { } openBrowse() { - this.projectModalLoading = true; const NEWPATH = this.electronService.browse(); - if (NEWPATH !== null) { - const RESULT = this.gitService.setPath(NEWPATH); - if (RESULT.success) { - this.toastr.info(RESULT.message, RESULT.title); - } else { - this.toastr.error(RESULT.message, RESULT.title); + this.openRepo(NEWPATH); + } + + openRepo(path: any) { + if (this.path !== path) { + this.projectModalLoading = true; + if (path !== null) { + const RESULT = this.gitService.setPath(path); + if (RESULT.success) { + this.toastr.info(RESULT.message, RESULT.title); + } else { + this.toastr.error(RESULT.message, RESULT.title); + } } + this.projectModalLoading = false; } - this.projectModalLoading = false; + } + + ngOnDestroy() { + this.pathSubscription.unsubscribe(); + this.repoNameSubscription.unsubscribe(); } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 1bf92c9..4fa7329 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -40,6 +40,7 @@ }, "INFORMATION": "Information", "SUCCESS": "Success", + "ERROR": "Error", "DANGER": "Danger", "UPDATE_VALUE": "Update value", "DISPLAY_VALUE": "Display value", @@ -49,7 +50,9 @@ "OPEN": { "REGULAR": "Open the regular modal", "FULLSCREEN": "Open the fullscreen modal", - "LOADING": "Open the modal with loading" + "LOADING": "Open the modal with loading", + "OPENED_REPO": "The repository was successfully opened", + "NOT_GIT_REPO": "This is not a git repository" }, "EXIT": "Exit", "FIRST_SECTION": "First section", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 3604526..795c765 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -40,6 +40,7 @@ }, "INFORMATION": "Information", "SUCCESS": "Succès", + "ERROR": "Erreur", "DANGER": "Danger", "UPDATE_VALUE": "Changer la valeur", "DISPLAY_VALUE": "Afficher la valeur", @@ -77,7 +78,9 @@ "TITLE": "Ouvrir", "REPO": "Ouvrir un Dépôt", "OPENED": "Ouvert récemment", - "BROWSE": "Parcourir" + "BROWSE": "Parcourir", + "OPENED_REPO": "Le dépôt a été ouvert avec succès", + "NOT_GIT_REPO": "Ce répertoire n'est pas un répertoire git" }, "CLONE": "Cloner", "INIT": "Initialiser" diff --git a/yarn.lock b/yarn.lock index 93eb294..0f3a016 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5427,11 +5427,26 @@ lodash.get@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + +lodash.merge@^4.6.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" + integrity sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ== + lodash.mergewith@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ== +lodash.set@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" + integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= + lodash.tail@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.tail/-/lodash.tail-4.1.1.tgz#d2333a36d9e7717c8ad2f7cacafec7c32b444664" @@ -6014,6 +6029,18 @@ ngx-scrollbar@^4.1.1: dependencies: tslib "^1.9.0" +ngx-store@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ngx-store/-/ngx-store-2.1.0.tgz#b0789406fd60102f8ea925f507376b87f91f9af2" + integrity sha512-NVFP/VUctQuzwGqmaSx6bbQwT1XmGmHe0ACTMyxoWq7gmpAFAt/LkGuei70aX4ukyH1tQNk9zuYzTQlQOIG7rg== + dependencies: + lodash.get "^4.4.2" + lodash.isequal "^4.5.0" + lodash.merge "^4.6.1" + lodash.set "^4.3.2" + ts-debug "^1.3.0" + tslib "^1.9.3" + ngx-toastr@^9.1.1: version "9.1.1" resolved "https://registry.yarnpkg.com/ngx-toastr/-/ngx-toastr-9.1.1.tgz#c7ec0284d13951422ccf47439a387372ddccc768" @@ -9168,6 +9195,11 @@ truncate-utf8-bytes@^1.0.0: dependencies: utf8-byte-length "^1.0.1" +ts-debug@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-debug/-/ts-debug-1.3.0.tgz#ecf9fb60f7be223a0ff9113ac48e93da139ad98f" + integrity sha512-sP9Q4Nfqu5ImWLH955PpxbjR2zgLWS3NIc2tCw/JZtZMFFxUZe3fvkhdA0vSIpjiGFKPwCg6v0drthjwnSQTGA== + ts-node@6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-6.0.3.tgz#28bf74bcad134fad17f7469dad04638ece03f0f4" @@ -9182,7 +9214,7 @@ ts-node@6.0.3: source-map-support "^0.5.3" yn "^2.0.0" -tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0: +tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: version "1.9.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== From a713a8ff0ebba531c6efd4821cda7980c8419dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Sun, 17 Feb 2019 18:55:52 +0100 Subject: [PATCH 045/160] refactor(icon-button): ajout option disabled --- src/app/components/icon-button/icon-button.component.html | 2 +- src/app/components/icon-button/icon-button.component.scss | 5 +++++ src/app/components/icon-button/icon-button.component.ts | 5 ++++- src/app/screens/toolbox/toolbox.component.html | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/app/components/icon-button/icon-button.component.html b/src/app/components/icon-button/icon-button.component.html index 81a4849..9e1ed63 100644 --- a/src/app/components/icon-button/icon-button.component.html +++ b/src/app/components/icon-button/icon-button.component.html @@ -1,4 +1,4 @@ -
+
diff --git a/src/app/components/icon-button/icon-button.component.scss b/src/app/components/icon-button/icon-button.component.scss index 748c8e6..bf4642c 100644 --- a/src/app/components/icon-button/icon-button.component.scss +++ b/src/app/components/icon-button/icon-button.component.scss @@ -14,6 +14,11 @@ @include bg-color($light-grey); cursor: pointer; + &.disabled { + color: $muted-white; + cursor: not-allowed; + } + &:hover { @include bg-color($dark-grey); } diff --git a/src/app/components/icon-button/icon-button.component.ts b/src/app/components/icon-button/icon-button.component.ts index e2576f7..de9c772 100644 --- a/src/app/components/icon-button/icon-button.component.ts +++ b/src/app/components/icon-button/icon-button.component.ts @@ -11,6 +11,7 @@ export class IconButtonComponent implements OnInit { @Input() value: String; @Input() tooltipValue: String; @Input() placement: String; + @Input() disabled: Boolean = false; @Input() icon: { name: String, isFab: Boolean @@ -24,7 +25,9 @@ export class IconButtonComponent implements OnInit { } execClick(evt) { - this.buttonClicked.emit(evt); + if (!this.disabled) { + this.buttonClicked.emit(evt); + } } getValueTranslation() { diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index b6262b0..b0fdedf 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -373,11 +373,13 @@

IconButtons

From 59c3c30e2d286a382a00eae7db22d419613b8b08 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Sun, 17 Feb 2019 19:01:51 +0100 Subject: [PATCH 046/160] =?UTF-8?q?refactor(open):=20am=C3=A9lioration=20e?= =?UTF-8?q?t=20gestion=20erreur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 45 +++++++++++++------ src/app/screens/home/home.component.html | 10 ++--- src/app/screens/home/home.component.scss | 4 +- src/app/screens/home/home.component.ts | 16 ++++--- .../screens/toolbox/toolbox.component.scss | 3 ++ src/app/screens/toolbox/toolbox.component.ts | 1 + src/assets/i18n/en.json | 9 ++-- src/assets/i18n/fr.json | 3 +- src/variables.scss | 1 + 9 files changed, 58 insertions(+), 34 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 12c43b4..5fce660 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -7,6 +7,7 @@ import * as GitUrlParse from 'git-url-parse'; import { ServiceResult } from '../models/ServiceResult'; import { TranslateService } from '@ngx-translate/core'; import { LocalStorage } from 'ngx-store'; +import { resolve } from 'url'; @Injectable() export class GitService { @@ -26,7 +27,7 @@ export class GitService { this.repoNameSubject = new Subject(); this.recentProjectSubject = new Subject(); if (this.recentProject[0].path) { - this.path = this.recentProject[0].path; + this.setPath(this.recentProject[0].path); } else { this.path = this.electronService.process.cwd(); } @@ -56,21 +57,27 @@ export class GitService { * Fonction permettant de changer le chemin courant * @param newPath le nouveau chemin */ - setPath(newPath) { - if (this.isRepo(newPath)) { - this.path = newPath; - this.repoName = this.electronService.path.basename(this.path); - this.emitRepoNameSubject(); - this.electronService.process.chdir(this.path); - this.git.cwd(this.path); - this.gitP.cwd(this.path); - this.emitPathSubject(); - this.registerProject(this.repoName, this.path); - return new ServiceResult(true, this.translate.instant('SUCCESS'), - this.translate.instant('OPEN.OPENED_REPO')); + async setPath(newPath) { + if (this.electronService.fs.existsSync(newPath)) { + if (await this.isRepo(newPath)) { + this.path = newPath; + this.repoName = this.electronService.path.basename(this.path); + this.emitRepoNameSubject(); + this.electronService.process.chdir(this.path); + this.git.cwd(this.path); + this.gitP.cwd(this.path); + this.emitPathSubject(); + this.registerProject(this.repoName, this.path); + return new ServiceResult(true, this.translate.instant('SUCCESS'), + this.translate.instant('OPEN.OPENED_REPO')); + } else { + return new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('OPEN.NOT_GIT_REPO')); + } } else { + this.deleteProjetWithPath(newPath); return new ServiceResult(false, this.translate.instant('ERROR'), - this.translate.instant('OPEN.NOT_GIT_REPO')); + this.translate.instant('OPEN.REPO_NOT_EXIST')); } } @@ -97,4 +104,14 @@ export class GitService { this.recentProject.splice(id, 1); this.emitRecentProjectSubject(); } + + deleteProjetWithPath(path: any) { + for (let INDEX = 0; INDEX < this.recentProject.length; INDEX++) { + if (this.recentProject[INDEX].path == path) { + this.recentProject.splice(INDEX, 1); + INDEX--; + } + } + this.emitRecentProjectSubject(); + } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 457113d..d1239cb 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -48,30 +48,28 @@ {{ 'OPEN.REPO' | translate }} -
+
-
{{ 'OPEN.OPENED' | translate }}
-
+ [class.gh-open-first]="isFirst" class="col-md-12 pt-1 pb-1 gh-open-recentProject"> +
{{project.value.repo}}
-
+
{{project.value.path}}
-
{{ 'CLONE' | translate }} {{ 'INIT' | translate }} diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 15cf9b4..0f2aa3d 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -110,10 +110,10 @@ } .gh-open-first { - @include bg-color($disabled-green); + @include bg-color($light-green-hover); &:hover { - @include bg-color($disabled-green); + @include bg-color($light-green-hover); cursor: default; } } diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index d5da80b..7e71735 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -86,14 +86,16 @@ export class HomeComponent implements OnInit, OnDestroy { if (this.path !== path) { this.projectModalLoading = true; if (path !== null) { - const RESULT = this.gitService.setPath(path); - if (RESULT.success) { - this.toastr.info(RESULT.message, RESULT.title); - } else { - this.toastr.error(RESULT.message, RESULT.title); - } + this.gitService.setPath(path) + .then((data) => { + if (data.success) { + this.toastr.info(data.message, data.title); + } else { + this.toastr.error(data.message, data.title); + } + this.projectModalLoading = false; + }); } - this.projectModalLoading = false; } } diff --git a/src/app/screens/toolbox/toolbox.component.scss b/src/app/screens/toolbox/toolbox.component.scss index 31f178a..ee4e200 100644 --- a/src/app/screens/toolbox/toolbox.component.scss +++ b/src/app/screens/toolbox/toolbox.component.scss @@ -55,6 +55,9 @@ a.link-white { .disabled-green { @include bg-color($disabled-green); } +.light-green-hover { + @include bg-color($light-green-hover); +} .dark-red { @include bg-color($dark-red); } diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index a084317..180f4ac 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -65,6 +65,7 @@ export class ToolboxComponent implements OnInit { 'dark-green', 'light-green', 'disabled-green', + 'light-green-hover', 'dark-red', 'light-red', 'disabled-red', diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 4fa7329..b85bbda 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -50,9 +50,7 @@ "OPEN": { "REGULAR": "Open the regular modal", "FULLSCREEN": "Open the fullscreen modal", - "LOADING": "Open the modal with loading", - "OPENED_REPO": "The repository was successfully opened", - "NOT_GIT_REPO": "This is not a git repository" + "LOADING": "Open the modal with loading" }, "EXIT": "Exit", "FIRST_SECTION": "First section", @@ -80,7 +78,10 @@ "TITLE": "Open", "REPO": "Open a Reporitory", "OPENED": "Recently Opened", - "BROWSE": "Browse" + "BROWSE": "Browse", + "OPENED_REPO": "The repository was successfully opened", + "NOT_GIT_REPO": "This is not a git repository", + "REPO_NOT_EXIST": "The repository no longer exist" }, "CLONE": "Clone", "INIT": "Init" diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 795c765..3756804 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -80,7 +80,8 @@ "OPENED": "Ouvert récemment", "BROWSE": "Parcourir", "OPENED_REPO": "Le dépôt a été ouvert avec succès", - "NOT_GIT_REPO": "Ce répertoire n'est pas un répertoire git" + "NOT_GIT_REPO": "Ce répertoire n'est pas un répertoire git", + "REPO_NOT_EXIST": "Ce répertoire n'existe plus" }, "CLONE": "Cloner", "INIT": "Initialiser" diff --git a/src/variables.scss b/src/variables.scss index 24854cc..4a3c0f2 100644 --- a/src/variables.scss +++ b/src/variables.scss @@ -8,6 +8,7 @@ $gh-green: #1B958A; $dark-green: #314739; $light-green:#477F4B; $disabled-green: #2C3835; +$light-green-hover: #37553E; $dark-red:#54383E; $light-red: #963D3E; $disabled-red: #382C32; From ed7e70f0f346b7b67ca45bbe8bda649daa5d4338 Mon Sep 17 00:00:00 2001 From: Unknown <76480julien@gmail.com> Date: Sun, 17 Feb 2019 22:14:06 +0100 Subject: [PATCH 047/160] refactor(init): Modification du service (+ retour avec promise) + form --- src/app/providers/git.service.ts | 32 ++++++++++---- src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.ts | 53 ++++++++---------------- 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index bfa0c30..252b4d2 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -34,16 +34,32 @@ export class GitService { /** * Fonction permettant d'initialiser un repo git - * @param currentPath le chemin dans lequel doit être initialisé le projet + * @param initLocation le chemin qui contiendra le projet + * @param initName le nom du projet */ - async init(currentPath: string) { - let RES; + init(initLocation: string, initName: string) { - await gitPromise(currentPath).init() - .then( () => { - RES = new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS'); - }); + if (initLocation && initName) { + const PATHTOREPO = this.electronService.path.join(initLocation, initName); + return new Promise((resolve, reject) => { + // Si l'emplacement existe + if (this.electronService.fs.existsSync(initLocation)) { + if (!this.electronService.fs.existsSync(PATHTOREPO)) { + // Répertoire existe pas encore donc on le créé et on init dedans + this.electronService.fs.mkdirSync(PATHTOREPO); + } - return RES; + gitPromise(PATHTOREPO).init() + .then( () => { + resolve(new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS')); + }) + .catch( () => { + reject(new ServiceResult(false, 'ERROR', 'INIT.FAILED')); + }); + } else { + reject(new ServiceResult(false, 'ERROR', 'PATH_NOT_FOUND')); + } + }); + } } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 51a0576..cd0ca01 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -82,7 +82,7 @@
- +
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 946cb84..ba39ab0 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -89,45 +89,28 @@ export class HomeComponent implements OnInit, OnDestroy { async initSubmit() { this.projectModalLoading = true; - // A DEPLACER DANS LE SERVICE ? (rapide à faire) - // Si les champs sont bien remplis + if (this.initLocation && this.initName) { - // Si l'emplacement existe - if (this.electronService.fs.existsSync(this.initLocation)) { - if (!this.electronService.fs.existsSync(this.electronService.path.join(this.initLocation, this.initName))) { - // Répertoire existe pas encore donc on le créé et on init dedans - this.electronService.fs.mkdirSync(this.electronService.path.join(this.initLocation, this.initName)); - } - - const RESULT = await this.gitService.init(this.electronService.path.join(this.initLocation, this.initName)); - if (RESULT.success) { - this.toastr.success(this.translateService.instant(RESULT.message), this.translateService.instant(RESULT.title), { - onActivateTick: true - }); - - // METTRE LE CHEMIN COMME ETANT CELUI PAR DEFAUT - } else { - this.toastr.error(this.translateService.instant('INIT.FAILED'), this.translateService.instant('ERROR'), { - onActivateTick: true - }); - } - - this.projectModalLoading = false; - - } else { - this.toastr.error(this.translateService.instant('PATH_NOT_FOUND'), this.translateService.instant('ERROR'), { - onActivateTick: true + await this.gitService.init(this.initLocation, this.initName) + .then( (result) => { + this.toastr.info(this.translateService.instant(result.message), this.translateService.instant(result.title), { + onActivateTick: true + }); + + // On vide les champs et on ferme la modale + this.projectModalVisible = false; + this.initName = ''; + this.initLocation = ''; + this.fullPath = ''; + }) + .catch( (result) => { + this.toastr.error(this.translateService.instant(result.message), this.translateService.instant(result.title), { + onActivateTick: true + }); }); - - this.projectModalLoading = false; - } } - // On vide les champs et on ferme la modale - this.projectModalVisible = false; - this.initName = ''; - this.initLocation = ''; - this.fullPath = ''; + this.projectModalLoading = false; } ngOnDestroy() { From 4afc8e73501f9ac790b1dccc45564c5bb8fb23db Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Sun, 17 Feb 2019 23:29:10 +0100 Subject: [PATCH 048/160] feat(pref-lang): Modifications app.component + service + preference --- src/app/app.component.ts | 10 +++++++++- src/app/providers/language-preferences.service.ts | 12 ++++++++++-- .../screens/preferences/preferences.component.html | 2 +- .../screens/preferences/preferences.component.ts | 14 +++----------- src/assets/i18n/en.json | 1 + src/assets/i18n/fr.json | 1 + 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index aab83dd..a1c9fe5 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -14,7 +14,15 @@ export class AppComponent { this.translate.addLangs(['fr', 'en']); // Ici on doit chercher depuis le local storage (si vide prendre fr du coup) - this.translate.setDefaultLang(this.translate.getLangs()[0]); + // this.translate.setDefaultLang(this.translate.getLangs()[0]); + // localStorage.setItem('en', 'en'); + if (this.translate.getDefaultLang() === 'en') { + this.translate.setDefaultLang('en'); + } else { + this.translate.setDefaultLang('fr'); + } + + console.log('AppConfig', AppConfig); if (electronService.isElectron()) { diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index e2bb175..380a219 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -6,16 +6,23 @@ import { TranslateService } from '@ngx-translate/core'; export class LanguagePreferencesService { languages: any[]; preferences: string; + index: number; preferencesSubject = new Subject(); constructor(private translate: TranslateService) { + this.languages = [ { key: 'fr', value: this.translate.instant('FRENCH') }, { key: 'en', value: this.translate.instant('ENGLISH') }, ]; // Ici ca sera pas forcement ça en fonction du local storage encore uen fois - this.preferences = this.languages[0].value; + if (this.translate.getDefaultLang() === 'fr') { + this.preferences = this.languages[0].value; + } else { + this.preferences = this.languages[1].value; + } + this.emitPreferencesSubject(); } @@ -24,8 +31,9 @@ export class LanguagePreferencesService { } setLanguage(newLanguage) { - this.preferences = newLanguage; + this.preferences = this.translate.instant(newLanguage); if (this.preferences === this.translate.instant('FRENCH')) { + localStorage.clear; this.translate.setDefaultLang('fr'); } else { this.translate.setDefaultLang('en'); diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index c0d1069..8d1f833 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -23,7 +23,7 @@ [(value)]="dropdownLanguageValue">
- +
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index 7cb7fa7..974ad07 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -48,17 +48,9 @@ export class PreferencesComponent implements OnInit, OnDestroy { } } - switchLanguage(language: String) { - this.langPrefService.setLanguage(language); - // 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]); - - // } + switchLanguage() { + // console.log(language); + this.langPrefService.setLanguage(this.dropdownLanguageValue); } ngOnDestroy() { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index f99738b..aa5b3fc 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -4,6 +4,7 @@ "COLORS": "Colors", "TAGS": "Tags", "TAG": "Tag", + "CHANGE_PREFERENCE": "Change preferences", "LANGUE": "Language", "FRENCH": "French", "ENGLISH": "English", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 2e2187b..d93a430 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -4,6 +4,7 @@ "COLORS": "Couleurs", "TAGS": "Balises", "TAG": "Balise", + "CHANGE_PREFERENCE": "Changer les préférences", "LANGUE": "Langage", "FRENCH": "Français", "ENGLISH": "Anglais", From 00140f7c8eec46ce42c90d60dbeb3ba1d61f03a6 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Mon, 18 Feb 2019 02:44:54 +0100 Subject: [PATCH 049/160] feat(left-panel): Ajout panel gauche au container + css --- package.json | 1 + src/app/app.module.ts | 2 ++ src/app/screens/home/home.component.html | 4 ++++ src/app/screens/home/home.component.scss | 17 +++++++++++++++++ src/app/screens/home/home.component.ts | 20 +++++++++++++++++++- yarn.lock | 7 +++++++ 6 files changed, 50 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 42eb1a3..3129e0e 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@angular/material": "^7.3.1", "@angular/platform-server": "^7.1.4", "@ng-bootstrap/ng-bootstrap": "^4.0.2", + "angular-resizable-element": "^3.2.3", "bootstrap": "4.1.3", "chai": "^4.2.0", "chai-as-promised": "^7.1.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c8cdb84..ac5def9 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -13,6 +13,7 @@ import { NgScrollbarModule } from 'ngx-scrollbar'; import {MatTabsModule, MatIconModule } from '@angular/material'; import { ContextMenuModule } from 'ngx-contextmenu'; import { ClipboardModule } from 'ngx-clipboard'; +import { ResizableModule } from 'angular-resizable-element'; // NG Translate @@ -83,6 +84,7 @@ export function HttpLoaderFactory(http: HttpClient) { FormsModule, HttpClientModule, AppRoutingModule, + ResizableModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index fa449b3..4b966f5 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,6 +41,10 @@ +
+ DIV TEST +
+ diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 533940c..5257ccb 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -100,4 +100,21 @@ .cursor-pointer { cursor: pointer; +} + +.rectangle { + position: fixed; + top: 50px; + height: 88%; + min-width: 20%; + max-width: 50%; + border-top: 1px solid $dark; + background: $light-grey; + color: $white; + text-align:center; + padding: $gap-sm; + + mwlResizable { + box-sizing: border-box; + } } \ No newline at end of file diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 10d8d17..f661582 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; +import { ResizeEvent } from 'angular-resizable-element'; @Component({ selector: 'app-home', @@ -11,11 +12,13 @@ export class HomeComponent implements OnInit { projectModalVisible: Boolean; searchInputValue: String; + dimensions: number; + style: Object; constructor(public router: Router, private toastr: ToastrService) { } ngOnInit() { - + this.dimensions = 20; } pullButtonClicked() { @@ -46,4 +49,19 @@ export class HomeComponent implements OnInit { this.toastr.info(this.searchInputValue.toString()); } + validate(event: ResizeEvent): boolean { + if (event.rectangle.width && + (event.rectangle.width < this.dimensions) + ) { + return false; + } + return true; + } + + onResizeEnd(event: ResizeEvent): void { + this.style = { + width: `${event.rectangle.width}px` + }; + } + } diff --git a/yarn.lock b/yarn.lock index 93eb294..dc36b82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -620,6 +620,13 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= +angular-resizable-element@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/angular-resizable-element/-/angular-resizable-element-3.2.3.tgz#0080a61fdbe88634ea233596a6640ffa597130de" + integrity sha512-BRBYZOKcqKdMbCsmZxuc3SPwmrTXsM2eDQK4O/RiXul/3v0puTZ2r913uQiFg971SI4Tl9Udtzjpgg6MbU6tNw== + dependencies: + tslib "^1.9.0" + ansi-align@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" From 689717de890fb0ffc58f1924e08ea57bc063d9a9 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Mon, 18 Feb 2019 03:31:48 +0100 Subject: [PATCH 050/160] feat(accordion): Ajout du composant accordion --- src/app/app.module.ts | 4 ++- .../accordion/accordion.component.html | 12 +++++++++ .../accordion/accordion.component.scss | 7 ++++++ .../accordion/accordion.component.spec.ts | 25 +++++++++++++++++++ .../accordion/accordion.component.ts | 15 +++++++++++ src/app/screens/home/home.component.html | 2 ++ 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/app/components/accordion/accordion.component.html create mode 100644 src/app/components/accordion/accordion.component.scss create mode 100644 src/app/components/accordion/accordion.component.spec.ts create mode 100644 src/app/components/accordion/accordion.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c8cdb84..a6faba2 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -44,6 +44,7 @@ import { ModalComponent } from './components/modal/modal.component'; import { InputNumberComponent } from './components/input-number/input-number.component'; import { CopyButtonComponent } from './components/copy-button/copy-button.component'; import { PreferencesComponent } from './screens/preferences/preferences.component'; +import { AccordionComponent } from './components/accordion/accordion.component'; // AoT requires an exported function for factories @@ -69,7 +70,8 @@ export function HttpLoaderFactory(http: HttpClient) { ModalComponent, InputNumberComponent, CopyButtonComponent, - PreferencesComponent + PreferencesComponent, + AccordionComponent ], imports: [ ReactiveFormsModule, diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html new file mode 100644 index 0000000..6bceb66 --- /dev/null +++ b/src/app/components/accordion/accordion.component.html @@ -0,0 +1,12 @@ + + + + EMPLACEMENT PROVISOIR + + + + + EMPLACEMENT PROVISOIR + + + diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss new file mode 100644 index 0000000..db7a7c2 --- /dev/null +++ b/src/app/components/accordion/accordion.component.scss @@ -0,0 +1,7 @@ +@import '../../../variables.scss'; + +.gh-accordion { + position: fixed; + top: 50px; + background: $blue-grey; +} \ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.spec.ts b/src/app/components/accordion/accordion.component.spec.ts new file mode 100644 index 0000000..10f1099 --- /dev/null +++ b/src/app/components/accordion/accordion.component.spec.ts @@ -0,0 +1,25 @@ +// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +// import { AccordionComponent } from './accordion.component'; + +// describe('AccordionComponent', () => { +// let component: AccordionComponent; +// let fixture: ComponentFixture; + +// beforeEach(async(() => { +// TestBed.configureTestingModule({ +// declarations: [ AccordionComponent ] +// }) +// .compileComponents(); +// })); + +// beforeEach(() => { +// fixture = TestBed.createComponent(AccordionComponent); +// component = fixture.componentInstance; +// fixture.detectChanges(); +// }); + +// it('should create', () => { +// expect(component).toBeTruthy(); +// }); +// }); diff --git a/src/app/components/accordion/accordion.component.ts b/src/app/components/accordion/accordion.component.ts new file mode 100644 index 0000000..f292dd4 --- /dev/null +++ b/src/app/components/accordion/accordion.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-accordion', + templateUrl: './accordion.component.html', + styleUrls: ['./accordion.component.scss'] +}) +export class AccordionComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index fa449b3..209dda3 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,6 +41,8 @@ + + From 2ecd9515dc10ed7a1f6d3f13491449616c24a6ea Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Mon, 18 Feb 2019 10:45:20 +0100 Subject: [PATCH 051/160] feat(left-panel): Changement du nom de classe de la div --- src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 4b966f5..7ac432b 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,7 +41,7 @@ -
+
DIV TEST
diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 5257ccb..ba089eb 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -102,7 +102,7 @@ cursor: pointer; } -.rectangle { +.left-panel { position: fixed; top: 50px; height: 88%; From d8c638ce5cdd6630de795204321025c51420f19e Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 18:34:38 +0100 Subject: [PATCH 052/160] =?UTF-8?q?refactor(init):=20pr=C3=A9cision=20fait?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 252b4d2..55fa702 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -51,6 +51,9 @@ export class GitService { gitPromise(PATHTOREPO).init() .then( () => { + // TODO : Mettre le chemin comme étant mtn celui par défaut + + resolve(new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS')); }) .catch( () => { From f9d3955c0afba5303af86c3177faff7a28d36d36 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Mon, 18 Feb 2019 18:42:25 +0100 Subject: [PATCH 053/160] fix(open): petites corrections --- src/app/providers/git.service.ts | 1 - src/app/screens/home/home.component.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 5fce660..b029001 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -7,7 +7,6 @@ import * as GitUrlParse from 'git-url-parse'; import { ServiceResult } from '../models/ServiceResult'; import { TranslateService } from '@ngx-translate/core'; import { LocalStorage } from 'ngx-store'; -import { resolve } from 'url'; @Injectable() export class GitService { diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 7e71735..405663f 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -4,7 +4,6 @@ import { ToastrService } from 'ngx-toastr'; import { GitService } from '../../providers/git.service'; import { ElectronService } from '../../providers/electron.service'; import { Subscription } from 'rxjs'; -import { LocalStorage } from 'ngx-store'; @Component({ selector: 'app-home', From 79bc7bf76ccfaa309e4e655206829fa3725e977f Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 18:55:27 +0100 Subject: [PATCH 054/160] refactor(init): suppression des commentaires inutiles --- src/app/providers/git.service.ts | 14 -------------- src/app/screens/home/home.component.ts | 1 - 2 files changed, 15 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 55fa702..8f3682d 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -24,36 +24,22 @@ export class GitService { this.pathSubject.next(this.path); } - /** - * Fonction permettant de tester si currentPath est un repo git - * @param currentPath le chemin à tester - */ isRepo(currentPath: string) { return gitPromise(currentPath).checkIsRepo(); } - /** - * Fonction permettant d'initialiser un repo git - * @param initLocation le chemin qui contiendra le projet - * @param initName le nom du projet - */ init(initLocation: string, initName: string) { if (initLocation && initName) { const PATHTOREPO = this.electronService.path.join(initLocation, initName); return new Promise((resolve, reject) => { - // Si l'emplacement existe if (this.electronService.fs.existsSync(initLocation)) { if (!this.electronService.fs.existsSync(PATHTOREPO)) { - // Répertoire existe pas encore donc on le créé et on init dedans this.electronService.fs.mkdirSync(PATHTOREPO); } gitPromise(PATHTOREPO).init() .then( () => { - // TODO : Mettre le chemin comme étant mtn celui par défaut - - resolve(new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS')); }) .catch( () => { diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index ba39ab0..3276420 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -97,7 +97,6 @@ export class HomeComponent implements OnInit, OnDestroy { onActivateTick: true }); - // On vide les champs et on ferme la modale this.projectModalVisible = false; this.initName = ''; this.initLocation = ''; From 8bfd353302b4b321e5b0c4e6a1c8a95ef51ee7d3 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Mon, 18 Feb 2019 18:56:46 +0100 Subject: [PATCH 055/160] fix(open): petites corrections --- src/app/providers/git.service.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index b029001..97d4125 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -44,18 +44,10 @@ export class GitService { this.recentProjectSubject.next(this.recentProject.slice()); } - /** - * Fonction permettant de tester si currentPath est un repo git - * @param currentPath le chemin à tester - */ isRepo(currentPath: string) { return gitPromise(currentPath).checkIsRepo(); } - /** - * Fonction permettant de changer le chemin courant - * @param newPath le nouveau chemin - */ async setPath(newPath) { if (this.electronService.fs.existsSync(newPath)) { if (await this.isRepo(newPath)) { From 463b7a4ec7160704b45915b944d90f1480993d9a Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 19:34:57 +0100 Subject: [PATCH 056/160] refactor(init): correction d'une fonction --- src/app/screens/home/home.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 3276420..d4c6717 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -69,7 +69,7 @@ export class HomeComponent implements OnInit, OnDestroy { initBrowse() { const INITPATH = this.electronService.browse(); - if (INITPATH !== undefined) { + if (INITPATH !== null) { this.initLocation = INITPATH; } this.updateFullPath(); From e1a03360e58a09a3461b37445f7904362ef44153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Mon, 18 Feb 2019 19:54:45 +0100 Subject: [PATCH 057/160] =?UTF-8?q?fix(merge):=20d=C3=A9but=20fix=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 22 +++++++++++++--------- src/app/screens/home/home.component.ts | 9 +++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 73d6bca..189cdea 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -10,7 +10,7 @@ import { LocalStorage } from 'ngx-store'; @Injectable() export class GitService { - @LocalStorage({key: 'recentProject'}) recentProject = []; + @LocalStorage({ key: 'recentProject' }) recentProject = []; recentProjectSubject: Subject; path: any; pathSubject: Subject; @@ -25,8 +25,12 @@ export class GitService { this.pathSubject = new Subject(); this.repoNameSubject = new Subject(); this.recentProjectSubject = new Subject(); - if (this.recentProject[0].path) { - this.setPath(this.recentProject[0].path); + if (this.recentProject[0]) { + if (this.recentProject[0].path) { + this.setPath(this.recentProject[0].path); + } else { + this.path = this.electronService.process.cwd(); + } } else { this.path = this.electronService.process.cwd(); } @@ -43,7 +47,7 @@ export class GitService { emitRecentProjectSubject() { this.recentProjectSubject.next(this.recentProject.slice()); } - + isRepo(currentPath: string) { return gitPromise(currentPath).checkIsRepo(); } @@ -58,10 +62,10 @@ export class GitService { } gitPromise(PATHTOREPO).init() - .then( () => { + .then(() => { resolve(new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS')); }) - .catch( () => { + .catch(() => { reject(new ServiceResult(false, 'ERROR', 'INIT.FAILED')); }); } else { @@ -70,7 +74,7 @@ export class GitService { }); } } - + async setPath(newPath) { if (this.electronService.fs.existsSync(newPath)) { if (await this.isRepo(newPath)) { @@ -91,7 +95,7 @@ export class GitService { } else { this.deleteProjetWithPath(newPath); return new ServiceResult(false, this.translate.instant('ERROR'), - this.translate.instant('OPEN.REPO_NOT_EXIST')); + this.translate.instant('OPEN.REPO_NOT_EXIST')); } } @@ -102,7 +106,7 @@ export class GitService { }; for (let INDEX = 0; INDEX < this.recentProject.length; INDEX++) { if (this.recentProject[INDEX].repo == PROJECT.repo - && this.recentProject[INDEX].path == PROJECT.path) { + && this.recentProject[INDEX].path == PROJECT.path) { this.recentProject.splice(INDEX, 1); INDEX--; } diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index c86bd07..f4f7787 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -7,7 +7,6 @@ import { initNgModule } from '@angular/core/src/view/ng_module'; import { Subscription } from 'rxjs'; import { ServiceResult } from '../../models/ServiceResult'; import { TranslateService } from '@ngx-translate/core'; -import { Subscription } from 'rxjs'; @Component({ selector: 'app-home', @@ -37,13 +36,13 @@ export class HomeComponent implements OnInit, OnDestroy { this.path = path; }); this.gitService.emitPathSubject(); - + this.repoNameSubscription = this.gitService.repoNameSubject.subscribe( (repoName: any) => { this.repoName = repoName; }); this.gitService.emitRepoNameSubject(); - + this.recentProjectSubscription = this.gitService.recentProjectSubject.subscribe( (recentProject: any) => { this.recentProject = recentProject; @@ -128,7 +127,9 @@ export class HomeComponent implements OnInit, OnDestroy { openBrowse() { const NEWPATH = this.electronService.browse(); - this.openRepo(NEWPATH); + if (NEWPATH !== null) { + this.openRepo(NEWPATH); + } } openRepo(path: any) { From 2409e7a8bd9a7d48185924225f9551c9021e98af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Mon, 18 Feb 2019 20:40:25 +0100 Subject: [PATCH 058/160] =?UTF-8?q?fix(mac):=20fix=20de=20la=20v=C3=A9rifi?= =?UTF-8?q?cation=20de=20r=C3=A9pertoire=20sur=20mac?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 48 ++++++++++++++------------ src/app/screens/home/home.component.ts | 10 +++--- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 189cdea..14257e1 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -48,10 +48,6 @@ export class GitService { this.recentProjectSubject.next(this.recentProject.slice()); } - isRepo(currentPath: string) { - return gitPromise(currentPath).checkIsRepo(); - } - init(initLocation: string, initName: string) { if (initLocation && initName) { const PATHTOREPO = this.electronService.path.join(initLocation, initName); @@ -76,27 +72,33 @@ export class GitService { } async setPath(newPath) { - if (this.electronService.fs.existsSync(newPath)) { - if (await this.isRepo(newPath)) { - this.path = newPath; - this.repoName = this.electronService.path.basename(this.path); - this.emitRepoNameSubject(); - this.electronService.process.chdir(this.path); - this.git.cwd(this.path); - this.gitP.cwd(this.path); - this.emitPathSubject(); - this.registerProject(this.repoName, this.path); - return new ServiceResult(true, this.translate.instant('SUCCESS'), - this.translate.instant('OPEN.OPENED_REPO')); + return new Promise((resolve, reject) => { + if (this.electronService.fs.existsSync(newPath)) { + gitPromise(newPath).checkIsRepo() + .then(isRepo => { + if (isRepo) { + this.path = newPath; + this.repoName = this.electronService.path.basename(this.path); + this.emitRepoNameSubject(); + this.electronService.process.chdir(this.path); + this.git.cwd(this.path); + this.gitP.cwd(this.path); + this.emitPathSubject(); + this.registerProject(this.repoName, this.path); + resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), + this.translate.instant('OPEN.OPENED_REPO'))); + } + }) + .catch(() => { + reject(new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('OPEN.NOT_GIT_REPO'))); + }); } else { - return new ServiceResult(false, this.translate.instant('ERROR'), - this.translate.instant('OPEN.NOT_GIT_REPO')); + this.deleteProjetWithPath(newPath); + reject(new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('OPEN.REPO_NOT_EXIST'))); } - } else { - this.deleteProjetWithPath(newPath); - return new ServiceResult(false, this.translate.instant('ERROR'), - this.translate.instant('OPEN.REPO_NOT_EXIST')); - } + }); } registerProject(repo: any, path: any) { diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index f4f7787..9d1040b 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -138,12 +138,12 @@ export class HomeComponent implements OnInit, OnDestroy { if (path !== null) { this.gitService.setPath(path) .then((data) => { - if (data.success) { - this.toastr.info(data.message, data.title); - } else { - this.toastr.error(data.message, data.title); - } this.projectModalLoading = false; + this.toastr.info(data.message, data.title); + }) + .catch((data) => { + this.projectModalLoading = false; + this.toastr.error(data.message, data.title); }); } } From ce55627cca32cc5f86ac01b7519d2b50f9391897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Mon, 18 Feb 2019 21:11:47 +0100 Subject: [PATCH 059/160] refactor(home): formatage TS --- src/app/screens/home/home.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 9d1040b..51fd1b4 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -28,25 +28,25 @@ export class HomeComponent implements OnInit, OnDestroy { recentProjectSubscription: Subscription; - constructor(public router: Router, private toastr: ToastrService, + constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService, private gitService: GitService, private translateService: TranslateService) { this.pathSubscription = this.gitService.pathSubject.subscribe( (path: any) => { this.path = path; - }); + }); this.gitService.emitPathSubject(); this.repoNameSubscription = this.gitService.repoNameSubject.subscribe( (repoName: any) => { this.repoName = repoName; - }); + }); this.gitService.emitRepoNameSubject(); this.recentProjectSubscription = this.gitService.recentProjectSubject.subscribe( (recentProject: any) => { this.recentProject = recentProject; - }); + }); this.gitService.emitRecentProjectSubject(); } @@ -106,7 +106,7 @@ export class HomeComponent implements OnInit, OnDestroy { if (this.initLocation && this.initName) { await this.gitService.init(this.initLocation, this.initName) - .then( (result) => { + .then((result) => { this.toastr.info(this.translateService.instant(result.message), this.translateService.instant(result.title), { onActivateTick: true }); @@ -116,7 +116,7 @@ export class HomeComponent implements OnInit, OnDestroy { this.initLocation = ''; this.fullPath = ''; }) - .catch( (result) => { + .catch((result) => { this.toastr.error(this.translateService.instant(result.message), this.translateService.instant(result.title), { onActivateTick: true }); @@ -139,6 +139,7 @@ export class HomeComponent implements OnInit, OnDestroy { this.gitService.setPath(path) .then((data) => { this.projectModalLoading = false; + this.projectModalVisible = false; this.toastr.info(data.message, data.title); }) .catch((data) => { From fafc81e937a8d1dff7ca53a2f1a5e9fb99f90d93 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 21:21:56 +0100 Subject: [PATCH 060/160] =?UTF-8?q?fix(windows):=20v=C3=A9rification=20du?= =?UTF-8?q?=20r=C3=A9pertoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 14257e1..0c28238 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -76,6 +76,7 @@ export class GitService { if (this.electronService.fs.existsSync(newPath)) { gitPromise(newPath).checkIsRepo() .then(isRepo => { + console.log(isRepo); if (isRepo) { this.path = newPath; this.repoName = this.electronService.path.basename(this.path); @@ -87,6 +88,9 @@ export class GitService { this.registerProject(this.repoName, this.path); resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), this.translate.instant('OPEN.OPENED_REPO'))); + } else { + reject(new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('OPEN.NOT_GIT_REPO'))); } }) .catch(() => { From 8f3a691904db78f98c1ecbfd7388e7e59ca212ac Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 22:11:24 +0100 Subject: [PATCH 061/160] =?UTF-8?q?feat(info-bar):=20cr=C3=A9ation=20de=20?= =?UTF-8?q?l'info=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 4 ++- .../info-bar/info-bar.component.html | 3 +++ .../info-bar/info-bar.component.scss | 14 +++++++++++ .../info-bar/info-bar.component.spec.ts | 25 +++++++++++++++++++ .../components/info-bar/info-bar.component.ts | 15 +++++++++++ src/app/screens/home/home.component.html | 6 +++++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/app/components/info-bar/info-bar.component.html create mode 100644 src/app/components/info-bar/info-bar.component.scss create mode 100644 src/app/components/info-bar/info-bar.component.spec.ts create mode 100644 src/app/components/info-bar/info-bar.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index aa8bdd7..a4a1f33 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -46,6 +46,7 @@ import { ModalComponent } from './components/modal/modal.component'; import { InputNumberComponent } from './components/input-number/input-number.component'; import { CopyButtonComponent } from './components/copy-button/copy-button.component'; import { PreferencesComponent } from './screens/preferences/preferences.component'; +import { InfoBarComponent } from './components/info-bar/info-bar.component'; // AoT requires an exported function for factories @@ -71,7 +72,8 @@ export function HttpLoaderFactory(http: HttpClient) { ModalComponent, InputNumberComponent, CopyButtonComponent, - PreferencesComponent + PreferencesComponent, + InfoBarComponent ], imports: [ ReactiveFormsModule, diff --git a/src/app/components/info-bar/info-bar.component.html b/src/app/components/info-bar/info-bar.component.html new file mode 100644 index 0000000..5994c35 --- /dev/null +++ b/src/app/components/info-bar/info-bar.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.scss b/src/app/components/info-bar/info-bar.component.scss new file mode 100644 index 0000000..63b974a --- /dev/null +++ b/src/app/components/info-bar/info-bar.component.scss @@ -0,0 +1,14 @@ +@import '../../../variables.scss'; + +.gh-info-bar { + position: fixed; + z-index: 4; + color: $white; + @include fs($fs-medium); + @include bg-color($dark-blue); + @include wX(100%); + min-height: 50px; + display: flex; + align-items: center; + justify-content: center; +} \ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.spec.ts b/src/app/components/info-bar/info-bar.component.spec.ts new file mode 100644 index 0000000..41bb891 --- /dev/null +++ b/src/app/components/info-bar/info-bar.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InfoBarComponent } from './info-bar.component'; + +describe('InfoBarComponent', () => { + let component: InfoBarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ InfoBarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(InfoBarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/info-bar/info-bar.component.ts b/src/app/components/info-bar/info-bar.component.ts new file mode 100644 index 0000000..5bf0c04 --- /dev/null +++ b/src/app/components/info-bar/info-bar.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-info-bar', + templateUrl: './info-bar.component.html', + styleUrls: ['./info-bar.component.scss'] +}) +export class InfoBarComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index d1239cb..b6379dd 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -76,4 +76,10 @@ + + Successfully cloned repo 'TestGit' + + + + \ No newline at end of file From 2f24a2670a838f83ba73a88992043f188b5fca55 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 22:50:02 +0100 Subject: [PATCH 062/160] refactor(info-bar): derniers correctifs du code --- src/app/screens/home/home.component.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index b6379dd..d1239cb 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -76,10 +76,4 @@ - - Successfully cloned repo 'TestGit' - - - - \ No newline at end of file From 0710ad7578295de993d89379d04ec365359ddddf Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Mon, 18 Feb 2019 23:04:12 +0100 Subject: [PATCH 063/160] =?UTF-8?q?refactor(init):=20ajoute=20le=20nouveau?= =?UTF-8?q?=20projet=20aux=20projets=20r=C3=A9cents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/providers/git.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 0c28238..3716f9b 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -59,6 +59,7 @@ export class GitService { gitPromise(PATHTOREPO).init() .then(() => { + this.setPath(PATHTOREPO); resolve(new ServiceResult(true, 'SUCCESS', 'INIT.SUCCESS')); }) .catch(() => { @@ -76,7 +77,6 @@ export class GitService { if (this.electronService.fs.existsSync(newPath)) { gitPromise(newPath).checkIsRepo() .then(isRepo => { - console.log(isRepo); if (isRepo) { this.path = newPath; this.repoName = this.electronService.path.basename(this.path); @@ -111,8 +111,8 @@ export class GitService { path: path }; for (let INDEX = 0; INDEX < this.recentProject.length; INDEX++) { - if (this.recentProject[INDEX].repo == PROJECT.repo - && this.recentProject[INDEX].path == PROJECT.path) { + if (this.recentProject[INDEX].repo === PROJECT.repo + && this.recentProject[INDEX].path === PROJECT.path) { this.recentProject.splice(INDEX, 1); INDEX--; } @@ -131,7 +131,7 @@ export class GitService { deleteProjetWithPath(path: any) { for (let INDEX = 0; INDEX < this.recentProject.length; INDEX++) { - if (this.recentProject[INDEX].path == path) { + if (this.recentProject[INDEX].path === path) { this.recentProject.splice(INDEX, 1); INDEX--; } From 4bd7efd41d00f092167df31004c724dde9a2bd27 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Mon, 18 Feb 2019 23:18:31 +0100 Subject: [PATCH 064/160] refactor(open): gestion du cas sans repo --- src/app/screens/home/home.component.html | 13 +++++++------ src/app/screens/home/home.component.scss | 12 ++++++++++++ src/app/screens/home/home.component.ts | 5 +++++ src/app/screens/toolbox/toolbox.component.ts | 3 ++- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 816d859..46dbdea 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -5,8 +5,11 @@ @@ -58,14 +61,12 @@
-
-
+
{{project.value.repo}}
-
-
+
{{project.value.path}}
diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 0f2aa3d..f9a9349 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -121,4 +121,16 @@ .gh-open-recentPath { font-size: $fs-small; color: $muted-white; +} + +.gh-project-not-opened { + visibility: hidden; +} + +.icon-times { + color: $muted-white; + + &:hover { + color: $white; + } } \ No newline at end of file diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 51fd1b4..ea9688a 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -150,6 +150,11 @@ export class HomeComponent implements OnInit, OnDestroy { } } + closeRepo() { + this.path = undefined; + this.repoName = undefined; + } + ngOnDestroy() { this.pathSubscription.unsubscribe(); this.repoNameSubscription.unsubscribe(); diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 68f16a4..071f5f1 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -119,7 +119,8 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-code-branch', isFab: false}, { icon: 'fa-cog', isFab: false}, {icon: 'fa-laptop', isFab: false}, - { icon: 'fa-search', isFab: false} + { icon: 'fa-search', isFab: false}, + { icon: 'fa-times', isFab: false} ]; this.dataDropdownExample = [ From 0ff57038da39042a0118a3f5ec0df681a5576165 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 01:15:07 +0100 Subject: [PATCH 065/160] =?UTF-8?q?feat(accordion):=20D=C3=A9but=20css=20d?= =?UTF-8?q?u=20composant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 6 +- .../accordion/accordion.component.html | 78 ++++++++++++++++--- .../accordion/accordion.component.scss | 27 ++++++- .../accordion/accordion.component.ts | 4 +- src/app/screens/home/home.component.html | 3 +- 5 files changed, 101 insertions(+), 17 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a6faba2..1cd0c58 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,11 +10,10 @@ import { HttpClientModule, HttpClient } from '@angular/common/http'; import { AppRoutingModule } from './app-routing.module'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgScrollbarModule } from 'ngx-scrollbar'; -import {MatTabsModule, MatIconModule } from '@angular/material'; +import {MatTabsModule, MatIconModule, MatExpansionModule, MatSortModule, MatFormFieldModule } from '@angular/material'; import { ContextMenuModule } from 'ngx-contextmenu'; import { ClipboardModule } from 'ngx-clipboard'; - // NG Translate import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; @@ -77,6 +76,9 @@ export function HttpLoaderFactory(http: HttpClient) { ReactiveFormsModule, MatIconModule, MatTabsModule, + MatSortModule, + MatExpansionModule, + MatFormFieldModule, NgScrollbarModule, NgbModule, ClipboardModule, diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html index 6bceb66..072cfd9 100644 --- a/src/app/components/accordion/accordion.component.html +++ b/src/app/components/accordion/accordion.component.html @@ -1,12 +1,72 @@ - - - - EMPLACEMENT PROVISOIR - - - + + + + + + + {{ title }} + - EMPLACEMENT PROVISOIR + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, + craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings + occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus + labore sustainable VHS. - + + \ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index db7a7c2..19a7baf 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -1,7 +1,26 @@ @import '../../../variables.scss'; -.gh-accordion { - position: fixed; - top: 50px; - background: $blue-grey; +// .gh-accordion { +// position: fixed; +// top: 70px; +// max-width: 50%; +// min-width: 20%; +// } + +/deep/ .card { + top: 80px; +} + +/deep/ .card-block { + max-width: 50%; + min-width: 20%; +} + +/deep/ .card-header { + background: $light-grey; + border-color: $muted-white; +} + +/deep/ .card-body { + background: $dark-grey; } \ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.ts b/src/app/components/accordion/accordion.component.ts index f292dd4..a8f2e43 100644 --- a/src/app/components/accordion/accordion.component.ts +++ b/src/app/components/accordion/accordion.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-accordion', @@ -7,6 +7,8 @@ import { Component, OnInit } from '@angular/core'; }) export class AccordionComponent implements OnInit { + @Input() title: String = 'test'; + constructor() { } ngOnInit() { diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 209dda3..f92f408 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,7 +41,8 @@
- + + From 42390b58b88243e19102d3345b05ce5cc4236e17 Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Tue, 19 Feb 2019 13:31:50 +0100 Subject: [PATCH 066/160] =?UTF-8?q?refactor(info-bar):=20Gestion=20de=20la?= =?UTF-8?q?=20visibilit=C3=A9=20+=20ajout=20=C3=A0=20la=20toolbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../info-bar/info-bar.component.html | 2 +- .../info-bar/info-bar.component.scss | 6 ++++- .../components/info-bar/info-bar.component.ts | 3 ++- .../screens/toolbox/toolbox.component.html | 24 +++++++++++++++++++ src/app/screens/toolbox/toolbox.component.ts | 9 +++++++ src/assets/i18n/en.json | 7 +++++- src/assets/i18n/fr.json | 7 +++++- 7 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/app/components/info-bar/info-bar.component.html b/src/app/components/info-bar/info-bar.component.html index 5994c35..10716d7 100644 --- a/src/app/components/info-bar/info-bar.component.html +++ b/src/app/components/info-bar/info-bar.component.html @@ -1,3 +1,3 @@ -
+
\ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.scss b/src/app/components/info-bar/info-bar.component.scss index 63b974a..1809edb 100644 --- a/src/app/components/info-bar/info-bar.component.scss +++ b/src/app/components/info-bar/info-bar.component.scss @@ -8,7 +8,11 @@ @include bg-color($dark-blue); @include wX(100%); min-height: 50px; - display: flex; align-items: center; justify-content: center; + display:none; + + &.visible { + display: flex; + } } \ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.ts b/src/app/components/info-bar/info-bar.component.ts index 5bf0c04..e50905b 100644 --- a/src/app/components/info-bar/info-bar.component.ts +++ b/src/app/components/info-bar/info-bar.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; @Component({ selector: 'app-info-bar', @@ -6,6 +6,7 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./info-bar.component.scss'] }) export class InfoBarComponent implements OnInit { + @Input() visible: Boolean = false; constructor() { } diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index b0fdedf..0aee608 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -353,6 +353,26 @@

{{ 'MODAL.WINDOW' | translate }}

+ + +
+
+

{{ 'INFOBAR.TITLE' | translate }}

+
+
+
+ +
+
+ +
+
+
+ + +

IconButtons

@@ -649,5 +669,9 @@

Dropdowns

+ + {{ 'INFOBAR.TITLE' | translate }} + + \ No newline at end of file diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 6f8852d..407bffe 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -25,6 +25,7 @@ export class ToolboxComponent implements OnInit { modalLoadingVisible: Boolean; modalInputValue: String; modalTabSelectedIndex: any; + infoBarVisible: Boolean; inputValueNumber: number; inputMinMaxValueNumber: number; max: number; @@ -224,6 +225,14 @@ export class ToolboxComponent implements OnInit { ); } + openInfoBar() { + this.infoBarVisible = true; + } + + closeInfoBar() { + this.infoBarVisible = false; + } + displayModalInputValue() { this.toastr.info(this.modalInputValue.toString()); } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index b85bbda..91332d1 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -38,6 +38,7 @@ "GITLAB": "This is GitLab" } }, + "CLOSE": "Close", "INFORMATION": "Information", "SUCCESS": "Success", "ERROR": "Error", @@ -84,5 +85,9 @@ "REPO_NOT_EXIST": "The repository no longer exist" }, "CLONE": "Clone", - "INIT": "Init" + "INIT": "Init", + "INFOBAR": { + "TITLE": "Information bar", + "OPEN": "Open the information bar" + } } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 3756804..1bdb5f3 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -38,6 +38,7 @@ "GITLAB": "Ceci est GitLab" } }, + "CLOSE": "Fermer", "INFORMATION": "Information", "SUCCESS": "Succès", "ERROR": "Erreur", @@ -84,5 +85,9 @@ "REPO_NOT_EXIST": "Ce répertoire n'existe plus" }, "CLONE": "Cloner", - "INIT": "Initialiser" + "INIT": "Initialiser", + "INFOBAR": { + "TITLE": "Barre d'informations", + "OPEN": "Ouvrir la barre d'informations" + } } \ No newline at end of file From 6ace7341675a90634cfea6001b7f3394055c7d0f Mon Sep 17 00:00:00 2001 From: nulji <76480julien@gmail.com> Date: Tue, 19 Feb 2019 13:37:06 +0100 Subject: [PATCH 067/160] refactor(info-bar): correctif dans les fichiers de langue --- src/assets/i18n/en.json | 10 +++++----- src/assets/i18n/fr.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 91332d1..8232ef9 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -61,6 +61,10 @@ "SECOND_CONTENT": "Second content", "THIRD_CONTENT": "Third content" }, + "INFOBAR": { + "TITLE": "Information bar", + "OPEN": "Open the information bar" + }, "CONTEXT_MENU": "Menu contextuel", "CLICK": { "RIGHT": "Right click", @@ -85,9 +89,5 @@ "REPO_NOT_EXIST": "The repository no longer exist" }, "CLONE": "Clone", - "INIT": "Init", - "INFOBAR": { - "TITLE": "Information bar", - "OPEN": "Open the information bar" - } + "INIT": "Init" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 1bdb5f3..1dbfc9a 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -61,6 +61,10 @@ "SECOND_CONTENT": "Deuxième contenu", "THIRD_CONTENT": "Troisième contenu" }, + "INFOBAR": { + "TITLE": "Barre d'informations", + "OPEN": "Ouvrir la barre d'informations" + }, "CONTEXT_MENU": "Menu contextuel", "CLICK": { "RIGHT": "Clic droit", @@ -85,9 +89,5 @@ "REPO_NOT_EXIST": "Ce répertoire n'existe plus" }, "CLONE": "Cloner", - "INIT": "Initialiser", - "INFOBAR": { - "TITLE": "Barre d'informations", - "OPEN": "Ouvrir la barre d'informations" - } + "INIT": "Initialiser" } \ No newline at end of file From a503e1e2af0f453affc70fca5886f1b719cd9005 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 15:38:31 +0100 Subject: [PATCH 068/160] feat(accordion): Fin css du composant --- .../accordion/accordion.component.html | 50 +++++-------------- .../accordion/accordion.component.scss | 39 +++++++++++---- .../accordion/accordion.component.ts | 7 ++- src/app/screens/home/home.component.html | 4 +- src/app/screens/toolbox/toolbox.component.ts | 2 + src/assets/i18n/en.json | 1 + src/assets/i18n/fr.json | 1 + 7 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html index 072cfd9..ed88346 100644 --- a/src/app/components/accordion/accordion.component.html +++ b/src/app/components/accordion/accordion.component.html @@ -32,41 +32,15 @@ --> - - - - {{ title }} - - - Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia - aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, - sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, - craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings - occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus - labore sustainable VHS. - - - - \ No newline at end of file + + + + {{ title }} + + +
    +
  • branche test
  • +
+
+
+
\ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 19a7baf..33dcdd6 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -1,26 +1,45 @@ @import '../../../variables.scss'; -// .gh-accordion { -// position: fixed; -// top: 70px; -// max-width: 50%; -// min-width: 20%; -// } +.gh-accordion { + & i { + float: left; + padding: 5px; + font-size: 15px; + } +} /deep/ .card { top: 80px; + @include wX(10cm); + border: $light-grey; + background: $light-grey; } /deep/ .card-block { - max-width: 50%; - min-width: 20%; + @include wX(10cm); + max-width: 100%; + min-width: 80%; } /deep/ .card-header { + @include wX(10cm); + padding: 0; background: $light-grey; - border-color: $muted-white; + border: 1px solid $dark-grey; } /deep/ .card-body { + @include wX(10cm); background: $dark-grey; -} \ No newline at end of file + font-size: 15px; +} + +/deep/ .btn-link { + font-size: 15px; + color: $white; + + &:hover { + text-decoration: none; + color: $white; + } +} diff --git a/src/app/components/accordion/accordion.component.ts b/src/app/components/accordion/accordion.component.ts index a8f2e43..94c654e 100644 --- a/src/app/components/accordion/accordion.component.ts +++ b/src/app/components/accordion/accordion.component.ts @@ -7,7 +7,12 @@ import { Component, OnInit, Input } from '@angular/core'; }) export class AccordionComponent implements OnInit { - @Input() title: String = 'test'; + @Input() title: String; + @Input() disabled: Boolean = false; + @Input() icon: { + name: String, + isFab: Boolean + }; constructor() { } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index f92f408..5c9e41a 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,8 +41,8 @@
- - + + diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index a89b756..80b6fb4 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -116,6 +116,8 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-download', isFab: false }, { icon: 'fa-sign-out-alt', isFab: false}, { icon: 'fa-code-branch', isFab: false}, + { icon: 'fa-laptop', isFab: false}, + { icon: 'fa-cloud', isFab: false}, { icon: 'fa-cog', isFab: false}, { icon: 'fa-search', isFab: false} ]; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 97e8e11..1d051eb 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -73,6 +73,7 @@ "EDITOR": "Editor", "UI": "User Interface", "REPOSITORY_MANAGEMENT": "Repository management", + "REMOTE": "REMOTE", "OPEN": "Open", "CLONE": "Clone", "INIT": "Init" diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index fabae1d..80b77b8 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -73,6 +73,7 @@ "EDITOR": "Editeur", "UI": "Interface Utilisateur", "REPOSITORY_MANAGEMENT": "Gestion du répertoire", + "REMOTE": "DISTANT", "OPEN": "Ouvrir", "CLONE": "Cloner", "INIT": "Initialiser" From 0b6a1546e71e8035c438c54d497ee31b41d9bd3c Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 15:53:36 +0100 Subject: [PATCH 069/160] feat(accordion): Petites modifications --- .../accordion/accordion.component.html | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html index ed88346..076630f 100644 --- a/src/app/components/accordion/accordion.component.html +++ b/src/app/components/accordion/accordion.component.html @@ -1,38 +1,4 @@ - - - - + {{ title }} From 17403fd756b7bf18606532ece7f996b1e6d6ec6a Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 17:11:32 +0100 Subject: [PATCH 070/160] feat(pref-lang): Gestion du localStorage --- src/app/app.component.ts | 11 ++++++----- src/app/providers/language-preferences.service.ts | 4 ++-- .../screens/preferences/preferences.component.html | 2 +- src/app/screens/preferences/preferences.component.ts | 6 +++++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a1c9fe5..25c96ea 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,11 +16,12 @@ export class AppComponent { // Ici on doit chercher depuis le local storage (si vide prendre fr du coup) // this.translate.setDefaultLang(this.translate.getLangs()[0]); // localStorage.setItem('en', 'en'); - if (this.translate.getDefaultLang() === 'en') { - this.translate.setDefaultLang('en'); - } else { - this.translate.setDefaultLang('fr'); - } + if (localStorage.getItem('lang') === null) { + this.translate.setDefaultLang('fr'); + } else { + this.translate.setDefaultLang('en'); + } + console.log(localStorage.length); console.log('AppConfig', AppConfig); diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 380a219..c1a4ea6 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -6,7 +6,6 @@ import { TranslateService } from '@ngx-translate/core'; export class LanguagePreferencesService { languages: any[]; preferences: string; - index: number; preferencesSubject = new Subject(); constructor(private translate: TranslateService) { @@ -33,9 +32,10 @@ export class LanguagePreferencesService { setLanguage(newLanguage) { this.preferences = this.translate.instant(newLanguage); if (this.preferences === this.translate.instant('FRENCH')) { - localStorage.clear; + localStorage.removeItem('lang'); this.translate.setDefaultLang('fr'); } else { + localStorage.setItem('lang', 'en'); this.translate.setDefaultLang('en'); } this.emitPreferencesSubject(); diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 8d1f833..c329c2e 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -23,7 +23,7 @@ [(value)]="dropdownLanguageValue">
- +
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index 974ad07..9df056c 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -27,7 +27,6 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.preferencesTabSelectedIndex = 1; this.dataDropdownLanguage = this.langPrefService.getLanguages(); - console.log(this.dataDropdownLanguage); // 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 @@ -57,4 +56,9 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.languageSubscription.unsubscribe(); } + // Fonction qui regroupe toutes les fonctions applicables aux préférences + saveChangedPreferences() { + this.switchLanguage(); + } + } From 21094262084d3ec22ee74a50622f3738524938c1 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 22:51:59 +0100 Subject: [PATCH 071/160] feat(pref-lang): Modification localStorage + loader --- src/app/app.component.ts | 2 -- src/app/app.module.ts | 2 +- .../providers/language-preferences.service.ts | 23 +++++++++------ .../preferences/preferences.component.html | 4 +-- .../preferences/preferences.component.ts | 29 +++++++++++++------ 5 files changed, 37 insertions(+), 23 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 25c96ea..275ab58 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -21,8 +21,6 @@ export class AppComponent { } else { this.translate.setDefaultLang('en'); } - console.log(localStorage.length); - console.log('AppConfig', AppConfig); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3d51749..aefc921 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -102,7 +102,7 @@ export function HttpLoaderFactory(http: HttpClient) { useBootstrap4: true }) ], - providers: [ElectronService, GitService, EditorPreferencesService], + providers: [ElectronService, GitService, EditorPreferencesService, LanguagePreferencesService], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index c1a4ea6..899d43f 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -1,6 +1,7 @@ import { Injectable, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; +import { ServiceResult } from '../models/ServiceResult'; @Injectable() export class LanguagePreferencesService { @@ -30,15 +31,19 @@ export class LanguagePreferencesService { } setLanguage(newLanguage) { - this.preferences = this.translate.instant(newLanguage); - if (this.preferences === this.translate.instant('FRENCH')) { - localStorage.removeItem('lang'); - this.translate.setDefaultLang('fr'); - } else { - localStorage.setItem('lang', 'en'); - this.translate.setDefaultLang('en'); - } - this.emitPreferencesSubject(); + return new Promise((resolve) => { + this.preferences = newLanguage; + if (this.preferences === this.languages[0].key) { + localStorage.removeItem('lang'); + this.translate.setDefaultLang('fr'); + } else { + localStorage.setItem('lang', 'en'); + this.translate.setDefaultLang('en'); + } + resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), + this.translate.instant('CHANGE_PREFERENCE'))); + this.emitPreferencesSubject(); + }); } getLanguages() { diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index c329c2e..5781a3f 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -1,4 +1,4 @@ - + @@ -23,7 +23,7 @@ [(value)]="dropdownLanguageValue">
- +
diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index 9df056c..ccbbf7d 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -1,8 +1,9 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnInit, OnDestroy, Input } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { LanguagePreferencesService } from '../../providers/language-preferences.service'; +import { ToastrService } from 'ngx-toastr'; @Component({ selector: 'app-preferences', @@ -11,6 +12,8 @@ import { LanguagePreferencesService } from '../../providers/language-preferences }) export class PreferencesComponent implements OnInit, OnDestroy { + @Input() loading: Boolean = false; + preferencesVisible: Boolean; preferencesTabSelectedIndex: any; dropdownLanguageValue: string; @@ -19,7 +22,7 @@ export class PreferencesComponent implements OnInit, OnDestroy { languageSubscription: Subscription; constructor(public router: Router, private translate: TranslateService, - private langPrefService: LanguagePreferencesService) { + private langPrefService: LanguagePreferencesService, private toastr: ToastrService) { } ngOnInit() { @@ -47,18 +50,26 @@ export class PreferencesComponent implements OnInit, OnDestroy { } } - switchLanguage() { - // console.log(language); - this.langPrefService.setLanguage(this.dropdownLanguageValue); + // switchLanguage() { + // this.langPrefService.setLanguage(this.dropdownLanguageValue); + // } + + // Fonction qui regroupe toutes les fonctions applicables aux préférences + saveChangedPreferences() { + this.loading = true; + this.langPrefService.setLanguage(this.dropdownLanguageValue) + .then((res) => { + this.loading = false; + this.toastr.info(res.message, res.title); + }); + // this.switchLanguage(); + this.loading = false; + this.router.navigate(['home']); } ngOnDestroy() { this.languageSubscription.unsubscribe(); } - // Fonction qui regroupe toutes les fonctions applicables aux préférences - saveChangedPreferences() { - this.switchLanguage(); - } } From 045f3a9efe2b7179aafb99506ea3aac22b437a0f Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Tue, 19 Feb 2019 23:40:17 +0100 Subject: [PATCH 072/160] =?UTF-8?q?feat(accordion):=20D=C3=A9but=20inserti?= =?UTF-8?q?on=20dans=20la=20toolbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accordion/accordion.component.scss | 6 +++--- src/app/screens/home/home.component.html | 3 --- .../screens/toolbox/toolbox.component.html | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 33dcdd6..ca215d8 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -9,7 +9,6 @@ } /deep/ .card { - top: 80px; @include wX(10cm); border: $light-grey; background: $light-grey; @@ -17,8 +16,9 @@ /deep/ .card-block { @include wX(10cm); - max-width: 100%; - min-width: 80%; + // max-width: 100%; + // min-width: 80%; + margin-bottom: 20px; } /deep/ .card-header { diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 5c9e41a..fa449b3 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -41,9 +41,6 @@ - - - diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index b0fdedf..5552fca 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -595,6 +595,25 @@

Dropdowns

+
+
+
+

Accordion

+
+
+ + +
+
+ +
+
+ +
+
+
From e8b2796ec7fcab60b749735bd3ddcdc9d6022d41 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 00:26:57 +0100 Subject: [PATCH 073/160] feat(pref-lang): Quelques modifications dans pref.service et pref.ts --- .../providers/language-preferences.service.ts | 25 +++++++++---------- .../preferences/preferences.component.ts | 16 +++++------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 899d43f..39ffdfd 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -31,19 +31,18 @@ export class LanguagePreferencesService { } setLanguage(newLanguage) { - return new Promise((resolve) => { - this.preferences = newLanguage; - if (this.preferences === this.languages[0].key) { - localStorage.removeItem('lang'); - this.translate.setDefaultLang('fr'); - } else { - localStorage.setItem('lang', 'en'); - this.translate.setDefaultLang('en'); - } - resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), - this.translate.instant('CHANGE_PREFERENCE'))); - this.emitPreferencesSubject(); - }); + localStorage.setItem('lang', newLanguage); + this.translate.setDefaultLang(newLanguage); + + // this.preferences = newLanguage; + // if (this.preferences === this.languages[0].key) { + // localStorage.removeItem('lang'); + // this.translate.setDefaultLang('fr'); + // } else { + // localStorage.setItem('lang', 'en'); + // this.translate.setDefaultLang('en'); + // } + this.emitPreferencesSubject(); } getLanguages() { diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index ccbbf7d..3723772 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -37,7 +37,6 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.languageSubscription = this.langPrefService.preferencesSubject.subscribe( (preference) => { - console.log(preference); this.dropdownLanguageValue = preference; } ); @@ -50,20 +49,17 @@ export class PreferencesComponent implements OnInit, OnDestroy { } } - // switchLanguage() { - // this.langPrefService.setLanguage(this.dropdownLanguageValue); - // } + switchLanguage() { + this.langPrefService.setLanguage(this.dropdownLanguageValue); + } // Fonction qui regroupe toutes les fonctions applicables aux préférences saveChangedPreferences() { this.loading = true; - this.langPrefService.setLanguage(this.dropdownLanguageValue) - .then((res) => { - this.loading = false; - this.toastr.info(res.message, res.title); - }); - // this.switchLanguage(); + this.switchLanguage(); this.loading = false; + this.toastr.info(this.translate.instant('SUCCESS'), + this.translate.instant('CHANGE_PREFERENCE')); this.router.navigate(['home']); } From 4a250d771acdbb192ea2bc42294673cdc393fc69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 20 Feb 2019 00:53:02 +0100 Subject: [PATCH 074/160] =?UTF-8?q?refactor(clone):=20avanc=C3=A9=20dans?= =?UTF-8?q?=20le=20clone=20+=20modif=20toolbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- .../info-bar/info-bar.component.html | 2 +- .../info-bar/info-bar.component.scss | 6 +- .../components/info-bar/info-bar.component.ts | 14 ++- src/app/components/input/input.component.html | 2 +- src/app/components/input/input.component.ts | 1 + src/app/providers/electron.service.ts | 6 +- src/app/screens/home/home.component.html | 83 ++++++++------ src/app/screens/home/home.component.scss | 2 +- src/app/screens/home/home.component.ts | 30 ++++- .../screens/toolbox/toolbox.component.html | 22 +++- src/app/screens/toolbox/toolbox.component.ts | 2 + src/assets/i18n/en.json | 10 +- src/assets/i18n/fr.json | 10 +- yarn.lock | 103 ++---------------- 15 files changed, 141 insertions(+), 156 deletions(-) diff --git a/package.json b/package.json index 460e317..bfd3967 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "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", @@ -66,7 +65,8 @@ "rxjs-tslint": "^0.1.6", "simple-git": "^1.107.0", "sinon": "^7.2.3", - "spectron": "^5.0.0" + "spectron": "^5.0.0", + "valid-url": "^1.0.9" }, "devDependencies": { "@angular-devkit/build-angular": "^0.11.4", diff --git a/src/app/components/info-bar/info-bar.component.html b/src/app/components/info-bar/info-bar.component.html index 10716d7..9bd0913 100644 --- a/src/app/components/info-bar/info-bar.component.html +++ b/src/app/components/info-bar/info-bar.component.html @@ -1,3 +1,3 @@ -
+
\ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.scss b/src/app/components/info-bar/info-bar.component.scss index 1809edb..6a63b61 100644 --- a/src/app/components/info-bar/info-bar.component.scss +++ b/src/app/components/info-bar/info-bar.component.scss @@ -10,9 +10,5 @@ min-height: 50px; align-items: center; justify-content: center; - display:none; - - &.visible { - display: flex; - } + display: flex; } \ No newline at end of file diff --git a/src/app/components/info-bar/info-bar.component.ts b/src/app/components/info-bar/info-bar.component.ts index e50905b..375025b 100644 --- a/src/app/components/info-bar/info-bar.component.ts +++ b/src/app/components/info-bar/info-bar.component.ts @@ -1,9 +1,21 @@ import { Component, OnInit, Input } from '@angular/core'; +import { trigger, style, transition, animate } from '@angular/animations'; @Component({ selector: 'app-info-bar', + animations: [ + trigger('slideInOut', [ + transition(':enter', [ + style({transform: 'translateY(-100%)'}), + animate('200ms ease-in', style({transform: 'translateY(0%)'})) + ]), + transition(':leave', [ + animate('200ms ease-in', style({transform: 'translateY(-100%)'})) + ]) + ]) + ], templateUrl: './info-bar.component.html', - styleUrls: ['./info-bar.component.scss'] + styleUrls: ['./info-bar.component.scss'], }) export class InfoBarComponent implements OnInit { @Input() visible: Boolean = false; diff --git a/src/app/components/input/input.component.html b/src/app/components/input/input.component.html index 34445ee..54a9004 100644 --- a/src/app/components/input/input.component.html +++ b/src/app/components/input/input.component.html @@ -1,2 +1,2 @@ - \ No newline at end of file diff --git a/src/app/components/input/input.component.ts b/src/app/components/input/input.component.ts index d144f29..61b5b06 100644 --- a/src/app/components/input/input.component.ts +++ b/src/app/components/input/input.component.ts @@ -12,6 +12,7 @@ export class InputComponent implements OnInit { @Input() placeholder: String; @Input() readonly: Boolean; @Input() disabled: Boolean; + @Input() type: String = 'text'; currentValue: String; @Output() diff --git a/src/app/providers/electron.service.ts b/src/app/providers/electron.service.ts index 0c41f5a..8b72476 100644 --- a/src/app/providers/electron.service.ts +++ b/src/app/providers/electron.service.ts @@ -7,6 +7,7 @@ import * as childProcess from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; import * as process from 'process'; +import * as url from 'url'; @Injectable() export class ElectronService { @@ -19,7 +20,7 @@ export class ElectronService { fs: typeof fs; path: typeof path; shell: typeof shell; - keytar: any; + url: typeof url; constructor() { // Conditional imports @@ -33,8 +34,7 @@ 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); + this.url = window.require('url'); } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index e398d52..134c116 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -1,44 +1,46 @@ -
- -
- -
- -
-
- - -
-
- - + +
+ + -
- - + +
+
+ + +
+
+ + +
+
+ + +
-
- -
-
-
- + +
+
+
+ +
+ + +
- - -
-
+ @@ -98,7 +100,7 @@
- +
@@ -146,4 +148,13 @@ - \ No newline at end of file + + + + + {{ 'LOG_TO_CONTINUE' | translate }} + + + + + diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 0f2aa3d..54c119b 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -65,7 +65,7 @@ top: 50%; margin-top: -50px; left: 100%; - z-index: 2; + z-index: 1; } &::before { diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 5c865ed..e98e4c7 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -7,6 +7,8 @@ import { initNgModule } from '@angular/core/src/view/ng_module'; import { Subscription } from 'rxjs'; import { ServiceResult } from '../../models/ServiceResult'; import { TranslateService } from '@ngx-translate/core'; +import * as GitUrlParse from 'git-url-parse'; + @Component({ selector: 'app-home', @@ -28,8 +30,10 @@ export class HomeComponent implements OnInit, OnDestroy { repoNameSubscription: Subscription; recentProject: any[]; recentProjectSubscription: Subscription; - - constructor(public router: Router, private toastr: ToastrService) { } + credInfoBarVisible: boolean; + username: string; + password: string; + homeLoading: boolean; constructor(public router: Router, private toastr: ToastrService, private electronService: ElectronService, private gitService: GitService, @@ -91,12 +95,22 @@ export class HomeComponent implements OnInit, OnDestroy { } } - clone() { + cloneSubmit() { if (this.electronService.fs.existsSync(this.cloneFolder.toString())) { + this.projectModalVisible = false; + this.credInfoBarVisible = true; } else { - this.toastr.error(this.translate.instant('ERROR'), this.translate.instant('NO_FOLDER')); + this.toastr.error(this.translateService.instant('ERROR'), this.translateService.instant('NO_FOLDER')); } } + + clone() { + console.log(this.username, this.password); + this.credInfoBarVisible = false; + this.homeLoading = true; + // lancer le loader de home + appel au service + } + initBrowse() { const INITPATH = this.electronService.browse(); if (INITPATH !== null) { @@ -166,6 +180,14 @@ export class HomeComponent implements OnInit, OnDestroy { } } + closeCredInfoBar() { + this.credInfoBarVisible = false; + this.username = ''; + this.password = ''; + this.cloneUrl = ''; + this.cloneFolder = ''; + } + ngOnDestroy() { this.pathSubscription.unsubscribe(); this.repoNameSubscription.unsubscribe(); diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index 0aee608..bd52b5a 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -273,6 +273,26 @@

Input

'>
+
+ +
+ +
+
+ +
+
+
+ +
@@ -365,7 +385,7 @@

{{ 'INFOBAR.TITLE' | translate }}

diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 0cb2dce..be2ef6d 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -39,6 +39,7 @@ export class ToolboxComponent implements OnInit { value: String = 'value'; dropdownValue: String; dropdownValueTwo: String; + passwordInput: string; constructor(private electronService: ElectronService, @@ -50,6 +51,7 @@ export class ToolboxComponent implements OnInit { this.inputEmptyValue = ''; this.modalTabSelectedIndex = 1; + this.passwordInput = 'toto'; this.inputValueNumber = 10; this.inputMinMaxValueNumber = 0; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index ab4fcfc..eb1fb60 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -28,7 +28,6 @@ "URL": "URL", "TITLE": "Clone" }, - "BROWSE": "Browse", "BUTTON": { "PRIMARY": "Primary button", "SUCCESS": "Success button", @@ -48,7 +47,6 @@ "NAME": "Nom", "INFORMATION": "Information", "SUCCESS": "Success", - "ERROR": "Error", "DANGER": "Danger", "ERROR": "Error", "PATH_NOT_FOUND": "This path doesn't exist", @@ -97,7 +95,6 @@ "NOT_GIT_REPO": "This is not a git repository", "REPO_NOT_EXIST": "The repository no longer exist" }, - "CLONE": "Clone", "INIT": { "TITLE": "Init", "TAB_TITLE": "Initialize a Repo", @@ -107,5 +104,10 @@ }, "FULL_PATH": "Full path", "BROWSE": "Browse", - "CREATE_REPOSITORY": "Create Repository" + "CREATE_REPOSITORY": "Create Repository", + "LOG_IN": "Log in", + "CANCEL": "Cancel", + "USERNAME": "USERNAME", + "PASSWORD": "PASSWORD", + "LOG_TO_CONTINUE": "Please log to continue:" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 926e65f..71b3000 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -28,7 +28,6 @@ "URL": "URL", "TITLE": "Cloner" }, - "BROWSE": "Parcourir", "BUTTON": { "PRIMARY": "Bouton primaire", "SUCCESS": "Bouton succès", @@ -48,7 +47,6 @@ "NAME": "Nom", "INFORMATION": "Information", "SUCCESS": "Succès", - "ERROR": "Erreur", "DANGER": "Danger", "ERROR": "Erreur", "PATH_NOT_FOUND": "Ce chemin n'existe pas", @@ -97,7 +95,6 @@ "NOT_GIT_REPO": "Ce répertoire n'est pas un répertoire git", "REPO_NOT_EXIST": "Ce répertoire n'existe plus" }, - "CLONE": "Cloner", "INIT": { "TITLE": "Initialiser", "TAB_TITLE": "Initialiser un dépôt", @@ -107,5 +104,10 @@ }, "FULL_PATH": "Chemin complet", "BROWSE": "Parcourir", - "CREATE_REPOSITORY": "Créer le répertoire" + "CREATE_REPOSITORY": "Créer le répertoire", + "LOG_IN": "S'identifier", + "CANCEL": "Annuler", + "USERNAME": "Nom d'utilisateur", + "PASSWORD": "Mot de passe", + "LOG_TO_CONTINUE": "Veuillez vous identifier pour continuer :" } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d3dd28f..b72ba6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -292,28 +292,6 @@ 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" @@ -2482,13 +2460,6 @@ 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" @@ -2637,7 +2608,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.3: +detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= @@ -3231,11 +3202,6 @@ 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" @@ -3824,11 +3790,6 @@ 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" @@ -5223,14 +5184,6 @@ 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" @@ -5814,11 +5767,6 @@ 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" @@ -6018,7 +5966,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.12.1, nan@^2.10.0, nan@^2.9.2: +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== @@ -6040,11 +5988,6 @@ 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" @@ -6128,13 +6071,6 @@ 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" @@ -6263,11 +6199,6 @@ 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" @@ -6531,7 +6462,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.1, 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.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== @@ -6720,7 +6651,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.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= @@ -8315,20 +8246,6 @@ 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" @@ -9031,7 +8948,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.13.0, tar-fs@^1.15.3: +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== @@ -9605,6 +9522,11 @@ uuid@~3.1.0: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== +valid-url@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" + integrity sha1-HBRHm0DxOXp1eC8RXkCGRHQzogA= + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" @@ -9908,11 +9830,6 @@ 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 4ad6e3ce68c7adebe2b97251a7add686c303e33f Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 01:51:03 +0100 Subject: [PATCH 075/160] =?UTF-8?q?feat(pref-lang):=20Tentative=20r=C3=A9g?= =?UTF-8?q?lage=20affichage=20langue=20dans=20dropdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.ts | 6 +++--- src/app/providers/language-preferences.service.ts | 10 +++++----- src/app/screens/preferences/preferences.component.ts | 7 ++++++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 275ab58..b590bbe 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -16,10 +16,10 @@ export class AppComponent { // Ici on doit chercher depuis le local storage (si vide prendre fr du coup) // this.translate.setDefaultLang(this.translate.getLangs()[0]); // localStorage.setItem('en', 'en'); - if (localStorage.getItem('lang') === null) { - this.translate.setDefaultLang('fr'); - } else { + if (localStorage.getItem('lang') === 'en') { this.translate.setDefaultLang('en'); + } else { + this.translate.setDefaultLang('fr'); } console.log('AppConfig', AppConfig); diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 39ffdfd..1b7861f 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -16,8 +16,8 @@ export class LanguagePreferencesService { { key: 'en', value: this.translate.instant('ENGLISH') }, ]; - // Ici ca sera pas forcement ça en fonction du local storage encore uen fois - if (this.translate.getDefaultLang() === 'fr') { + // // Ici ca sera pas forcement ça en fonction du local storage encore uen fois + if (localStorage.getItem('lang') === 'fr') { this.preferences = this.languages[0].value; } else { this.preferences = this.languages[1].value; @@ -45,8 +45,8 @@ export class LanguagePreferencesService { this.emitPreferencesSubject(); } - getLanguages() { - return this.languages; - } + // getLanguages() { + // return this.languages; + // } } diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index 3723772..f834de2 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -29,7 +29,11 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.preferencesVisible = true; this.preferencesTabSelectedIndex = 1; - this.dataDropdownLanguage = this.langPrefService.getLanguages(); + // this.dataDropdownLanguage = this.langPrefService.getLanguages(); + this.dataDropdownLanguage = [ + { key: 'fr', value: this.translate.instant('FRENCH') }, + { key: 'en', value: this.translate.instant('ENGLISH') }, + ]; // 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 @@ -38,6 +42,7 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.languageSubscription = this.langPrefService.preferencesSubject.subscribe( (preference) => { this.dropdownLanguageValue = preference; + this.langPrefService.preferences = preference; } ); this.langPrefService.emitPreferencesSubject(); From e99bb34b8df6eb1e6a239c8ae00a1e97073024b1 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 02:32:58 +0100 Subject: [PATCH 076/160] feat(accordion): Fin insertion du composant accordion dans toolbox --- .../accordion/accordion.component.scss | 17 +++++------ .../screens/toolbox/toolbox.component.html | 28 +++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index ca215d8..3c16e58 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -9,27 +9,25 @@ } /deep/ .card { - @include wX(10cm); + @include wX(9cm); border: $light-grey; background: $light-grey; + margin-bottom: 2cm; } /deep/ .card-block { - @include wX(10cm); - // max-width: 100%; - // min-width: 80%; - margin-bottom: 20px; + @include wX(9cm); } /deep/ .card-header { - @include wX(10cm); + @include wX(9cm); padding: 0; background: $light-grey; border: 1px solid $dark-grey; } /deep/ .card-body { - @include wX(10cm); + @include wX(9cm); background: $dark-grey; font-size: 15px; } @@ -37,8 +35,11 @@ /deep/ .btn-link { font-size: 15px; color: $white; + @include wX(100%); + text-decoration: none; + text-align: left; - &:hover { + &:hover, &:focus { text-decoration: none; color: $white; } diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index 5552fca..5d43522 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -600,18 +600,22 @@

Dropdowns

Accordion

-
- - -
-
- -
-
- -
+
+
+ +
+
+ +
+
+ +
+
+ +
+
From dd243027b4a507a0e9dc5b83af9296f66f672d82 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 12:36:32 +0100 Subject: [PATCH 077/160] feat(pref-lang): Quelques modifications --- .../providers/language-preferences.service.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 1b7861f..433571c 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -11,18 +11,18 @@ export class LanguagePreferencesService { constructor(private translate: TranslateService) { - this.languages = [ - { key: 'fr', value: this.translate.instant('FRENCH') }, - { key: 'en', value: this.translate.instant('ENGLISH') }, - ]; + // this.languages = [ + // { key: 'fr', value: this.translate.instant('FRENCH') }, + // { key: 'en', value: this.translate.instant('ENGLISH') }, + // ]; // // Ici ca sera pas forcement ça en fonction du local storage encore uen fois - if (localStorage.getItem('lang') === 'fr') { - this.preferences = this.languages[0].value; - } else { - this.preferences = this.languages[1].value; - } - + // if (localStorage.getItem('lang') === 'fr') { + // this.preferences = this.languages[0].value; + // } else { + // this.preferences = this.languages[1].value; + // } + this.preferences = localStorage.getItem('lang'); this.emitPreferencesSubject(); } @@ -33,7 +33,7 @@ export class LanguagePreferencesService { setLanguage(newLanguage) { localStorage.setItem('lang', newLanguage); this.translate.setDefaultLang(newLanguage); - + this.preferences = newLanguage; // this.preferences = newLanguage; // if (this.preferences === this.languages[0].key) { // localStorage.removeItem('lang'); From 30b15c2f05f822a7aa8d9c8087143d0cf9fe4670 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 12:50:50 +0100 Subject: [PATCH 078/160] feat(pref-lang): Retrait des commentaires inutiles --- src/app/app.component.ts | 4 +--- .../providers/language-preferences.service.ts | 19 ------------------- .../preferences/preferences.component.ts | 5 ----- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index b590bbe..bdcf65d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,9 +13,7 @@ export class AppComponent { private translate: TranslateService) { this.translate.addLangs(['fr', 'en']); - // Ici on doit chercher depuis le local storage (si vide prendre fr du coup) - // this.translate.setDefaultLang(this.translate.getLangs()[0]); - // localStorage.setItem('en', 'en'); + if (localStorage.getItem('lang') === 'en') { this.translate.setDefaultLang('en'); } else { diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index 433571c..e0f5423 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -11,17 +11,6 @@ export class LanguagePreferencesService { constructor(private translate: TranslateService) { - // this.languages = [ - // { key: 'fr', value: this.translate.instant('FRENCH') }, - // { key: 'en', value: this.translate.instant('ENGLISH') }, - // ]; - - // // Ici ca sera pas forcement ça en fonction du local storage encore uen fois - // if (localStorage.getItem('lang') === 'fr') { - // this.preferences = this.languages[0].value; - // } else { - // this.preferences = this.languages[1].value; - // } this.preferences = localStorage.getItem('lang'); this.emitPreferencesSubject(); } @@ -34,14 +23,6 @@ export class LanguagePreferencesService { localStorage.setItem('lang', newLanguage); this.translate.setDefaultLang(newLanguage); this.preferences = newLanguage; - // this.preferences = newLanguage; - // if (this.preferences === this.languages[0].key) { - // localStorage.removeItem('lang'); - // this.translate.setDefaultLang('fr'); - // } else { - // localStorage.setItem('lang', 'en'); - // this.translate.setDefaultLang('en'); - // } this.emitPreferencesSubject(); } diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index f834de2..c260815 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -29,14 +29,11 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.preferencesVisible = true; this.preferencesTabSelectedIndex = 1; - // this.dataDropdownLanguage = this.langPrefService.getLanguages(); this.dataDropdownLanguage = [ { key: 'fr', value: this.translate.instant('FRENCH') }, { key: 'en', value: this.translate.instant('ENGLISH') }, ]; - // 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(); // renvoie 'fr' ou 'en' this.languageSubscription = this.langPrefService.preferencesSubject.subscribe( @@ -71,6 +68,4 @@ export class PreferencesComponent implements OnInit, OnDestroy { ngOnDestroy() { this.languageSubscription.unsubscribe(); } - - } From b1f8cecc944a8b6dbfe01998d417a069bbe1c300 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 14:58:30 +0100 Subject: [PATCH 079/160] feat(pref-lang): Affichage de la langue courante + retrait commentaires --- src/app/providers/language-preferences.service.ts | 6 ------ src/app/screens/preferences/preferences.component.html | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index e0f5423..f29f636 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -1,7 +1,6 @@ import { Injectable, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; -import { ServiceResult } from '../models/ServiceResult'; @Injectable() export class LanguagePreferencesService { @@ -25,9 +24,4 @@ export class LanguagePreferencesService { this.preferences = newLanguage; this.emitPreferencesSubject(); } - - // getLanguages() { - // return this.languages; - // } - } diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 5781a3f..78d31e8 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -20,7 +20,7 @@
+ [(value)]="dropdownLanguageValue" [required]="true">
From b77f0fe66d2ca0e2bbbfd56c6c804b155b620ca5 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 18:07:14 +0100 Subject: [PATCH 080/160] maintain(not-opened): page accueil sans repo --- src/app/screens/home/home.component.html | 33 ++++++++++++++++++------ src/app/screens/home/home.component.scss | 30 +++++++++++++++++++++ src/app/screens/home/home.component.ts | 4 ++- 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 46dbdea..0bfd38f 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -5,27 +5,27 @@
-
-
-
@@ -34,14 +34,31 @@
- +
- + +
+
+
+
+
{{ 'OPEN.REPO' | translate }}
+
+
+
+
{{ 'INIT.TAB_TITLE' | translate }}
+
+
+
+
{{ 'CLONE' | translate }}
+
+
+
+
@@ -59,7 +76,7 @@ {{ 'OPEN.OPENED' | translate }}
+ [class.gh-open-first]="isFirst && repoName" class="col-md-12 pt-1 pb-1 gh-open-recentProject">
{{project.value.repo}} diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index f9a9349..a60de1d 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -33,6 +33,31 @@ } } +.gh-main-panel { + @include wX-hX(100%, 100%); + position: fixed; + color: $muted-white; + font-size: $fs-large; + + &-not-opened { + top: 40%; + position: relative; + + &-button { + border-style: solid; + border-color: $light-grey; + border-width: 1px; + padding: 10px 20px; + + &:hover { + @include bg-color($light-grey); + cursor: pointer; + } + } + } + +} + .gh-breadcrumbs { list-style: none; overflow: hidden; @@ -133,4 +158,9 @@ &:hover { color: $white; } +} + +.disabled-search { + cursor: not-allowed; + color: $muted-white } \ No newline at end of file diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index ea9688a..f0bc2a7 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -78,7 +78,9 @@ export class HomeComponent implements OnInit, OnDestroy { } displaySearchInputValue() { - this.toastr.info(this.searchInputValue.toString()); + if (this.repoName) { + this.toastr.info(this.searchInputValue.toString()); + } } initBrowse() { From 5e3205c6afb42b96df4f3971fb4d2a870669f609 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 18:13:30 +0100 Subject: [PATCH 081/160] feat(modal): ouvrir un onglet precis --- src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 0bfd38f..4a0c220 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -62,7 +62,7 @@ - + diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index f0bc2a7..22be38a 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -14,6 +14,7 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit, OnDestroy { + projectModalTabSelectedIndex: any; projectModalVisible: Boolean; searchInputValue: string; initName: string; From 62624be8c6a708ef17f949bd9cb5a17e05eceddc Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 18:15:16 +0100 Subject: [PATCH 082/160] feat(accordion): Modification du css --- .../accordion/accordion.component.scss | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 3c16e58..2724843 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -4,36 +4,37 @@ & i { float: left; padding: 5px; - font-size: 15px; + font-size: 12px; } } /deep/ .card { @include wX(9cm); - border: $light-grey; + border: 1px solid $light-grey; background: $light-grey; - margin-bottom: 2cm; + margin-bottom: 76px; } /deep/ .card-block { - @include wX(9cm); + @include wX(340px); } /deep/ .card-header { - @include wX(9cm); + @include wX(340px); padding: 0; background: $light-grey; border: 1px solid $dark-grey; } /deep/ .card-body { - @include wX(9cm); + @include wX(340px); background: $dark-grey; - font-size: 15px; + color: $white; + font-size: 12px; } /deep/ .btn-link { - font-size: 15px; + font-size: 12px; color: $white; @include wX(100%); text-decoration: none; From 4cc227b88a60223997cef57f546e8b09e4384590 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 18:22:57 +0100 Subject: [PATCH 083/160] =?UTF-8?q?feat(accordion):=20Compl=C3=A9ment=20de?= =?UTF-8?q?=20modification=20du=20css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/accordion/accordion.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 2724843..5d3867f 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -9,7 +9,7 @@ } /deep/ .card { - @include wX(9cm); + @include wX(340px); border: 1px solid $light-grey; background: $light-grey; margin-bottom: 76px; From 37f7b83925b424cc5fc88af30a8795506fb8732d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 20 Feb 2019 18:57:07 +0100 Subject: [PATCH 084/160] =?UTF-8?q?feat(clone):=20avanc=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/info-bar/info-bar.component.ts | 6 +++--- src/app/screens/home/home.component.ts | 18 +++++++++++++----- src/assets/i18n/en.json | 3 ++- src/assets/i18n/fr.json | 3 ++- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/app/components/info-bar/info-bar.component.ts b/src/app/components/info-bar/info-bar.component.ts index 375025b..7813a3d 100644 --- a/src/app/components/info-bar/info-bar.component.ts +++ b/src/app/components/info-bar/info-bar.component.ts @@ -6,11 +6,11 @@ import { trigger, style, transition, animate } from '@angular/animations'; animations: [ trigger('slideInOut', [ transition(':enter', [ - style({transform: 'translateY(-100%)'}), - animate('200ms ease-in', style({transform: 'translateY(0%)'})) + style({transform: 'translateX(-100%)'}), + animate('300ms ease-in', style({transform: 'translateX(0%)'})) ]), transition(':leave', [ - animate('200ms ease-in', style({transform: 'translateY(-100%)'})) + animate('300ms ease-in', style({transform: 'translateX(-100%)'})) ]) ]) ], diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index e98e4c7..624befa 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -97,18 +97,26 @@ export class HomeComponent implements OnInit, OnDestroy { cloneSubmit() { if (this.electronService.fs.existsSync(this.cloneFolder.toString())) { - this.projectModalVisible = false; - this.credInfoBarVisible = true; + var URL = GitUrlParse(this.cloneUrl); + if (URL.protocol === 'https') { + this.projectModalVisible = false; + this.credInfoBarVisible = true; + } else if (URL.protocol === 'ssh') { + this.toastr.error('Pas de ssh pour le moment', 'Erreur'); + } else { + this.toastr.error(this.translateService.instant('INVALID_URL'), + this.translateService.instant('ERROR')); + } } else { - this.toastr.error(this.translateService.instant('ERROR'), this.translateService.instant('NO_FOLDER')); + this.toastr.error(this.translateService.instant('PATH_NOT_FOUND'), + this.translateService.instant('ERROR')); } } clone() { - console.log(this.username, this.password); this.credInfoBarVisible = false; this.homeLoading = true; - // lancer le loader de home + appel au service + this.gitService.clone(); } initBrowse() { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index eb1fb60..aabf27f 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -109,5 +109,6 @@ "CANCEL": "Cancel", "USERNAME": "USERNAME", "PASSWORD": "PASSWORD", - "LOG_TO_CONTINUE": "Please log to continue:" + "LOG_TO_CONTINUE": "Please log to continue:", + "INVALID_URL": "Invalid URL" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 71b3000..4c90fc3 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -109,5 +109,6 @@ "CANCEL": "Annuler", "USERNAME": "Nom d'utilisateur", "PASSWORD": "Mot de passe", - "LOG_TO_CONTINUE": "Veuillez vous identifier pour continuer :" + "LOG_TO_CONTINUE": "Veuillez vous identifier pour continuer :", + "INVALID_URL": "URL invalide" } \ No newline at end of file From 643456b2703cb223535f2fa05799ff7ae3afb095 Mon Sep 17 00:00:00 2001 From: Julien Lamy <76480julien@gmail.com> Date: Wed, 20 Feb 2019 19:15:15 +0100 Subject: [PATCH 085/160] refactor(accordion): modification du css --- src/app/components/accordion/accordion.component.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 5d3867f..1afac67 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -13,6 +13,7 @@ border: 1px solid $light-grey; background: $light-grey; margin-bottom: 76px; + border: 0; } /deep/ .card-block { @@ -24,6 +25,7 @@ padding: 0; background: $light-grey; border: 1px solid $dark-grey; + border-radius: 0 !important; } /deep/ .card-body { From 25c8528cdb716fc01058fd73bea1d585ce337814 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 19:28:33 +0100 Subject: [PATCH 086/160] refactor(main-panel): ouverture de la modal avec l'option choisie --- src/app/screens/home/home.component.html | 22 ++++++++++++---------- src/app/screens/home/home.component.ts | 3 ++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 4a0c220..56d002a 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -43,19 +43,21 @@
-
+ + +
-
-
{{ 'OPEN.REPO' | translate }}
-
+
+
{{ 'OPEN.REPO' | translate }}
+
-
-
{{ 'INIT.TAB_TITLE' | translate }}
-
+
+
{{ 'INIT.TAB_TITLE' | translate }}
+
-
-
{{ 'CLONE' | translate }}
-
+
+
{{ 'CLONE' | translate }}
+
diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 22be38a..947d598 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -74,7 +74,8 @@ export class HomeComponent implements OnInit, OnDestroy { this.router.navigate(['preferences']); } - openProjectModal() { + openProjectModal(tabSelected: any) { + this.projectModalTabSelectedIndex = tabSelected; this.projectModalVisible = true; } From e2d5521c2ced7efec72874f0b893bcf46003f431 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 19:32:56 +0100 Subject: [PATCH 087/160] fix(not-opened): petite correction --- src/app/screens/home/home.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 56d002a..5426140 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -45,7 +45,7 @@
-
+
{{ 'OPEN.REPO' | translate }}
From ef04e933233c5db843abd747d08ed12f982fbdeb Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 21:35:11 +0100 Subject: [PATCH 088/160] fix(not-opened): correction travis --- src/app/screens/home/home.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 5426140..d18d26d 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -7,7 +7,7 @@
  • - {{ repoName }}
  • + {{ repoName }}
  • Branch
  • From 011968968d89b8fb24d7c883dfc64f4f726d8b55 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Wed, 20 Feb 2019 21:40:03 +0100 Subject: [PATCH 089/160] fix(not-opened): correction travis --- src/app/screens/home/home.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index d18d26d..b93708b 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -4,10 +4,10 @@
    From f3ac72e0b48838a5c5b84fbb0693e2df30bb9be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Wed, 20 Feb 2019 23:29:34 +0100 Subject: [PATCH 090/160] feat(clone): fin https avec gestion erreur --- src/app/providers/git.service.ts | 34 ++++++++++++++++++++++++ src/app/screens/home/home.component.html | 2 +- src/app/screens/home/home.component.ts | 20 +++++++++++--- src/assets/i18n/en.json | 7 ++++- src/assets/i18n/fr.json | 8 +++++- 5 files changed, 65 insertions(+), 6 deletions(-) diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 3716f9b..775efdc 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -138,4 +138,38 @@ export class GitService { } this.emitRecentProjectSubject(); } + + async cloneHttps(url: GitUrlParse, folder: string, username: string, password: string) { + return new Promise((resolve, reject) => { + const REMOTE = `https://${username}:${password}@${url.resource}${url.pathname}`; + gitPromise(folder) + .clone(REMOTE, null) + .then(() => { + const REPOPATH = this.electronService.path.join(folder, url.name); + gitPromise(REPOPATH) + .raw(['remote', 'set-url', 'origin', url]) + .then(() => { + resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), + this.translate.instant('CLONE.DONE'))); + }) + .catch((err) => { + console.log(err); + reject(new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant('CLONE.ERROR'))); + }); + }) + .catch((err) => { + var ERRMSG = 'CLONE.ERROR'; + if (err.toString().includes('unable to update url base from redirection')) { + ERRMSG = 'CLONE.UNABLE_TO_UPDATE'; + } else if (err.toString().includes('HTTP Basic: Access denied')) { + ERRMSG = 'CLONE.HTTP_ACCESS_DENIED'; + } else if (err.toString().includes('could not create work tree')) { + ERRMSG = 'CLONE.NOT_WORK_TREE'; + } + reject(new ServiceResult(false, this.translate.instant('ERROR'), + this.translate.instant(ERRMSG))); + }); + }); + } } diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 134c116..8dc90fc 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -155,6 +155,6 @@ {{ 'LOG_TO_CONTINUE' | translate }} - + diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 624befa..460b846 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -19,7 +19,7 @@ export class HomeComponent implements OnInit, OnDestroy { projectModalVisible: Boolean; searchInputValue: string; cloneUrl: String; - cloneFolder: String; + cloneFolder: string; initName: string; initLocation: string; projectModalLoading: Boolean; @@ -113,10 +113,20 @@ export class HomeComponent implements OnInit, OnDestroy { } } - clone() { + cloneHttps() { this.credInfoBarVisible = false; this.homeLoading = true; - this.gitService.clone(); + this.gitService.cloneHttps(GitUrlParse(this.cloneUrl), this.cloneFolder, this.username, this.password) + .then((data) => { + this.homeLoading = false; + this.resetCloneInputs(); + this.toastr.info(data.message, data.title); + }) + .catch((data) => { + this.homeLoading = false; + this.resetCloneInputs(); + this.toastr.error(data.message, data.title); + }); } initBrowse() { @@ -190,6 +200,10 @@ export class HomeComponent implements OnInit, OnDestroy { closeCredInfoBar() { this.credInfoBarVisible = false; + this.resetCloneInputs(); + } + + resetCloneInputs() { this.username = ''; this.password = ''; this.cloneUrl = ''; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index aabf27f..12eeb71 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -26,7 +26,12 @@ "CLONE": { "WHERE": "Where to clone", "URL": "URL", - "TITLE": "Clone" + "TITLE": "Clone", + "DONE": "The repository was clone", + "ERROR": "Problem during the clone", + "UNABLE_TO_UPDATE": "Unable to update url base from redirection", + "HTTP_ACCESS_DENIED": "HTTP basic: Access denied", + "NOT_WORK_TREE": "Could not create work tree : permission denied" }, "BUTTON": { "PRIMARY": "Primary button", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 4c90fc3..630f7d6 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -26,7 +26,12 @@ "CLONE": { "WHERE": "Où cloner", "URL": "URL", - "TITLE": "Cloner" + "TITLE": "Cloner", + "DONE": "Le répertoire a été cloné", + "ERROR": "Problème lors du clone", + "UNABLE_TO_UPDATE": "Impossible de mettre à jour la base de l'URL à partir d'une redirection", + "HTTP_ACCESS_DENIED": "HTTP basic: Accès refusé", + "NOT_WORK_TREE": "Impossible de créer le repertoire de travail : permission refusé" }, "BUTTON": { "PRIMARY": "Bouton primaire", @@ -34,6 +39,7 @@ "DANGER": "Bouton danger", "DISABLED": "Bouton désactivé", "LARGE": "Bouton allongé" + }, "ICONBUTTON": { "GITHUB": "GitHub", From f5279a2e9fb3573ba5332d4111f6da71b72f956b Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 23:36:46 +0100 Subject: [PATCH 091/160] feat(pref-lang): Affichage de la langue si localStorage vide --- src/app/app.component.ts | 6 +++--- src/app/providers/language-preferences.service.ts | 8 +++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index bdcf65d..2d7d1f3 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -14,10 +14,10 @@ export class AppComponent { this.translate.addLangs(['fr', 'en']); - if (localStorage.getItem('lang') === 'en') { - this.translate.setDefaultLang('en'); - } else { + if (localStorage.getItem('lang') === null || localStorage.getItem('lang') === 'fr') { this.translate.setDefaultLang('fr'); + } else { + this.translate.setDefaultLang('en'); } console.log('AppConfig', AppConfig); diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index f29f636..c11034b 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -10,7 +10,13 @@ export class LanguagePreferencesService { constructor(private translate: TranslateService) { - this.preferences = localStorage.getItem('lang'); + if (localStorage.getItem('lang') === null + || localStorage.getItem('lang') === 'fr') { + this.preferences = 'fr'; + } else { + this.preferences = 'en'; + } + this.emitPreferencesSubject(); } From 3f7fb76e8f966e51dd74c4f580b1574e332cf859 Mon Sep 17 00:00:00 2001 From: Cyrielle AM Date: Wed, 20 Feb 2019 23:50:16 +0100 Subject: [PATCH 092/160] feat(pref-lang): Petite modification dans langue-pref.service --- src/app/providers/language-preferences.service.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/app/providers/language-preferences.service.ts b/src/app/providers/language-preferences.service.ts index c11034b..0248c0e 100644 --- a/src/app/providers/language-preferences.service.ts +++ b/src/app/providers/language-preferences.service.ts @@ -10,12 +10,7 @@ export class LanguagePreferencesService { constructor(private translate: TranslateService) { - if (localStorage.getItem('lang') === null - || localStorage.getItem('lang') === 'fr') { - this.preferences = 'fr'; - } else { - this.preferences = 'en'; - } + this.preferences = this.translate.getDefaultLang(); this.emitPreferencesSubject(); } From 4069a71a235b97284b82666a1e2a5ee2c7a66985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 21 Feb 2019 16:11:18 +0100 Subject: [PATCH 093/160] fix(pref-lang): fix erreur dans le toastr --- src/app/screens/preferences/preferences.component.ts | 4 ++-- src/assets/i18n/en.json | 1 + src/assets/i18n/fr.json | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index c260815..a3e68ec 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -60,8 +60,8 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.loading = true; this.switchLanguage(); this.loading = false; - this.toastr.info(this.translate.instant('SUCCESS'), - this.translate.instant('CHANGE_PREFERENCE')); + this.toastr.info(this.translate.instant('CHANGE_PREF_DONE'), + this.translate.instant('SUCCESS')); this.router.navigate(['home']); } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 6bbced8..628d407 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -5,6 +5,7 @@ "TAGS": "Tags", "TAG": "Tag", "CHANGE_PREFERENCE": "Change preferences", + "CHANGE_PREF_DONE": "The preferences were changed", "LANGUE": "Language", "FRENCH": "French", "ENGLISH": "English", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 73fa7af..5eb4109 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -5,6 +5,7 @@ "TAGS": "Balises", "TAG": "Balise", "CHANGE_PREFERENCE": "Changer les préférences", + "CHANGE_PREF_DONE": "Les préférences ont été changées", "LANGUE": "Langage", "FRENCH": "Français", "ENGLISH": "Anglais", From 5403c37addda8b6d1a48a3e299a01496df038860 Mon Sep 17 00:00:00 2001 From: Martin Blondel Date: Thu, 21 Feb 2019 16:27:21 +0100 Subject: [PATCH 094/160] refactor(html): ajout input dans l'html avant test --- src/app/screens/home/home.component.html | 40 ++++++++------ src/app/screens/home/home.component.spec.ts | 59 +++++++++++++++++++++ 2 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 src/app/screens/home/home.component.spec.ts diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 3f5b705..069d492 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -74,26 +74,36 @@ {{ 'OPEN.REPO' | translate }} -
    - +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    - - - {{ 'OPEN.OPENED' | translate }} - -
    + + + {{ 'OPEN.OPENED' | translate }} + +
    +
    -
    - {{project.value.repo}} -
    + {{project.value.repo}}
    -
    -
    - {{project.value.path}} -
    +
    +
    +
    + {{project.value.path}}
    +
    {{ 'CLONE' | translate }} diff --git a/src/app/screens/home/home.component.spec.ts b/src/app/screens/home/home.component.spec.ts new file mode 100644 index 0000000..a11f14d --- /dev/null +++ b/src/app/screens/home/home.component.spec.ts @@ -0,0 +1,59 @@ +import { async, ComponentFixture, TestBed, tick, fakeAsync } from '@angular/core/testing'; + +import { HomeComponent } from './home.component'; +import { FormsModule } from '@angular/forms'; +import { TranslateService } from '@ngx-translate/core'; +import { DebugElement } from '@angular/core'; +import { By } from '@angular/platform-browser'; +import { MockTranslateService } from '../../models/MockTranslateService'; +import * as child from 'child_process'; + +describe('HomeComponent', () => { + let component: HomeComponent; + let fixture: ComponentFixture; + let inputEl: DebugElement; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HomeComponent ], + imports: [ + FormsModule, + child + ], + providers: [ + { + provide: TranslateService, + useClass: MockTranslateService + } + ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HomeComponent); + component = fixture.componentInstance; + //inputEl = fixture.debugElement.query(By.css('input.gh-input')); + }); + + it('tests the component creation', () => { + expect(component).toBeTruthy(); + }); + + /*it('tests the component value', fakeAsync(() => { + const content = 'axuluphrum'; + component.value = content; + fixture.detectChanges(); + inputEl.nativeElement.dispatchEvent(new Event('input')); + tick(); + fixture.detectChanges(); + expect(inputEl.nativeElement.value).toEqual(content); + })); + + it('tests the getPlaceholderTranslation function', () => { + const content = 'something'; + component.placeholder = content; + const translation = component.getPlaceholderTranslation(); + expect(translation).toBe(component.placeholder.toUpperCase()); + });*/ +}); From 81e6ee0784cca6523bce8aceb918b8a9dd522054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 21 Feb 2019 17:07:35 +0100 Subject: [PATCH 095/160] =?UTF-8?q?refactor(clone):=20ajout=20possibilit?= =?UTF-8?q?=C3=A9=20d'ouvrir=20apres=20clone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/models/ServiceResult.ts | 4 +++- src/app/providers/git.service.ts | 8 +++++++- src/app/screens/home/home.component.html | 7 +++++++ src/app/screens/home/home.component.ts | 16 +++++++++++++++- src/assets/i18n/en.json | 6 +++++- src/assets/i18n/fr.json | 6 +++++- 6 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/app/models/ServiceResult.ts b/src/app/models/ServiceResult.ts index def9710..93c2f2e 100644 --- a/src/app/models/ServiceResult.ts +++ b/src/app/models/ServiceResult.ts @@ -2,10 +2,12 @@ export class ServiceResult { success: Boolean; title: string; message: string; + newData?: string; - constructor(success: Boolean, title: string, message: string) { + constructor(success: Boolean, title: string, message: string, newData?: string) { this.success = success; this.title = title; this.message = message; + this.newData = newData; } } diff --git a/src/app/providers/git.service.ts b/src/app/providers/git.service.ts index 775efdc..53f6951 100644 --- a/src/app/providers/git.service.ts +++ b/src/app/providers/git.service.ts @@ -150,7 +150,7 @@ export class GitService { .raw(['remote', 'set-url', 'origin', url]) .then(() => { resolve(new ServiceResult(true, this.translate.instant('SUCCESS'), - this.translate.instant('CLONE.DONE'))); + this.translate.instant('CLONE.DONE'), REPOPATH)); }) .catch((err) => { console.log(err); @@ -166,6 +166,12 @@ export class GitService { ERRMSG = 'CLONE.HTTP_ACCESS_DENIED'; } else if (err.toString().includes('could not create work tree')) { ERRMSG = 'CLONE.NOT_WORK_TREE'; + } else if (err.toString().includes('Repository not found')) { + ERRMSG = 'CLONE.REPO_NOT_FOUND'; + } else if (err.toString().includes('already exists and is not an empty directory')) { + ERRMSG = 'CLONE.ALREADY_EXISTS'; + } else if (err.toString().includes('Invalid username or password')) { + ERRMSG = 'CLONE.INVALID_CRED'; } reject(new ServiceResult(false, this.translate.instant('ERROR'), this.translate.instant(ERRMSG))); diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 8dc90fc..ea59f5e 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -158,3 +158,10 @@ + + + + + + + diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 460b846..13cda3e 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -31,6 +31,8 @@ export class HomeComponent implements OnInit, OnDestroy { recentProject: any[]; recentProjectSubscription: Subscription; credInfoBarVisible: boolean; + openClonedInfoBarVisible: boolean; + newClonedRepoPath: string; username: string; password: string; homeLoading: boolean; @@ -119,7 +121,8 @@ export class HomeComponent implements OnInit, OnDestroy { this.gitService.cloneHttps(GitUrlParse(this.cloneUrl), this.cloneFolder, this.username, this.password) .then((data) => { this.homeLoading = false; - this.resetCloneInputs(); + this.openClonedInfoBarVisible = true; + this.newClonedRepoPath = data.newData; this.toastr.info(data.message, data.title); }) .catch((data) => { @@ -203,11 +206,22 @@ export class HomeComponent implements OnInit, OnDestroy { this.resetCloneInputs(); } + openClonedRepo() { + this.gitService.setPath(this.newClonedRepoPath); + this.closeClonedInfoBar(); + } + + closeClonedInfoBar() { + this.openClonedInfoBarVisible = false; + this.resetCloneInputs(); + } + resetCloneInputs() { this.username = ''; this.password = ''; this.cloneUrl = ''; this.cloneFolder = ''; + this.newClonedRepoPath = ''; } ngOnDestroy() { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 12eeb71..e5892e3 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -31,7 +31,10 @@ "ERROR": "Problem during the clone", "UNABLE_TO_UPDATE": "Unable to update url base from redirection", "HTTP_ACCESS_DENIED": "HTTP basic: Access denied", - "NOT_WORK_TREE": "Could not create work tree : permission denied" + "NOT_WORK_TREE": "Could not create work tree : permission denied", + "REPO_NOT_FOUND": "Repository not found", + "ALREADY_EXISTS": "This repository already exists and is not an empty directory", + "INVALID_CRED": "Invalid username or password" }, "BUTTON": { "PRIMARY": "Primary button", @@ -112,6 +115,7 @@ "CREATE_REPOSITORY": "Create Repository", "LOG_IN": "Log in", "CANCEL": "Cancel", + "OPEN_NOW": "Open now", "USERNAME": "USERNAME", "PASSWORD": "PASSWORD", "LOG_TO_CONTINUE": "Please log to continue:", diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 630f7d6..1828020 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -31,7 +31,10 @@ "ERROR": "Problème lors du clone", "UNABLE_TO_UPDATE": "Impossible de mettre à jour la base de l'URL à partir d'une redirection", "HTTP_ACCESS_DENIED": "HTTP basic: Accès refusé", - "NOT_WORK_TREE": "Impossible de créer le repertoire de travail : permission refusé" + "NOT_WORK_TREE": "Impossible de créer le repertoire de travail : permission refusé", + "REPO_NOT_FOUND": "Répertoire non trouvé", + "ALREADY_EXISTS": "Ce répertoire existe déjà et n'est pas un dossier vide", + "INVALID_CRED": "Nom d'utilisateur ou mot de passe invalide" }, "BUTTON": { "PRIMARY": "Bouton primaire", @@ -113,6 +116,7 @@ "CREATE_REPOSITORY": "Créer le répertoire", "LOG_IN": "S'identifier", "CANCEL": "Annuler", + "OPEN_NOW": "Ouvrir", "USERNAME": "Nom d'utilisateur", "PASSWORD": "Mot de passe", "LOG_TO_CONTINUE": "Veuillez vous identifier pour continuer :", From bf27a504a4bab106944ffab1c4df1505ac51d5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 21 Feb 2019 18:11:56 +0100 Subject: [PATCH 096/160] refactor(html): fin de l'ajout de l'input --- src/app/screens/home/home.component.html | 15 +++-- src/app/screens/home/home.component.scss | 1 - src/app/screens/home/home.component.ts | 21 +++++-- src/assets/i18n/en.json | 5 +- src/assets/i18n/fr.json | 5 +- tests/open-repository.js | 72 ++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 15 deletions(-) create mode 100644 tests/open-repository.js diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 069d492..7206d85 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -4,7 +4,7 @@
      -
    • +
    • {{ repoName }}
    • @@ -69,7 +69,7 @@ - + {{ 'OPEN.REPO' | translate }} @@ -86,12 +86,17 @@
    +
    +
    + +
    +
    {{ 'OPEN.OPENED' | translate }} -
    @@ -105,8 +110,8 @@
    - {{ 'CLONE' | translate }} - + {{ 'CLONE' | translate }} + {{ 'INIT.TAB_TITLE' | translate }} diff --git a/src/app/screens/home/home.component.scss b/src/app/screens/home/home.component.scss index 22e39d5..dddc13b 100644 --- a/src/app/screens/home/home.component.scss +++ b/src/app/screens/home/home.component.scss @@ -155,7 +155,6 @@ &:hover { @include bg-color($light-green-hover); - cursor: default; } } diff --git a/src/app/screens/home/home.component.ts b/src/app/screens/home/home.component.ts index 641540c..565c2d6 100644 --- a/src/app/screens/home/home.component.ts +++ b/src/app/screens/home/home.component.ts @@ -30,6 +30,7 @@ export class HomeComponent implements OnInit, OnDestroy { repoNameSubscription: Subscription; recentProject: any[]; recentProjectSubscription: Subscription; + openFolder: string; ngOnInit() { this.dimensions = 20; @@ -150,28 +151,38 @@ export class HomeComponent implements OnInit, OnDestroy { openBrowse() { const NEWPATH = this.electronService.browse(); if (NEWPATH !== null) { - this.openRepo(NEWPATH); + this.openFolder = NEWPATH; } } - openRepo(path: any) { - if (this.path !== path) { + openRepo() { + if (this.path !== this.openFolder) { this.projectModalLoading = true; - if (path !== null) { - this.gitService.setPath(path) + if (this.openFolder !== null) { + this.gitService.setPath(this.openFolder) .then((data) => { this.projectModalLoading = false; this.projectModalVisible = false; + this.openFolder = ''; this.toastr.info(data.message, data.title); }) .catch((data) => { this.projectModalLoading = false; + this.openFolder = ''; this.toastr.error(data.message, data.title); }); } + } else { + this.toastr.error(this.translateService.instant('OPEN.ALREADY'), + this.translateService.instant('ERROR')); } } + openRecentRepo(recentPath: string) { + this.openFolder = recentPath; + this.openRepo(); + } + closeRepo() { this.path = undefined; this.repoName = undefined; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index fc54814..a23fb12 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -44,7 +44,6 @@ "SUCCESS": "Success", "ERROR": "Error", "DANGER": "Danger", - "ERROR": "Error", "PATH_NOT_FOUND": "This path doesn't exist", "UPDATE_VALUE": "Update value", "DISPLAY_VALUE": "Display value", @@ -90,7 +89,9 @@ "BROWSE": "Browse", "OPENED_REPO": "The repository was successfully opened", "NOT_GIT_REPO": "This is not a git repository", - "REPO_NOT_EXIST": "The repository no longer exist" + "REPO_NOT_EXIST": "The repository no longer exist", + "WHERE": "Where to clone", + "ALREADY": "Already opened" }, "CLONE": "Clone", "INIT": { diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 0416a80..2436305 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -42,7 +42,6 @@ "NAME": "Nom", "INFORMATION": "Information", "SUCCESS": "Succès", - "ERROR": "Erreur", "DANGER": "Danger", "ERROR": "Erreur", "PATH_NOT_FOUND": "Ce chemin n'existe pas", @@ -90,7 +89,9 @@ "BROWSE": "Parcourir", "OPENED_REPO": "Le dépôt a été ouvert avec succès", "NOT_GIT_REPO": "Ce répertoire n'est pas un répertoire git", - "REPO_NOT_EXIST": "Ce répertoire n'existe plus" + "REPO_NOT_EXIST": "Ce répertoire n'existe plus", + "WHERE": "Où ouvrir", + "ALREADY": "Déjà ouvert" }, "CLONE": "Cloner", "INIT": { diff --git a/tests/open-repository.js b/tests/open-repository.js new file mode 100644 index 0000000..06e3ee1 --- /dev/null +++ b/tests/open-repository.js @@ -0,0 +1,72 @@ +const Application = require('spectron').Application; +const path = require('path'); +const chai = require('chai'); +var expect = require('chai').expect; + +require('mocha-sinon'); +const chaiAsPromised = require('chai-as-promised'); +const name = require('../package.json').name; +const version = require('../package.json').version; + +if (process.platform === 'linux') { + electronPath = path.join(__dirname, '..', 'release', `${name}-${version}.AppImage`); + console.log(electronPath); +} else if (process.platform === 'darwin') { + electronPath = path.join(__dirname, '..', 'release', `${name}.app/Contents/MacOS/${name}`); +} else if (process.platform === 'win32') { + electronPath = path.join(__dirname, '..', 'release', `${name}-${version}.exe`); +} + +var appPath = path.join(__dirname, '..'); + +var app = new Application({ + path: electronPath, + args: [appPath] +}); + +global.before(function () { + chai.should(); + chai.use(chaiAsPromised); +}); + +describe('Test Example', function () { + beforeEach(function () { + var log = console.log; + this.sinon.stub(console, 'log').callsFake( function() { + return log.apply(log, arguments); + }); + return app.start(); + }); + + afterEach(function () { + return app.stop(); + }); + + it('tests the open repository', function() { + var btn = app.client.waitUntilWindowLoaded().element('#project-manager'); + console.log(btn); + btn.click(); + var openTab = app.client.element('#tab-open'); + }); + + // it('test console.log', function() { + // app.client.getText('#content').then(function(text) { + // console.log(text); + // }); + // return app.client.waitUntilWindowLoaded() + // .getRenderProcessLogs().then((logs) => { + // expect( console.log.calledWith('coucou mon ptit pote') ).to.be.true; + // }); + // }); + + // it('test button change angular', function () { + // var btn = app.client.element('#btntest'); + // var btntext = app.client.getText('#btntest').then(function(text){ + // expect(text).to.be.equal('test1'); + // }); + // btn.click(); + // btntext = app.client.getText('#btntest').then(function(text){ + // expect(text).to.be.equal('test2'); + // }); + // }); +}); \ No newline at end of file From 74e228cb21d8421439019d1f14a0f064bb700621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 21 Feb 2019 19:52:00 +0100 Subject: [PATCH 097/160] =?UTF-8?q?refactor(open):=20d=C3=A9but=20des=20te?= =?UTF-8?q?sts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/app/screens/home/home.component.html | 4 ++-- tests/open-repository.js | 22 ++++++++++++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index fe2218f..6db661a 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "e2e": "npm run postinstall:web && ng e2e", "test:unit": "npm run postinstall:web && ng test", "test:unit:coverage": "npm run postinstall:web && ng test --watch=false --code-coverage", - "test:e2e": "mocha --timeout 15000 tests/test.js" + "test:e2e": "mocha --timeout 15000 tests/open-repository.js" }, "dependencies": { "@angular/animations": "^7.2.4", diff --git a/src/app/screens/home/home.component.html b/src/app/screens/home/home.component.html index 7206d85..a3fdde1 100644 --- a/src/app/screens/home/home.component.html +++ b/src/app/screens/home/home.component.html @@ -80,13 +80,13 @@
    - +
    -
    +
    diff --git a/tests/open-repository.js b/tests/open-repository.js index 06e3ee1..2141a5d 100644 --- a/tests/open-repository.js +++ b/tests/open-repository.js @@ -29,7 +29,7 @@ global.before(function () { chai.use(chaiAsPromised); }); -describe('Test Example', function () { +describe('Test open repository', function () { beforeEach(function () { var log = console.log; this.sinon.stub(console, 'log').callsFake( function() { @@ -42,11 +42,21 @@ describe('Test Example', function () { return app.stop(); }); - it('tests the open repository', function() { - var btn = app.client.waitUntilWindowLoaded().element('#project-manager'); - console.log(btn); - btn.click(); - var openTab = app.client.element('#tab-open'); + it('should open the repository', function() { + /*var btn = app.client.waitUntilWindowLoaded().element('#project-manager'); + btn.click();*/ + return app.client.waitUntilWindowLoaded() + .click('#project-manager') + .click('#mat-tab-label-0-0') + .setValue('.open-input input', 'toto') + .waitUntilTextExists() + .element('.open-browse input').isEnabled().should.be.equal(true); + //console.log(t); + /*var openTab = app.client.waitUntilWindowLoaded().element('#mat-tab-label-0-0'); + openTab.click();*/ + // var input = app.client.waitUntilWindowLoaded().element('.open-input input'); + // input.setValue('toto'); + //return app.client.waitUntilWindowLoaded().element('.open-input input').getValue().should.be.equal('toto'); }); // it('test console.log', function() { From 096f51c14445df4c3f5e0a4be12b7e5889fdd4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Thu, 21 Feb 2019 23:10:13 +0100 Subject: [PATCH 098/160] =?UTF-8?q?feat(pref-3):=20d=C3=A9but=20pref=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 9 +++++- .../container/container.component.html | 2 +- .../providers/theme-preferences.service.ts | 25 ++++++++++++++++ .../preferences/preferences.component.html | 12 ++++++++ .../preferences/preferences.component.ts | 29 ++++++++++++++++++- src/app/screens/toolbox/toolbox.component.ts | 15 +++++++++- src/assets/i18n/en.json | 5 +++- src/assets/i18n/fr.json | 5 +++- 8 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 src/app/providers/theme-preferences.service.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ad55bf0..a51fe21 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -22,6 +22,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { ElectronService } from './providers/electron.service'; import { GitService } from './providers/git.service'; import { LanguagePreferencesService } from './providers/language-preferences.service'; +import { ThemePreferencesService } from './providers/theme-preferences.service'; import { WebviewDirective } from './directives/webview.directive'; @@ -108,7 +109,13 @@ export function HttpLoaderFactory(http: HttpClient) { useBootstrap4: true }) ], - providers: [ElectronService, GitService, EditorPreferencesService, LanguagePreferencesService], + providers: [ + ElectronService, + GitService, + EditorPreferencesService, + LanguagePreferencesService, + ThemePreferencesService + ], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/components/container/container.component.html b/src/app/components/container/container.component.html index f72a7f8..346e1ed 100644 --- a/src/app/components/container/container.component.html +++ b/src/app/components/container/container.component.html @@ -1,3 +1,3 @@ -
    +
    \ No newline at end of file diff --git a/src/app/providers/theme-preferences.service.ts b/src/app/providers/theme-preferences.service.ts new file mode 100644 index 0000000..c2340da --- /dev/null +++ b/src/app/providers/theme-preferences.service.ts @@ -0,0 +1,25 @@ +import { Injectable, OnInit } from '@angular/core'; +import { Subject } from 'rxjs'; +import { LocalStorage } from 'ngx-store'; + +@Injectable() +export class ThemePreferencesService { + @LocalStorage({ key: 'themePreference' }) themePreference = ''; + themePreferenceSubject: Subject; + + constructor() { + this.themePreferenceSubject = new Subject(); + if (this.themePreference.length === 0) { + this.setThemePreference('dark'); + } + } + + emitThemePreferencesSubject() { + this.themePreferenceSubject.next(this.themePreference); + } + + setThemePreference(newTheme: string) { + this.themePreference = newTheme; + this.emitThemePreferencesSubject(); + } +} diff --git a/src/app/screens/preferences/preferences.component.html b/src/app/screens/preferences/preferences.component.html index 78d31e8..fa0254c 100644 --- a/src/app/screens/preferences/preferences.component.html +++ b/src/app/screens/preferences/preferences.component.html @@ -37,6 +37,18 @@ {{ 'UI' | translate }} +
    +
    + +
    +
    + +
    +
    + +
    +
    \ No newline at end of file diff --git a/src/app/screens/preferences/preferences.component.ts b/src/app/screens/preferences/preferences.component.ts index a3e68ec..7a9a1f2 100644 --- a/src/app/screens/preferences/preferences.component.ts +++ b/src/app/screens/preferences/preferences.component.ts @@ -4,6 +4,7 @@ import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { LanguagePreferencesService } from '../../providers/language-preferences.service'; import { ToastrService } from 'ngx-toastr'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-preferences', @@ -18,11 +19,15 @@ export class PreferencesComponent implements OnInit, OnDestroy { preferencesTabSelectedIndex: any; dropdownLanguageValue: string; dataDropdownLanguage: Array; + dataDropdownTheme: Array; + currentTheme: string; languageSubscription: Subscription; + themePrefSubscription: Subscription; constructor(public router: Router, private translate: TranslateService, - private langPrefService: LanguagePreferencesService, private toastr: ToastrService) { + private langPrefService: LanguagePreferencesService, private toastr: ToastrService, + private themePrefService: ThemePreferencesService) { } ngOnInit() { @@ -34,6 +39,11 @@ export class PreferencesComponent implements OnInit, OnDestroy { { key: 'en', value: this.translate.instant('ENGLISH') }, ]; + this.dataDropdownTheme = [ + { key: 'dark', value: this.translate.instant('DARK') }, + { key: 'light', value: this.translate.instant('LIGHT') } + ]; + this.dropdownLanguageValue = this.translate.getDefaultLang(); // renvoie 'fr' ou 'en' this.languageSubscription = this.langPrefService.preferencesSubject.subscribe( @@ -43,6 +53,13 @@ export class PreferencesComponent implements OnInit, OnDestroy { } ); this.langPrefService.emitPreferencesSubject(); + + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); } checkIfCloseModal(event) { @@ -65,7 +82,17 @@ export class PreferencesComponent implements OnInit, OnDestroy { this.router.navigate(['home']); } + saveChangedUIPreferences() { + this.loading = true; + this.themePrefService.setThemePreference(this.currentTheme); + this.loading = false; + this.toastr.info(this.translate.instant('CHANGE_PREF_DONE'), + this.translate.instant('SUCCESS')); + this.router.navigate(['home']); + } + ngOnDestroy() { this.languageSubscription.unsubscribe(); + this.themePrefSubscription.unsubscribe(); } } diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index b0b32b6..9f23a74 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -3,6 +3,8 @@ import { ElectronService } from '../../providers/electron.service'; import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; import { ContextMenuComponent } from 'ngx-contextmenu'; +import { Subscription } from 'rxjs'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-toolbox', @@ -40,9 +42,20 @@ export class ToolboxComponent implements OnInit { dropdownValue: String; dropdownValueTwo: String; + themePrefSubscription: Subscription; + currentTheme: string; + constructor(private electronService: ElectronService, - private toastr: ToastrService, private translateService: TranslateService) { } + private toastr: ToastrService, private translateService: TranslateService, + private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { this.cbValue = true; diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index e35bf6d..ab6a473 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -107,5 +107,8 @@ }, "FULL_PATH": "Full path", "BROWSE": "Browse", - "CREATE_REPOSITORY": "Create Repository" + "CREATE_REPOSITORY": "Create Repository", + "LIGHT": "Light", + "DARK": "Dark", + "THEME": "Theme" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index c9a1a03..8fb498c 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -107,5 +107,8 @@ }, "FULL_PATH": "Chemin complet", "BROWSE": "Parcourir", - "CREATE_REPOSITORY": "Créer le répertoire" + "CREATE_REPOSITORY": "Créer le répertoire", + "LIGHT": "Clair", + "DARK": "Sombre", + "THEME": "Theme" } \ No newline at end of file From e85b729853de8d94a6885098965eead6fba86018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 22 Feb 2019 00:17:53 +0100 Subject: [PATCH 099/160] feat(pref-3): ajout variables --- .../screens/toolbox/toolbox.component.html | 32 ++++++- .../screens/toolbox/toolbox.component.scss | 70 +++++++++++++-- src/app/screens/toolbox/toolbox.component.ts | 90 ++++++++++++------- src/assets/i18n/en.json | 5 +- src/assets/i18n/fr.json | 5 +- src/variables.scss | 31 ++++++- 6 files changed, 185 insertions(+), 48 deletions(-) diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index 7dda552..5701920 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -5,10 +5,38 @@
    -

    {{ 'COLORS' | translate }}

    +

    {{ 'DARK_THEME' | translate }}

    -
    +
    +
    +
    +
    + ${{ color }} +
    +
    +
    +
    +
    +
    +

    {{ 'LIGHT_THEME' | translate }}

    +
    +
    +
    +
    +
    +
    + ${{ color }} +
    +
    +
    +
    +
    +
    +

    {{ 'INDEPENDENT_THEME' | translate }}

    +
    +
    +
    diff --git a/src/app/screens/toolbox/toolbox.component.scss b/src/app/screens/toolbox/toolbox.component.scss index ee4e200..a6ce665 100644 --- a/src/app/screens/toolbox/toolbox.component.scss +++ b/src/app/screens/toolbox/toolbox.component.scss @@ -31,21 +31,16 @@ a.link-white { } // Background colors +// DARK THEME .dark-blue { @include bg-color($dark-blue); } .light-blue { @include bg-color($light-blue); } -.light-blue-hover { - @include bg-color($light-blue-hover); -} .disabled-blue { @include bg-color($disabled-blue); } -.gh-green { - @include bg-color($gh-green); -} .dark-green { @include bg-color($dark-green); } @@ -76,16 +71,73 @@ a.link-white { .blue-grey { @include bg-color($blue-grey); } -.white { - @include bg-color($white); + +// LIGHT THEME +.dark-blue-light { + @include bg-color($dark-blue-light); +} +.light-blue-light { + @include bg-color($light-blue-light); +} +.disabled-blue-light { + @include bg-color($disabled-blue-light); +} +.dark-green-light { + @include bg-color($dark-green-light); +} +.disabled-green-light { + @include bg-color($disabled-green-light); +} +.light-green-hover-light { + @include bg-color($light-green-hover-light); +} +.dark-red-light { + @include bg-color($dark-red-light); +} +.light-red-light { + @include bg-color($light-red-light); +} +.disabled-red-light { + @include bg-color($disabled-red-light); +} +.button-bar-light { + @include bg-color($button-bar-light); +} +.arrow-light { + @include bg-color($arrow-light); +} +.border-grey-light { + @include bg-color($border-grey-light); +} +.dark-grey-light { + @include bg-color($dark-grey-light); +} +.light-grey-light { + @include bg-color($light-grey-light); +} +.grey-variant-light { + @include bg-color($grey-variant-light); +} + +// INDEPENDANT OF THEME +.light-blue-hover { + @include bg-color($light-blue-hover); } .muted-white { @include bg-color($muted-white); } +.white { + @include bg-color($white); +} +.muted-dark { + @include bg-color($muted-dark); +} .dark { @include bg-color($dark); } - +.gh-green { + @include bg-color($gh-green); +} // Font sizes .fs-xsmall { @include fs($fs-xsmall); diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 9f23a74..781583c 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -14,7 +14,9 @@ import { ThemePreferencesService } from '../../providers/theme-preferences.servi export class ToolboxComponent implements OnInit { @ViewChild('userCM') userCM: ContextMenuComponent; @ViewChild('subjectCM') subjectCM: ContextMenuComponent; - colorList: Array; + darkColorList: Array; + lightColorList: Array; + independentColorList: Array; fsList: Array; faList: Array; cbValue: Boolean; @@ -49,13 +51,13 @@ export class ToolboxComponent implements OnInit { constructor(private electronService: ElectronService, private toastr: ToastrService, private translateService: TranslateService, private themePrefService: ThemePreferencesService) { - this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( - (newTheme: string) => { - this.currentTheme = newTheme; - } - ); - this.themePrefService.emitThemePreferencesSubject(); - } + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { this.cbValue = true; @@ -70,12 +72,10 @@ export class ToolboxComponent implements OnInit { this.min = 0; this.dropdownValue = 'banana'; - this.colorList = [ + this.darkColorList = [ 'dark-blue', 'light-blue', - 'light-blue-hover', 'disabled-blue', - 'gh-green', 'dark-green', 'light-green', 'disabled-green', @@ -86,9 +86,35 @@ export class ToolboxComponent implements OnInit { 'dark-grey', 'light-grey', 'blue-grey', - 'white', + 'version' + ]; + + this.lightColorList = [ + 'dark-blue-light', + 'light-blue-light', + 'disabled-blue-light', + 'dark-green-light', + 'light-green-light', + 'disabled-green-light', + 'light-green-hover-light', + 'dark-red-light', + 'light-red-light', + 'disabled-red-light', + 'button-bar-light', + 'arrow-light', + 'border-grey-light', + 'dark-grey-light', + 'light-grey-light', + 'grey-variant-light' + ]; + + this.independentColorList = [ + 'light-blue-hover', 'muted-white', - 'dark' + 'white', + 'muted-dark', + 'dark', + 'gh-green' ]; this.fsList = [ @@ -129,28 +155,28 @@ export class ToolboxComponent implements OnInit { { icon: 'fa-spinner', isFab: false }, { icon: 'fa-upload', isFab: false }, { icon: 'fa-download', isFab: false }, - { icon: 'fa-sign-out-alt', isFab: false}, - { icon: 'fa-code-branch', isFab: false}, - { icon: 'fa-laptop', isFab: false}, - { icon: 'fa-cloud', isFab: false}, - { icon: 'fa-cog', isFab: false}, - {icon: 'fa-laptop', isFab: false}, - { icon: 'fa-search', isFab: false}, - { icon: 'fa-times', isFab: false} + { icon: 'fa-sign-out-alt', isFab: false }, + { icon: 'fa-code-branch', isFab: false }, + { icon: 'fa-laptop', isFab: false }, + { icon: 'fa-cloud', isFab: false }, + { icon: 'fa-cog', isFab: false }, + { icon: 'fa-laptop', isFab: false }, + { icon: 'fa-search', isFab: false }, + { icon: 'fa-times', isFab: false } ]; this.dataDropdownExample = [ - {key: 'orange', value: 'Orange'}, - {key: 'banana', value: 'Banane'}, - {key: 'cherry', value: 'Cerise'}, - {key: 'pear', value: 'Poire'}, + { key: 'orange', value: 'Orange' }, + { key: 'banana', value: 'Banane' }, + { key: 'cherry', value: 'Cerise' }, + { key: 'pear', value: 'Poire' }, ]; this.dataDropdownExampleTwo = [ - {key: 'carrot', value: 'Carotte'}, - {key: 'leek', value: 'Poireau'}, - {key: 'squash', value: 'Courge'}, - {key: 'potato', value: 'Patate'}, + { key: 'carrot', value: 'Carotte' }, + { key: 'leek', value: 'Poireau' }, + { key: 'squash', value: 'Courge' }, + { key: 'potato', value: 'Patate' }, ]; this.contextMenuFirstObject = [ @@ -163,7 +189,7 @@ export class ToolboxComponent implements OnInit { ]; this.contextMenuSecondObject = [ - { name: 'Prog Objet', teacher: 'M. Andary', language: 'Java' }, + { name: 'Prog Objet', teacher: 'M. Andary', language: 'Java' }, { name: 'S&T', teacher: 'M. Patrou', language: 'Scala' }, { name: 'Langage Web', teacher: 'M. Nicart', language: 'JavaScript' }, ]; @@ -236,10 +262,10 @@ export class ToolboxComponent implements OnInit { this.modalLoadingVisible = true; this.modalLoading = true; new Promise(resolve => setTimeout(resolve, 3000)) - .then( () => { + .then(() => { this.modalLoading = false; } - ); + ); } openInfoBar() { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index ab6a473..ebcb635 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -110,5 +110,8 @@ "CREATE_REPOSITORY": "Create Repository", "LIGHT": "Light", "DARK": "Dark", - "THEME": "Theme" + "THEME": "Theme", + "DARK_THEME": "Dark theme", + "LIGHT_THEME": "Light theme", + "INDEPENDENT_THEME": "Independent of the theme" } \ No newline at end of file diff --git a/src/assets/i18n/fr.json b/src/assets/i18n/fr.json index 8fb498c..bd10973 100644 --- a/src/assets/i18n/fr.json +++ b/src/assets/i18n/fr.json @@ -110,5 +110,8 @@ "CREATE_REPOSITORY": "Créer le répertoire", "LIGHT": "Clair", "DARK": "Sombre", - "THEME": "Theme" + "THEME": "Thème", + "DARK_THEME": "Thème sombre", + "LIGHT_THEME": "Thème clair", + "INDEPENDENT_THEME": "Indépendant du thème" } \ No newline at end of file diff --git a/src/variables.scss b/src/variables.scss index 4a3c0f2..92834af 100644 --- a/src/variables.scss +++ b/src/variables.scss @@ -1,10 +1,9 @@ // Couleurs +// DARK THEME $dark-blue: #353D5A; $light-blue: #4C5DAA; -$light-blue-hover: #4D88FF; $disabled-blue: #2A3345; -$gh-green: #1B958A; $dark-green: #314739; $light-green:#477F4B; $disabled-green: #2C3835; @@ -15,9 +14,35 @@ $disabled-red: #382C32; $dark-grey: #2C2E34; $light-grey: #373841; $blue-grey: #3E4453; -$white: #fff; +$version: #3E4453; + + +// LIGHT THEME +$dark-blue-light: #4C88FC; +$light-blue-light: #DDE6F8; +$disabled-blue-light: #EAEFF8; +$dark-green-light: #5BB862; +$light-green-light: #E0EDE1; +$disabled-green-light: #ECF2EC; +$light-green-hover-light: #C7E4CA; +$dark-red-light: #DA413E; +$light-red-light: #ECD6D5; +$disabled-red-light: #E0D6D5; +$button-bar-light: #464E69; +$arrow-light: #525C7C; +$border-grey-light: #C6C6C6; +$dark-grey-light: #F0F0F0; +$light-grey-light: #F7F7F7; +$grey-variant-light: #E8E8E8; + +// Independent of theme +$light-blue-hover: #4D88FF; $muted-white: #C9CACC; +$white: #fff;; +$muted-dark: #8A8A8B; $dark: #222328; +$gh-green: #1B958A; + // Font family $ff-default: 'Open Sans', sans-serif; From 688e1f2cb4a9b99c659d30784c84b0ee5a4323a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 22 Feb 2019 15:37:46 +0100 Subject: [PATCH 100/160] =?UTF-8?q?feat(pref-3):=20avanc=C3=A9e=20dans=20l?= =?UTF-8?q?e=20theme=20des=20composants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accordion/accordion.component.spec.ts | 25 ------ .../components/button/button.component.html | 2 +- .../components/button/button.component.scss | 78 +++++++++++++++++-- src/app/components/button/button.component.ts | 12 ++- .../container/container.component.scss | 2 +- .../copy-button/copy-button.component.html | 6 +- .../copy-button/copy-button.component.scss | 8 +- .../copy-button/copy-button.component.ts | 13 +++- .../dropdown/dropdown.component.html | 2 +- .../dropdown/dropdown.component.scss | 26 ++++++- .../components/dropdown/dropdown.component.ts | 13 +++- .../icon-button/icon-button.component.html | 2 +- .../icon-button/icon-button.component.scss | 28 +++++-- .../icon-button/icon-button.component.ts | 13 +++- .../input-number/input-number.component.html | 2 +- .../input-number/input-number.component.ts | 13 +++- src/app/components/input/input.component.html | 2 +- src/app/components/input/input.component.scss | 40 +++++++--- src/app/components/input/input.component.ts | 13 +++- .../screens/toolbox/toolbox.component.html | 4 +- .../screens/toolbox/toolbox.component.scss | 19 ++++- src/app/screens/toolbox/toolbox.component.ts | 4 +- src/variables.scss | 4 +- 23 files changed, 256 insertions(+), 75 deletions(-) delete mode 100644 src/app/components/accordion/accordion.component.spec.ts diff --git a/src/app/components/accordion/accordion.component.spec.ts b/src/app/components/accordion/accordion.component.spec.ts deleted file mode 100644 index 10f1099..0000000 --- a/src/app/components/accordion/accordion.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -// import { AccordionComponent } from './accordion.component'; - -// describe('AccordionComponent', () => { -// let component: AccordionComponent; -// let fixture: ComponentFixture; - -// beforeEach(async(() => { -// TestBed.configureTestingModule({ -// declarations: [ AccordionComponent ] -// }) -// .compileComponents(); -// })); - -// beforeEach(() => { -// fixture = TestBed.createComponent(AccordionComponent); -// component = fixture.componentInstance; -// fixture.detectChanges(); -// }); - -// it('should create', () => { -// expect(component).toBeTruthy(); -// }); -// }); diff --git a/src/app/components/button/button.component.html b/src/app/components/button/button.component.html index cd6ddc7..09dbe46 100644 --- a/src/app/components/button/button.component.html +++ b/src/app/components/button/button.component.html @@ -1,2 +1,2 @@ \ No newline at end of file + [ngClass]="[type + '-' + currentTheme, (disabled ? 'disabled' : ''), (large ? 'large' : '')]" /> \ No newline at end of file diff --git a/src/app/components/button/button.component.scss b/src/app/components/button/button.component.scss index 890072b..73bfa9e 100644 --- a/src/app/components/button/button.component.scss +++ b/src/app/components/button/button.component.scss @@ -3,12 +3,11 @@ .gh-button { border-style: solid; border-radius: 2px; - color: $white; outline: none; - - &.primary { + &.primary-dark { @include bg-color($dark-blue); border-color: $light-blue; + color: $white; cursor: pointer; &:hover { @@ -27,10 +26,33 @@ } } - &.success { + &.primary-light { + @include bg-color($light-blue-light); + border-color: $dark-blue-light; + cursor: pointer; + color: $dark; + + &:hover { + @include bg-color($dark-blue-light); + } + + &.disabled { + @include bg-color($disabled-blue-light); + border-color: $dark-blue-light; + color: $dark; + + &:hover { + cursor: not-allowed; + color: $white; + } + } + } + + &.success-dark { @include bg-color($dark-green); border-color: $light-green; cursor: pointer; + color: $white; &:hover { @include bg-color($light-green); @@ -49,10 +71,34 @@ } } - &.danger { + &.success-light { + @include bg-color($light-green-light); + border-color: $dark-green-light; + cursor: pointer; + color: $dark; + + &:hover { + @include bg-color($dark-green-light); + } + + &.disabled { + @include bg-color($disabled-green-light); + border-color: $dark-green-light; + color: $dark; + + + &:hover { + cursor: not-allowed; + color: $white; + } + } + } + + &.danger-dark { @include bg-color($dark-red); border-color: $light-red; cursor: pointer; + color: $white; &:hover { @include bg-color($light-red); @@ -69,6 +115,28 @@ } } } + + &.danger-light { + @include bg-color($light-red-light); + border-color: $dark-red-light; + cursor: pointer; + color: $dark; + + &:hover { + @include bg-color($dark-red-light); + } + + &.disabled { + @include bg-color($disabled-red-light); + border-color: $dark-red-light; + color: $dark; + + &:hover { + cursor: not-allowed; + color: $white; + } + } + } } .large { diff --git a/src/app/components/button/button.component.ts b/src/app/components/button/button.component.ts index a911cd3..e5ba507 100644 --- a/src/app/components/button/button.component.ts +++ b/src/app/components/button/button.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-button', @@ -14,8 +16,16 @@ export class ButtonComponent implements OnInit { @Input() large: Boolean = false; @Input() type: String = 'primary'; @Output() buttonClicked: EventEmitter = new EventEmitter(); + themePrefSubscription: Subscription; + currentTheme: string; - constructor(private translateService: TranslateService) { + constructor(private translateService: TranslateService, private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); } ngOnInit() { diff --git a/src/app/components/container/container.component.scss b/src/app/components/container/container.component.scss index 4e25cb3..4ab6096 100644 --- a/src/app/components/container/container.component.scss +++ b/src/app/components/container/container.component.scss @@ -15,7 +15,7 @@ @include wX-hX(100%, calc(100% - #{$footer-height})); overflow: auto; - &.white { + &.light { background-color: $white; } diff --git a/src/app/components/copy-button/copy-button.component.html b/src/app/components/copy-button/copy-button.component.html index 6aa4f38..5c836fb 100644 --- a/src/app/components/copy-button/copy-button.component.html +++ b/src/app/components/copy-button/copy-button.component.html @@ -1,8 +1,8 @@ -
    -
    +
    +
    -
    +
    diff --git a/src/app/components/copy-button/copy-button.component.scss b/src/app/components/copy-button/copy-button.component.scss index b27286e..1cdc9b1 100644 --- a/src/app/components/copy-button/copy-button.component.scss +++ b/src/app/components/copy-button/copy-button.component.scss @@ -18,7 +18,6 @@ font-size: $fs-medium; &__button { - background: $light-grey; width: 40px; height: 40px; border-radius: 50%; @@ -27,6 +26,13 @@ display: flex; align-items: center; justify-content: center; + &.dark { + background-color: $light-grey; + } + + &.light { + background-color: $button-bar-light; + } } &__copy { diff --git a/src/app/components/copy-button/copy-button.component.ts b/src/app/components/copy-button/copy-button.component.ts index 4db0b74..14766a0 100644 --- a/src/app/components/copy-button/copy-button.component.ts +++ b/src/app/components/copy-button/copy-button.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { ClipboardService } from 'ngx-clipboard'; +import { Subscription } from 'rxjs'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-copy-button', @@ -10,9 +12,18 @@ export class CopyButtonComponent implements OnInit { @Input() template: string; copy: Boolean; + themePrefSubscription: Subscription; + currentTheme: string; - constructor(private clipboardService: ClipboardService) {} + constructor(private clipboardService: ClipboardService, private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { diff --git a/src/app/components/dropdown/dropdown.component.html b/src/app/components/dropdown/dropdown.component.html index 3d2b056..d613e45 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/components/dropdown/dropdown.component.scss b/src/app/components/dropdown/dropdown.component.scss index dacc1ff..dbcd0ac 100644 --- a/src/app/components/dropdown/dropdown.component.scss +++ b/src/app/components/dropdown/dropdown.component.scss @@ -10,9 +10,6 @@ } outline: none; - background-color: $dark; - color: $white; - border : 1px solid $dark-grey; border-radius: 3px; font-size: $fs-medium; padding: $gap-md; @@ -25,12 +22,33 @@ outline: 0; } - &.disabled { + &.dark { + background-color: $dark; + color: $white; + border : 1px solid $dark-grey; + &.disabled { color: $muted-white; &:hover { cursor: not-allowed; color: $white; } + } } + + &.light { + background-color: $white; + color: $white; + border : 1px solid $border-light-grey-light; + + &.disabled { + color: $muted-white; + + &:hover { + cursor: not-allowed; + color: $white; + } + } + } + } \ No newline at end of file diff --git a/src/app/components/dropdown/dropdown.component.ts b/src/app/components/dropdown/dropdown.component.ts index 4131753..dadf5f0 100644 --- a/src/app/components/dropdown/dropdown.component.ts +++ b/src/app/components/dropdown/dropdown.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-dropdown', @@ -9,6 +11,8 @@ export class DropdownComponent implements OnInit { @Input() disabled: Boolean = false; @Input() required: Boolean = false; + themePrefSubscription: Subscription; + currentTheme: string; currentValue: string; @Input() idKey: String; @@ -29,7 +33,14 @@ export class DropdownComponent implements OnInit { } } - constructor() { } + constructor(private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } getOptKey(option: any) { if (this.idKey) { diff --git a/src/app/components/icon-button/icon-button.component.html b/src/app/components/icon-button/icon-button.component.html index 9e1ed63..ca8727d 100644 --- a/src/app/components/icon-button/icon-button.component.html +++ b/src/app/components/icon-button/icon-button.component.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/src/app/components/icon-button/icon-button.component.scss b/src/app/components/icon-button/icon-button.component.scss index bf4642c..9226733 100644 --- a/src/app/components/icon-button/icon-button.component.scss +++ b/src/app/components/icon-button/icon-button.component.scss @@ -11,17 +11,33 @@ white-space: nowrap; text-overflow: clip; - @include bg-color($light-grey); + cursor: pointer; - &.disabled { - color: $muted-white; - cursor: not-allowed; + &.dark { + @include bg-color($light-grey); + &.disabled { + color: $muted-white; + cursor: not-allowed; + } + + &:hover { + @include bg-color($dark-grey); + } } - &:hover { - @include bg-color($dark-grey); + &.light { + @include bg-color($button-bar-light); + &.disabled { + color: $muted-white; + cursor: not-allowed; + } + + &:hover { + @include bg-color($button-bar-hover-light); + } } + .gh-button-div { padding-bottom: 5px; diff --git a/src/app/components/icon-button/icon-button.component.ts b/src/app/components/icon-button/icon-button.component.ts index de9c772..0d7b5c2 100644 --- a/src/app/components/icon-button/icon-button.component.ts +++ b/src/app/components/icon-button/icon-button.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; +import { Subscription } from 'rxjs'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-icon-button', @@ -17,9 +19,18 @@ export class IconButtonComponent implements OnInit { isFab: Boolean }; @Output() buttonClicked: EventEmitter = new EventEmitter(); + themePrefSubscription: Subscription; + currentTheme: string; - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService, private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { } diff --git a/src/app/components/input-number/input-number.component.html b/src/app/components/input-number/input-number.component.html index aea3e3f..6079d8b 100644 --- a/src/app/components/input-number/input-number.component.html +++ b/src/app/components/input-number/input-number.component.html @@ -1,2 +1,2 @@ \ No newline at end of file + [readonly]="readonly" [disabled]="disabled" [ngClass]="[currentTheme, disabled ? 'disabled' : '']" [formControl]="form" [(ngModel)]="value" /> \ No newline at end of file diff --git a/src/app/components/input-number/input-number.component.ts b/src/app/components/input-number/input-number.component.ts index 23aa1c1..964e6bf 100644 --- a/src/app/components/input-number/input-number.component.ts +++ b/src/app/components/input-number/input-number.component.ts @@ -1,6 +1,8 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { FormControl } from '@angular/forms'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-input-number', @@ -17,6 +19,8 @@ export class InputNumberComponent implements OnInit { @Input() min: number; currentValue: number; form: FormControl; + themePrefSubscription: Subscription; + currentTheme: string; @Output() valueChange = new EventEmitter(); @@ -39,7 +43,14 @@ export class InputNumberComponent implements OnInit { this.valueChange.emit(this.currentValue); } - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService, private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { this.form = new FormControl(''); diff --git a/src/app/components/input/input.component.html b/src/app/components/input/input.component.html index 34445ee..53723ea 100644 --- a/src/app/components/input/input.component.html +++ b/src/app/components/input/input.component.html @@ -1,2 +1,2 @@ \ No newline at end of file + [readonly]="readonly" [disabled]="disabled" [ngClass]="[currentTheme, disabled ? 'disabled' : '']" [(ngModel)]="value" /> \ No newline at end of file diff --git a/src/app/components/input/input.component.scss b/src/app/components/input/input.component.scss index 6864a66..1dc2f5a 100644 --- a/src/app/components/input/input.component.scss +++ b/src/app/components/input/input.component.scss @@ -2,27 +2,43 @@ .gh-input { outline: none; - background-color: $dark; - color: $white; - border : 1px solid $dark-grey; border-radius: 3px; font-size: $fs-medium; padding: $gap-md; line-height: 1; @include wX(100%); + &.dark { + color: $white; + border : 1px solid $dark-grey; + background-color: $dark; + &.disabled { + color: $muted-white; + + &:hover { + cursor: not-allowed; + color: $white; + } + } + } + + &.light { + color: $dark; + border : 1px solid $border-light-grey-light; + background-color: $white; + &.disabled { + color: $dark; + + &:hover { + cursor: not-allowed; + color: $muted-dark; + } + } + } + &:focus { border-color: $light-blue-hover; box-shadow: 0 0 0 1px $light-blue-hover; outline: 0; } - - &.disabled { - color: $muted-white; - - &:hover { - cursor: not-allowed; - color: $white; - } - } } \ No newline at end of file diff --git a/src/app/components/input/input.component.ts b/src/app/components/input/input.component.ts index d144f29..a8bb379 100644 --- a/src/app/components/input/input.component.ts +++ b/src/app/components/input/input.component.ts @@ -1,5 +1,7 @@ import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; +import { Subscription } from 'rxjs'; @Component({ selector: 'app-input', @@ -13,6 +15,8 @@ export class InputComponent implements OnInit { @Input() readonly: Boolean; @Input() disabled: Boolean; currentValue: String; + themePrefSubscription: Subscription; + currentTheme: string; @Output() valueChange = new EventEmitter(); @@ -27,7 +31,14 @@ export class InputComponent implements OnInit { this.valueChange.emit(this.currentValue); } - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService, private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { } diff --git a/src/app/screens/toolbox/toolbox.component.html b/src/app/screens/toolbox/toolbox.component.html index 5701920..c6b48bb 100644 --- a/src/app/screens/toolbox/toolbox.component.html +++ b/src/app/screens/toolbox/toolbox.component.html @@ -281,12 +281,12 @@

    Input

    '>
    -
    +
    -
    +
    diff --git a/src/app/screens/toolbox/toolbox.component.scss b/src/app/screens/toolbox/toolbox.component.scss index a6ce665..2b247fa 100644 --- a/src/app/screens/toolbox/toolbox.component.scss +++ b/src/app/screens/toolbox/toolbox.component.scss @@ -12,7 +12,11 @@ } .bb-white { - border-bottom: 1px solid $white; + border-bottom: 2px solid $white; +} + +.bb-dark { + border-bottom: 1px solide $dark; } .gh-div-loader { @@ -85,6 +89,9 @@ a.link-white { .dark-green-light { @include bg-color($dark-green-light); } +.light-green-light { + @include bg-color($light-green-light); +} .disabled-green-light { @include bg-color($disabled-green-light); } @@ -103,11 +110,17 @@ a.link-white { .button-bar-light { @include bg-color($button-bar-light); } +.button-bar-hover-light { + @include bg-color($button-bar-hover-light); +} .arrow-light { @include bg-color($arrow-light); } -.border-grey-light { - @include bg-color($border-grey-light); +.border-light-grey-light { + @include bg-color($border-light-grey-light); +} +.border-dark-grey-light { + @include bg-color($border-dark-grey-light); } .dark-grey-light { @include bg-color($dark-grey-light); diff --git a/src/app/screens/toolbox/toolbox.component.ts b/src/app/screens/toolbox/toolbox.component.ts index 781583c..9e02337 100644 --- a/src/app/screens/toolbox/toolbox.component.ts +++ b/src/app/screens/toolbox/toolbox.component.ts @@ -101,8 +101,10 @@ export class ToolboxComponent implements OnInit { 'light-red-light', 'disabled-red-light', 'button-bar-light', + 'button-bar-hover-light', 'arrow-light', - 'border-grey-light', + 'border-light-grey-light', + 'border-dark-grey-light', 'dark-grey-light', 'light-grey-light', 'grey-variant-light' diff --git a/src/variables.scss b/src/variables.scss index 92834af..1ddb6ee 100644 --- a/src/variables.scss +++ b/src/variables.scss @@ -29,8 +29,10 @@ $dark-red-light: #DA413E; $light-red-light: #ECD6D5; $disabled-red-light: #E0D6D5; $button-bar-light: #464E69; +$button-bar-hover-light: #3E465E; $arrow-light: #525C7C; -$border-grey-light: #C6C6C6; +$border-dark-grey-light: #C6C6C6; +$border-light-grey-light: #DADADA; $dark-grey-light: #F0F0F0; $light-grey-light: #F7F7F7; $grey-variant-light: #E8E8E8; From a8c4944d75f2aaef1b6e1c5b39bc6daf504201c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Drouin?= Date: Fri, 22 Feb 2019 20:56:03 +0100 Subject: [PATCH 101/160] feat(pref-3): css complet light --- src/app/app.component.ts | 10 - .../accordion/accordion.component.html | 4 +- .../accordion/accordion.component.scss | 112 +++++--- .../accordion/accordion.component.ts | 13 +- .../container/container.component.html | 2 +- .../container/container.component.scss | 11 +- .../dropdown/dropdown.component.scss | 6 +- .../components/footer/footer.component.html | 6 +- .../components/footer/footer.component.scss | 39 ++- src/app/components/footer/footer.component.ts | 12 +- .../icon-button/icon-button.component.html | 2 +- .../icon-button/icon-button.component.scss | 4 + .../input-number/input-number.component.ts | 2 +- .../components/loader/loader.component.html | 4 +- .../components/loader/loader.component.scss | 19 +- src/app/components/loader/loader.component.ts | 13 +- src/app/components/modal/modal.component.html | 8 +- src/app/components/modal/modal.component.scss | 47 +++- src/app/components/modal/modal.component.ts | 13 +- .../providers/theme-preferences.service.ts | 10 +- src/app/screens/home/home.component.html | 28 +- src/app/screens/home/home.component.scss | 139 +++++++-- src/app/screens/home/home.component.ts | 12 +- .../screens/toolbox/toolbox.component.html | 110 ++++---- .../screens/toolbox/toolbox.component.scss | 265 ++++++++++-------- src/app/screens/toolbox/toolbox.component.ts | 4 +- src/styles.scss | 116 +++++++- src/variables.scss | 3 +- 28 files changed, 712 insertions(+), 302 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 2d7d1f3..c0c858c 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -19,15 +19,5 @@ export class AppComponent { } else { this.translate.setDefaultLang('en'); } - - console.log('AppConfig', AppConfig); - - if (electronService.isElectron()) { - console.log('Mode electron'); - console.log('Electron ipcRenderer', electronService.ipcRenderer); - console.log('NodeJS childProcess', electronService.childProcess); - } else { - console.log('Mode web'); - } } } diff --git a/src/app/components/accordion/accordion.component.html b/src/app/components/accordion/accordion.component.html index 076630f..cbf6f35 100644 --- a/src/app/components/accordion/accordion.component.html +++ b/src/app/components/accordion/accordion.component.html @@ -1,7 +1,7 @@ - + - {{ title }} + {{ title }}
      diff --git a/src/app/components/accordion/accordion.component.scss b/src/app/components/accordion/accordion.component.scss index 1afac67..039cd2b 100644 --- a/src/app/components/accordion/accordion.component.scss +++ b/src/app/components/accordion/accordion.component.scss @@ -6,44 +6,90 @@ padding: 5px; font-size: 12px; } -} -/deep/ .card { - @include wX(340px); - border: 1px solid $light-grey; - background: $light-grey; - margin-bottom: 76px; - border: 0; + & /deep/ .card { + @include wX(340px); + margin-bottom: 76px; + border: 0; + } + + & /deep/ .card-block { + @include wX(340px); + } + + & /deep/ .card-header { + @include wX(340px); + padding: 0; + border-radius: 0 !important; + } + + & /deep/ .card-body { + @include wX(340px); + font-size: 12px; + } + + & /deep/ .btn-link { + font-size: 12px; + @include wX(100%); + text-decoration: none; + text-align: left; + + &:hover, &:focus { + text-decoration: none; + } + } + } -/deep/ .card-block { - @include wX(340px); -} +.gh-accordion.dark { + & /deep/ .card { + border: 1px solid $light-grey; + background: $light-grey; + } + + & /deep/ .card-header { + background: $light-grey; + border: 1px solid $dark-grey; -/deep/ .card-header { - @include wX(340px); - padding: 0; - background: $light-grey; - border: 1px solid $dark-grey; - border-radius: 0 !important; + & .icon-dark { + color: $muted-white; + } + } + + & /deep/ .card-body { + background: $dark-grey; + color: $white; + border: 1px solid $dark-grey; + } + + & /deep/ .btn-link { + color: $white; + &:hover, &:focus { + color: $white; + } + } } -/deep/ .card-body { - @include wX(340px); - background: $dark-grey; - color: $white; - font-size: 12px; -} -/deep/ .btn-link { - font-size: 12px; - color: $white; - @include wX(100%); - text-decoration: none; - text-align: left; - - &:hover, &:focus { - text-decoration: none; - color: $white; +.gh-accordion.light { + & /deep/ .card-header { + background: $dark-grey-light; + border: 1px solid $border-dark-grey-light; + & .icon-light { + color: rgb(141, 141, 141); + } } -} + + & /deep/ .card-body { + background: $light-grey-light; + color: $dark; + border: 1px solid $border-dark-grey-light; + } + + & /deep/ .btn-link { + color: $dark; + &:hover, &:focus { + color: $dark; + } + } +} \ No newline at end of file diff --git a/src/app/components/accordion/accordion.component.ts b/src/app/components/accordion/accordion.component.ts index 94c654e..0426842 100644 --- a/src/app/components/accordion/accordion.component.ts +++ b/src/app/components/accordion/accordion.component.ts @@ -1,4 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; +import { Subscription } from 'rxjs'; +import { ThemePreferencesService } from '../../providers/theme-preferences.service'; @Component({ selector: 'app-accordion', @@ -13,8 +15,17 @@ export class AccordionComponent implements OnInit { name: String, isFab: Boolean }; + themePrefSubscription: Subscription; + currentTheme: string; - constructor() { } + constructor(private themePrefService: ThemePreferencesService) { + this.themePrefSubscription = this.themePrefService.themePreferenceSubject.subscribe( + (newTheme: string) => { + this.currentTheme = newTheme; + } + ); + this.themePrefService.emitThemePreferencesSubject(); + } ngOnInit() { } diff --git a/src/app/components/container/container.component.html b/src/app/components/container/container.component.html index 346e1ed..5863e19 100644 --- a/src/app/components/container/container.component.html +++ b/src/app/components/container/container.component.html @@ -1,3 +1,3 @@ -
      +
      \ No newline at end of file diff --git a/src/app/components/container/container.component.scss b/src/app/components/container/container.component.scss index 4ab6096..cbd9fa0 100644 --- a/src/app/components/container/container.component.scss +++ b/src/app/components/container/container.component.scss @@ -17,10 +17,17 @@ &.light { background-color: $white; + &.gh-border { + border: 1px solid $border-dark-grey-light; + } } &.dark-grey { background-color: $dark-grey; + &.gh-border { + border: 1px solid $dark; + } + } &.light-grey { @@ -35,10 +42,6 @@ background-color: $dark; } - &.dark-border { - border: 1px solid $dark; - } - &.loader-dark { background-color: $dark; opacity: 0.8; diff --git a/src/app/components/dropdown/dropdown.component.scss b/src/app/components/dropdown/dropdown.component.scss index dbcd0ac..1fa750e 100644 --- a/src/app/components/dropdown/dropdown.component.scss +++ b/src/app/components/dropdown/dropdown.component.scss @@ -38,15 +38,15 @@ &.light { background-color: $white; - color: $white; + color: $dark; border : 1px solid $border-light-grey-light; &.disabled { - color: $muted-white; + color: $muted-dark; &:hover { cursor: not-allowed; - color: $white; + color: $dark; } } } diff --git a/src/app/components/footer/footer.component.html b/src/app/components/footer/footer.component.html index e67f77e..c30f20e 100644 --- a/src/app/components/footer/footer.component.html +++ b/src/app/components/footer/footer.component.html @@ -1,6 +1,6 @@ -