Skip to content

Commit

Permalink
Add isAnonymous input to ScenarioTrendsComponent (#413)
Browse files Browse the repository at this point in the history
Extended ScenarioTrendsComponent to accept the isAnonymous input parameter. Adjusted the onPointSelect method to respect this isAnonymous flag, ensuring point selection handling changes based on anonymity.
  • Loading branch information
ludeknovy authored Sep 11, 2024
1 parent 3e45d80 commit 543bee6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { normalizeOverviewData } from "../../utils/normalizeOverviewData";
})
export class ScenarioTrendsComponent implements OnInit {
@Input() params;
@Input() isAnonymous: boolean;
Highcharts: typeof Highcharts = Highcharts;
updateAggregatedScenarioTrendsChartFlag = false;
updateLabelScenarioTrendsChartFlag = false;
Expand Down Expand Up @@ -159,7 +160,7 @@ export class ScenarioTrendsComponent implements OnInit {
}

onPointSelect(event) {
if (event && event.point && event.point) {
if (event && event.point && !this.isAnonymous) {
// Label series have item id amended to open correct detail, it's needed for a case when a labels do not match, eg:
// label2 start at point 0, but label2 starts at point 1, it leads to off by N issues.
// It's not needed for aggregated trend chart, as that is column chart and only one point can be clicked.
Expand Down
2 changes: 1 addition & 1 deletion src/app/scenario/scenario.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="items-overview content-container">
<div class="container-fluid">

<app-scenario-trends [params]="params"></app-scenario-trends>
<app-scenario-trends [params]="params" [isAnonymous]="isAnonymous"></app-scenario-trends>

<div class="row rr" *ngIf="!isAnonymous">
<div class="col" *ngIf="items$ | async; let items">
Expand Down

0 comments on commit 543bee6

Please sign in to comment.