-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: (WIP) migrate unit task list
- Loading branch information
1 parent
2e93914
commit d22caf2
Showing
7 changed files
with
64 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...app/units/states/tasks/viewer/directives/f-unit-task-list/f-unit-task-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<mat-selection-list #tasks [multiple]="false"> | ||
<mat-list-option *ngFor="let task of unitTasks" [value]="task" (click)="setSelectedTask(task)"> | ||
{{ task.name }} | ||
</mat-list-option> | ||
</mat-selection-list> |
Empty file.
21 changes: 21 additions & 0 deletions
21
.../units/states/tasks/viewer/directives/f-unit-task-list/f-unit-task-list.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { FUnitTaskListComponent } from './f-unit-task-list.component'; | ||
|
||
describe('FUnitTaskListComponent', () => { | ||
let component: FUnitTaskListComponent; | ||
let fixture: ComponentFixture<FUnitTaskListComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [FUnitTaskListComponent] | ||
}); | ||
fixture = TestBed.createComponent(FUnitTaskListComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
25 changes: 25 additions & 0 deletions
25
src/app/units/states/tasks/viewer/directives/f-unit-task-list/f-unit-task-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { Unit } from 'src/app/api/models/unit'; | ||
|
||
@Component({ | ||
selector: 'f-unit-task-list', | ||
templateUrl: './f-unit-task-list.component.html', | ||
styleUrls: ['./f-unit-task-list.component.scss'], | ||
}) | ||
export class FUnitTaskListComponent implements OnInit { | ||
@Input() unit: Unit; | ||
@Input() unitTasks: Task[]; | ||
@Input() selectedTaskDef: Task; | ||
|
||
constructor() {} | ||
|
||
ngOnInit(): void { | ||
console.log(this.unit); | ||
console.log(this.selectedTaskDef); | ||
} | ||
|
||
setSelectedTask(task: Task) { | ||
console.log(task); | ||
this.selectedTaskDef = task; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters