From 3ac6a6fdfc05497393d429506a311231485628ed Mon Sep 17 00:00:00 2001 From: yelinz Date: Fri, 8 Nov 2024 13:46:19 +0100 Subject: [PATCH] fix(analytics): display new lines in table --- packages/analytics/addon/components/ca-report-preview.hbs | 2 ++ packages/analytics/addon/components/ca-report-preview.js | 8 ++++++++ .../app/styles/@projectcaluma/ember-analytics.scss | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/packages/analytics/addon/components/ca-report-preview.hbs b/packages/analytics/addon/components/ca-report-preview.hbs index cf99e1d1d..2e3d078d0 100644 --- a/packages/analytics/addon/components/ca-report-preview.hbs +++ b/packages/analytics/addon/components/ca-report-preview.hbs @@ -33,6 +33,7 @@ {{entry.value}} @@ -45,6 +46,7 @@ {{summary.value}} diff --git a/packages/analytics/addon/components/ca-report-preview.js b/packages/analytics/addon/components/ca-report-preview.js index d8243f440..4ddf612ee 100644 --- a/packages/analytics/addon/components/ca-report-preview.js +++ b/packages/analytics/addon/components/ca-report-preview.js @@ -90,6 +90,14 @@ export default class CaReportPreviewComponent extends Component { return "s"; } + getCSSClass(value) { + if (value?.includes("\n")) { + return "multiline-data"; + } + + return ""; + } + // cleaning needed because excel does not support carriage returns cleanValue = (value) => value?.replaceAll(/\r/g, ""); } diff --git a/packages/analytics/app/styles/@projectcaluma/ember-analytics.scss b/packages/analytics/app/styles/@projectcaluma/ember-analytics.scss index 470945f6f..fdb4a2587 100644 --- a/packages/analytics/app/styles/@projectcaluma/ember-analytics.scss +++ b/packages/analytics/app/styles/@projectcaluma/ember-analytics.scss @@ -4,3 +4,10 @@ .sortable-item.is-dragging { z-index: 10; } + +.multiline-data { + white-space: pre-line; + line-height: normal; + padding-top: 0 !important; + padding-bottom: 0 !important; +}