Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #118 from Yamazaki93/develop
Browse files Browse the repository at this point in the history
Release Update For 0.4.0
  • Loading branch information
Yamazaki93 authored Aug 21, 2018
2 parents 4b34200 + 0278cb0 commit e7e81b6
Show file tree
Hide file tree
Showing 14 changed files with 118 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,15 @@ describe('CommitDetailComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});
it('should untoggle panel and file panel when selected commit is null', () => {
let commitSelection = TestBed.get(CommitSelectionService) as MockCommitSelection;
component.toggled = true;
component.fileToggled = true;

commitSelection.selectionChange.emit(null);
fixture.detectChanges();

expect(component.toggled).toBeFalsy();
expect(component.fileToggled).toBeFalsy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { FileViewPanelComponent } from '../file-view-panel/file-view-panel.compo
})
export class CommitDetailComponent implements OnInit {

private toggled = false;
toggled = false;
fileToggled = false;
private loading = false;
private fileToggled = false;
private selectedCommit: CommitDetail = null;
private selectedTab = "";
private selectedFile = "";
Expand All @@ -42,7 +42,9 @@ export class CommitDetailComponent implements OnInit {
this.selectedTab = 'info';
}
} else {
this.fileToggled = false;
this.toggled = false;
this.closeFilePanel();
this.layout.isDetailPanelOpen = false;
}
});
selection.selectingChange.subscribe(selecting => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,27 @@ describe('CommitSelectionService', () => {
it('should be created', inject([CommitSelectionService], (service: CommitSelectionService) => {
expect(service).toBeTruthy();
}));

it('should set selectedCommit to null and emit changes on repo closed', inject([CommitSelectionService], (service: CommitSelectionService) => {
let emit = false;
let electron = TestBed.get(ElectronService) as MockElectron;
service.selectionChange.subscribe(s => {
emit = true;
});
electron.receiveEvent('Repo-Closed', {});

expect(service.selectedCommit).toBeNull();
expect(emit).toBeTruthy();
}));
it('should set selectedCommit to null and emit changes on repo opened', inject([CommitSelectionService], (service: CommitSelectionService) => {
let emit = false;
let electron = TestBed.get(ElectronService) as MockElectron;
service.selectionChange.subscribe(s => {
emit = true;
});
electron.receiveEvent('Repo-OpenSuccessful', {});

expect(service.selectedCommit).toBeNull();
expect(emit).toBeTruthy();
}));
});
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ export class CommitSelectionService {
this._selectedFile = "";
this.selectedFileChange.emit(this._selectedFile);
});
this.electron.onCD('Repo-Closed', (event, arg) => {
this.selectedCommit = null;
this.selectionChange.emit(this.selectedCommit);
});

this.electron.onCD('Repo-OpenSuccessful', (event, arg) => {
this.selectedCommit = null;
this.selectionChange.emit(this.selectedCommit);
});
}

