@@ -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