(feat) AUDIT-36: add esm-audit-log-app with Carbon DataTable, filters and pagination#267
(feat) AUDIT-36: add esm-audit-log-app with Carbon DataTable, filters and pagination#267AshThe25 wants to merge 3 commits into
Conversation
|
Backend REST endpoint that powers this workspace: |
|
Nice clean structure. One thing worth confirming: the useSWR key is a URL string, so changing startIndex or limit triggers a fresh fetch as expected, but does the backend cache control header play well with SWR revalidation on focus? |
There was a problem hiding this comment.
Small thought: if filters.userUuid is pasted with trailing whitespace the REST call will 404. A .trim() before params.set('user', ...) would save users from a confusing empty result.
There was a problem hiding this comment.
Fixed — added .trim() on userUuid before setting the URL param.
There was a problem hiding this comment.
Two small UX points on the filters reset flow:
handleClearFiltersresets page to 1 but does not reset pageSize, which feels inconsistent.DEFAULT_FILTERSuses empty strings for dates, but DatePicker passes undefined when cleared. Worth aligning to avoid a stale "" value sticking in the URL params.
There was a problem hiding this comment.
Both fixed — handleClearFilters now resets pageSize back to the default alongside page, and changed startDate/endDate type to string|undefined to align with what DatePicker passes when cleared.
There was a problem hiding this comment.
Filter-by-user takes a raw UUID which is tough for non-admin users. A downstream improvement could be a UserSelect component wired to the existing users REST endpoint, keeping UUID under the hood
There was a problem hiding this comment.
Agreed — a UserSelect component would be a good improvement. I've noted it as a follow-up since it would require wiring to the users REST endpoint. Happy to tackle it as a separate PR if that works.
efd3e26 to
5fc1d1f
Compare
|
@praneeth622 Good catch. SWR's default If we wanted to suppress unnecessary revalidation we could pass |
…, pagination and detail modal Adds a new esm-audit-log-app workspace package for OpenMRS administrators. - Carbon DataTable with sortable columns: Date/Time, User, Action, Object Type, Object ID, Child Logs - Filter panel: user UUID, action (CREATED/UPDATED/DELETED), start/end date via DatePicker - Server-side pagination with configurable page sizes (10/25/50) - Action tags colour-coded with Carbon Tag (green/blue/red) - Detail modal (AUDIT-45): clicking any row opens a Modal with field-level changes and child log entries - SWR-based data fetching via useAuditLogs and useAuditLogDetail hooks - Lazy-loaded detail modal to keep initial bundle size small Depends on openmrs-module-auditlog PRs openmrs#17 and openmrs#28.
52a4bbe to
9027226
Compare
|
@praneeth622 squashed down to a single clean commit now — let me know if anything else needs addressing before this can move forward. |
|
@AshThe25 thanks for the turnaround. All three inline threads look resolved on my end. The |
|
@jayasanka all of @praneeth622's review comments have been resolved — .trim() on userUuid, pageSize reset on clear-filters, and string|undefined date typing are all in. Single clean commit. Would you be able to take a look when you get a chance? |
will be greatful if u assist then to merge it up |
|
@jayasanka all of @praneeth622's review comments are resolved and he's cleared everything on his end. Would you be able to take a look when you get a chance? |
|
@denniskigen would you be able to take a look at this when you get a chance? All of @praneeth622's review comments have been resolved. |
cc1d299 to
9027226
Compare
|
@denniskigen now that #725 and #729 are in, wanted to flag #267 again — this is the audit log frontend app that the form-engine work feeds into. @praneeth622 has cleared all review comments. Would appreciate a look when you get a chance. |
|
@denniskigen would love your review on this when you get a chance! This adds the full Audit Log frontend app to esm-admin-tools — Carbon DataTable with filters, pagination, and workspace integration. All of @praneeth622's review comments have been resolved. Happy to address any feedback. Thanks! |
Requirements
feat,fix, orchore, among others). See existing PR titles for inspiration.If applicable
Summary
Adds
esm-audit-log-app— a new O3 workspace package providing an Audit Log dashboard for OpenMRS administrators.Features:
DataTablewith sortable columns: Date & Time, User, Action, Object Type, Object ID, Child LogsDatePickerTag(green/blue/red)Modalshowing field-level changes (old/new values) and child log entriesuseAuditLogsanduseAuditLogDetailhooksBackend dependency:
openmrs-module-auditlogPRs #17 (list endpoint) and #28 (detail endpoint)Screenshots
N/A — requires running auditlog module backend
Related Issue
https://issues.openmrs.org/browse/AUDIT-36
Other
N/A