Skip to content

Commit 18045fc

Browse files
committed
feat: allow customizable UI terminology for Team and Group (#513)
1 parent a0d7fbc commit 18045fc

18 files changed

Lines changed: 114 additions & 27 deletions

src/app/component/activity-description/activity-description.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ <h3><b>Usefulness</b></h3>
288288
<!-- <mat-expansion-panel>
289289
<mat-expansion-panel-header>
290290
<mat-panel-title>
291-
<b>Teams Evidence</b>
291+
<b>{{ settings.getTeamLabelPlural() }} Evidence</b>
292292
</mat-panel-title>
293293
</mat-expansion-panel-header>
294294
<mat-accordion multi="true">
@@ -349,7 +349,7 @@ <h4 class="tool-name" [innerHTML]="implement['name']"></h4>
349349
</span>
350350
</span>
351351
<span class="ref-section" *ngIf="teamsImplemented.size === 0">
352-
<span class="ref-values">No teams have started this activity yet</span>
352+
<span class="ref-values">No {{ settings.getTeamLabelPlural() | lowercase }} have started this activity yet</span>
353353
</span>
354354
</div>
355355
</mat-panel-title>
@@ -367,7 +367,7 @@ <h4 class="tool-name" [innerHTML]="implement['name']"></h4>
367367
</div>
368368
</div>
369369
<ng-template #noTeamsBlock>
370-
<p>No teams have started implementing this activity yet.</p>
370+
<p>No {{ settings.getTeamLabelPlural() | lowercase }} have started implementing this activity yet.</p>
371371
</ng-template>
372372
</mat-expansion-panel>
373373
</mat-accordion>

src/app/component/activity-description/activity-description.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MatAccordion } from '@angular/material/expansion';
1414
import { Activity } from '../../model/activity-store';
1515
import { LoaderService } from '../../service/loader/data-loader.service';
1616
import { TeamName, ProgressTitle } from '../../model/types';
17+
import { SettingsService } from 'src/app/service/settings/settings.service';
1718

