Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:kleder/timetracker into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
weronikacysewska committed Feb 16, 2018
2 parents ef4e3c2 + 20ae026 commit f8fc40a
Show file tree
Hide file tree
Showing 20 changed files with 740 additions and 554 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/tmp
/out-tsc
/app-builds
T-Rec.dmg

# dependencies
/node_modules
Expand Down
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-dinky

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions installers/windows/T-Rec_Installer/T-Rec_Installer/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,6 @@
<WixVariable Id="WixUIBannerBmp" Value="$(var.ProjectDir)\assets\top_banner.jpg"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.TimetrackerDir)LICENSE.rtf"/>

<SetProperty
Id="RegistryAutorun"
Value ="AUTORUN=[AUTORUN];INSTALLFOLDER=[INSTALLFOLDER]"
Sequence="execute"
Before="RegistryAutorun"/>

<CustomAction Id="RegistryAutorun"
BinaryKey="CAJR"
DllEntry="RegistryAutorun"
Execute="deferred"
Return="check"
Impersonate="no"
/>

<Binary Id="CAJR" SourceFile="..\CustomAction\bin\Debug\CustomAction.CA.dll"/>

<InstallExecuteSequence>
<Custom Action="RegistryAutorun" Before="InstallFinalize"/>
</InstallExecuteSequence>