selectFileDetail(file, sha = null, fullFile = false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<h2>
<i class="icon-info mr-3"></i>About</h2>
<div class="content-container full-width">
<h3>MetroGit 0.3.0</h3>
<h3>MetroGit 0.4.0</h3>
<h5>Repository: <a href="javascript:void(0)" (click)="goToRepo()">https://github.com/Yamazaki93/MetroGit</a></h5>
<h5>Love this app? I will greatly appreciate it if you can <a href="javascript:void(0)" (click)="goToBMC()">Buy Me A Tea</a> !</h5>
<h5>License: MIT © Ming-Hung (Michael) Lu</h5>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ export class AboutPageComponent implements OnInit {
goToRepo() {
this.electron.ipcRenderer.send('Shell-Open', {url: 'https://github.com/Yamazaki93/MetroGit'});
}
goToBMC() {
this.electron.ipcRenderer.send('Shell-Open', {url: 'https://www.buymeacoffee.com/mjCsGWDTS'});
}
}
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
<div class="p-3">
<h2>
<i class="icon-package mr-3"></i>Release Notes 0.3.0</h2>
<i class="icon-package mr-3"></i>Release Notes 0.4.0</h2>
<div class="content-container full-width">
<h3>
<i class="icon-star mr-3"></i>Highlights</h3>
<ul>
<li>JIRA Tab Rebooted - You get to see any JIRA issue you want! The details tab is reworked to allow using the JIRA UI
when no commits are selected. JIRA UI is also reworked to include searching for JIRA issue by key and summary. Also
added functions: adding JIRA subtask, editing JIRA title, select JIRA resolution on-the-fly during transition
<li>Fine Tuned Staging And Unstaging - New to MetroGit is the ability to stage by hunk and lines individually so making
partial commit is never easier. File changes view now also supports live update so you can preview changes in realtime.
<br/>
<img src="assets/release-note/MG0.3.0-1.gif">
<img src="assets/release-note/MG0.4.0-1.gif">
</li>
<li>Viewing Entire File With Changes - Tired of seeing scattered changes? Now you can toggle between whole
file mode and hunks mode to see changes in a whole new way. In whole file mode, the changes in the commit
are conveniently color coded and mixed in with the rest of the contents. Also added: file viewer now distinguish
betwen binary and non-binary files and you can now filter by change type in the "File Changes" list
<li>Repo History And Initialization - Managing multiple repository? No problem. MetroGit now display all previous opened
repo conveniently in the file tab so you can switch between repositories easily. You can also initialize a brand
new repo just with MetroGit.
<br/>
<img src="assets/release-note/MG0.3.0-2.gif">
<img src="assets/release-note/MG0.4.0-2.gif">
</li>
<li>Repositiory Profile - Switching between work and personal use has never been easier. MetroGit now allows setting up
profile per repository so you can commit with different name and email per repository. The profile will be automatically
applied when you open another repo.
<br/>
<img src="assets/release-note/MG0.3.0-3.gif">
</li>
<li>Viewing of Submodules - Now you can see submodules and their commit information next to your commits.
<br/>
</li>
<li>New In-App Updater - Settings section now includes a brand new update component. Allowing manual checking of updates and downloading updates.
<li>JIRA Issue Navigation - Now you can navigate between different JIRA issues with ease. MetroGit remembers previous JIRA
issues you have opened so you don't have to remember the previous story keys.
<br/>
<img src="assets/release-note/MG0.4.0-3.gif">
</li>
</ul>
<h3>
<i class="icon-plus-circle mr-3"></i>New</h3>
<ul>
<li>About Page</li>
<li>Delete Branch</li>
<li>Turn On/Off Tooltips</li>
<li>Auto Cache Cleanup</li>
<li>New JIRA Resolution Selector</li>
</ul>
<!--<h3>
<h3>
<i class="icon-alert-triangle mr-3"></i>Bugfixes</h3>
<ul>
<li>#26 Strange Files Committed</li>
<li>#46 FileDetailPanel Remains Open After Changes Committed</li>
<li>#51 MacOS Menu Not Showing Correctly</li>
</ul>-->
<li>#111 File In Changes Sometimes Shows All Line As Created</li>
</ul>
</div>
</div>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions app/git/file-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ function getFileDetail(path, commit, fullFile = false) {
})
});
} else if (commit === 'workdir') {
return NodeGit.Diff.indexToWorkdir(Repo, null, {
flags: NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS
return Repo.index().then(ind => {
return NodeGit.Diff.indexToWorkdir(Repo, ind, {
flags: NodeGit.Diff.OPTION.SHOW_UNTRACKED_CONTENT | NodeGit.Diff.OPTION.RECURSE_UNTRACKED_DIRS
})
}).then(diff => {
return processDiff(diff, path, commit, fullFile);
})
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"type": "git",
"url": "https://github.com/Yamazaki93/MetroGit.git"
},
"author": "Michael Lu",
"author": {
"name": "Michael Lu",
"email": "[email protected]"
},
"license": "SEE LICENSE IN LICENSE",
"devDependencies": {
"electron": "^1.8.4",
Expand All @@ -41,14 +44,21 @@
"provider": "github"
}
},
"linux": {
"target": "deb",
"category": "Development",
"publish": {
"provider": "github"
}
},
"nsis": {
"license": "../LICENSE"
},
"extends": null
},
"dependencies": {
"axios": "^0.18.0",
"electron-updater": "^2.21.10",
"electron-updater": "^3.0.3",
"get-folder-size": "^2.0.0",
"keytar": "^4.2.1",
"nodegit": "^0.22.0",
Expand Down
5 changes: 5 additions & 0 deletions publish-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd app/frontend
ng build --prod --aot=false
cd ../..

electron-builder build --linux --publish always
49 changes: 28 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ [email protected], builder-util-runtime@^4.2.0:
fs-extra-p "^4.5.2"
sax "^1.2.4"

builder-util-runtime@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-4.2.1.tgz#0caa358f1331d70680010141ca591952b69b35bc"
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"
dependencies:
bluebird-lst "^1.0.5"
debug "^3.1.0"
fs-extra-p "^4.6.0"
fs-extra-p "^4.6.1"
sax "^1.2.4"

[email protected]:
Expand Down Expand Up @@ -680,19 +680,19 @@ [email protected]:
lazy-val "^1.0.3"
mime "^2.3.1"

electron-updater@^2.21.10:
version "2.21.10"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-2.21.10.tgz#aa66757ebf966f4247f247a8433af45cfe8e93b0"
electron-updater@^3.0.3:
version "3.1.1"
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-3.1.1.tgz#4214d39680b3194a492f593e871a8c463d8970f4"
dependencies:
bluebird-lst "^1.0.5"
builder-util-runtime "~4.2.1"
builder-util-runtime "~4.4.1"
electron-is-dev "^0.3.0"
fs-extra-p "^4.6.0"
js-yaml "^3.11.0"
fs-extra-p "^4.6.1"
js-yaml "^3.12.0"
lazy-val "^1.0.3"
lodash.isequal "^4.5.0"
semver "^5.5.0"
source-map-support "^0.5.5"
source-map-support "^0.5.6"

electron@^1.8.4:
version "1.8.4"
Expand Down Expand Up @@ -827,12 +827,12 @@ fs-extra-p@^4.5.0, fs-extra-p@^4.5.2:
bluebird-lst "^1.0.5"
fs-extra "^5.0.0"

fs-extra-p@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/fs-extra-p/-/fs-extra-p-4.6.0.tgz#c7b7117f0dcf8a99c9b2ed589067c960abcf3ef9"
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"
dependencies:
bluebird-lst "^1.0.5"
fs-extra "^6.0.0"
fs-extra "^6.0.1"

fs-extra@^0.30.0:
version "0.30.0"
Expand Down Expand Up @@ -860,9 +860,9 @@ fs-extra@^5.0.0:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.0.tgz#0f0afb290bb3deb87978da816fcd3c7797f3a817"
fs-extra@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-6.0.1.tgz#8abc128f7946e310135ddc93b98bddb410e7a34b"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
Expand Down Expand Up @@ -1205,6 +1205,13 @@ js-yaml@^3.10.0, js-yaml@^3.11.0:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^3.12.0:
version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
Expand Down Expand Up @@ -2026,9 +2033,9 @@ source-map-support@^0.5.4:
dependencies:
source-map "^0.6.0"

source-map-support@^0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.5.tgz#0d4af9e00493e855402e8ec36ebed2d266fceb90"
source-map-support@^0.5.6:
version "0.5.8"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.8.tgz#04f5581713a8a65612d0175fbf3a01f80a162613"
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
Expand Down

0 comments on commit e7e81b6

Please sign in to comment.