Skip to content

Commit 84c13fb

Browse files
authored
Merge pull request #267 from jdsmithit/add-in-pipes-and-task-list-filtering
Add in filter for team list filtering via a pipe
2 parents e5120b4 + 2dfbf2c commit 84c13fb

4 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { UsageComponent } from './component/usage/usage.component';
2020
import { AboutUsComponent } from './component/about-us/about-us.component';
2121
import { DependencyGraphComponent } from './component/dependency-graph/dependency-graph.component';
2222
import { Teams } from './component/teams/teams.component';
23+
import { ToStringValuePipe } from './pipe/to-string-value.pipe';
2324

2425
@NgModule({
2526
declarations: [
@@ -36,6 +37,7 @@ import { Teams } from './component/teams/teams.component';
3637
AboutUsComponent,
3738
DependencyGraphComponent,
3839
Teams,
40+
ToStringValuePipe,
3941
],
4042
imports: [
4143
BrowserModule,

src/app/component/circular-heatmap/circular-heatmap.component.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,17 @@ <h2>Nothing to show</h2>
254254
*ngFor="let item of activity.teamsImplemented | keyvalue">
255255
<mat-checkbox
256256
[checked]="item.value === true"
257+
*ngIf="teamVisible.includes(item.key | ToStringValue)"
257258
color="primary"
258259
(click)="this.teamCheckbox(activityIndex, item.key)">
259260
{{ item.key }}
260261
</mat-checkbox>
261262
</li>
262263
</ul>
264+
<b *ngIf="teamVisible.length === 0">
265+
No Teams Selected, Please select a team from the filters
266+
above.
267+
</b>
263268
</ng-template>
264269
</mat-expansion-panel>
265270
</mat-card-content>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ToStringValuePipe } from './to-string-value.pipe';
2+
3+
describe('ToStringValuePipe', () => {
4+
it('create an instance', () => {
5+
const pipe = new ToStringValuePipe();
6+
expect(pipe).toBeTruthy();
7+
});
8+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Pipe, PipeTransform } from '@angular/core';
2+
3+
@Pipe({
4+
name: 'ToStringValue',
5+
pure: true,
6+
})
7+
export class ToStringValuePipe implements PipeTransform {
8+
transform(value: unknown): string {
9+
return value as string;
10+
}
11+
}

0 commit comments

Comments
 (0)