From 91e38520a260b694bf70e033a246d492ed93357a Mon Sep 17 00:00:00 2001 From: Andrea Bollini Date: Wed, 2 Jun 2021 14:36:06 +0200 Subject: [PATCH] Respect maxColumns exposed by the metric box configuration --- src/app/core/layout/metrics-components-data.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/core/layout/metrics-components-data.service.ts b/src/app/core/layout/metrics-components-data.service.ts index b88b29406b9..2afc74e593e 100644 --- a/src/app/core/layout/metrics-components-data.service.ts +++ b/src/app/core/layout/metrics-components-data.service.ts @@ -69,8 +69,10 @@ export class MetricsComponentsDataService { * Get matching metrics for item. */ getMatchingMetrics(metrics: Metric[], maxColumn: number, metricTypes: string[]): MetricRow[] { - - const metricRows = this.computeMetricsRows(metrics, 3, metricTypes); + if (maxColumn == null || maxColumn <= 0) { + maxColumn = 3; + } + const metricRows = this.computeMetricsRows(metrics, maxColumn, metricTypes); return metricRows; }