diff --git a/src/app/component/circular-heatmap/circular-heatmap.component.ts b/src/app/component/circular-heatmap/circular-heatmap.component.ts index 267a34d0d..891d75604 100644 --- a/src/app/component/circular-heatmap/circular-heatmap.component.ts +++ b/src/app/component/circular-heatmap/circular-heatmap.component.ts @@ -398,7 +398,7 @@ export class CircularHeatmapComponent implements OnInit { .append('svg') .attr('width', '60%') // 70% forces the heatmap down .attr('height', 'auto') - .attr('viewBox', '0 0 1150 1150') + .attr('viewBox', '0 0 1150 1150') .append('g') .attr( 'transform', diff --git a/src/app/component/mapping/mapping.component.html b/src/app/component/mapping/mapping.component.html index d0898b21f..42264c6a9 100644 --- a/src/app/component/mapping/mapping.component.html +++ b/src/app/component/mapping/mapping.component.html @@ -271,7 +271,7 @@ - + {{ item.teamImplementation[key] }} diff --git a/src/app/component/mapping/mapping.component.ts b/src/app/component/mapping/mapping.component.ts index 54b817800..9d1b2ea81 100644 --- a/src/app/component/mapping/mapping.component.ts +++ b/src/app/component/mapping/mapping.component.ts @@ -154,12 +154,18 @@ export class MappingComponent implements OnInit { ] ); for (let a = 0; a < activityInCurrentSubDimension.length; a++) { - if (a == 0) { - this.allTeams = Object.keys( + if (!this.allTeams || this.allTeams.length == 0) { + if ( this.YamlObject[this.allDimensionNames[i]][ subdimensionsInCurrentDimension[j] ][activityInCurrentSubDimension[a]]['teamsImplemented'] - ); + ) { + this.allTeams = Object.keys( + this.YamlObject[this.allDimensionNames[i]][ + subdimensionsInCurrentDimension[j] + ][activityInCurrentSubDimension[a]]['teamsImplemented'] + ); + } } this.setValueandAppendToDatasetSortedbyActivity( this.allDimensionNames[i], @@ -247,26 +253,31 @@ export class MappingComponent implements OnInit { ISO22: ISO22Array, samm2: '', }; - if (SAMMArray.length == 0) { - this.allMappingDataSortedBySAMM.push(this.temporaryMappingElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedBySAMM.push( - this.temporaryMappingElement - ); - } else { - this.plannedMappingDataSortedBySAMM.push(this.temporaryMappingElement); + + if (SAMMArray) { + if (SAMMArray.length == 0) { + this.allMappingDataSortedBySAMM.push(this.temporaryMappingElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedBySAMM.push( + this.temporaryMappingElement + ); + } else { + this.plannedMappingDataSortedBySAMM.push( + this.temporaryMappingElement + ); + } } - } - for (var i = 0; i < SAMMArray.length; i++) { - const newTempElement = JSON.parse( - JSON.stringify(this.temporaryMappingElement) - ); - newTempElement['samm2'] = SAMMArray[i]; - this.allMappingDataSortedBySAMM.push(newTempElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedBySAMM.push(newTempElement); - } else { - this.plannedMappingDataSortedBySAMM.push(newTempElement); + for (var i = 0; i < SAMMArray.length; i++) { + const newTempElement = JSON.parse( + JSON.stringify(this.temporaryMappingElement) + ); + newTempElement['samm2'] = SAMMArray[i]; + this.allMappingDataSortedBySAMM.push(newTempElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedBySAMM.push(newTempElement); + } else { + this.plannedMappingDataSortedBySAMM.push(newTempElement); + } } } //sorting by descending order @@ -372,27 +383,31 @@ export class MappingComponent implements OnInit { }; console.log(this.temporaryMappingElement); - if (ISOArray.length == 0) { - this.allMappingDataSortedByISO17.push(this.temporaryMappingElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedByISO17.push( - this.temporaryMappingElement - ); - } else { - this.plannedMappingDataSortedByISO17.push(this.temporaryMappingElement); + if (ISOArray) { + if (ISOArray.length == 0) { + this.allMappingDataSortedByISO17.push(this.temporaryMappingElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedByISO17.push( + this.temporaryMappingElement + ); + } else { + this.plannedMappingDataSortedByISO17.push( + this.temporaryMappingElement + ); + } } - } - for (var i = 0; i < ISOArray.length; i++) { - const newTempElement = JSON.parse( - JSON.stringify(this.temporaryMappingElement) - ); - newTempElement['ISO17'] = ISOArray[i]; - //console.log(newTempElement); - this.allMappingDataSortedByISO17.push(newTempElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedByISO17.push(newTempElement); - } else { - this.plannedMappingDataSortedByISO17.push(newTempElement); + for (var i = 0; i < ISOArray.length; i++) { + const newTempElement = JSON.parse( + JSON.stringify(this.temporaryMappingElement) + ); + newTempElement['ISO17'] = ISOArray[i]; + //console.log(newTempElement); + this.allMappingDataSortedByISO17.push(newTempElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedByISO17.push(newTempElement); + } else { + this.plannedMappingDataSortedByISO17.push(newTempElement); + } } } //sorting by descending order @@ -429,27 +444,32 @@ export class MappingComponent implements OnInit { ISO22: '', samm2: SAMMArray, }; - if (ISO22Array.length == 0) { - this.allMappingDataSortedByISO22.push(this.temporaryMappingElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedByISO22.push( - this.temporaryMappingElement - ); - } else { - this.plannedMappingDataSortedByISO22.push(this.temporaryMappingElement); + + if (ISO22Array) { + if (ISO22Array.length == 0) { + this.allMappingDataSortedByISO22.push(this.temporaryMappingElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedByISO22.push( + this.temporaryMappingElement + ); + } else { + this.plannedMappingDataSortedByISO22.push( + this.temporaryMappingElement + ); + } } - } - for (var i = 0; i < ISO22Array.length; i++) { - const newTempElement = JSON.parse( - JSON.stringify(this.temporaryMappingElement) - ); - newTempElement['ISO22'] = ISO22Array[i]; - //console.log(newTempElement); - this.allMappingDataSortedByISO22.push(newTempElement); - if (this.YamlObject[dim][subDim][activity]['isImplemented']) { - this.performedMappingDataSortedByISO22.push(newTempElement); - } else { - this.plannedMappingDataSortedByISO22.push(newTempElement); + for (var i = 0; i < ISO22Array.length; i++) { + const newTempElement = JSON.parse( + JSON.stringify(this.temporaryMappingElement) + ); + newTempElement['ISO22'] = ISO22Array[i]; + //console.log(newTempElement); + this.allMappingDataSortedByISO22.push(newTempElement); + if (this.YamlObject[dim][subDim][activity]['isImplemented']) { + this.performedMappingDataSortedByISO22.push(newTempElement); + } else { + this.plannedMappingDataSortedByISO22.push(newTempElement); + } } } //sorting by descending order