feat(AuditLog): Add the organisation audit log page

TA
4h ago
+1764-76

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8889

The organisation audit log page, on the endpoints from #8921. It sits behind the organisation_audit_log flag and is shown to organisation admins only.

  • New Audit Log tab in the organisation nav.
  • Logs grouped by day. Each row shows the project and environment, and expands to the field changes. When a log has no field changes, the row links to the related object instead.
  • Search, Clear all and paging. The search lives in the URL.
  • Loading, empty, no access and error states.

A new list rather than the project page's AuditLog: it uses no Flux stores, so the project page can move onto it later.

Shared changes, not behind the flag:

  • Accordion gets a controlled open and a row variant, and the rows use it. Its other users (release pipeline status, environment metrics, pending change requests) keep the card look.
  • ColorSwatch takes children and an xl size. The project initial in each row is built on it.
  • The project palette and contrast colour move out of Utils into paletteColour, so Jest can test them. Utils still exports them, so existing callers don't change.
  • New --always-black token, the pair of --always-white, for the initial on light palette colours.

Next: filtering by scope (#8941), then the stories and the RTL tests.

How did you test this code?

  • Unit tests for the filters, URL round trip, day grouping, error kinds, related object links and palette colours.
  • By hand against a local API: with the flag on, open Organisation → Audit Log, search, expand a row and page through.