Skip to content

551 audit log improvements#827

Merged
ignatiusm merged 17 commits into
mainfrom
551-audit-log-improvements
Apr 28, 2026
Merged

551 audit log improvements#827
ignatiusm merged 17 commits into
mainfrom
551-audit-log-improvements

Conversation

@ignatiusm

Copy link
Copy Markdown
Contributor

This PR adds:

  • Audit Log endpoint in the backend,
  • Audit Log UI in Admin Portal,
  • Types and test helpers in common,
  • Backend tests to check API is working (extensive)
  • cypress tests to check custom UI functionality (I didn't test sorting and pagination)

What is out of scope, but would be good to do in the future:

  • change col ordering, remove reduncant cols,
  • compare against user stories in Audit log proposal doc
  • improve audit log data model to:
    • actually link to resources in meta (rather than string)
    • actually link to userName (rather than id)
    • backend filtering?

Goal is to get this MVP UI to dev so @mhebrard can have a play with it and think about what would be good to add before pushing this to UAT

@ignatiusm ignatiusm requested a review from plouka13 April 24, 2026 04:40

@plouka13 plouka13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a general question - is access to the audit log table (or some of the logs) different between StudyAdmin and OrgAdmin? Is this something that's been discussed?

A couple of nice to haves could be included here. Happy to skip depending on your work load.

  1. Would be cool if the payload is 'prettified' - something like the below image is a bit hard to pick out important information.

  2. Also would be cool if the true or false could be colour coded or use some kind of visual (similar to the PATCH, POST, GET etc. chips) to make it a bit more appealing and clear.

Image

Comment thread application/backend/src/controllers/AuditLogsController.test.ts Outdated
Comment thread application/backend/src/controllers/AuditLogsController.test.ts Outdated
Comment thread application/backend/src/controllers/AuditLogsController.test.ts Outdated
Comment thread application/backend/src/controllers/AuditLogsController.test.ts Outdated
Comment thread application/backend/src/controllers/AuditLogsController.test.ts Outdated
@ignatiusm

Copy link
Copy Markdown
Contributor Author

A bit of a general question - is access to the audit log table (or some of the logs) different between StudyAdmin and OrgAdmin? Is this something that's been discussed?

A couple of nice to haves could be included here. Happy to skip depending on your work load.

1. Would be cool if the payload is 'prettified' - something like the below image is a bit hard to pick out important information.

2. Also would be cool if the `true` or `false` could be colour coded or use some kind of visual (similar to the PATCH, POST, GET etc. chips) to make it a bit more appealing and clear.
Image

Hi @plouka13 - Rather than addressing that here, I've moved that comment to another github issue where I'd like peple to put their feedback on the Audit log UI. That means I'll aim to get this PR to dev asap, and then people can play around on dev and put subsequent feedback on that issue.

@plouka13 plouka13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! Happy to be merged once little typos/commented out code is cleaned up :)

@ignatiusm ignatiusm merged commit 9b6470b into main Apr 28, 2026
6 checks passed
@ignatiusm ignatiusm deleted the 551-audit-log-improvements branch April 28, 2026 02:35
@ignatiusm ignatiusm restored the 551-audit-log-improvements branch April 28, 2026 02:36
ignatiusm added a commit that referenced this pull request Apr 28, 2026
@ignatiusm ignatiusm deleted the 551-audit-log-improvements branch April 28, 2026 02:48
ignatiusm added a commit that referenced this pull request Apr 28, 2026
* create 1.2.1-rc.1 patch release

* Defer minimatch til next month (#792)

* Snyk fixes: Update minimatch and rollup (#794)

* Update minimatch and rollup

* Remove snyk exceptions

* Bump axios

* 796 dependabot response (#797)

* Bump tar

* bump vite in admin- and user-client

* bump mdast-util-to-hast

* bump lodash

* bump lodash-es

* bump body-parser

* bump js-yaml

* bump esbuild

* bump jsdiff

* Bump multer (#798)

bump multer

* create 1.2.2-rc.1 patch release

Note: previous release was 1.2.1, however security alerts blocked merging updated Chart version number.
this PR fixes those security alerts

* bump version

* 551 audit log improvements (#827)

* Adds audit-logs endpoint

* Appease the linter

* Adds audit-log UI

* Adds serverside pagination and sorting for auditlogs

* Tiny tweak for center align

* Fix capilatisation in admin settings panel

* Do not sort encrypted field

* AuditLogController -> AuditLogsController

* Adds list of backend tests

* Adds seedAuditLogs test helper

* Add AllowedAuditLogSortFields to make DRY

* Add defaultAuditLogsPageSize for DRY config

* Use new DRY config and type

* First draft of backend auditlog tests

* Randomise audit log test seed userId

* Adds audit-log cypress tests

* Fix typos, remove unneeded imports

* Revert "551 audit log improvements (#827)"

This reverts commit 9b6470b.

* Tweak minikube install and add debug info to helm CI workflows

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ignatiusm added a commit that referenced this pull request Apr 29, 2026
ignatiusm added a commit that referenced this pull request Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants