Skip to content

Commit

Permalink
Merge pull request #146 from GitHarpon/release
Browse files Browse the repository at this point in the history
release(deploy): déploiement v1.2.0 client
  • Loading branch information
Nemtecl authored Mar 19, 2019
2 parents b79cde1 + 8790f1b commit cd67194
Show file tree
Hide file tree
Showing 107 changed files with 8,193 additions and 931 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ node_js:
sudo: required
addons:
chrome: stable
cache:
directories:
- node_modules
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- npm set progress=false
- npm install
- npm run electron:linux
script:
- npm run test:unit:coverage
- npm run test:e2e
notifications:
email: false
slack:
Expand Down
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ 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**

Expand Down Expand Up @@ -90,7 +82,6 @@ Installer les dépendances
|`electron-builder.json`| Fichier contenant toutes les informations pour la création d'une release. |
|`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. |
Expand Down Expand Up @@ -118,7 +109,6 @@ Comme expliqué plus haut, nous avons utilisé le kit de démarrage. Le fichier
|`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 ⚠️

Expand All @@ -127,24 +117,6 @@ Comme expliqué plus haut, nous avons utilisé le kit de démarrage. Le fichier
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.

### Sur macOS

`yarn electron:mac` puis cliquer sur le .dmg généré et mettre le .app dans le dossier release. On peut alors lancer la commande `yarn test:e2e`.

### Sur Linux

`yarn electron:linux` et s'assurer d'avoir lancer une fois le .AppImage pour que la fenêtre de dialogue ne s'affiche plus par la suite. On peut alors lancer la commande `yarn test:e2e`.


### Sur Windows

`yarn electron:windows` puis lancer la commande `yarn test:e2e`.


## Ajouter un package

```yarn add [package]```
Expand Down
6 changes: 2 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"codeCoverageExclude": [
"src/app/providers/*",
"src/app/components/**",
"src/app/screens/toolbox/**",
"src/app/providers/*",
"src/app/models/**",
"src/environments/**"
"src/app/components/monaco-wrapper/**"
],
"scripts": [],
"styles": [
Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function createWindow() {
}));
}

// win.webContents.openDevTools();
win.webContents.openDevTools();