<Feature Id="ProductFeature" Title="T_Rec_Installer" Level="1">
<ComponentGroupRef Id="ProductComponents" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "T-Rec",
"version": "1.1.0",
"version": "1.2.0",
"description": "T-Rec time tracker is built for speed and live work item update in youtrack system.",
"homepage": "",
"homepage": "https://github.com/kleder/timetracker",
"author": {
"name": "Kleder",
"email": "[email protected]"
Expand Down Expand Up @@ -35,7 +35,9 @@
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time",
"electron-rebuild": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time"
"electron-rebuild": "electron-rebuild -f -w sqlite3,@paulcbetts/system-idle-time",
"deb64":"npm run electron:linux && electron-installer-debian --src app-builds/T-Rec-linux-x64/ --dest app-builds/installers/ --arch amd64",
"dmg": "npm run electron:mac && electron-installer-dmg app-builds/T-Rec-darwin-x64/T-Rec.app T-Rec --icon=./src/assets/trec-logo.png --overwrite --background=./src./assets/t-rec-bg.png"
},
"dependencies": {
"@paulcbetts/system-idle-time": "^1.0.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<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>
<input id="add-account__name" [(ngModel)]="name" name="name" (keypress)="onEnterKey($event)" 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" (keypress)="onEnterKey($event)" 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" (keypress)="onEnterKey($event)" 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>
<button [ngClass]="!formCtrl.form.valid? 'btn--grey' : 'btn--red'" [disabled]="!formCtrl.form.valid" class="btn" (click)="login()" type="submit">ADD ACCOUNT</button>
</div>
</div>
</form>
Expand Down
12 changes: 10 additions & 2 deletions src/app/components/accounts/add-account/add-account.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { shell } from 'electron';
import { DataService } from '../../../services/data.service';
import { MenuService } from '../../../services/menu.service'
import { DatabaseService } from '../../../services/database.service'
import { NumberValueAccessor } from '@angular/forms/src/directives/number_value_accessor';
const ENTER_KEYCODE = 13

@Component({
selector: 'app-add-account',
Expand All @@ -25,8 +27,7 @@ export class AddAccountComponent implements OnInit {
public youTrackUrl = "";
public token = "";
public firstAccount: boolean;
public accounts

public accounts;
constructor(
public http: Http,
public account: AccountService,
Expand Down Expand Up @@ -90,6 +91,13 @@ export class AddAccountComponent implements OnInit {
}
}

public onEnterKey(e) {
if (e.keyCode === ENTER_KEYCODE) {
this.login()
}

}

public async getAccounts(): Promise<any> {
this.accounts = await this.databaseService.getAccounts();
}
Expand Down
16 changes: 13 additions & 3 deletions src/app/components/workspace/boards/boards.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h2 class="project-list__title" (click)="openInBrowser('/agiles/'+agile.id)" >{{
<span class="project-list__comments trec-icon-comments" *ngIf="issue.hasComment" title="Issue has {{ issue.hasComment }} comment(s)">
{{ issue.hasComment }}
</span>
<span class="project-list__state" (click)="showCommandModal(issue.id)" title="Apply command">[...]</span>
<button class="project-list__record" [ngClass]="issue.id == timerService.currentIssue?.issueId ? 'recording' : ''" (click)="startTracking(issue)">
<span *ngIf="issue.id == timerService.currentIssue?.issueId; else timerOff"><span class="trec-icon-stop"></span>STOP</span>
<ng-template #timerOff><span class="trec-icon-record"></span>REC</ng-template>
Expand All @@ -35,6 +36,7 @@ <h2 class="project-list__title" (click)="openInBrowser('/agiles/'+agile.id)" >{{

<div class="project-list__content">
<span class="project-list__summary">{{ issue.field.summary }}</span>
<span class="project-list__estimation" title="Estimation time: {{ issue.field.Est }}">{{ issue.field.Est }}</span>
</div>
</div>
<div *ngIf="agile?.issues == 0" class="project-list__issues--empty">
Expand All @@ -52,9 +54,9 @@ <h2 class="project-list__title" (click)="openInBrowser('/agiles/'+agile.id)" >{{
</div>
<div id="addIssue" class="modal">
<div class="modal__backdrop" (click)="hideAddIssueModal()"></div>
<div *ngIf="currentAgile != undefined" class="modal__content">
<div *ngIf="currentAgile != undefined || applyCommand != undefined" class="modal__content">
<span class="trec-icon-close" (click)="hideAddIssueModal()"></span>
<div class="modal__text">{{ 'Create issue at ' + currentAgile.name + ' Board' }}</div>
<div class="modal__text" *ngIf="currentAgile != undefined">{{ 'Create issue at ' + currentAgile.name + ' Board' }}</div>
<div *ngIf="newIssue" class="modal__form">
<label>Project</label>
<select [(ngModel)]="newIssue.project">
Expand All @@ -66,9 +68,17 @@ <h2 class="project-list__title" (click)="openInBrowser('/agiles/'+agile.id)" >{{
<textarea [(ngModel)]="newIssue.description"></textarea>
<button class="btn btn--transparent" (click)="createIssueOnBoard(newIssue, currentAgile.name)">Add to YouTrack</button>
</div>
</div>
<div *ngIf="applyCommand" class="modal__form">
<label>Apply command</label>
<input type="text" [(ngModel)]="applyCommand.command" (keypress)="showSuggestion(applyCommand)">
<div class="modal__text-suggestion" *ngIf="applyCommand.suggestions">
<div *ngFor="let suggestion of applyCommand.suggestions.suggest; let i=index"><span *ngIf="i<5">{{suggestion.option}}</span></div>
</div>
<button class="btn btn--transparent" (click)="executeCommand(applyCommand)">Apply</button>
</div>
</div>
</div>
</div>

<ng-template #spinner>
<div class="loading-container">
Expand Down
19 changes: 19 additions & 0 deletions src/app/components/workspace/boards/boards.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,23 @@
}
}
.project-list__content {
position: relative;
font-family: 'Montserrat', sans-serif;
color: $white;
font-size: 14px;
font-weight: 400;
text-align: left;
.project-list__summary {
width: 88%;
display: inline-block;
}
.project-list__estimation {
position: absolute;
bottom: -5px;
right: -4px;
font-size: 10px;
color: $issue-font-color;
}
}
}
}
Expand Down Expand Up @@ -249,6 +261,13 @@
font-size: 20px;
cursor: pointer;
}

.modal__text-suggestion {
font-size: 14px;
line-height: 16px;
padding: 0 0 16px;
}

.modal__backdrop {
position: fixed;
top: 0;
Expand Down
48 changes: 41 additions & 7 deletions src/app/components/workspace/boards/boards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ export class BoardsComponent implements OnInit {
private unstoppedItem: any
private allItemsFromDb: any
public agiles: any
public applyCommand: any
private totalTimes: object
private boardStates: Array<any> = []
private issueHexColor: any
private boardsChecked: boolean
private newIssue: newIssue
private currentAgile: object

constructor(
public api: ApiService,
public timerService: TimerService,
Expand Down Expand Up @@ -87,8 +89,15 @@ export class BoardsComponent implements OnInit {
this.getAllBoardStates()
}

public showCommandModal(issue){
this.currentAgile = undefined
this.applyCommand = { id: issue, command:'' }
document.getElementById('addIssue').style.display = 'block'
}

public showAddIssueModal(agile) {
this.currentAgile = agile
this.applyCommand = undefined
console.log("agile", this.currentAgile)
this.newIssue = new newIssue
this.newIssue.project = this.currentAgile["projects"][0]["id"]
Expand Down Expand Up @@ -117,6 +126,11 @@ export class BoardsComponent implements OnInit {
async getAgileVisibility(boardName) {
let account = await this.account.Current()
this.databaseService.getBoardVisibilities(account["id"], boardName).then(boardVisibility => {
if (boardVisibility.length === 0) {
this.databaseService.initBoardVisibility(account["id"], boardName, 0).then( () => {
this.getAgileVisibility(boardName)
})
}
this.agiles.filter(agile => {
if (agile.name == boardVisibility[0].boardName) {
boardVisibility[0].visible == 1? agile.checked = true : agile.checked = false
Expand Down Expand Up @@ -181,6 +195,22 @@ export class BoardsComponent implements OnInit {
)
}

public showSuggestion(commNdItem: any){
this.api.getCommandSuggestions(commNdItem.id,{command:commNdItem.command, max:5}).then( data => {
console.log(data)
this.applyCommand.suggestions = data;
})
}

public executeCommand(commNdItem: any) {
this.api.executeCommand(commNdItem.id,{command:commNdItem.command}).then( data => {
this.applyCommand = undefined;
document.getElementById('addIssue').style.display = "none";
this.init();
})
}


public prepareIssues = (issues, agileName, agileIndex) => {
let that = this
console.log("issues", issues, )
Expand Down Expand Up @@ -245,13 +275,17 @@ export class BoardsComponent implements OnInit {
}

public convertEstimate = (est) => {
let newEst = Number(est) / 60
if (newEst < 8) {
return newEst + "h"
} else if (newEst % 8 !== 0){
return Math.floor(newEst / 8) + "d" + newEst % 8 + "h"
if (est === undefined) {
return "No est"
} else {
return Math.floor(newEst / 8) + "d"
let newEst = Number(est) / 60
if (newEst < 8) {
return newEst + "h"
} else if (newEst % 8 !== 0){
return Math.floor(newEst / 8) + "d" + newEst % 8 + "h"
} else {
return Math.floor(newEst / 8) + "d"
}
}
}

Expand All @@ -265,7 +299,7 @@ export class BoardsComponent implements OnInit {
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]
item.agile = issue.agile
console.log("issue.id ", issue.id)
console.log("summary", issue.field)
this.timerService.startItem(item);
Expand Down
39 changes: 37 additions & 2 deletions src/app/components/workspace/records/records.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="container" *ngIf="!loader else spinner">
<div class="record-list" *ngIf="todaySummaryItems?.length !=0 else empty">
<div class="record-list" *ngIf="todaySummaryItems?.length !=0">
<div class="record-list__title">TODAY</div>
<div class="record-list__item" *ngFor="let record of todaySummaryItems">
<div class="record-list__header">
<span class="record-list__summary">{{ record.summary }}</span>
Expand All @@ -14,8 +15,42 @@
</div>
</div>
</div>
<div class="record-list" *ngIf="yesterdaySummaryItems?.length !=0">
<div class="record-list__title">YESTERDAY</div>
<div class="record-list__item" *ngFor="let record of yesterdaySummaryItems">
<div class="record-list__header">
<span class="record-list__summary">{{ record.summary }}</span>
<span class="record-list__todays-time">{{ record.todaysTime | secondsToTime}}</span>
</div>
<div class="record-list__content">
<span class="record-list__agile">{{ record.agile }}</span>
<button class="record-list__record" [ngClass]="record.id == timerService.currentIssue?.issueId ? 'recording' : ''" (click)="getIssueAndStart(record.id)">
<span *ngIf="record.id == timerService.currentIssue?.issueId; else timerOff"><span class="trec-icon-stop"></span>STOP</span>
<ng-template #timerOff><span class="trec-icon-record"></span>REC</ng-template>
</button>
</div>
</div>
</div>
<div class="record-list" *ngIf="itemsFromPast?.length !=0 else empty">
<div *ngFor="let past of itemsFromPast">
<div class="record-list__title">{{ past.date }}</div>
<div class="record-list__item" *ngFor="let record of past.records">
<div class="record-list__header">
<span class="record-list__summary">{{ record.Summary }}</span>
<span class="record-list__todays-time">{{ record.duration | secondsToTime}}</span>
</div>
<div class="record-list__content">
<span class="record-list__agile">{{ record.agile }}</span>
<button class="record-list__record" [ngClass]="record.id == timerService.currentIssue?.issueId ? 'recording' : ''" (click)="getIssueAndStart(record.id)">
<span *ngIf="record.id == timerService.currentIssue?.issueId; else timerOff"><span class="trec-icon-stop"></span>STOP</span>
<ng-template #timerOff><span class="trec-icon-record"></span>REC</ng-template>
</button>
</div>
</div>
</div>
</div>
<ng-template #empty>
<div class="record-list--empty" *ngIf="todaySummaryItems?.length == 0">
<div class="record-list--empty" *ngIf="todaySummaryItems?.length == 0 && yesterdaySummaryItems?.length == 0 && itemsFromPast.length == 0">
<img src="../../../../assets/dino-foot.png" alt="foot">
<div class="record-list__title">You haven't made any time entry yet</div>
<div class="record-list__text">Go back to the Boards tab, select the task and hit record.</div>
Expand Down
10 changes: 10 additions & 0 deletions src/app/components/workspace/records/records.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
.record-list {
padding: 5px 10px;
cursor: default;
&__title {
padding-bottom: 8px;
font-family: 'Montserrat', sans-serif;
color: $font-grey;
font-size: 12px;
font-weight: 400;
text-transform: uppercase;
letter-spacing: 1px;
cursor: default;
}
&__item {
background-color: $issue-bg-color;
border: 0px solid $issue-bg-color;
Expand Down
Loading

0 comments on commit f8fc40a

Please sign in to comment.