* removed funservice
* prio color pipe fixed with svg sizes * prefix pipe added
This commit is contained in:
parent
41c057c5e5
commit
5f2639061b
@ -14,10 +14,5 @@
|
||||
<div app-kanban-entry-item class="four wide column"
|
||||
rowHeading="DÖNER"
|
||||
[kanbanEntries]="kanbanBoard.done"></div>
|
||||
<app-animgif *ngIf="showSomeFun"
|
||||
class="kanban-view"
|
||||
title="ANIMATED IMPORTANCE"
|
||||
[data]="fun.animGifs"
|
||||
[cameraUrls]="fun.cameraUrls"></app-animgif>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
[title]="assignee?.name">
|
||||
</div>
|
||||
<a [href]="jiraHref(kanbanEntry)" target="_blank"
|
||||
[innerHTML]="kanbanEntry.summary|shortenText|priorityColor:kanbanEntry.issuePriorityIcon:kanbanEntry.worklog"
|
||||
[innerHTML]="kanbanEntry.summary|shortenText|priorityColor:kanbanEntry.issuePriorityIcon:kanbanEntry.worklog|prefixJiraId:kanbanEntry.key"
|
||||
[title]="kanbanEntry.summary"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
8
src/app/kanban/shared/prefix-jira-id.pipe.spec.ts
Normal file
8
src/app/kanban/shared/prefix-jira-id.pipe.spec.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { PrefixJiraIdPipe } from './prefix-jira-id.pipe';
|
||||
|
||||
describe('PrefixJiraIdPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new PrefixJiraIdPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
12
src/app/kanban/shared/prefix-jira-id.pipe.ts
Normal file
12
src/app/kanban/shared/prefix-jira-id.pipe.ts
Normal file
@ -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}`;
|
||||
}
|
||||
|
||||
}
|
||||
@ -34,7 +34,7 @@ export class PriorityColorPipe implements PipeTransform {
|
||||
value = value.replace(xlMatch, (fullMatch: string, mhrMatched: string) => {
|
||||
return `<span class="match-xl">${mhrMatched}</span> `;
|
||||
});
|
||||
return (prioIcon ? `<img class="prio-icon" src="${prioIcon}"> ` : "") + value;
|
||||
return (prioIcon ? `<img class="prio-icon" width="16" height="16" src="${prioIcon}"> ` : "") + value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user