Skip to content

Commit

Permalink
Merge pull request #14 from kleder/develop
Browse files Browse the repository at this point in the history
* Fixes of UI
* notification fixes
* change version to 1.0.0
* ubuntu fix
  • Loading branch information
rkorszun authored Jan 22, 2018
2 parents e7de976 + 9b3343c commit 031057f
Show file tree
Hide file tree
Showing 52 changed files with 1,035 additions and 462 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ script:
- npm --version
- npm install
- npm run electron:$TARGET
- zip -r build.zip app-builds/Trec-*-x64/
- zip -r build.zip app-builds/T-Rec-*/

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# T-Rec time recording app

![T-rec image](./src/assets/trec-logo.png)
![T-Rec image](./src/assets/trec-logo.png)

T-Rec is a desktop time recording app that helps you log your work time into Youtrack. Recorded time entries are automatically synced to InCloud or Standalone Youtrack.

Expand Down
36 changes: 33 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ try {
// app.on('ready', createWindow);
app.on('ready', () => {
let trayImage = ''
if (process.platform == 'darwin') {
if (process.platform == 'darwin' || process.platform == 'linux') {
trayImage = './assets/tray/osx/icon_tray-normal.png';
}
else if (process.platform == 'win32') {
Expand All @@ -103,30 +103,49 @@ try {
mainWindow = new BrowserWindow({
width: 400,
height: 650,
minWidth:400,
minHeight: 650,
title: 'T-Rec App',
frame: false,
icon: __dirname + '/assets/trec-logo.png',
show: false
})



splash = new BrowserWindow({
width: 400,
height: 420,
minWidth:400,
minHeight: 420,
frame: false,
alwaysOnTop: true
})
splash.loadURL(url.format({
pathname: path.join(__dirname, 'splash.html'),
protocol: 'file',
slashes: true,
icon: __dirname + '/assets/trec-logo.png'
}))

mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file',
slashes: true,
icon: __dirname + '/assets/trec-logo.png'
}))
}))

mainWindow.webContents.executeJavaScript(`
var path = require('path');
module.paths.push(path.resolve('node_modules'));
module.paths.push(path.resolve('../node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'electron', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'electron.asar', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'app', 'node_modules'));
module.paths.push(path.resolve(__dirname, '..', '..', 'app.asar', 'node_modules'));
path = undefined;
`);

