From 1798010698720bbd6b4fe9f2ea68d5e51b17a579 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Thu, 18 Jan 2018 15:13:38 +0100 Subject: [PATCH 01/41] edit submenu for osx --- main.ts | 13 ++++++++++++- src/app/services/menu.service.ts | 13 +++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 5534ba5..345a254 100644 --- a/main.ts +++ b/main.ts @@ -138,7 +138,7 @@ try { mainWindow.on('closed', function() { app.quit() }) - + mainWindow.webContents.on('context-menu', (e, props) => { const InputMenu = Menu.buildFromTemplate([ { label: "Cut", @@ -172,6 +172,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)) } diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index 043f10f..5ee395c 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -30,6 +30,19 @@ export class MenuService { submenu: newMenu.initMenu(app, remote.getCurrentWindow()) } ] + if (process.platform == 'darwin') { + mainMenuTemplate.push( + { + label: 'Edit', + submenu: [ + {role: 'cut'}, + {role: 'copy'}, + {role: 'paste'}, + {role: 'selectall'} + ] + } + ) + } mainMenuTemplate[0].submenu[0].enabled = arg console.log("remote.menuitem", remote.MenuItem[0]) remote.Menu.setApplicationMenu(Menu.buildFromTemplate(mainMenuTemplate)) From 7ca86e3f8c08d76c643db66de2f550c7912fa6ba Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Thu, 18 Jan 2018 15:16:09 +0100 Subject: [PATCH 02/41] html, css changes in views --- .../about-trec/about-trec.component.scss | 2 +- .../add-account/add-account.component.ts | 6 +- .../boards-choice.component.scss | 9 +- .../edit-account/edit-account.component.scss | 15 ++-- .../licenses/licenses.component.scss | 2 +- .../switch-account.component.html | 2 +- .../switch-account.component.ts | 6 +- .../tracking/dashboard/dashboard.component.ts | 13 +-- .../tracking/tracking.component.html | 20 ++++- .../tracking/tracking.component.scss | 82 +++++++++++++----- src/app/theme/colors.scss | 2 +- src/assets/icons/trec-icons.eot | Bin 3640 -> 4036 bytes src/assets/icons/trec-icons.svg | 1 + src/assets/icons/trec-icons.ttf | Bin 3464 -> 3860 bytes src/assets/icons/trec-icons.woff | Bin 3540 -> 3936 bytes src/styles.scss | 7 ++ 16 files changed, 117 insertions(+), 50 deletions(-) diff --git a/src/app/components/about-trec/about-trec.component.scss b/src/app/components/about-trec/about-trec.component.scss index b37f8b2..032ff8a 100644 --- a/src/app/components/about-trec/about-trec.component.scss +++ b/src/app/components/about-trec/about-trec.component.scss @@ -27,7 +27,7 @@ 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; diff --git a/src/app/components/add-account/add-account.component.ts b/src/app/components/add-account/add-account.component.ts index 3ec1774..ac8b11c 100644 --- a/src/app/components/add-account/add-account.component.ts +++ b/src/app/components/add-account/add-account.component.ts @@ -11,6 +11,7 @@ import { ToasterService } from '../../services/toaster.service'; import { shell } from 'electron'; import { DataService } from '../../services/data.service'; +import { MenuService } from '../../services/menu.service' @Component({ selector: 'app-add-account', @@ -31,7 +32,8 @@ export class AddAccountComponent implements OnInit { public activatedRoute: ActivatedRoute, public apiService: ApiService, public toasterService: ToasterService, - public dataService: DataService + public dataService: DataService, + private menuService: MenuService ) { } @@ -45,6 +47,8 @@ export class AddAccountComponent implements OnInit { var current = await this.account.Current(); if (current != undefined && !this.firstAccount){ this.router.navigate(['/boards'], { queryParams: {justLoggedIn: false, name: current.name, url: current.url} }); + } else if (current == undefined) { + this.menuService.enabledWorkspace(false) } } diff --git a/src/app/components/boards-choice/boards-choice.component.scss b/src/app/components/boards-choice/boards-choice.component.scss index 0839c16..b957439 100644 --- a/src/app/components/boards-choice/boards-choice.component.scss +++ b/src/app/components/boards-choice/boards-choice.component.scss @@ -91,11 +91,12 @@ cursor: pointer; &:checked { &:before { - content: "\2714"; - font-size: 22px; + font-family: 'trec-icons' !important; + content: "\e901"; + font-size: 28px; position: absolute; - top: 12px; - left: 17px; + top: 11px; + left: 15px; color: $custom-red; } } diff --git a/src/app/components/edit-account/edit-account.component.scss b/src/app/components/edit-account/edit-account.component.scss index e663e73..ecabab0 100644 --- a/src/app/components/edit-account/edit-account.component.scss +++ b/src/app/components/edit-account/edit-account.component.scss @@ -36,7 +36,7 @@ cursor: default; } .edit-account__form { - margin: 23px 0 30px; + margin-bottom: 30px; .edit-account__title { margin-bottom: 15px; } @@ -109,12 +109,13 @@ cursor: pointer; &:checked { &:before { - content: "\2714"; - font-size: 22px; - position: absolute; - top: 12px; - left: 17px; - color: $custom-red; + font-family: 'trec-icons' !important; + content: "\e901"; + font-size: 28px; + position: absolute; + top: 11px; + left: 15px; + color: $custom-red; } } &:checked + label { diff --git a/src/app/components/licenses/licenses.component.scss b/src/app/components/licenses/licenses.component.scss index 927c59a..37cf7a2 100644 --- a/src/app/components/licenses/licenses.component.scss +++ b/src/app/components/licenses/licenses.component.scss @@ -27,7 +27,7 @@ font-family: 'Montserrat', sans-serif; box-sizing: border-box; color: $white; - padding: 20px 20px 20px 30px; + padding: 10px 20px 30px; margin-bottom: 20px; overflow: auto; } diff --git a/src/app/components/switch-account/switch-account.component.html b/src/app/components/switch-account/switch-account.component.html index 659b318..6f57619 100644 --- a/src/app/components/switch-account/switch-account.component.html +++ b/src/app/components/switch-account/switch-account.component.html @@ -13,7 +13,7 @@
- +
diff --git a/src/app/components/switch-account/switch-account.component.ts b/src/app/components/switch-account/switch-account.component.ts index b2c518a..f4ad449 100644 --- a/src/app/components/switch-account/switch-account.component.ts +++ b/src/app/components/switch-account/switch-account.component.ts @@ -35,12 +35,12 @@ export class SwitchAccountComponent implements OnInit { public async getAccounts(): Promise { this.accounts = await this.databaseService.getAccounts(); console.log("this.accounts", this.accounts) + this.accounts.forEach(account => { + account.current? this.isCurrentAccountExists = true : '' + }) if (this.accounts.length == 0) { this.goToAddAccount(true) } - this.accounts.forEach(account => { - account.current? this.isCurrentAccountExists = true : '' - }) } public setAsCurrent(clickedAccount) { diff --git a/src/app/components/tracking/dashboard/dashboard.component.ts b/src/app/components/tracking/dashboard/dashboard.component.ts index 114ab5f..39f16cb 100644 --- a/src/app/components/tracking/dashboard/dashboard.component.ts +++ b/src/app/components/tracking/dashboard/dashboard.component.ts @@ -224,6 +224,7 @@ export class DashboardComponent implements OnInit { this.toasterService.showToaster('Your tracking has been removed!', 'default') } if (action == 'resume') { + this.timerService.turnTimer(item); this.agiles.filter(agile => { if (agile.name == item.agile) { agile.issues.filter(issue => { @@ -232,7 +233,7 @@ export class DashboardComponent implements OnInit { unstoppedIssue.date = item.date unstoppedIssue.duration = item.duration console.log(unstoppedIssue) - this.sendWorkItems(unstoppedIssue) + this.startTracking(unstoppedIssue, item.duration) this.hideModal() } }) @@ -260,14 +261,16 @@ export class DashboardComponent implements OnInit { } } - public startTracking(issue: any) { + public startTracking(issue: any, duration?) { + console.log('issue in start tracking', issue) var item = new WorkItemData; item.issueId = issue.id; - item.duration = 0; - item.date = Date.now(); - item.startDate = Date.now(); + item.duration = duration || 0; + item.date = issue.date || Date.now(); + item.startDate = issue.startDate || Date.now(); item.summary = issue.field.summary; item.agile = issue.field.sprint[0].id.split(':')[0] + console.log("issue.id ", issue.id) console.log("summary", issue.field) this.timerService.startItem(item); } diff --git a/src/app/components/tracking/tracking.component.html b/src/app/components/tracking/tracking.component.html index 43dd19b..107f2be 100644 --- a/src/app/components/tracking/tracking.component.html +++ b/src/app/components/tracking/tracking.component.html @@ -31,7 +31,7 @@ \ No newline at end of file diff --git a/src/app/components/edit-account/edit-account.component.scss b/src/app/components/edit-account/edit-account.component.scss index ecabab0..ddaf55d 100644 --- a/src/app/components/edit-account/edit-account.component.scss +++ b/src/app/components/edit-account/edit-account.component.scss @@ -159,7 +159,7 @@ color: $white; } .edit-account__remove-account { - margin-bottom: 144px; + margin-bottom: 50px; .btn { .trec-icon-remove { font-size: 20px; @@ -208,7 +208,7 @@ text-align: center; padding: 24px; z-index: 10000; - background-color: #3b3e42; + background-color: $menu-color; color: $white; font-family: 'Montserrat', sans-serif; border-radius: 4px; @@ -221,16 +221,23 @@ padding: 14px 7px 0; margin: 0 auto; button { + position: relative; display: inline-block; - width: 60px; - height: 22px; - border: 0px solid #ffffff; - border-radius: 2px; - font-family: 'Montserrat', sans-serif; - font-size: 12px; - font-weight: 500; - margin: 0 2px; - cursor: pointer; + padding: 0; + width: calc(50% - 4px); + height: 40px; + &:first-of-type { + float: left; + } + &:last-of-type { + float: right; + } + .trec-icon-remove { + vertical-align: sub; + margin-right: 2px; + font-size: 24px; + color: $custom-red; + } } } } diff --git a/src/app/components/edit-board/edit-board.component.scss b/src/app/components/edit-board/edit-board.component.scss index 466cd16..23a4aca 100644 --- a/src/app/components/edit-board/edit-board.component.scss +++ b/src/app/components/edit-board/edit-board.component.scss @@ -3,6 +3,7 @@ margin-top: 60px; width: 100%; height: 100%; + background-color: $content-color; .edit-board__header { position: absolute; top: 0; @@ -23,8 +24,9 @@ } .edit-board__content { padding: 38px 17px; - height: calc(100% - 72px); + max-height: 100%; background-color: $content-color; + box-sizing: border-box; overflow: auto; &--empty { .edit-board__title { @@ -40,6 +42,7 @@ cursor: default; } .edit-board__form { + margin-bottom: 60px; .edit-board__item { margin-top: 16px; margin-bottom: 8px; diff --git a/src/app/components/switch-account/switch-account.component.scss b/src/app/components/switch-account/switch-account.component.scss index f3fcc31..b623307 100644 --- a/src/app/components/switch-account/switch-account.component.scss +++ b/src/app/components/switch-account/switch-account.component.scss @@ -75,10 +75,6 @@ border: 0; cursor: pointer; } - i { - padding-right: 16px; - color: $custom-red; - } } } } diff --git a/src/app/components/tracking/tracking.component.scss b/src/app/components/tracking/tracking.component.scss index d51fd00..98b98bd 100644 --- a/src/app/components/tracking/tracking.component.scss +++ b/src/app/components/tracking/tracking.component.scss @@ -45,7 +45,6 @@ } } .content { - // margin-top: 127px; padding: 20px 10px; float: left; width: 100%; @@ -91,20 +90,6 @@ height: calc(100% - 107px); } } } - button { - &.danger { - background-color: $custom-red; - color: $white !important; - } - &.positive { - background-color: $normal; - color: $dark !important - } - &.info { - background-color: #38b4e7; - color: $white !important; - } - } #current-item { visibility: hidden; position: fixed; diff --git a/src/app/components/tracking/tracking.component.ts b/src/app/components/tracking/tracking.component.ts index 6eeec5c..eb4184b 100644 --- a/src/app/components/tracking/tracking.component.ts +++ b/src/app/components/tracking/tracking.component.ts @@ -65,7 +65,6 @@ export class TrackingComponent implements OnDestroy, OnInit { subscribeIssueTime() { this.dataService.currentIssueTime.takeWhile(() => this.alive).subscribe(data => { let issueTime = data["currentTime"] - //let startDate = data["startDate"] console.log("TAKE", data) if (issueTime % 60 === 0) { this.databaseService.updateDuration(Math.round(issueTime), this.timerService.currentIssue.startDate) diff --git a/src/app/services/api.service.ts b/src/app/services/api.service.ts index 3a842a3..a77a99b 100644 --- a/src/app/services/api.service.ts +++ b/src/app/services/api.service.ts @@ -11,7 +11,6 @@ import { resolve } from 'dns'; export class ApiService { constructor( - // public http: Http, public http: HttpService, public accounts: AccountService ) { diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index 5ee395c..f07571c 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -18,13 +18,7 @@ export class MenuService { ) { } - public enabledWorkspace(arg:boolean) { - // this.accounts = await this.databaseService.getAccounts(); - // console.log("this.accounts", this.accounts) - // let isCurrentAccountExists - // this.accounts.forEach(account => { - // account.current? isCurrentAccountExists = true : '' - // }) + public enabledWorkspace(arg:boolean) { var mainMenuTemplate:Array = [ { submenu: newMenu.initMenu(app, remote.getCurrentWindow()) From 428955db92478f47b3553b96917e7b6c4a31eb22 Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 11:20:05 +0100 Subject: [PATCH 07/41] added trec image to about --- src/app/components/about-trec/about-trec.component.html | 5 ++--- src/app/components/about-trec/about-trec.component.scss | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/app/components/about-trec/about-trec.component.html b/src/app/components/about-trec/about-trec.component.html index 5cfce27..665a3c8 100644 --- a/src/app/components/about-trec/about-trec.component.html +++ b/src/app/components/about-trec/about-trec.component.html @@ -3,8 +3,7 @@
About
- - Kleder © 2018 +

Version {{version.version}}
Commit {{version.revision}}
@@ -27,5 +26,5 @@

- kleder.co + kleder.co © 2018 \ No newline at end of file diff --git a/src/app/components/about-trec/about-trec.component.scss b/src/app/components/about-trec/about-trec.component.scss index 032ff8a..24ddef6 100644 --- a/src/app/components/about-trec/about-trec.component.scss +++ b/src/app/components/about-trec/about-trec.component.scss @@ -33,11 +33,11 @@ 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; From f0152e1de5304b8bba1c2ce4c4f115b6fd788c9c Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 12:00:21 +0100 Subject: [PATCH 08/41] disable switch account in menu when no accounts --- .../add-account/add-account.component.ts | 20 ++++++++++--- src/app/services/menu.service.ts | 28 +++++++++++++++---- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/app/components/add-account/add-account.component.ts b/src/app/components/add-account/add-account.component.ts index ac8b11c..1784e3c 100644 --- a/src/app/components/add-account/add-account.component.ts +++ b/src/app/components/add-account/add-account.component.ts @@ -12,6 +12,7 @@ import { shell } from 'electron'; import { DataService } from '../../services/data.service'; import { MenuService } from '../../services/menu.service' +import { DatabaseService } from '../../services/database.service' @Component({ selector: 'app-add-account', @@ -23,7 +24,8 @@ export class AddAccountComponent implements OnInit { public name = "" public youTrackUrl = ""; public token = ""; - public firstAccount: boolean + public firstAccount: boolean; + public accounts constructor( public http: Http, @@ -33,7 +35,8 @@ export class AddAccountComponent implements OnInit { public apiService: ApiService, public toasterService: ToasterService, public dataService: DataService, - private menuService: MenuService + private menuService: MenuService, + private databaseService: DatabaseService ) { } @@ -47,8 +50,13 @@ export class AddAccountComponent implements OnInit { var current = await this.account.Current(); if (current != undefined && !this.firstAccount){ this.router.navigate(['/boards'], { queryParams: {justLoggedIn: false, name: current.name, url: current.url} }); - } else if (current == undefined) { + } else if (current == undefined) { this.menuService.enabledWorkspace(false) + this.getAccounts().then(() => { + if (this.accounts.length == 0) { + this.menuService.enabledWorkspaceAndSwitchAccount(false) + } + }) } } @@ -79,7 +87,11 @@ export class AddAccountComponent implements OnInit { this.loader = false; } ) - + } + + public async getAccounts(): Promise { + this.accounts = await this.databaseService.getAccounts(); + console.log("this.accounts", this.accounts) } public errorName() { diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index f07571c..d627d28 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -11,6 +11,7 @@ const app = remote.app @Injectable() export class MenuService { accounts + mainMenuTemplate:Array constructor( private accountService: AccountService, public databaseService: DatabaseService, @@ -19,13 +20,33 @@ export class MenuService { } public enabledWorkspace(arg:boolean) { - var mainMenuTemplate:Array = [ + this.mainMenuTemplate = [ { submenu: newMenu.initMenu(app, remote.getCurrentWindow()) } ] + this.addEditMenu() + this.mainMenuTemplate[0].submenu[0].enabled = arg + console.log("remote.menuitem", remote.MenuItem[0]) + remote.Menu.setApplicationMenu(Menu.buildFromTemplate(this.mainMenuTemplate)) + } + + public enabledWorkspaceAndSwitchAccount(arg:boolean) { + this.mainMenuTemplate = [ + { + submenu: newMenu.initMenu(app, remote.getCurrentWindow()) + } + ] + this.addEditMenu() + console.log("this.mainMenuTemplate[1]", this.mainMenuTemplate[0].submenu[1].submenu[0]) + this.mainMenuTemplate[0].submenu[0].enabled = arg + this.mainMenuTemplate[0].submenu[1].submenu[0].enabled = arg + remote.Menu.setApplicationMenu(Menu.buildFromTemplate(this.mainMenuTemplate)) + } + + public addEditMenu() { if (process.platform == 'darwin') { - mainMenuTemplate.push( + this.mainMenuTemplate.push( { label: 'Edit', submenu: [ @@ -37,9 +58,6 @@ export class MenuService { } ) } - mainMenuTemplate[0].submenu[0].enabled = arg - console.log("remote.menuitem", remote.MenuItem[0]) - remote.Menu.setApplicationMenu(Menu.buildFromTemplate(mainMenuTemplate)) } } From 8ce17f026aaddf95d80af5d902bcedef2ef51e00 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 12:01:27 +0100 Subject: [PATCH 09/41] naming --- README.md | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cf7d8b9..6ffcb1e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json index 7035eed..3428f69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "Trec", + "name": "T-Rec", "version": "0.9.5", - "description": "T-rec time tracker is built for speed and live work item update in youtrack system.", + "description": "T-Rec time tracker is built for speed and live work item update in youtrack system.", "homepage": "", "author": { "name": "Kleder", From c0d06f6b005a2d945cd6c8766fdabccd2df71b3f Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 12:02:35 +0100 Subject: [PATCH 10/41] clean up --- src/app/services/menu.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index d627d28..487d92f 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -38,7 +38,6 @@ export class MenuService { } ] this.addEditMenu() - console.log("this.mainMenuTemplate[1]", this.mainMenuTemplate[0].submenu[1].submenu[0]) this.mainMenuTemplate[0].submenu[0].enabled = arg this.mainMenuTemplate[0].submenu[1].submenu[0].enabled = arg remote.Menu.setApplicationMenu(Menu.buildFromTemplate(this.mainMenuTemplate)) From 0a00712342dafdf67288754aff8392c5e0ae9075 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 13:08:37 +0100 Subject: [PATCH 11/41] save account id with task in db, get all items from db by account id --- .../tracking/activity/activity.component.ts | 15 ++++++++---- .../tracking/dashboard/dashboard.component.ts | 9 +++++--- src/app/models/RemoteAccount.ts | 1 + src/app/services/database.service.ts | 23 +++++++++---------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/app/components/tracking/activity/activity.component.ts b/src/app/components/tracking/activity/activity.component.ts index 6bf3e98..c6bb59d 100644 --- a/src/app/components/tracking/activity/activity.component.ts +++ b/src/app/components/tracking/activity/activity.component.ts @@ -6,6 +6,7 @@ import { ApiService } from '../../../services/api.service' import { WorkItemData } from 'app/models/RemoteAccount'; import { Router } from '@angular/router'; import { HttpService } from '../../../services/http.service' +import { AccountService } from '../../../services/account.service' @Component({ selector: 'app-activity', @@ -24,14 +25,16 @@ export class ActivityComponent implements OnInit { private dataService: DataService, private api: ApiService, public router: Router, - public httpService: HttpService + public httpService: HttpService, + public account: AccountService ) { this.todaySummaryItems = [] this.todayTimes = {} } - ngOnInit() { - this.databaseService.getAllItems().then(rows => { + async ngOnInit() { + var current = await this.account.Current(); + this.databaseService.getAllItems(current["id"]).then(rows => { if (rows) { this.prepareItems(rows) } @@ -76,13 +79,15 @@ export class ActivityComponent implements OnInit { } - public getIssueAndStart(issueId) { + async getIssueAndStart(issueId) { + let account = await this.account.Current() return new Promise(resolve => { this.api.getIssue(issueId).then(issue => { var newIssue : WorkItemData; newIssue = { + accountId: account["id"], issueId: issue["id"], - agile: "", + agile: issue.field.find(item => item.name == "sprint").value[0].id.split(":")[0], duration: 0, summary: issue.field.find(item => item.name == "summary" ).value, date: Date.now(), diff --git a/src/app/components/tracking/dashboard/dashboard.component.ts b/src/app/components/tracking/dashboard/dashboard.component.ts index 79070b4..017e6b7 100644 --- a/src/app/components/tracking/dashboard/dashboard.component.ts +++ b/src/app/components/tracking/dashboard/dashboard.component.ts @@ -97,10 +97,11 @@ export class DashboardComponent implements OnInit { }) } - public getItemsFromDb() { + async getItemsFromDb() { + let account = await this.account.Current() let that = this this.totalTimes = {} - this.databaseService.getAllItems().then(data => { + this.databaseService.getAllItems(account["id"]).then(data => { console.log("resolve from db", data) this.allItemsFromDb = data this.allItemsFromDb.forEach(function(row) { @@ -222,9 +223,11 @@ export class DashboardComponent implements OnInit { } } - public startTracking(issue: any, duration?) { + async startTracking(issue: any, duration?) { console.log('issue in start tracking', issue) + let account = await this.account.Current() var item = new WorkItemData; + item.accountId = account["id"], item.issueId = issue.id; item.duration = duration || 0; item.date = issue.date || Date.now(); diff --git a/src/app/models/RemoteAccount.ts b/src/app/models/RemoteAccount.ts index 7cef942..947f38c 100644 --- a/src/app/models/RemoteAccount.ts +++ b/src/app/models/RemoteAccount.ts @@ -28,6 +28,7 @@ class FieldValue { } export class WorkItemData { + public accountId: number public date: number public duration: number public issueId: string diff --git a/src/app/services/database.service.ts b/src/app/services/database.service.ts index 6d43a8b..59088e8 100644 --- a/src/app/services/database.service.ts +++ b/src/app/services/database.service.ts @@ -6,7 +6,6 @@ import { from } from 'rxjs/observable/from'; const sqlite3 = require('sqlite3').verbose() const path = require('path') - @Injectable() export class DatabaseService { public loader = false @@ -25,7 +24,7 @@ export class DatabaseService { var dbPath = path.resolve(folder,'database') this.db = new sqlite3.Database(dbPath, (data) => { if (data == null){ - this.db.run("CREATE TABLE IF NOT EXISTS `tasks` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `published` TEXT, `agile` TEXT, `issueid` TEXT, `status` TEXT, `date` INTEGER, `duration` INTEGER, `lastUpdate` TEXT )"); + this.db.run("CREATE TABLE IF NOT EXISTS `tasks` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER, `published` TEXT, `agile` TEXT, `issueid` TEXT, `status` TEXT, `date` INTEGER, `duration` INTEGER, `lastUpdate` TEXT)"); this.db.run("CREATE TABLE IF NOT EXISTS `account` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `name` TEXT, `url` TEXT, `token` TEXT, `current` INTEGER)"); this.db.run("CREATE TABLE IF NOT EXISTS `variables` (id INTEGER NOT NULL PRIMARY KEY, `name` TEXT UNIQUE, `value` INTEGER)"); this.db.run("CREATE TABLE IF NOT EXISTS `boards_states` (id INTEGER NOT NULL PRIMARY KEY, `accountId` INT, `boardName` TEXT, `state` TEXT, `hexColor` TEXT)"); @@ -41,12 +40,12 @@ export class DatabaseService { }) } - public async getAllItems() : Promise { + public async getAllItems(accountId) : Promise { let that = this return new Promise((resolve, reject) => { this.loader = true this.db.serialize(() => { - that.db.all('SELECT * FROM `tasks`', function(err, rows) { + that.db.all("SELECT * FROM `tasks` WHERE `accountId` = '" + accountId + "'" , function(err, rows) { that.loader = false if (err) { that.loader = false @@ -61,14 +60,14 @@ export class DatabaseService { } public startItem = (issue : WorkItemData) => { - let that = this - let status = "start" - let duration = 0 - this.db.serialize(function() { - let stmt = that.db.prepare("INSERT INTO `tasks` (`published`, `agile`, `issueid`, `status`, `date`, `duration`, `lastUpdate`,`summary`) VALUES (0, '" + issue.agile + "', '" + issue.issueId + "', '" + status + "', '" + issue.date + "', '" + duration + "', '" + issue.date + "','"+ issue.summary +"')"); - stmt.run() - stmt.finalize() - }); + let that = this + let status = "start" + let duration = 0 + this.db.serialize(function() { + let stmt = that.db.prepare("INSERT INTO `tasks` (`accountId`, `published`, `agile`, `issueid`, `status`, `date`, `duration`, `lastUpdate`,`summary`) VALUES ('" + issue.accountId + "', 0, '" + issue.agile + "', '" + issue.issueId + "', '" + status + "', '" + issue.date + "', '" + duration + "', '" + issue.date + "','"+ issue.summary +"')"); + stmt.run() + stmt.finalize() + }); } From 43a013304c8f6c1d8be5028620b5f69cf1102f9b Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 13:09:22 +0100 Subject: [PATCH 12/41] menu win css change --- src/app/components/toolbar/toolbar.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/toolbar/toolbar.component.scss b/src/app/components/toolbar/toolbar.component.scss index b082eb4..7a91b6f 100644 --- a/src/app/components/toolbar/toolbar.component.scss +++ b/src/app/components/toolbar/toolbar.component.scss @@ -77,7 +77,7 @@ cursor: pointer; -webkit-app-region: no-drag; float: left; - margin: 10px 0 0 15px; + margin: 1px 0 0 15px; font-size: 22px; } .toolbar__icon { From 60b4ecf0a39cf5fe653a54f6adfc2e81e099d555 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 13:09:29 +0100 Subject: [PATCH 13/41] clean up --- src/app/services/menu.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index 487d92f..877cd03 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -27,7 +27,6 @@ export class MenuService { ] this.addEditMenu() this.mainMenuTemplate[0].submenu[0].enabled = arg - console.log("remote.menuitem", remote.MenuItem[0]) remote.Menu.setApplicationMenu(Menu.buildFromTemplate(this.mainMenuTemplate)) } From a55ab84d5cc82d3e312982750ce884f4a9a02c59 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:22:35 +0100 Subject: [PATCH 14/41] menu changes --- src/Menu.ts | 3 ++- src/app/services/menu.service.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Menu.ts b/src/Menu.ts index 04f9e79..f0ec1ac 100644 --- a/src/Menu.ts +++ b/src/Menu.ts @@ -15,7 +15,7 @@ export class CustomMenu { label: 'Accounts', submenu: [ { - label: 'Switch', + label: 'Switch account', click() { mainWindow.webContents.executeJavaScript('window.location="#/accounts"') } @@ -49,6 +49,7 @@ export class CustomMenu { { type:'separator' }, { label: 'Quit', + accelerator: 'CommandOrControl+Q', click() { app.quit() } diff --git a/src/app/services/menu.service.ts b/src/app/services/menu.service.ts index 877cd03..52ad41b 100644 --- a/src/app/services/menu.service.ts +++ b/src/app/services/menu.service.ts @@ -48,6 +48,7 @@ export class MenuService { { label: 'Edit', submenu: [ + {role: 'undo'}, {role: 'cut'}, {role: 'copy'}, {role: 'paste'}, From ed07531fee3d9ad5e708c7670ca867e77e6f99a6 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:23:58 +0100 Subject: [PATCH 15/41] fix jumping loader --- src/app/components/tracking/dashboard/dashboard.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/components/tracking/dashboard/dashboard.component.ts b/src/app/components/tracking/dashboard/dashboard.component.ts index 017e6b7..c040989 100644 --- a/src/app/components/tracking/dashboard/dashboard.component.ts +++ b/src/app/components/tracking/dashboard/dashboard.component.ts @@ -71,7 +71,6 @@ export class DashboardComponent implements OnInit { public init() { this.api.getAllAgiles().then( data => { - this.httpService.loader = false this.agiles = data this.agiles.forEach(agile => { this.getAgileVisibility(agile.name) From f98ac6946e4f43a2ecd797ce4327473e5434ca9d Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:24:59 +0100 Subject: [PATCH 16/41] toaster +3s --- src/app/app.component.scss | 4 ++-- src/app/services/toaster.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/app.component.scss b/src/app/app.component.scss index f6cc69a..66537b7 100644 --- a/src/app/app.component.scss +++ b/src/app/app.component.scss @@ -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; diff --git a/src/app/services/toaster.service.ts b/src/app/services/toaster.service.ts index 31c7ee8..7ec3a3a 100644 --- a/src/app/services/toaster.service.ts +++ b/src/app/services/toaster.service.ts @@ -29,7 +29,7 @@ export class ToasterService { } setTimeout(function() { that.toaster.className = that.toaster.className.replace("show", "") - }, 2500); + }, 5500); }, 300) this.toaster.className = that.toaster.className.replace("default-notification--default", "") this.toaster.className = that.toaster.className.replace("default-notification--success", "") From 8e5b93972f67b818fc034564c5595a5a26218855 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:25:24 +0100 Subject: [PATCH 17/41] remove cancel button, add X, css changes --- .../about-trec/about-trec.component.scss | 2 +- .../add-account/add-account.component.html | 24 ++++++++++-------- .../add-account/add-account.component.scss | 20 ++++++++++++--- .../add-account/add-account.component.ts | 1 + .../boards-choice.component.html | 2 +- .../boards-choice.component.scss | 1 - .../change-account-token.component.html | 6 ++--- .../change-account-token.component.scss | 13 ++++++++-- .../edit-account/edit-account.component.html | 22 ++++++---------- .../edit-account/edit-account.component.scss | 25 ++++++++++++++++++- .../edit-account/edit-account.component.ts | 6 +++++ .../edit-board/edit-board.component.html | 10 +++----- .../edit-board/edit-board.component.scss | 12 ++++++++- .../licenses/licenses.component.scss | 2 +- .../switch-account.component.html | 4 +-- .../switch-account.component.scss | 13 ++++++++-- .../components/toolbar/toolbar.component.scss | 2 +- .../dashboard/dashboard.component.scss | 18 ++++++++++--- .../tracking/tracking.component.scss | 9 ++++--- src/styles.scss | 3 ++- 20 files changed, 138 insertions(+), 57 deletions(-) diff --git a/src/app/components/about-trec/about-trec.component.scss b/src/app/components/about-trec/about-trec.component.scss index 24ddef6..ec64c30 100644 --- a/src/app/components/about-trec/about-trec.component.scss +++ b/src/app/components/about-trec/about-trec.component.scss @@ -11,7 +11,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; } &__title { diff --git a/src/app/components/add-account/add-account.component.html b/src/app/components/add-account/add-account.component.html index f699e8c..7f8a9ae 100644 --- a/src/app/components/add-account/add-account.component.html +++ b/src/app/components/add-account/add-account.component.html @@ -2,16 +2,18 @@ - \ No newline at end of file diff --git a/src/app/components/add-account/add-account.component.scss b/src/app/components/add-account/add-account.component.scss index b1af7a2..449aaaf 100644 --- a/src/app/components/add-account/add-account.component.scss +++ b/src/app/components/add-account/add-account.component.scss @@ -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; @@ -56,9 +68,11 @@ cursor: default; .btn { display: inline-block; - width: calc(50% - 4px); &:nth-child(2) { - float: right; + float: right; + } + &--center { + width: 100%; } } } @@ -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; diff --git a/src/app/components/add-account/add-account.component.ts b/src/app/components/add-account/add-account.component.ts index 1784e3c..72c26f7 100644 --- a/src/app/components/add-account/add-account.component.ts +++ b/src/app/components/add-account/add-account.component.ts @@ -54,6 +54,7 @@ export class AddAccountComponent implements OnInit { this.menuService.enabledWorkspace(false) this.getAccounts().then(() => { if (this.accounts.length == 0) { + this.accounts = false this.menuService.enabledWorkspaceAndSwitchAccount(false) } }) diff --git a/src/app/components/boards-choice/boards-choice.component.html b/src/app/components/boards-choice/boards-choice.component.html index dc5c50a..e2cfbc7 100644 --- a/src/app/components/boards-choice/boards-choice.component.html +++ b/src/app/components/boards-choice/boards-choice.component.html @@ -1,12 +1,12 @@
Select agile boards +
You will be able to edit this selection later
-
You will be able to edit this selection later
diff --git a/src/app/components/boards-choice/boards-choice.component.scss b/src/app/components/boards-choice/boards-choice.component.scss index 51e220c..d63e004 100644 --- a/src/app/components/boards-choice/boards-choice.component.scss +++ b/src/app/components/boards-choice/boards-choice.component.scss @@ -124,7 +124,6 @@ } } &__hint { - margin-top: 40px; font-family: 'Montserrat', sans-serif; color: $font-grey; text-align: center; diff --git a/src/app/components/change-account-token/change-account-token.component.html b/src/app/components/change-account-token/change-account-token.component.html index 1470950..0fc1ca0 100644 --- a/src/app/components/change-account-token/change-account-token.component.html +++ b/src/app/components/change-account-token/change-account-token.component.html @@ -1,15 +1,15 @@
diff --git a/src/app/components/change-account-token/change-account-token.component.scss b/src/app/components/change-account-token/change-account-token.component.scss index c351bf6..74ef659 100644 --- a/src/app/components/change-account-token/change-account-token.component.scss +++ b/src/app/components/change-account-token/change-account-token.component.scss @@ -11,7 +11,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; .change-account-token__title { font-family: 'Montserrat', sans-serif; @@ -23,10 +23,20 @@ } } .change-account-token__content { + position: relative; padding: 38px 17px; height: calc(100% - 72px); background-color: $content-color; overflow: auto; + .change-account__close { + position: absolute; + top: 18px; + right: 12px; + color: white; + font-size: 24px; + font-weight: 700; + cursor: pointer; + } .change-account-token__title { font-family: 'Montserrat', sans-serif; color: $font-grey; @@ -72,7 +82,6 @@ cursor: default; .btn { display: inline-block; - width: calc(50% - 4px); &:nth-child(2) { float: right; } diff --git a/src/app/components/edit-account/edit-account.component.html b/src/app/components/edit-account/edit-account.component.html index c375a2a..bc09668 100644 --- a/src/app/components/edit-account/edit-account.component.html +++ b/src/app/components/edit-account/edit-account.component.html @@ -3,20 +3,17 @@
diff --git a/src/app/components/edit-account/edit-account.component.scss b/src/app/components/edit-account/edit-account.component.scss index ddaf55d..e6fdf35 100644 --- a/src/app/components/edit-account/edit-account.component.scss +++ b/src/app/components/edit-account/edit-account.component.scss @@ -11,7 +11,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; .edit-account__title { font-family: 'Montserrat', sans-serif; @@ -23,10 +23,20 @@ } } .edit-account__content { + position: relative; padding: 38px 17px; height: calc(100% - 72px); background-color: $content-color; overflow: auto; + .edit-account__close { + position: absolute; + top: 18px; + right: 12px; + color: white; + font-size: 24px; + font-weight: 700; + cursor: pointer; + } .edit-account__title { font-family: 'Montserrat', sans-serif; color: $font-grey; @@ -121,6 +131,9 @@ &:checked + label { color: $white; } + &:hover + label { + color: $custom-red; + } } label { display: block; @@ -146,6 +159,9 @@ font-size: 22px; z-index: 1000; cursor: pointer; + &:hover { + color: $white; + } } &:last-of-type { margin-bottom: 32px; @@ -161,10 +177,17 @@ .edit-account__remove-account { margin-bottom: 50px; .btn { + position: relative; .trec-icon-remove { + position: absolute; + top: 12px; + left: 154px; font-size: 20px; vertical-align: sub; } + &:first-of-type { + margin-bottom: 8px; + } } } } diff --git a/src/app/components/edit-account/edit-account.component.ts b/src/app/components/edit-account/edit-account.component.ts index ec8c393..bdacae8 100644 --- a/src/app/components/edit-account/edit-account.component.ts +++ b/src/app/components/edit-account/edit-account.component.ts @@ -120,4 +120,10 @@ export class EditAccountComponent implements OnInit { }) } + public saveChanges(account) { + this.updateAgilesVisibility() + this.editNameOrUrl(account) + this.backToWorkspace() + } + } diff --git a/src/app/components/edit-board/edit-board.component.html b/src/app/components/edit-board/edit-board.component.html index 9135865..421baa3 100644 --- a/src/app/components/edit-board/edit-board.component.html +++ b/src/app/components/edit-board/edit-board.component.html @@ -3,6 +3,7 @@
Edit {{ boardName }}
+
SET PRIORITY COLORS
@@ -12,16 +13,13 @@
-
- - -
+
-
No states
- + +
No states
diff --git a/src/app/components/edit-board/edit-board.component.scss b/src/app/components/edit-board/edit-board.component.scss index 23a4aca..3c3ec90 100644 --- a/src/app/components/edit-board/edit-board.component.scss +++ b/src/app/components/edit-board/edit-board.component.scss @@ -11,7 +11,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; .edit-board__title { font-family: 'Montserrat', sans-serif; @@ -23,6 +23,7 @@ } } .edit-board__content { + position: relative; padding: 38px 17px; max-height: 100%; background-color: $content-color; @@ -33,6 +34,15 @@ margin-bottom: 32px; } } + .edit-board__close { + position: absolute; + top: 18px; + right: 12px; + color: white; + font-size: 24px; + font-weight: 700; + cursor: pointer; + } .edit-board__title { font-family: 'Montserrat', sans-serif; color: $font-grey; diff --git a/src/app/components/licenses/licenses.component.scss b/src/app/components/licenses/licenses.component.scss index 37cf7a2..ef74806 100644 --- a/src/app/components/licenses/licenses.component.scss +++ b/src/app/components/licenses/licenses.component.scss @@ -10,7 +10,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; .licenses__title { font-family: 'Montserrat', sans-serif; diff --git a/src/app/components/switch-account/switch-account.component.html b/src/app/components/switch-account/switch-account.component.html index 6f57619..fc717de 100644 --- a/src/app/components/switch-account/switch-account.component.html +++ b/src/app/components/switch-account/switch-account.component.html @@ -3,6 +3,7 @@
Accounts
+
    SET ACTIVE ACCOUNT
  • @@ -13,8 +14,7 @@
    - - +
\ No newline at end of file diff --git a/src/app/components/switch-account/switch-account.component.scss b/src/app/components/switch-account/switch-account.component.scss index b623307..21b04ab 100644 --- a/src/app/components/switch-account/switch-account.component.scss +++ b/src/app/components/switch-account/switch-account.component.scss @@ -9,7 +9,7 @@ right: 0; width: 140px; margin: 0 auto; - padding: 31px 0 2px; + padding: 20px 0 0px; background-color: $menu-color; } &__title { @@ -24,13 +24,13 @@ cursor: default; .btn { display: inline-block; - width: calc(50% - 4px); &:nth-child(2) { float: right; } } } &__content { + position: relative; .accounts__title { font-family: 'Montserrat', sans-serif; color: $font-grey; @@ -40,6 +40,15 @@ letter-spacing: 1px; cursor: default; } + .accounts__close { + position: absolute; + top: -32px; + right: 0px; + color: white; + font-size: 24px; + font-weight: 700; + cursor: pointer; + } ul { margin-top: 4px; padding: 0; diff --git a/src/app/components/toolbar/toolbar.component.scss b/src/app/components/toolbar/toolbar.component.scss index 7a91b6f..4a8bf5e 100644 --- a/src/app/components/toolbar/toolbar.component.scss +++ b/src/app/components/toolbar/toolbar.component.scss @@ -66,7 +66,7 @@ text-align: center; .toolbar__logo { display: inline-block; - margin-top: 17px; + margin-top: 3px; .logo { width: 72px; } diff --git a/src/app/components/tracking/dashboard/dashboard.component.scss b/src/app/components/tracking/dashboard/dashboard.component.scss index 9748f20..3c1a791 100644 --- a/src/app/components/tracking/dashboard/dashboard.component.scss +++ b/src/app/components/tracking/dashboard/dashboard.component.scss @@ -13,6 +13,7 @@ cursor: pointer; &:hover { .project-list__title { + opacity: 0.7; text-decoration: underline; } } @@ -41,7 +42,6 @@ height: 15px; background-color: #35343d; border-radius: 4px; - span { float: left; color: $font-grey; @@ -62,6 +62,9 @@ letter-spacing: 1px; cursor: pointer; outline: none; + &:hover { + color: $custom-red; + } } } .project-list__item { @@ -95,8 +98,10 @@ .project-list__id { padding-right: 14px; cursor: pointer; + text-decoration: underline; &:hover { - text-decoration: underline; + color: $white; + text-decoration: none; } } .project-list__priority { @@ -181,6 +186,8 @@ } } .loading-container { + height: calc(100% - 20px); + position: relative; padding: 10px; &__name { margin-bottom: 12px; @@ -211,7 +218,12 @@ } } .spinner { - margin-bottom: 30px; + position: absolute; + left: 0; + right: 0; + top: 190px; + bottom: 0; + margin: 0 auto; .lds-css { text-align: center; } diff --git a/src/app/components/tracking/tracking.component.scss b/src/app/components/tracking/tracking.component.scss index 98b98bd..4d1875e 100644 --- a/src/app/components/tracking/tracking.component.scss +++ b/src/app/components/tracking/tracking.component.scss @@ -8,13 +8,13 @@ width: 100%; background-color: $menu-color; ul { - padding: 0px 23px 0 30px; + padding: 0px 20px; margin: 0; margin-top: -10px; li { display: block; float: left; - width: 40%; + width: 47%; padding: 13px; color: $white; list-style: none; @@ -22,7 +22,10 @@ font-family: 'Montserrat', sans-serif; border-top: 0; box-sizing: border-box; - cursor: pointer; + cursor: pointer; + &:hover { + color: $custom-red; + } &.active { border-bottom: 2px solid $custom-red; } diff --git a/src/styles.scss b/src/styles.scss index 9d43aa5..2c546bd 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -22,7 +22,8 @@ html, body { outline: none; &--grey { background-color: $font-grey; - color: $font-btn-color; + color: $font-btn-color; + cursor: not-allowed; &:hover { background-color: $font-btn-color; color: $font-grey; From b8275440efb566a877dbd85356aa19aa0ba40dd0 Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 15:44:56 +0100 Subject: [PATCH 18/41] resize --- main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.ts b/main.ts index 345a254..6231352 100644 --- a/main.ts +++ b/main.ts @@ -103,6 +103,8 @@ try { mainWindow = new BrowserWindow({ width: 400, height: 650, + minWidth:400, + minHeight: 650, title: 'T-Rec App', frame: false, icon: __dirname + '/assets/trec-logo.png', @@ -112,6 +114,8 @@ try { splash = new BrowserWindow({ width: 400, height: 420, + minWidth:400, + minHeight: 420, frame: false, alwaysOnTop: true }) From 395edbab82c7f6bb61ad92f304bd16eddb86a6c0 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:50:02 +0100 Subject: [PATCH 19/41] report issue if > 10sec, ceil seconds all the time --- src/app/services/timer.service.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/app/services/timer.service.ts b/src/app/services/timer.service.ts index 20a2886..a2367f6 100644 --- a/src/app/services/timer.service.ts +++ b/src/app/services/timer.service.ts @@ -50,13 +50,19 @@ export class TimerService { if (this.currentIssue == undefined){ return 0; } - var stoppedTime = this.currentIssue.duration - if (stoppedTime < 60 && !this.hideHints) { - this.showModal() + if (stoppedTime <= 10) { + this.currentIssue = undefined + return 0 } + if (stoppedTime <= 10 && !this.hideHints) { + this.showModal() + } else if (stoppedTime > 10 && stoppedTime < 60) { + this.currentIssue = undefined + return stoppedTime = 60 + } this.currentIssue = undefined - return stoppedTime + return Math.ceil(stoppedTime/60)*60 } public startidleTime(min) { @@ -129,13 +135,13 @@ export class TimerService { this.trayDefault() let issue = this.currentIssue; console.log(issue) - let stoppedTime = this.stopIssueTimer() - if (stoppedTime >= 60) { + issue.duration = this.stopIssueTimer() + if (issue.duration >= 60) { return this.api.createNewWorkItem(issue).then( data => { this.stopIdleTime() // stop issueTimer && saveInDb - this.databaseService.stopItem(stoppedTime, issue.startDate) + this.databaseService.stopItem(issue.duration, issue.startDate) this.databaseService.setIsPublished(issue.startDate) this.stopTrackingNotifications() this.toasterService.showToaster('Your tracking has been saved!', 'default') @@ -146,7 +152,7 @@ export class TimerService { } return new Promise((resolve, reject) => { this.stopTrackingNotifications() - this.toasterService.showToaster('Records shorter than 1 minute will not be reported.', 'error') + this.toasterService.showToaster('Records shorter than 10 seconds will not be reported.', 'error') reject("To small amount of data"); }) } From 627966c87ae7f630e9e0b286fc5280d5589ed0b0 Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Fri, 19 Jan 2018 15:50:15 +0100 Subject: [PATCH 20/41] css fix --- src/app/components/edit-account/edit-account.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/edit-account/edit-account.component.scss b/src/app/components/edit-account/edit-account.component.scss index e6fdf35..363961e 100644 --- a/src/app/components/edit-account/edit-account.component.scss +++ b/src/app/components/edit-account/edit-account.component.scss @@ -181,7 +181,7 @@ .trec-icon-remove { position: absolute; top: 12px; - left: 154px; + left: 66px; font-size: 20px; vertical-align: sub; } From 6cb0d61997e0bb30d4b34e1a7f18897221662e67 Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 15:53:34 +0100 Subject: [PATCH 21/41] move button upper --- src/app/components/edit-account/edit-account.component.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/components/edit-account/edit-account.component.html b/src/app/components/edit-account/edit-account.component.html index bc09668..6af2e09 100644 --- a/src/app/components/edit-account/edit-account.component.html +++ b/src/app/components/edit-account/edit-account.component.html @@ -23,7 +23,9 @@ - + + + @@ -32,7 +34,7 @@ REMOVE ACCOUNT - + From 9a3be7e0b3b58805bf5e58fc819e84c1dc263626 Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 16:07:50 +0100 Subject: [PATCH 22/41] fix db init --- src/app/services/database.service.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/app/services/database.service.ts b/src/app/services/database.service.ts index 59088e8..252e649 100644 --- a/src/app/services/database.service.ts +++ b/src/app/services/database.service.ts @@ -23,20 +23,18 @@ export class DatabaseService { } var dbPath = path.resolve(folder,'database') this.db = new sqlite3.Database(dbPath, (data) => { - if (data == null){ - this.db.run("CREATE TABLE IF NOT EXISTS `tasks` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER, `published` TEXT, `agile` TEXT, `issueid` TEXT, `status` TEXT, `date` INTEGER, `duration` INTEGER, `lastUpdate` TEXT)"); + + if (data == null){ + this.db.run("CREATE TABLE IF NOT EXISTS `tasks` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER, `published` TEXT, `agile` TEXT, `issueid` TEXT, `status` TEXT, `date` INTEGER, `duration` INTEGER, `lastUpdate` TEXT, `Summary` TEXT)"); this.db.run("CREATE TABLE IF NOT EXISTS `account` (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, `name` TEXT, `url` TEXT, `token` TEXT, `current` INTEGER)"); this.db.run("CREATE TABLE IF NOT EXISTS `variables` (id INTEGER NOT NULL PRIMARY KEY, `name` TEXT UNIQUE, `value` INTEGER)"); this.db.run("CREATE TABLE IF NOT EXISTS `boards_states` (id INTEGER NOT NULL PRIMARY KEY, `accountId` INT, `boardName` TEXT, `state` TEXT, `hexColor` TEXT)"); this.db.run("CREATE UNIQUE INDEX BOARDS_INDEX ON boards_states (accountId, boardName, state)"); this.db.run("CREATE TABLE IF NOT EXISTS `boards_visibility` (id INTEGER NOT NULL PRIMARY KEY, `accountId` INT, `boardName` TEXT, `visible` INTEGER)"); this.db.run("CREATE UNIQUE INDEX BOARDS_CHOOSE ON boards_visibility (accountId, boardName)"); - this.db.run("CREATE TABLE IF NOT EXISTS `boards_after_choose` (id INTEGER NOT NULL PRIMARY KEY, `accountId` INT, `afterChoose` INTEGER)"); - this.db.run("CREATE UNIQUE INDEX BOARDS_CHOOSE ON boards_visibility (accountId)"); - this.variablesInit() + this.db.run("CREATE TABLE IF NOT EXISTS `boards_after_choose` (id INTEGER NOT NULL PRIMARY KEY, `accountId` INT, `afterChoose` INTEGER)"); + this.variablesInit() } - this.db.run("ALTER TABLE `tasks` ADD COLUMN Summary TEXT;"); - this.db.run("ALTER TABLE `account` ADD COLUMN current INTEGER;"); }) } From 42a70d1d6f888cac7e004931a0736711337f81de Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 16:42:24 +0100 Subject: [PATCH 23/41] get ravis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f67add6..9a57d86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: From e37b4168e8c1dd4c15b053b2ab1ce6206f6bf9bf Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 16:57:11 +0100 Subject: [PATCH 24/41] change version to 1.0.0 --- package.json | 2 +- .../change-account-token/change-account-token.component.html | 2 +- src/app/components/edit-account/edit-account.component.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 3428f69..f183fd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "T-Rec", - "version": "0.9.5", + "version": "1.0.0", "description": "T-Rec time tracker is built for speed and live work item update in youtrack system.", "homepage": "", "author": { diff --git a/src/app/components/change-account-token/change-account-token.component.html b/src/app/components/change-account-token/change-account-token.component.html index 0fc1ca0..f80bf88 100644 --- a/src/app/components/change-account-token/change-account-token.component.html +++ b/src/app/components/change-account-token/change-account-token.component.html @@ -9,7 +9,7 @@ diff --git a/src/app/components/edit-account/edit-account.component.html b/src/app/components/edit-account/edit-account.component.html index 6af2e09..dd446ca 100644 --- a/src/app/components/edit-account/edit-account.component.html +++ b/src/app/components/edit-account/edit-account.component.html @@ -23,7 +23,7 @@ - + From 7537020f55ccb63d6d6b5cf59f562e29cf6bc232 Mon Sep 17 00:00:00 2001 From: Rafal Korszun Date: Fri, 19 Jan 2018 16:59:02 +0100 Subject: [PATCH 25/41] bout data fix --- src/app/components/about-trec/about-trec.component.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/components/about-trec/about-trec.component.html b/src/app/components/about-trec/about-trec.component.html index 665a3c8..157e100 100644 --- a/src/app/components/about-trec/about-trec.component.html +++ b/src/app/components/about-trec/about-trec.component.html @@ -6,8 +6,7 @@

Version {{version.version}}
- Commit {{version.revision}}
- Branch {{version.branch}} + Commit {{version.revision}}

Special thanks go to:

From c4594101c82d17a65baf92814a22ce720d07e95c Mon Sep 17 00:00:00 2001 From: Kamil Dobrzynski Date: Mon, 22 Jan 2018 08:27:04 +0100 Subject: [PATCH 26/41] fix missclick modal --- src/app/components/tracking/tracking.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/tracking/tracking.component.html b/src/app/components/tracking/tracking.component.html index 107f2be..76654b6 100644 --- a/src/app/components/tracking/tracking.component.html +++ b/src/app/components/tracking/tracking.component.html @@ -31,7 +31,7 @@

- +