Skip to content

Commit

Permalink
Merge branch 'rendering-build-vite' into 'main'
Browse files Browse the repository at this point in the history
Rendering build vite

See merge request reportcreator/reportcreator!408
  • Loading branch information
MWedl committed Jan 15, 2024
2 parents 7f9a804 + 2ea2a4a commit a08e326
Show file tree
Hide file tree
Showing 22 changed files with 16,938 additions and 40,220 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Next
* Diff-view for version history
* Set form fields readonly instead of disabled
* Update build system of Vue PDF rendering script from webpack to vite


## v2024.3 - 2024-01-09
Expand Down
15 changes: 15 additions & 0 deletions api/src/reportcreator_api/tests/test_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ def test_markdown_rendering(self):
'</div>'
])
)

@pytest.mark.parametrize(['props', 'items', 'html'], [
('', [], '<span></span>'),
('', ['a'], '<span>a</span>'),
('', ['a', 'b'], '<span>a and b</span>'),
('', ['a', 'b', 'c'], '<span>a, b and c</span>'),
('comma=";" and="+"', ['a', 'b', 'c'], '<span>a;b+c</span>'),
])
def test_comma_and_join(self, props, items, html):
actual_html = self.render_html(
f"""<comma-and-join {props}><template v-for="v, idx in report.field_list" #[idx]>{{{{ v }}}}</template></comma-and-join>""",
{'report': {'field_list': items}}
).replace('<!---->', '')
assert actual_html == html


def test_toc_rendering(self):
html = self.render_html("""
Expand Down
46,917 changes: 14,963 additions & 31,954 deletions rendering/NOTICE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions rendering/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
window.REPORT_TEMPLATE = `
<h1>Use this file for debugging</h1>
`;
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions rendering/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}
Loading

0 comments on commit a08e326

Please sign in to comment.