v20260104-14-reports-stats-total-runs-success-rate-fix #28
@ -1 +1 @@
|
||||
v20260103-20-reports-export-html-open-new-tab
|
||||
v20260104-01-reports-output-format-save-fix
|
||||
|
||||
@ -139,9 +139,12 @@ def api_reports_create():
|
||||
name = (payload.get("name") or "").strip() or "Report"
|
||||
description = (payload.get("description") or "").strip() or None
|
||||
report_type = (payload.get("report_type") or "one-time").strip() or "one-time"
|
||||
output_format = (payload.get("output_format") or "csv").strip() or "csv"
|
||||
output_format = (payload.get("output_format") or "csv").strip().lower() or "csv"
|
||||
schedule = (payload.get("schedule") or "").strip() or None
|
||||
|
||||
if output_format not in ("csv", "html", "pdf"):
|
||||
return {"error": "Invalid output_format. Use csv, html, or pdf."}, 400
|
||||
|
||||
report_config = payload.get("report_config")
|
||||
if report_config is not None and not isinstance(report_config, (dict, list, str)):
|
||||
report_config = None
|
||||
@ -406,6 +409,7 @@ def api_reports_update(report_id: int):
|
||||
- name
|
||||
- description
|
||||
- report_config
|
||||
- output_format
|
||||
"""
|
||||
err = _require_reporting_role()
|
||||
if err is not None:
|
||||
@ -420,6 +424,13 @@ def api_reports_update(report_id: int):
|
||||
desc = (payload.get("description") or "").strip()
|
||||
report.description = desc or None
|
||||
|
||||
if "output_format" in payload:
|
||||
fmt = (payload.get("output_format") or "").strip().lower()
|
||||
if fmt:
|
||||
if fmt not in ("csv", "html", "pdf"):
|
||||
return {"error": "Invalid output_format. Use csv, html, or pdf."}, 400
|
||||
report.output_format = fmt
|
||||
|
||||
if "report_config" in payload:
|
||||
rc = payload.get("report_config")
|
||||
if rc is None:
|
||||
|
||||
@ -536,7 +536,7 @@ class ReportDefinition(db.Model):
|
||||
# one-time | scheduled
|
||||
report_type = db.Column(db.String(32), nullable=False, default="one-time")
|
||||
|
||||
# csv | pdf (pdf is future)
|
||||
# csv | html | pdf
|
||||
output_format = db.Column(db.String(16), nullable=False, default="csv")
|
||||
|
||||
# customer scope for report generation
|
||||
|
||||
@ -181,6 +181,15 @@
|
||||
- Changed HTML report handling to open in a new browser tab instead of triggering a file download.
|
||||
- Enabled proper inline rendering of HTML reports to support graphical preview and layout validation.
|
||||
|
||||
---
|
||||
|
||||
## v20260104-01-reports-output-format-save-fix
|
||||
|
||||
- Fixed an issue where the selected report output format (HTML/PDF) was not persisted when saving or editing a report.
|
||||
- The report update endpoint now correctly stores the chosen output_format instead of always reverting to CSV.
|
||||
- Added validation and normalization for output_format values during report creation and update.
|
||||
- Ensured that selecting HTML as output no longer results in CSV being generated or downloaded.
|
||||
|
||||
================================================================================================================================================
|
||||
|
||||
## v0.1.15
|
||||
|
||||
Loading…
Reference in New Issue
Block a user