From 4fd742357501be9594e26488c28d371bc2f76cd2 Mon Sep 17 00:00:00 2001 From: Sofie Hofmann <29145005+sofie29@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:54:32 +0200 Subject: [PATCH] TSK-1383: Solving error in monitor when clicking on last entry in table --- .../components/report-table/report-table.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web/src/app/monitor/components/report-table/report-table.component.ts b/web/src/app/monitor/components/report-table/report-table.component.ts index 346ddf602..a8b9833ab 100644 --- a/web/src/app/monitor/components/report-table/report-table.component.ts +++ b/web/src/app/monitor/components/report-table/report-table.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ReportData } from 'app/monitor/models/report-data'; @Component({ @@ -6,18 +6,16 @@ import { ReportData } from 'app/monitor/models/report-data'; templateUrl: './report-table.component.html', styleUrls: ['./report-table.component.scss'] }) -export class ReportTableComponent implements OnInit { +export class ReportTableComponent { currentExpHeaders = 0; @Input() reportData: ReportData; - ngOnInit(): void {} - toggleFold(indexNumber: number, sumRow: boolean = false) { let rows = sumRow ? this.reportData.sumRow : this.reportData.rows; let index = indexNumber; - const toggleRow = rows[(index += 1)]; + const toggleRow = rows[index]; if (toggleRow.depth < this.reportData.meta.rowDesc.length - 1) { const firstChildRow = rows[(index += 1)]; firstChildRow.display = !firstChildRow.display;