-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new height option auto (min-height)
if rectangle is only ( basically no element is overlapping with it) or last element inside row or column, row and column layout is computed for children. - if rectangle is overlapping with other element and we make it relative placement of other element will be broken so for now it is set to compute layout as per above condition created patch that will convert isDynamicHeight Boolean to heightType with value "fixed" or "auto". updated default objects and control in Properties Panel. changed schema version number to 1.2.0 as schema is changed and is incompatible with old formats (1.1.0) we need to handle old formats. updated jinja render template - modified relative_containers to be recursive - updated all templates to use heightType properties - updated logic to include min-height - added logic for backwards compatibility. - also introduced dynamic height for static text if it has parseJinja enabled. - updated rectangle template to be dynamic height misc: is_older_schema now handles really old formats which don't have schema_version reverted styles for relative column
- Loading branch information
1 parent
36f8606
commit 8a4d958
Showing
17 changed files
with
157 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import frappe | ||
|
||
from print_designer.patches.patch_utils import patch_formats | ||
|
||
|
||
def execute(): | ||
"""changing isDynamicHeight property to heightType property in text and table elements""" | ||
|
||
def element_callback(el): | ||
if el.get("type") == "text" and not (el.get("isDynamic") or el.get("parseJinja")): | ||
return | ||
|
||
if not "isDynamicHeight" in el: | ||
el["isDynamicHeight"] = False | ||
|
||
if el["isDynamicHeight"]: | ||
el["heightType"] = "auto" | ||
else: | ||
el["heightType"] = "fixed" | ||
|
||
patch_formats( | ||
{"element": element_callback}, | ||
types=["text", "table"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
print_designer/print_designer/page/print_designer/jinja/macros/dynamictext.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
print_designer/print_designer/page/print_designer/jinja/macros/rectangle.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 24 additions & 4 deletions
28
print_designer/print_designer/page/print_designer/jinja/macros/relative_containers.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
print_designer/print_designer/page/print_designer/jinja/macros/statictext.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
print_designer/print_designer/page/print_designer/jinja/macros/table.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.