1819
@Component({
1920
selector: 'app-activity-description',
@@ -43,7 +44,10 @@ export class ActivityDescriptionComponent implements OnInit, OnChanges {
4344

4445
@ViewChildren(MatAccordion) accordion!: QueryList<MatAccordion>;
4546

46-
constructor(private loader: LoaderService) {}
47+
constructor(
48+
private loader: LoaderService,
49+
public settings: SettingsService
50+
) {}
4751

4852
ngOnInit() {
4953
// Set activity data if provided

src/app/component/report-config-modal/report-config-modal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h3>Display Configuration</h3>
1212
[value]="config.columnGrouping"
1313
(change)="setColumnGrouping($event.value)">
1414
<mat-button-toggle value="byProgress">By Progress Stage</mat-button-toggle>
15-
<mat-button-toggle value="byTeam">By Team</mat-button-toggle>
15+
<mat-button-toggle value="byTeam">By {{ settings.getTeamLabel() }}</mat-button-toggle>
1616
</mat-button-toggle-group>
1717
</div>
1818
</div>

src/app/component/report-config-modal/report-config-modal.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '../../model/report-config';
99
import { Activity } from '../../model/activity-store';
1010
import { ProgressTitle, TeamGroups } from '../../model/types';
11+
import { SettingsService } from 'src/app/service/settings/settings.service';
1112

1213
export interface ReportConfigModalData {
1314
config: ReportConfig;
@@ -37,7 +38,8 @@ export class ReportConfigModalComponent {
3738

3839
constructor(
3940
public dialogRef: MatDialogRef<ReportConfigModalComponent>,
40-
@Inject(MAT_DIALOG_DATA) public data: ReportConfigModalData
41+
@Inject(MAT_DIALOG_DATA) public data: ReportConfigModalData,
42+
public settings: SettingsService
4143
) {
4244
// Deep copy config to avoid mutating the original until save
4345
this.config = JSON.parse(JSON.stringify(data.config));

src/app/component/team-selector/team-selector.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="config-section">
2-
<h3>Teams</h3>
3-
<p class="config-hint">Select which teams to include in the report.</p>
2+
<h3>{{ settings.getTeamLabelPlural() }}</h3>
3+
<p class="config-hint">Select which {{ settings.getTeamLabelPlural() | lowercase }} to include in the report.</p>
44
<div class="select-all-actions">
55
<button mat-button color="primary" (click)="selectAllTeams()">Select All</button>
66
<button mat-button (click)="deselectAllTeams()">Deselect All</button>
77
<span *ngIf="groupNames.length > 0" class="group-section">
8-
<span class="group-label">Group:</span>
8+
<span class="group-label">{{ settings.getGroupLabel() }}:</span>
99
<button mat-stroked-button [matMenuTriggerFor]="groupMenu" class="group-dropdown-btn">
1010
<mat-icon>group</mat-icon>
11-
{{ selectedGroupName || 'Select Group' }}
11+
{{ selectedGroupName || 'Select ' + settings.getGroupLabel() }}
1212
<mat-icon>arrow_drop_down</mat-icon>
1313
</button>
1414
</span>

src/app/component/team-selector/team-selector.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, Input, Output, EventEmitter } from '@angular/core';
22
import { TeamGroups } from '../../model/types';
3+
import { SettingsService } from 'src/app/service/settings/settings.service';
34

45
@Component({
56
selector: 'app-team-selector',
@@ -15,6 +16,8 @@ export class TeamSelectorComponent {
1516

1617
selectedGroupName: string = '';
1718

19+
constructor(public settings: SettingsService) {}
20+
1821
isTeamSelected(team: string): boolean {
1922
return this.selectedTeams.includes(team);
2023
}

src/app/component/teams-groups-editor/teams-groups-editor.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="editor-container">
33
<div class="editor-list-panel">
44
<app-selectable-list
5-
title="Groups"
5+
[title]="settings.getGroupLabelPlural()"
66
[items]="keys(localCopyTeamGroups)"
77
[selectedItem]="selectedGroup"
88
[highlightedItems]="highlightedGroups"
@@ -20,7 +20,7 @@
2020
</div>
2121
<div class="editor-list-panel">
2222
<app-selectable-list
23-
title="Teams"
23+
[title]="settings.getTeamLabelPlural()"
2424
[items]="localCopyTeams"
2525
[selectedItem]="selectedTeam"
2626
[highlightedItems]="highlightedTeams"

src/app/component/teams-groups-editor/teams-groups-editor.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { Component, Input, Output, EventEmitter, OnChanges } from '@angular/core';
33
import { GroupName, TeamGroups, TeamName, TeamNames } from 'src/app/model/types';
44
import { perfNow, renameArrayElement } from 'src/app/util/util';
5+
import { SettingsService } from 'src/app/service/settings/settings.service';
56

67
enum EditMode {
78
NONE,
@@ -49,6 +50,8 @@ export class TeamsGroupsEditorComponent implements OnChanges {
4950
localCopyTeamsRenamed: Record<TeamName, TeamName> = {};
5051
localCopyTeamGroups: TeamGroups = {};
5152

53+
constructor(public settings: SettingsService) {}
54+
5255
ngOnChanges() {
5356
this.makeLocalCopy();
5457

@@ -159,7 +162,7 @@ export class TeamsGroupsEditorComponent implements OnChanges {
159162
}
160163

161164
onAddTeam() {
162-
let newName: string = this.findNextName(this.localCopyTeams, 'Team');
165+
let newName: string = this.findNextName(this.localCopyTeams, this.settings.getTeamLabel());
163166
this.localCopyTeams.push(newName);
164167
this.onTeamSelected(newName);
165168
}
@@ -194,7 +197,7 @@ export class TeamsGroupsEditorComponent implements OnChanges {
194197
}
195198

196199
onAddGroup() {
197-
let newName: string = this.findNextName(this.keys(this.localCopyTeamGroups), 'Group');
200+
let newName: string = this.findNextName(this.keys(this.localCopyTeamGroups), this.settings.getGroupLabel());
198201
this.localCopyTeamGroups[newName] = [];
199202
this.onGroupSelected(newName);
200203
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h2>Nothing to show</h2>
3535
</button>
3636
<div class="team-filter" [class.hidden]="!showFilters">
3737
<mat-form-field class="team-chip-list">
38-
<mat-label>Team Group Filter</mat-label>
38+
<mat-label>{{ settings.getTeamLabel() }} {{ settings.getGroupLabel() }} Filter</mat-label>
3939
<mat-chip-list selectable>
4040
<mat-chip
4141
#chip="matChip"
@@ -47,7 +47,7 @@ <h2>Nothing to show</h2>
4747
</mat-chip-list>
4848
</mat-form-field>
4949
<mat-form-field>
50-
<mat-label>Team Filter</mat-label>
50+
<mat-label>{{ settings.getTeamLabel() }} Filter</mat-label>
5151
<mat-chip-list selectable multiple>
5252
<mat-chip
5353
#chip="matChip"
@@ -116,14 +116,14 @@ <h2>Nothing to show</h2>
116116
mat-raised-button
117117
class="downloadButtonClass"
118118
(click)="exportTeamProgress()">
119-
Download team progress
119+
Download {{ settings.getTeamLabel() | lowercase }} progress
120120
</button>
121121
<button
122122
class="normal-button"
123123
mat-raised-button
124124
class="resetButtonClass"
125125
(click)="deleteLocalTeamsProgress()">
126-
Delete team progress
126+
Delete {{ settings.getTeamLabel() | lowercase }} progress
127127
</button>
128128
</div>
129129
</div>

src/app/pages/circular-heatmap/circular-heatmap.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class CircularHeatmapComponent implements OnInit, OnDestroy {
6464
constructor(
6565
private loader: LoaderService,
6666
private sectorService: SectorService,
67-
private settings: SettingsService,
67+
public settings: SettingsService,
6868
private themeService: ThemeService,
6969
private titleService: TitleService,
7070
private router: Router,

0 commit comments

Comments
 (0)