From 5f2639061be004dcce2ff05ef5569116cc2c7021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Tue, 17 Apr 2018 11:51:33 +0200 Subject: [PATCH] * removed funservice * prio color pipe fixed with svg sizes * prefix pipe added --- .../kanban-board/kanban-board.component.html | 5 --- .../kanban-board/kanban-board.component.ts | 39 ++----------------- .../kanban-entry-item.component.html | 2 +- src/app/kanban/kanban-routing.module.ts | 5 +-- src/app/kanban/kanban.module.ts | 6 ++- .../kanban/shared/prefix-jira-id.pipe.spec.ts | 8 ++++ src/app/kanban/shared/prefix-jira-id.pipe.ts | 12 ++++++ src/app/kanban/shared/priority-color.pipe.ts | 2 +- 8 files changed, 30 insertions(+), 49 deletions(-) create mode 100644 src/app/kanban/shared/prefix-jira-id.pipe.spec.ts create mode 100644 src/app/kanban/shared/prefix-jira-id.pipe.ts diff --git a/src/app/kanban/kanban-board/kanban-board.component.html b/src/app/kanban/kanban-board/kanban-board.component.html index c85c07a..435b752 100644 --- a/src/app/kanban/kanban-board/kanban-board.component.html +++ b/src/app/kanban/kanban-board/kanban-board.component.html @@ -14,10 +14,5 @@
- diff --git a/src/app/kanban/kanban-board/kanban-board.component.ts b/src/app/kanban/kanban-board/kanban-board.component.ts index 0240805..bb972b6 100644 --- a/src/app/kanban/kanban-board/kanban-board.component.ts +++ b/src/app/kanban/kanban-board/kanban-board.component.ts @@ -1,4 +1,4 @@ -import {Component, HostBinding, HostListener, OnDestroy, OnInit} from '@angular/core'; +import {Component, HostBinding, HostListener, OnInit} from '@angular/core'; import {Title} from '@angular/platform-browser'; import {ActivatedRoute} from '@angular/router'; @@ -7,12 +7,6 @@ import { KanbanService, KanbanEntry, } from "../shared"; -import { - Fun, - FunService, -} from "../../shared"; -import {Subscription} from "rxjs/Subscription"; -import {TimerObservable} from "rxjs/observable/TimerObservable"; const WIP_LIMIT_INPROGRESS = 12; const WIP_LIMIT_VERIFICATION = 8; @@ -20,24 +14,18 @@ const WIP_LIMIT_VERIFICATION = 8; const STYLE_HIDDEN = 'hidden'; const STYLE_VISIBLE = 'scroll'; -const FUN_TIMER = 2000; - @Component({ selector: 'app-kanban-board', templateUrl: './kanban-board.component.html', styleUrls: ['./kanban-board.component.css'] }) -export class KanbanBoardComponent implements OnInit, OnDestroy { - - private funTimer: Subscription; +export class KanbanBoardComponent implements OnInit { @HostBinding('style.overflow') hostOverflow = STYLE_HIDDEN; - public showSomeFun: boolean = false; constructor(private titleService: Title, private route: ActivatedRoute, - private kanbanService: KanbanService, - private funService: FunService) { + private kanbanService: KanbanService) { } /** @@ -47,23 +35,9 @@ export class KanbanBoardComponent implements OnInit, OnDestroy { this.titleService.setTitle('TaurusXFT : Kanban board'); this.route.data.subscribe((data: { kanbanBoard: KanbanBoard, - fun: Fun, }) => { this.kanbanBoard = data.kanbanBoard; - this.fun = data.fun; }); - this.lunchTime(); - let timer0 = TimerObservable.create(FUN_TIMER, FUN_TIMER); - this.funTimer = timer0.subscribe(() => this.lunchTime.bind(this)); - } - - private lunchTime() { - let now = new Date(); - this.showSomeFun = (now.getHours() == 11 && now.getMinutes() > 29) || (now.getHours() == 12 && now.getMinutes() < 31); - } - - ngOnDestroy() { - this.funTimer.unsubscribe(); } get kanbanBoard(): KanbanBoard { @@ -74,13 +48,6 @@ export class KanbanBoardComponent implements OnInit, OnDestroy { this.kanbanService.kanbanBoard = kanbanBoard; } - get fun(): Fun { - return this.funService.fun; - } - - set fun(fun: Fun) { - this.funService.fun = fun; - } get inprogressWipLimit(): number { return WIP_LIMIT_INPROGRESS; } diff --git a/src/app/kanban/kanban-entry-item/kanban-entry-item.component.html b/src/app/kanban/kanban-entry-item/kanban-entry-item.component.html index 914e84a..2f58d4f 100644 --- a/src/app/kanban/kanban-entry-item/kanban-entry-item.component.html +++ b/src/app/kanban/kanban-entry-item/kanban-entry-item.component.html @@ -24,7 +24,7 @@ [title]="assignee?.name"> diff --git a/src/app/kanban/kanban-routing.module.ts b/src/app/kanban/kanban-routing.module.ts index 88e2326..fd267df 100644 --- a/src/app/kanban/kanban-routing.module.ts +++ b/src/app/kanban/kanban-routing.module.ts @@ -1,8 +1,7 @@ import {NgModule} from '@angular/core'; import {Routes, RouterModule} from '@angular/router'; import {KanbanBoardComponent} from "./kanban-board/kanban-board.component"; -import {KanbanService} from "./shared/kanban.service"; -import {FunService} from "../shared/fun.service"; +import {KanbanService} from "./shared"; const routes: Routes = [ { @@ -11,7 +10,6 @@ const routes: Routes = [ component: KanbanBoardComponent, resolve: { kanbanBoard: KanbanService, - fun: FunService, }, data: { disableAutoSwitch: false @@ -22,7 +20,6 @@ const routes: Routes = [ component: KanbanBoardComponent, resolve: { kanbanBoard: KanbanService, - fun: FunService, }, data: { disableAutoSwitch: true diff --git a/src/app/kanban/kanban.module.ts b/src/app/kanban/kanban.module.ts index cc1ae9d..5bfc597 100644 --- a/src/app/kanban/kanban.module.ts +++ b/src/app/kanban/kanban.module.ts @@ -10,8 +10,9 @@ import { PriorityColorPipe } from './shared/priority-color.pipe'; import { ShortenTextPipe } from './shared/shorten-text.pipe'; import { SelfUpdaterService } from './shared/self-updater.service'; import { BlockedDaysPipe } from './shared/blocked-days.pipe'; -import {KanbanRoutingModule} from "./kanban-routing.module"; -import {TspInfoModule} from "../tsp-info/tsp-info.module"; +import { KanbanRoutingModule } from "./kanban-routing.module"; +import { TspInfoModule } from "../tsp-info/tsp-info.module"; +import { PrefixJiraIdPipe } from './shared/prefix-jira-id.pipe'; @NgModule({ imports: [ @@ -26,6 +27,7 @@ import {TspInfoModule} from "../tsp-info/tsp-info.module"; PriorityColorPipe, ShortenTextPipe, BlockedDaysPipe, + PrefixJiraIdPipe, ], providers: [ KanbanService, diff --git a/src/app/kanban/shared/prefix-jira-id.pipe.spec.ts b/src/app/kanban/shared/prefix-jira-id.pipe.spec.ts new file mode 100644 index 0000000..465de75 --- /dev/null +++ b/src/app/kanban/shared/prefix-jira-id.pipe.spec.ts @@ -0,0 +1,8 @@ +import { PrefixJiraIdPipe } from './prefix-jira-id.pipe'; + +describe('PrefixJiraIdPipe', () => { + it('create an instance', () => { + const pipe = new PrefixJiraIdPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/kanban/shared/prefix-jira-id.pipe.ts b/src/app/kanban/shared/prefix-jira-id.pipe.ts new file mode 100644 index 0000000..247038c --- /dev/null +++ b/src/app/kanban/shared/prefix-jira-id.pipe.ts @@ -0,0 +1,12 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'prefixJiraId' +}) +export class PrefixJiraIdPipe implements PipeTransform { + + transform(value: string, jiraId: string): string { + return `[${jiraId}] ${value}`; + } + +} diff --git a/src/app/kanban/shared/priority-color.pipe.ts b/src/app/kanban/shared/priority-color.pipe.ts index d4452e1..e7627e3 100644 --- a/src/app/kanban/shared/priority-color.pipe.ts +++ b/src/app/kanban/shared/priority-color.pipe.ts @@ -34,7 +34,7 @@ export class PriorityColorPipe implements PipeTransform { value = value.replace(xlMatch, (fullMatch: string, mhrMatched: string) => { return `${mhrMatched} `; }); - return (prioIcon ? ` ` : "") + value; + return (prioIcon ? ` ` : "") + value; } }