Add audit logging integration for UI flag operations#2
Merged
rishabhrao merged 11 commits intomasterfrom Feb 18, 2026
Merged
Conversation
Extract user_id from configurable HTTP header and pass audit context to all FunWithFlags API calls. Works with the new audit logging feature in fun_with_flags core. Key changes: - Add audit_opts/1 helper that reads user_id from request header - All route handlers now pass audit opts to enable/disable/clear calls - Export and import pass user_id to FunWithFlags API - Utils.create_flag_with_name accepts optional opts for audit context - README updated with audit logging section
Shinyzenith
approved these changes
Feb 17, 2026
This commit introduces a new audit logs page that displays audit log entries for flag operations. Key changes include: - New `AuditLogFormatter` module for formatting audit log records. - Updated router to handle the `/audit_logs` route and fetch relevant audit entries. - New templates for displaying audit logs, including pagination and search functionality. - Integration of audit log links in the navigation across various pages. Additionally, JavaScript functionality is added to convert UTC timestamps to local time in the audit log table.
This commit introduces a theme selection option in the settings page, allowing users to choose between light, dark, and system color schemes. Key changes include: - New theme selection dropdown in the settings template. - JavaScript functionality to apply the selected theme immediately and save preferences in local storage. - CSS styles for dark theme to ensure proper styling across various UI components. Additionally, the theme is applied on page load to prevent a flash of the default theme.
This commit adds a new option to hide the flag column in the audit log table based on the `hide_flag_column` assign. Key changes include: - Updated the router to pass the `hide_flag_column` flag. - Modified the audit log template to conditionally render the flag column based on the new assign. This improves the flexibility of the audit log display, allowing for a cleaner view when flag information is not needed.
This commit improves the display of UTC timestamps in the audit logs by implementing a custom formatting function. Key changes include: - Replaced the default locale string conversion with a more detailed format that includes the day, month, year, and time in a 12-hour format with AM/PM indication. - Introduced an array for month names and a padding function for single-digit minutes and seconds. This enhancement provides a clearer and more user-friendly representation of timestamps in the audit log table.
89a7dcb to
8985501
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audit: [user_id: ...]to allFunWithFlags.enable/disable/clearcallsuser_id:toexport_flagsandimport_flagsUtils.create_flag_with_nameto accept and forward audit optsDepends on: invideoio/fun_with_flags#feat/audit-logging
Files changed
lib/fun_with_flags/ui/router.ex—audit_opts/1helper, all route handlers updatedlib/fun_with_flags/ui/utils.ex—create_flag_with_name/2accepts optsREADME.md— audit logging section addedTest plan
X-User-Idheader and verify audit logs contain the user_idmix test)