From 7725868bc96a4e59680044934305a2449fe51333 Mon Sep 17 00:00:00 2001 From: Aliaksandr Nikitsin Date: Fri, 1 Aug 2025 13:15:28 +0200 Subject: [PATCH] description line break --- framework/python/src/common/testreport.py | 9 ++++++++- resources/report/test_report_styles.css | 1 + .../test_packs/pilot/report_templates/results.jinja | 10 +++++----- .../qualification/report_templates/results.jinja | 10 +++++----- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/framework/python/src/common/testreport.py b/framework/python/src/common/testreport.py index baa66cc1c..af1563b84 100644 --- a/framework/python/src/common/testreport.py +++ b/framework/python/src/common/testreport.py @@ -356,13 +356,20 @@ def _calc_details_height(self, text): lines = math.ceil(len(text) / 45) return (lines * 14) + 12 + def _calc_text_line_height(self, text): + # Calculate result lines count + lines = math.ceil(len(text) / 52) + return 40 + 15 * (lines -1) + def _gen_result_page(self, results, space): # Build results page content page = [] page_space = 0 while results: result = results[0] - line_height = 40 + line_height = self._calc_text_line_height(result['description']) + if line_height > 40: + result['height'] = line_height if result['details']: line_height += self._calc_details_height(result['details']) page_space += line_height diff --git a/resources/report/test_report_styles.css b/resources/report/test_report_styles.css index 8533f6c0d..0a90803d1 100644 --- a/resources/report/test_report_styles.css +++ b/resources/report/test_report_styles.css @@ -484,6 +484,7 @@ .result-test-description { max-width: 300px; + white-space: normal; } .result-test-details { diff --git a/resources/test_packs/pilot/report_templates/results.jinja b/resources/test_packs/pilot/report_templates/results.jinja index c516cbdb2..c76a4c826 100644 --- a/resources/test_packs/pilot/report_templates/results.jinja +++ b/resources/test_packs/pilot/report_templates/results.jinja @@ -9,16 +9,16 @@ {% for test_result in page %} {% if test_result['result'] == 'Non-Compliant' and test_result['required_result'] in ["Required", "Required if Applicable"] %} - {% if test_result['details']%} -
+ {% if test_result['details'] %} +
{% else%} -
+
{% endif %} {% else %} {% if test_result['details']%} -
+
{% else %} -
+
{% endif %} {% endif %}
{{ test_result['name'] }}
diff --git a/resources/test_packs/qualification/report_templates/results.jinja b/resources/test_packs/qualification/report_templates/results.jinja index c516cbdb2..c76a4c826 100644 --- a/resources/test_packs/qualification/report_templates/results.jinja +++ b/resources/test_packs/qualification/report_templates/results.jinja @@ -9,16 +9,16 @@
{% for test_result in page %} {% if test_result['result'] == 'Non-Compliant' and test_result['required_result'] in ["Required", "Required if Applicable"] %} - {% if test_result['details']%} -
+ {% if test_result['details'] %} +
{% else%} -
+
{% endif %} {% else %} {% if test_result['details']%} -
+
{% else %} -
+
{% endif %} {% endif %}
{{ test_result['name'] }}