feat(audit-log): dated filename on CSV download button (PMS-474) #324

Merged
YousifShkara merged 1 commit from feat/PMS-474-audit-log-csv-download into main 2026-06-24 09:59:10 +02:00
Owner

PMS-455 shipped the audit-log CSV export endpoint and the SPA's "Download CSV" anchor that hits it with the current filter state preserved. The filename forced via the download attribute was a static audit-log.csv, which meant an admin who downloaded the log on consecutive days got audit-log.csv (1), audit-log.csv (2) ... in their browser's downloads folder. PMS-474 swaps the static filename for audit-log-YYYY-MM-DD.csv so the daily files sort cleanly and don't collide.

Computed at render time (not memoised) via chrono::Utc::now().format("%Y-%m-%d") so an operator who leaves the page open across midnight still gets today's date stamped onto the next click. The anchor itself stays a plain <a href="..."> (not a JS fetch + blob workaround) so the same-origin auth cookie travels with the navigation; the filter-state-derived href keeps the existing PMS-455 wiring intact.

#PMS-474

PMS-455 shipped the audit-log CSV export endpoint and the SPA's "Download CSV" anchor that hits it with the current filter state preserved. The filename forced via the `download` attribute was a static `audit-log.csv`, which meant an admin who downloaded the log on consecutive days got `audit-log.csv (1)`, `audit-log.csv (2)` ... in their browser's downloads folder. PMS-474 swaps the static filename for `audit-log-YYYY-MM-DD.csv` so the daily files sort cleanly and don't collide. Computed at render time (not memoised) via `chrono::Utc::now().format("%Y-%m-%d")` so an operator who leaves the page open across midnight still gets today's date stamped onto the next click. The anchor itself stays a plain `<a href="...">` (not a JS `fetch` + blob workaround) so the same-origin auth cookie travels with the navigation; the filter-state-derived `href` keeps the existing PMS-455 wiring intact. #PMS-474
feat(audit-log): dated filename on CSV download button (PMS-474)
All checks were successful
Check / fmt + clippy + tests (pull_request) Successful in 27m15s
Create release / Create release from merged PR (pull_request) Has been skipped
5829d0c902
PMS-455 shipped the audit-log CSV export endpoint and the SPA's "Download CSV" anchor that hits it with the current filter state preserved. The filename forced via the `download` attribute was a static `audit-log.csv`, which meant an admin who downloaded the log on consecutive days got `audit-log.csv (1)`, `audit-log.csv (2)` ... in their browser's downloads folder. PMS-474 swaps the static filename for `audit-log-YYYY-MM-DD.csv` so the daily files sort cleanly and don't collide.

Computed at render time (not memoised) via `chrono::Utc::now().format("%Y-%m-%d")` so an operator who leaves the page open across midnight still gets today's date stamped onto the next click. The anchor itself stays a plain `<a href="...">` (not a JS `fetch` + blob workaround) so the same-origin auth cookie travels with the navigation; the filter-state-derived `href` keeps the existing PMS-455 wiring intact.

#PMS-474
YousifShkara deleted branch feat/PMS-474-audit-log-csv-download 2026-06-24 09:59:10 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!324
No description provided.