Skip to content

Commit 568a4ba

Browse files
authored
Merge pull request #346 from vbakke/fix/345-spaces-in-groupnames
Fix #345 Spaces in groupnames
2 parents 1b4ddad + df94173 commit 568a4ba

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

.prettierrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"arrowParens": "avoid",
88
"trailingComma": "es5",
99
"bracketSameLine": true,
10-
"printWidth": 80
10+
"printWidth": 80,
11+
"endOfLine": "auto"
1112
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
shape-rendering: crispEdges;
99
}
1010

11-
.normal-button {
12-
background-color: white;
11+
.title-button {
12+
background-color: transparent;
1313
border: none;
1414
text-align: left;
1515
cursor: pointer;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ <h2>Nothing to show</h2>
230230
<mat-chip
231231
#c="matChip"
232232
*ngFor="let team of teamList"
233-
(click)="toggleTeamSelection(c)">
233+
(click)="toggleTeamSelection(c)"
234+
selected>
234235
{{ team }}
235236
</mat-chip>
236237
</mat-chip-list>
@@ -247,7 +248,7 @@ <h2>Nothing to show</h2>
247248
<mat-expansion-panel-header>
248249
<mat-panel-title>
249250
<button
250-
class="normal-button"
251+
class="title-button"
251252
(click)="
252253
$event.preventDefault();
253254
navigate(

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

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ export class CircularHeatmapComponent implements OnInit {
6868
}
6969

7070
ngOnInit(): void {
71+
console.log(`${this.perfNow()}s: ngOnInit`);
7172
// Ensure that Levels and Teams load before MaturityData
7273
// using promises, since ngOnInit does not support async/await
7374
this.LoadMaturityLevels()
7475
.then(() => this.LoadTeamsFromMetaYaml())
75-
.then(() => this.LoadMaturityDataFromGeneratedYaml());
76+
.then(() => this.LoadMaturityDataFromGeneratedYaml())
77+
.then(() => {
78+
console.log(`${this.perfNow()}s: set filters: ${this.chips?.length}`);
79+
this.matChipsArray = this.chips.toArray();
80+
});
7681
}
7782

7883
@ViewChildren(MatChip) chips!: QueryList<MatChip>;
@@ -255,7 +260,6 @@ export class CircularHeatmapComponent implements OnInit {
255260
this.teamList = this.YamlObject['teams'];
256261
this.teamGroups = this.YamlObject['teamGroups'];
257262
this.teamVisible = [...this.teamList];
258-
console.log(`${this.perfNow()}s: LoadTeamsFromMetaYaml End`);
259263
resolve();
260264
});
261265
});
@@ -276,15 +280,14 @@ export class CircularHeatmapComponent implements OnInit {
276280
this.radial_labels.push('Level ' + y);
277281
this.maxLevelOfActivities = y;
278282
}
279-
console.log(`${this.perfNow()}s: LoadMaturityLevels End`);
280283
resolve();
281284
});
282285
});
283286
}
284287

285288
toggleTeamGroupSelection(chip: MatChip) {
286289
chip.toggleSelected();
287-
let currChipValue = chip.value.replace(/\s/g, '');
290+
let currChipValue = chip.value.trim();
288291

289292
if (chip.selected) {
290293
this.selectedTeamChips = [currChipValue];
@@ -317,7 +320,7 @@ export class CircularHeatmapComponent implements OnInit {
317320

318321
toggleTeamSelection(chip: MatChip) {
319322
chip.toggleSelected();
320-
let currChipValue = chip.value.replace(/\s/g, '');
323+
let currChipValue = chip.value.trim();
321324
let prevSelectedChip = this.selectedTeamChips;
322325
if (chip.selected) {
323326
this.teamVisible.push(currChipValue);
@@ -334,21 +337,11 @@ export class CircularHeatmapComponent implements OnInit {
334337
this.updateChips(prevSelectedChip);
335338
}
336339

337-
ngAfterViewInit() {
338-
// Putting all the chips inside an array
339-
340-
setTimeout(() => {
341-
this.matChipsArray = this.chips.toArray();
342-
this.updateChips(true);
343-
this.reColorHeatmap();
344-
}, 100);
345-
}
346-
347340
updateChips(fromTeamGroup: any) {
348341
console.log('updating chips', fromTeamGroup);
349342
// Re select chips
350343
this.matChipsArray.forEach(chip => {
351-
let currChipValue = chip.value.replace(/\s/g, '');
344+
let currChipValue = chip.value.trim();
352345

353346
if (this.teamVisible.includes(currChipValue)) {
354347
console.log(currChipValue);

0 commit comments

Comments
 (0)