From e4a1abc1ad6a244e2b0de2361311764bd23e22ee Mon Sep 17 00:00:00 2001 From: Vegard Bakke Date: Thu, 2 Jan 2025 19:51:39 +0100 Subject: [PATCH] Remove sideeffect when opening modal dialog --- .../circular-heatmap/circular-heatmap.component.html | 2 +- .../circular-heatmap/circular-heatmap.component.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/component/circular-heatmap/circular-heatmap.component.html b/src/app/component/circular-heatmap/circular-heatmap.component.html index 027d2d5a..4e4e3152 100644 --- a/src/app/component/circular-heatmap/circular-heatmap.component.html +++ b/src/app/component/circular-heatmap/circular-heatmap.component.html @@ -251,7 +251,7 @@

Nothing to show

class="title-button" (click)=" $event.preventDefault(); - navigate( + openActivityDetails( currentDimension, cardHeader, activity['activityName'] diff --git a/src/app/component/circular-heatmap/circular-heatmap.component.ts b/src/app/component/circular-heatmap/circular-heatmap.component.ts index d23d1cff..95321c2a 100644 --- a/src/app/component/circular-heatmap/circular-heatmap.component.ts +++ b/src/app/component/circular-heatmap/circular-heatmap.component.ts @@ -739,21 +739,21 @@ export class CircularHeatmapComponent implements OnInit { } } - navigate(dim: string, subdim: string, activityName: string) { + openActivityDetails(dim: string, subdim: string, activityName: string) { let navigationExtras = { dimension: dim, subDimension: subdim, activityName: activityName, }; - this.yaml.setURI('./assets/YAML/generated/generated.yaml'); - this.activityDetails = this.YamlObject[dim][subdim][activityName]; - console.log(this.YamlObject); - console.log(this.YamlObject[dim][subdim]); + this.activityDetails = Object.assign( + {}, + this.YamlObject[dim][subdim][activityName] + ); + if (this.activityDetails) { this.activityDetails.navigationExtras = navigationExtras; } console.log(this.activityDetails); - console.log(this.ALL_CARD_DATA); this.showOverlay = true; }