From 378183599ad86a95bb713003fad3c87ca68b262a Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Fri, 17 Feb 2023 10:21:07 +0100 Subject: [PATCH] MOBILE-4077 ReportBuilder: Fix reports broken when receive a number --- .../components/report-column/report-column.ts | 12 +++++++++--- .../features/reportbuilder/services/reportbuilder.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/features/reportbuilder/components/report-column/report-column.ts b/src/core/features/reportbuilder/components/report-column/report-column.ts index cf5575c3d..4006702e0 100644 --- a/src/core/features/reportbuilder/components/report-column/report-column.ts +++ b/src/core/features/reportbuilder/components/report-column/report-column.ts @@ -12,25 +12,31 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; @Component({ selector: 'core-report-builder-report-column', templateUrl: './report-column.html', styleUrls: ['./report-column.scss'], }) -export class CoreReportBuilderReportColumnComponent { +export class CoreReportBuilderReportColumnComponent implements OnInit { @Input() isExpanded = false; @Input() isExpandable = false; @Input() showFirstTitle = false; @Input() columnIndex!: number; @Input() rowIndex!: number; - @Input() column!: string; + @Input() column!: string | number; @Input() contextId!: number; @Input() header!: string; @Output() onToggleRow: EventEmitter = new EventEmitter(); + ngOnInit(): void { + if (typeof this.column === 'number') { + this.column = this.column.toString(); + } + } + /** * Emits row click */ diff --git a/src/core/features/reportbuilder/services/reportbuilder.ts b/src/core/features/reportbuilder/services/reportbuilder.ts index 2564e25cc..601a89427 100644 --- a/src/core/features/reportbuilder/services/reportbuilder.ts +++ b/src/core/features/reportbuilder/services/reportbuilder.ts @@ -232,7 +232,7 @@ export interface CoreReportBuilderRetrieveReportMapped extends Omit