@@ -739,8 +739,10 @@ export class CircularHeatmapComponent implements OnInit {
739739 this . showOverlay = false ;
740740 }
741741
742- SaveEditedYAMLfile ( ) {
742+ saveEditedYAMLfile ( ) {
743+ this . setTeamsStatus ( this . YamlObject , this . teamList , this . ALL_CARD_DATA ) ;
743744 let yamlStr = yaml . dump ( this . YamlObject ) ;
745+
744746 let file = new Blob ( [ yamlStr ] , { type : 'text/csv;charset=utf-8' } ) ;
745747 var link = document . createElement ( 'a' ) ;
746748 link . href = window . URL . createObjectURL ( file ) ;
@@ -749,6 +751,26 @@ export class CircularHeatmapComponent implements OnInit {
749751 link . remove ( ) ;
750752 }
751753
754+ setTeamsStatus ( yamlObject : any , teamList : string [ ] , card_data : cardSchema [ ] ) {
755+ // Loop through all activities from the card_data
756+ for ( let card of card_data ) {
757+ for ( let activity of card . Activity ) {
758+ let dim : string = card . Dimension ;
759+ let subdim : string = card . SubDimension ;
760+ let activityName : string = activity . activityName ;
761+ let teamsImplemented : any = { } ;
762+
763+ // Get the state for all genuine teams of the activity
764+ for ( let team of teamList ) {
765+ teamsImplemented [ team ] = activity ?. teamsImplemented [ team ] || false ;
766+ }
767+ // Save the teams' state to the yaml object
768+ yamlObject [ dim ] [ subdim ] [ activityName ] . teamsImplemented =
769+ teamsImplemented ;
770+ }
771+ }
772+ }
773+
752774 reColorHeatmap ( ) {
753775 console . log ( 'recolor' ) ;
754776 for ( var index = 0 ; index < this . ALL_CARD_DATA . length ; index ++ ) {
0 commit comments