feat(audit-log): dated filename on CSV download button (PMS-474) #324
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!324
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/PMS-474-audit-log-csv-download"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
downloadattribute was a staticaudit-log.csv, which meant an admin who downloaded the log on consecutive days gotaudit-log.csv (1),audit-log.csv (2)... in their browser's downloads folder. PMS-474 swaps the static filename foraudit-log-YYYY-MM-DD.csvso 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 JSfetch+ blob workaround) so the same-origin auth cookie travels with the navigation; the filter-state-derivedhrefkeeps 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