feat: add viz_bundle support to report generation and enhance schema
- Introduced the `viz_bundle` block type to the report profile schema, allowing for the inclusion of bundled visualizations in PDF reports. - Updated the `build_structured_report_pdf` function to handle `VizBundleBlock` and append its content to the report. - Enhanced the report catalog API to include details for the new `viz_bundle` block type. - Added configuration editors for various visualization bundles in the frontend settings page. - Updated tests to validate the new `viz_bundle` functionality and ensure proper handling of report profiles. - Bumped application version to reflect these enhancements.
This commit is contained in:
1 parent
62729d0648
commit
3ab5dae130
7 files changed
+682
-104
No files matched your search
@@ -29,3 +29,28 @@ def test_chart_block_unknown_id_raises():
|
||||
}
|
||||
with pytest.raises(Exception):
|
||||
ReportProfilePayload.model_validate(raw)
|
||||
|
||||
|
||||
def test_viz_bundle_roundtrip():
|
||||
raw = {
|
||||
"version": 1,
|
||||
"document_title": "",
|
||||
"blocks": [
|
||||
{"type": "viz_bundle", "bundle_id": "body_history_viz", "config": {"chart_days": 14}},
|
||||
],
|
||||
}
|
||||
p = ReportProfilePayload.model_validate(raw)
|
||||
assert p.blocks[0].type == "viz_bundle"
|
||||
assert p.blocks[0].config.get("chart_days") == 14
|
||||
|
||||
|
||||
def test_viz_bundle_unknown_raises():
|
||||
import pytest
|
||||
|
||||
raw = {
|
||||
"version": 1,
|
||||
"document_title": "",
|
||||
"blocks": [{"type": "viz_bundle", "bundle_id": "not_a_bundle", "config": {}}],
|
||||
}
|
||||
with pytest.raises(Exception):
|
||||
ReportProfilePayload.model_validate(raw)
|
||||
Reference in new issue
Block a user