splash.once("ready-to-show", () => { splash.show()
})
setTimeout(() => {
Expand All @@ -138,7 +157,7 @@ try {
mainWindow.on('closed', function() {
app.quit()
})

mainWindow.webContents.on('context-menu', (e, props) => {
const InputMenu = Menu.buildFromTemplate([
{ label: "Cut",
Expand Down Expand Up @@ -172,6 +191,17 @@ try {
submenu: newMenu.initMenu(app, mainWindow)
}
]
mainMenuTemplate.push(
{
label: 'Edit',
submenu: [
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'selectall'}
]
}
)
Menu.setApplicationMenu(Menu.buildFromTemplate(mainMenuTemplate))
}

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function pack(plat, arch, cb) {

if (icon) {
DEFAULT_OPTS.icon = icon + (() => {
let extension = '.png';
let extension = '.ico';
if (plat === 'darwin') {
extension = '.icns';
} else if (plat === 'win32') {
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Trec",
"version": "0.9.5",
"description": "T-rec time tracker is built for speed and live work item update in youtrack system.",
"name": "T-Rec",
"version": "1.0.0",
"description": "T-Rec time tracker is built for speed and live work item update in youtrack system.",
"homepage": "",
"author": {
"name": "Kleder",
Expand Down Expand Up @@ -34,13 +34,13 @@
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-rebuild -f -w sqlite3",
"electron-rebuild": "electron-rebuild -f -w sqlite3"
"postinstall": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time",
"electron-rebuild": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time"
},
"dependencies": {
"@paulcbetts/system-idle-time": "git+https://github.com/paulcbetts/node-system-idle-time.git",
"sqlite3": "^3.1.13",
"electron-notifications": "^1.0.0"
"@paulcbetts/system-idle-time": "^1.0.4",
"electron-notifications": "^1.0.0",
"sqlite3": "^3.1.13"
},
"devDependencies": {
"@angular/animations": "^4.4.3",
Expand All @@ -56,7 +56,6 @@
"ionicons": "^3.0.0",
"ngx-loading": "^1.0.8",
"rxjs": "5.4.3",

"zone.js": "0.8.17",
"@angular/compiler": "4.4.3",
"electron-builder": "^19.37.2",
Expand Down
3 changes: 2 additions & 1 deletion src/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CustomMenu {
label: 'Accounts',
submenu: [
{
label: 'Switch',
label: 'Switch account',
click() {
mainWindow.webContents.executeJavaScript('window.location="#/accounts"')
}
Expand Down Expand Up @@ -49,6 +49,7 @@ export class CustomMenu {
{ type:'separator' },
{
label: 'Quit',
accelerator: 'CommandOrControl+Q',
click() {
app.quit()
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ body {
}
&.show {
visibility: visible;
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.2s;
animation: fadein 0.5s, fadeout 0.5s 2.2s;
-webkit-animation: fadein 0.5s, fadeout 0.5s 5.2s;
animation: fadein 0.5s, fadeout 0.5s 5.2s;
}
span {
color: $white;
Expand Down
8 changes: 3 additions & 5 deletions src/app/components/about-trec/about-trec.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
<div class="about-trec__title">About</div>
</div>
<div class="about-trec__content">

Kleder &#169; 2018
<img src="../../../assets/trec-logo.svg" class="about-trec-img">
<p>
Version <b>{{version.version}}</b> <br>
Commit <b>{{version.revision}}</b> <br>
Branch <b>{{version.branch}}</b>
Commit <b>{{version.revision}}</b> <br><br>
</p>
<p>
Special thanks go to:<br><br>
Expand All @@ -27,5 +25,5 @@
<a (click)="open('https://twitter.com/klederco')"><i class="fa fa-twitter"></i></a>
<a (click)="open('https://github.com/kleder')"><i class="fa fa-github"></i></a>
</div>
<a (click)="open('http://kleder.co')">kleder.co</a>
<a (click)="open('http://kleder.co')">kleder.co &#169; 2018</a>
</div>
8 changes: 4 additions & 4 deletions src/app/components/about-trec/about-trec.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
right: 0;
width: 140px;
margin: 0 auto;
padding: 31px 0 2px;
padding: 20px 0 0px;
background-color: $menu-color;
}
&__title {
Expand All @@ -27,17 +27,17 @@
font-family: 'Montserrat', sans-serif;
color: $white;
text-align: center;
padding: 44px 20px 90px;
padding: 38px 20px 90px;
margin-bottom: 20px;
height: 100%;
font-size: 14px;
img {
max-width: 160px;
margin: 20px auto 20px;
margin: 0 auto 0;
display: block;
}
p {
margin: 36px 0 22px 0;
margin: 26px 0 22px 0;
}
b {
color: $custom-red;
Expand Down
24 changes: 13 additions & 11 deletions src/app/components/add-account/add-account.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
<div class="add-account__header">
<div class="add-account__title">Add new account</div>
</div>
<form class="add-account_content">
<div class="add-account__form">
<input id="add-account__name" [(ngModel)]="name" name="name" placeholder="Custom name for an account" onfocus="this.placeholder=''" onblur="this.placeholder='Custom name for the account'" type="text" required>
<input id="add-account__url" [(ngModel)]="youTrackUrl" name="youTrackUrl" placeholder="YouTrack home URL" onfocus="this.placeholder=''" onblur="this.placeholder='YouTrack home URL'" type="text" required>
<input id="add-account__token" [(ngModel)]="token" name="token" placeholder="Token" onfocus="this.placeholder=''" onblur="this.placeholder='Token'" type="text" required>
<div class="add-account__buttons">
<button class="btn btn--grey" type="submit" routerLink="/accounts">CANCEL</button>
<button class="btn btn--red"(click)="login()" type="submit">ADD ACCOUNT</button>
<div class="add-account__content">
<span *ngIf="accounts?.length > 0" class="add-account__close trec-icon-close" routerLink="/accounts"></span>
<form #formCtrl="ngForm">
<div class="add-account__form">
<input id="add-account__name" [(ngModel)]="name" name="name" placeholder="Custom name for an account" onfocus="this.placeholder=''" onblur="this.placeholder='Custom name for the account'" type="text" required>
<input id="add-account__url" [(ngModel)]="youTrackUrl" name="youTrackUrl" placeholder="YouTrack home URL" onfocus="this.placeholder=''" onblur="this.placeholder='YouTrack home URL'" type="text" required>
<input id="add-account__token" [(ngModel)]="token" name="token" placeholder="Token" onfocus="this.placeholder=''" onblur="this.placeholder='Token'" type="text" required>
<div class="add-account__hint">How to obtain a new permament token? <a (click)="openInBrowser()">Click here</a></div>
<div class="add-account__buttons">
<button [ngClass]="!formCtrl.form.valid? 'btn--grey' : 'btn--red'" [disabled]="!formCtrl.form.valid" class="btn"(click)="login()" type="submit">ADD ACCOUNT</button>
</div>
</div>
</div>
<div class="add-account__hint">How to obtain a new permament token? <a (click)="openInBrowser()">Click here</a></div>
</form>
</form>
</div>
</div>
20 changes: 17 additions & 3 deletions src/app/components/add-account/add-account.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
font-weight: 400;
text-align: center;
}
&__content {
position: relative;
.add-account__close {
position: absolute;
top: -6px;
right: 14px;
color: white;
font-size: 24px;
font-weight: 700;
cursor: pointer;
}
}
&__form {
padding: 20px 20px 30px 20px;
font-size: 20px;
Expand Down Expand Up @@ -56,9 +68,11 @@
cursor: default;
.btn {
display: inline-block;
width: calc(50% - 4px);
&:nth-child(2) {
float: right;
float: right;
}
&--center {
width: 100%;
}
}
}
Expand All @@ -71,7 +85,7 @@
color: $custom-red;
}
&__hint {
margin-top: 100px;
margin: -8px 0 16px 0;
font-family: 'Montserrat', sans-serif;
color: $font-grey;
text-align: center;
Expand Down
Loading

0 comments on commit 031057f

Please sign in to comment.