Make app work again
This commit is contained in:
parent
a9ad628488
commit
938f3def1f
30 changed files with 236 additions and 155 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import { Component, Input } from '@angular/core';
|
||||
import { Tower } from '../../../../model/tower';
|
||||
import { ColoredBlock, Tower } from '../../../../model/tower';
|
||||
import { ModalService } from '../../../../services/modal.service';
|
||||
import { Block } from '../../../../model/block';
|
||||
import { IColor } from '../../../../interfaces/persistance/color';
|
||||
import { toHslString } from '../../../../utils/color';
|
||||
|
||||
@Component({
|
||||
selector: 'app-tower',
|
||||
|
|
@ -11,7 +8,13 @@ import { toHslString } from '../../../../utils/color';
|
|||
styleUrls: ['./tower.component.scss']
|
||||
})
|
||||
export class TowerComponent {
|
||||
readonly toHslString = toHslString;
|
||||
get towerName(): string {
|
||||
return this.tower.name;
|
||||
}
|
||||
|
||||
set towerName(value: string) {
|
||||
this.tower.changeName(value);
|
||||
}
|
||||
|
||||
@Input() set dateRange(value: { from: Date; to: Date }) {
|
||||
if (this.dateRange !== undefined && this.dateRange.from === value.from && this.dateRange.to === value.to) {
|
||||
|
|
@ -26,13 +29,13 @@ export class TowerComponent {
|
|||
|
||||
public constructor(private modalService: ModalService) {}
|
||||
|
||||
get drawableBlocks(): Array<Block & { color: IColor }> {
|
||||
get drawableBlocks(): Array<ColoredBlock> {
|
||||
return this.tower.coloredBlocks.filter(
|
||||
block => this.dateRange.from <= block.created && block.created <= this.dateRange.to && block.isDone
|
||||
);
|
||||
}
|
||||
|
||||
get tasks(): Array<Block & { color: IColor }> {
|
||||
get tasks(): Array<ColoredBlock> {
|
||||
return this.tower.coloredBlocks.filter(
|
||||
block => this.dateRange.from <= block.created && block.created <= this.dateRange.to && !block.isDone
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue