Skip to content

Commit

Permalink
Merge pull request #336 from 0x41head/activity-desc
Browse files Browse the repository at this point in the history
Fixed bug where changes done in circular heatmap were not shown in activity description
  • Loading branch information
wurstbrot authored Nov 14, 2024
2 parents ffccf07 + bbb5975 commit 68951ef
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface implementation {
url: string;
description: string;
}

export interface activityDescription {
dimension: string;
subDimension: string;
Expand Down Expand Up @@ -127,19 +128,6 @@ export class ActivityDescriptionComponent implements OnInit {
var currentActivityName = activityInCurrentSubDimension[a];

try {
console.log(this.currentActivity.uuid, this.currentActivity.uuid);
console.log(
'uuid',
this.YamlObject[allDimensionNames[i]][
subdimensionsInCurrentDimension[j]
][currentActivityName].uuid
);
console.log(
'currentActivityName',
this.YamlObject[allDimensionNames[i]][
subdimensionsInCurrentDimension[j]
][currentActivityName]
);
if (
this.YamlObject[allDimensionNames[i]][
subdimensionsInCurrentDimension[j]
Expand All @@ -149,7 +137,7 @@ export class ActivityDescriptionComponent implements OnInit {
this.YamlObject[allDimensionNames[i]][
subdimensionsInCurrentDimension[j]
][currentActivityName];
this.currentActivity = data;
this.currentActivity = JSON.parse(JSON.stringify(data)); // Creates a deep copy of current activity to keep two seperate versions - with and without martkdown
this.currentActivity.dimension = allDimensionNames[i];
this.currentActivity.subDimension =
subdimensionsInCurrentDimension[j];
Expand Down Expand Up @@ -262,7 +250,35 @@ export class ActivityDescriptionComponent implements OnInit {
data['isImplemented'],
false
);
this.currentActivity.teamsImplemented = data['teamsImplemented'];
const dataFromLocalStorage = localStorage.getItem('dataset');
if (dataFromLocalStorage !== null) {
var parsedDataFromLocalStorage = JSON.parse(dataFromLocalStorage);
var index = -1;
for (var i = 0; i < parsedDataFromLocalStorage.length; i++) {
for (
var j = 0;
j < parsedDataFromLocalStorage[i]['Activity'].length;
j++
) {
if (
parsedDataFromLocalStorage[i]['Activity'][j]['uuid'] ===
data['uuid']
) {
console.log('test', parsedDataFromLocalStorage[i]['Activity'][j]);

index = i;
this.currentActivity.teamsImplemented =
parsedDataFromLocalStorage[i]['Activity'][j][
'teamsImplemented'
];

break;
}
}
}
// this.currentActivity.teamsEvidence = this.defineEvidenceObject();
} else this.currentActivity.teamsImplemented = data['teamsImplemented'];

this.currentActivity.teamsEvidence = this.defineEvidenceObject(
data['teamsEvidence']
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Router } from '@angular/router';
import { MatChip } from '@angular/material/chips';

export interface activitySchema {
uuid: string;
activityName: string;
teamsImplemented: any;
}
Expand Down Expand Up @@ -101,6 +102,11 @@ export class CircularHeatmapComponent implements OnInit {

for (var a = 0; a < allActivityInThisSubDimension.length; a++) {
try {
var uuid =
this.YamlObject[allDimensionNames[d]][
allSubDimensionInThisDimension[s]
][allActivityInThisSubDimension[a]]['uuid'];

var lvlOfCurrentActivity =
this.YamlObject[allDimensionNames[d]][
allSubDimensionInThisDimension[s]
Expand Down Expand Up @@ -148,6 +154,7 @@ export class CircularHeatmapComponent implements OnInit {
});

activity.push({
uuid: uuid,
activityName: nameOfActivity,
teamsImplemented: teamStatus,
});
Expand Down Expand Up @@ -788,7 +795,7 @@ export class CircularHeatmapComponent implements OnInit {

ResetIsImplemented() {
localStorage.removeItem('dataset');
this.loadState()
this.loadState();
}

saveState() {
Expand Down

0 comments on commit 68951ef

Please sign in to comment.