From 28bef423080b843caa1b8c639426a347e8ea6bde Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Fri, 24 May 2024 13:10:20 +0530 Subject: [PATCH 1/2] fix: change heightType check to string In recent change we added 3 types of height fixed, auto, auto (min-height) so we converted property to string from boolean. check in dynamic text was for boolean so changed it to string comparison --- .../page/print_designer/jinja/macros/dynamictext.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print_designer/print_designer/page/print_designer/jinja/macros/dynamictext.html b/print_designer/print_designer/page/print_designer/jinja/macros/dynamictext.html index 6a1d450..1002381 100644 --- a/print_designer/print_designer/page/print_designer/jinja/macros/dynamictext.html +++ b/print_designer/print_designer/page/print_designer/jinja/macros/dynamictext.html @@ -1,9 +1,9 @@ {% from 'print_designer/page/print_designer/jinja/macros/spantag.html' import span_tag with context %} -{% macro dynamictext(element, send_to_jinja, is_parent_dynamic_height) -%} -
-
{% for field in element.dynamicContent %} From 39f7ea6b0790c3a123016757f7c09618726812bc Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Fri, 24 May 2024 13:18:29 +0530 Subject: [PATCH 2/2] chore: rename is_parent_dynamic_height to heightType --- .../page/print_designer/jinja/macros/rectangle.html | 6 +++--- .../print_designer/jinja/macros/render_element.html | 10 +++++----- .../page/print_designer/jinja/macros/statictext.html | 6 +++--- .../page/print_designer/jinja/macros/table.html | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/print_designer/print_designer/page/print_designer/jinja/macros/rectangle.html b/print_designer/print_designer/page/print_designer/jinja/macros/rectangle.html index ee5e0ac..e795ad7 100644 --- a/print_designer/print_designer/page/print_designer/jinja/macros/rectangle.html +++ b/print_designer/print_designer/page/print_designer/jinja/macros/rectangle.html @@ -1,13 +1,13 @@ -{% macro rectangle(element, render_element, send_to_jinja, is_parent_dynamic_height) -%} +{% macro rectangle(element, render_element, send_to_jinja, heightType) -%} {%- set heightType = element.get("heightType") -%} {%- if settings.get("schema_version") == "1.1.0" -%} {%- set heightType = "auto" if element.get("isDynamicHeight", False) else "fixed" -%} {%- endif -%} -
{% if element.childrens %} {% for object in element.childrens %} - {{ render_element(object, send_to_jinja, is_parent_dynamic_height) }} + {{ render_element(object, send_to_jinja, heightType) }} {% endfor %} {% endif %}
diff --git a/print_designer/print_designer/page/print_designer/jinja/macros/render_element.html b/print_designer/print_designer/page/print_designer/jinja/macros/render_element.html index d2820e2..f9892a8 100644 --- a/print_designer/print_designer/page/print_designer/jinja/macros/render_element.html +++ b/print_designer/print_designer/page/print_designer/jinja/macros/render_element.html @@ -7,18 +7,18 @@ {% from 'print_designer/page/print_designer/jinja/macros/table.html' import table with context %} -{% macro render_element(element, send_to_jinja, is_parent_dynamic_height = 'fixed') -%} +{% macro render_element(element, send_to_jinja, heightType = 'fixed') -%} {% if element.type == "rectangle" %} - {{ rectangle(element, render_element, send_to_jinja, is_parent_dynamic_height) }} + {{ rectangle(element, render_element, send_to_jinja, heightType) }} {% elif element.type == "image" %} {{image(element)}} {% elif element.type == "table" %} - {{table(element, send_to_jinja, is_parent_dynamic_height)}} + {{table(element, send_to_jinja, heightType)}} {% elif element.type == "text" %} {% if element.isDynamic %} - {{dynamictext(element, send_to_jinja, is_parent_dynamic_height)}} + {{dynamictext(element, send_to_jinja, heightType)}} {% else%} - {{statictext(element, send_to_jinja, is_parent_dynamic_height)}} + {{statictext(element, send_to_jinja, heightType)}} {% endif %} {% elif element.type == "barcode" %} {{barcode(element, send_to_jinja)}} diff --git a/print_designer/print_designer/page/print_designer/jinja/macros/statictext.html b/print_designer/print_designer/page/print_designer/jinja/macros/statictext.html index 9a34b8b..82aafd4 100644 --- a/print_designer/print_designer/page/print_designer/jinja/macros/statictext.html +++ b/print_designer/print_designer/page/print_designer/jinja/macros/statictext.html @@ -1,8 +1,8 @@ -{% macro statictext(element, send_to_jinja, is_parent_dynamic_height) -%} -
-

{% if element.parseJinja %} {{ render_user_text(element.content, doc, {}, send_to_jinja).get("message", "") }} diff --git a/print_designer/print_designer/page/print_designer/jinja/macros/table.html b/print_designer/print_designer/page/print_designer/jinja/macros/table.html index 9c6ce09..2550739 100644 --- a/print_designer/print_designer/page/print_designer/jinja/macros/table.html +++ b/print_designer/print_designer/page/print_designer/jinja/macros/table.html @@ -1,9 +1,9 @@ -{% macro table(element, send_to_jinja, is_parent_dynamic_height) -%} +{% macro table(element, send_to_jinja, heightType) -%} {%- set heightType = element.get("heightType") -%} {%- if settings.get("schema_version") == "1.1.0" -%} {%- set heightType = "auto" if element.get("isDynamicHeight", False) else "fixed" -%} {%- endif -%} - +
{% if element.columns %}