Skip to content

Commit 7d3c793

Browse files
committed
Teams: Add Dimension column
1 parent a854582 commit 7d3c793

4 files changed

Lines changed: 45 additions & 5 deletions

File tree

src/app/pages/matrix/matrix.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
<!-- Category Column -->
3939
<ng-container matColumnDef="Category">
40-
<th mat-header-cell *matHeaderCellDef class="table-small-width">Category</th>
40+
<th mat-header-cell *matHeaderCellDef class="table-small-width">Dimension</th>
4141
<td mat-cell *matCellDef="let element" class="table-small-width">
4242
<div class="dim-icon">
4343
<mat-icon mat-list-icon color="primary">{{dataStore?.meta?.getIcon(element.Category)}}</mat-icon>
@@ -48,7 +48,7 @@
4848

4949
<!-- Dimension Column -->
5050
<ng-container matColumnDef="Dimension">
51-
<th mat-header-cell *matHeaderCellDef class="table-small-width">Dimension</th>
51+
<th mat-header-cell *matHeaderCellDef class="table-small-width">Sub-dimension</th>
5252
<td mat-cell *matCellDef="let element" class="table-small-width">
5353
{{ element.Dimension }}
5454
</td>

src/app/pages/teams/teams.component.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ h3 {
9090
}
9191

9292
td.mat-cell {
93-
padding: 0 20px;
93+
padding: 0 10px;
9494
}
9595

9696
.progress-col {
@@ -102,4 +102,17 @@ td.mat-cell {
102102

103103
.teams-table {
104104
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
105+
}
106+
107+
.dimension-cell {
108+
display: flex;
109+
align-items: center;
110+
gap: 8px;
111+
}
112+
113+
.dimension-icon {
114+
font-size: 18px;
115+
width: 18px;
116+
height: 18px;
117+
line-height: 18px;
105118
}

src/app/pages/teams/teams.component.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ <h2>{{ infoTitle }}</h2>
2828
[suffix]="'activities'"></app-kpi>
2929
<app-kpi
3030
[title]="'Last updated:'"
31-
[value]="dateFormat(info[infoTitle]?.lastUpdated)"></app-kpi>
31+
[value]="dateFormat(info[infoTitle]?.lastUpdated)"
32+
[suffix]="info[infoTitle]?.lastUpdated ? '' : 'No activity registered'"></app-kpi>
3233
</div>
3334
</div>
3435

@@ -50,6 +51,22 @@ <h3>Activities in progress</h3>
5051
</td>
5152
</ng-container>
5253

54+
<ng-container matColumnDef="SubDimension">
55+
<th mat-header-cell mat-sort-header *matHeaderCellDef class="table-small-width">
56+
Dimension
57+
</th>
58+
<td mat-cell *matCellDef="let element" class="table-small-width">
59+
<div class="dimension-cell">
60+
<mat-icon
61+
class="dimension-icon"
62+
*ngIf="dataStore?.meta?.getIcon(element?.activity?.category || '')">
63+
{{ dataStore?.meta?.getIcon(element?.activity?.category || '') }}
64+
</mat-icon>
65+
<span>{{ element?.activity?.dimension }}</span>
66+
</div>
67+
</td>
68+
</ng-container>
69+
5370
<ng-container
5471
matColumnDef="{{ progressColumn }}"
5572
*ngFor="let progressColumn of progressColumnNames">

src/app/pages/teams/teams.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export class TeamsComponent implements OnInit, AfterViewInit {
8181
if (property === 'Activity') {
8282
return item.activity?.name || '';
8383
}
84+
if (property === 'SubDimension') {
85+
return item.activity?.dimension || '';
86+
}
8487
// For progress columns, sort by date string or timestamp
8588
if (this.progressColumnNames.includes(property)) {
8689
// If your progress is a date string, you may want to convert to Date for proper sorting
@@ -104,7 +107,7 @@ export class TeamsComponent implements OnInit, AfterViewInit {
104107
let progressStore: ProgressStore | null = this.dataStore?.progressStore;
105108
this.progressColumnNames = progressStore?.getInProgressTitles() || [];
106109
this.progressTitleImplemented = progressStore?.getCompletedProgressTitle() || 'Implemented';
107-
this.allColumnNames = ['Team', 'Activity', ...this.progressColumnNames];
110+
this.updateColumnNames();
108111
}
109112

110113
displayMessage(dialogInfo: DialogInfo) {
@@ -125,6 +128,12 @@ export class TeamsComponent implements OnInit, AfterViewInit {
125128
this.info[this.infoTitle] = this.makeTeamSummary(this.infoTitle, this.infoTeams);
126129
}
127130
this.dataSource.data = this?.info[this.infoTitle]?.activitiesInProgress || [];
131+
this.updateColumnNames();
132+
}
133+
134+
updateColumnNames() {
135+
const baseColumns = this.infoTeams.length > 1 ? ['Team'] : [];
136+
this.allColumnNames = [...baseColumns, 'SubDimension', 'Activity', ...this.progressColumnNames];
128137
}
129138

130139
onTeamsChanged(event: TeamsGroupsChangedEvent) {
@@ -143,6 +152,7 @@ export class TeamsComponent implements OnInit, AfterViewInit {
143152
this.dataSource.data = this?.info[this.infoTitle]?.activitiesInProgress || [];
144153

145154
this.setYamlData(this.dataStore);
155+
this.updateColumnNames();
146156
}
147157

148158
onExportTeamGroups() {

0 commit comments

Comments
 (0)