// Emitted when the window is closed.
win.on('closed', () => {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "git-harpon",
"version": "1.1.0",
"version": "1.2.0",
"description": "Open-source GUI for git",
"author": {
"name": "GitHarpon",
Expand Down Expand Up @@ -35,10 +35,8 @@
"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",
"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/*.js"
"test:unit:coverage": "npm run postinstall:web && ng test --watch=false --code-coverage"
},
"dependencies": {
"@angular/animations": "^7.2.4",
Expand All @@ -51,10 +49,12 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"git-url-parse": "^11.1.2",
"isomorphic-git": "^0.51.12",
"jquery": "^3.3.1",
"karma-htmlfile-reporter": "^0.3.8",
"mocha": "^5.2.0",
"mocha-sinon": "^2.1.0",
"moment": "^2.24.0",
"monaco-editor": "^0.14.3",
"ngx-clipboard": "^11.1.9",
"ngx-contextmenu": "^5.1.1",
Expand Down
26 changes: 24 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ import { CopyButtonComponent } from './components/copy-button/copy-button.compon
import { PreferencesComponent } from './screens/preferences/preferences.component';
import { AccordionComponent } from './components/accordion/accordion.component';
import { InfoBarComponent } from './components/info-bar/info-bar.component';
import { LeftPanelComponent } from './screens/left-panel/left-panel.component';
import { RightPanelComponent } from './screens/right-panel/right-panel.component';
import { GraphComponent } from './screens/graph/graph.component';
import { ViewCommitComponent } from './screens/view-commit/view-commit.component';
import { SendCommitComponent } from './screens/send-commit/send-commit.component';
import { RightPanelService } from './providers/right-panel.service';
import { LeftPanelService } from './providers/left-panel.service';
import { TextAreaComponent } from './components/text-area/text-area.component';
import { CommitTextAreaComponent } from './components/commit-text-area/commit-text-area.component';
import { FileDiffCommitComponent } from './components/file-diff-commit/file-diff-commit.component';
import { GraphService } from './providers/graph.service';


// AoT requires an exported function for factories
Expand Down Expand Up @@ -78,7 +89,15 @@ export function HttpLoaderFactory(http: HttpClient) {
CopyButtonComponent,
PreferencesComponent,
AccordionComponent,
InfoBarComponent
InfoBarComponent,
LeftPanelComponent,
RightPanelComponent,
GraphComponent,
ViewCommitComponent,
SendCommitComponent,
TextAreaComponent,
CommitTextAreaComponent,
FileDiffCommitComponent
],
imports: [
ReactiveFormsModule,
Expand Down Expand Up @@ -116,7 +135,10 @@ export function HttpLoaderFactory(http: HttpClient) {
EditorPreferencesService,
LanguagePreferencesService,
ThemePreferencesService,
TerminalManagerService
TerminalManagerService,
RightPanelService,
LeftPanelService,
GraphService
],
bootstrap: [AppComponent]
})
Expand Down
4 changes: 1 addition & 3 deletions src/app/components/accordion/accordion.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
<span><i [ngClass]="[(icon.isFab ? 'fab' : 'fa'), icon.name, 'icon-' + currentTheme]" class="fa-lg"></i>{{ title }}</span>
</ng-template>
<ng-template ngbPanelContent>
<ul>
<li>branche test</li>
</ul>
<ng-content></ng-content>
</ng-template>
</ngb-panel>
</ngb-accordion>
19 changes: 10 additions & 9 deletions src/app/components/accordion/accordion.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
}

& /deep/ .card {
@include wX(340px);
margin-bottom: 76px;
@include wX(100%);
border: 0;
}

& /deep/ .card-block {
/*& /deep/ .card-block {
@include wX(340px);
}
}*/

& /deep/ .card-header {
@include wX(340px);
//@include wX(340px);
padding: 0;
border-radius: 0 !important;
}

& /deep/ .card-body {
@include wX(340px);
//@include wX(340px);
font-size: 12px;
padding: 0;
}

& /deep/ .btn-link {
Expand All @@ -43,21 +43,22 @@

.gh-accordion.dark {
& /deep/ .card {
border: 1px solid $light-grey;
border: 0;
background: $light-grey;
}

& /deep/ .card-header {
background: $light-grey;
border: 1px solid $dark-grey;
padding: 0;
border-radius: 0 !important;

& .icon-dark {
color: $muted-white;
}
}

& /deep/ .card-body {
background: $dark-grey;
background: $low-dark;
color: $white;
border: 1px solid $dark-grey;
}
Expand Down
51 changes: 51 additions & 0 deletions src/app/components/accordion/accordion.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { async, ComponentFixture, TestBed} from '@angular/core/testing';
import { AccordionComponent } from './accordion.component';
import { NgbModule} from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
import { ThemePreferencesService } from '../../providers/theme-preferences.service';

import { MockTranslateService } from '../../models/MockTranslateService';
import { MockThemePreferencesService } from '../../models/MockThemePreferencesService';

describe('AccordionComponent', () => {
/* tslint:disable */
let component: AccordionComponent;
let fixture: ComponentFixture<AccordionComponent>;
/* tslint:enable */

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [AccordionComponent],
imports: [
NgbModule
],
providers: [
{
provide: TranslateService,
useClass: MockTranslateService
},
{
provide: ThemePreferencesService,
useClass: MockThemePreferencesService
}
]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AccordionComponent);
component = fixture.componentInstance;
});

it('tests the component creation', () => {
expect(component).toBeTruthy();
});

it('tests the component disabled change', () => {
component.icon = {name: 'fa-laptop', isFab: false};
component.disabled = true;
expect(component.disabled).toBeTruthy();
});

});
5 changes: 1 addition & 4 deletions src/app/components/accordion/accordion.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ThemePreferencesService } from '../../providers/theme-preferences.servi
templateUrl: './accordion.component.html',
styleUrls: ['./accordion.component.scss']
})
export class AccordionComponent implements OnInit {
export class AccordionComponent {

@Input() title: String;
@Input() disabled: Boolean = false;
Expand All @@ -27,7 +27,4 @@ export class AccordionComponent implements OnInit {
this.themePrefService.emitThemePreferencesSubject();
}

ngOnInit() {
}

}
Loading

0 comments on commit cd67194

Please sign in to comment.