Skip to content

Enhance admin tools logs for better readability CRASM-2559 #939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

lwersiy
Copy link
Collaborator

@lwersiy lwersiy commented Jun 9, 2025

🗣 Description

  • This PR enhances the AdminTool UserLog visibility by getting important information from the Payload details and displaying them in a table on the UI for easy readability.
  • Events are displayed on the table such that the most recent entries appear first..
  • New fields created to show the payload information without the need for deeper investigation.
  • All fields are filterable using different operators.
  • User local time is converted to UTC in the backend for timestamp filtering

Existing Behavior

  • Prior to the implementation the below fields were not filterable.
  • Timestamp did not show accurate dates and time.
    Event
    Result
    Timestamp
    Payload
    Details

Expected Behavior

  • Fileds can be filtered using different operators,
  • Timestamp fields shows specific date and time,
  • Column visibility model exclude certain columns by default
    Event
    Acting User
    Acted-on User
    Organization
    Region
    Role
    State
    User Type
    Timestamp
    Result
    Payload

💭 Motivation and context

Closes CRASM-2559

🧪 Testing

Tested Locally

<

📷 Screenshots (if appropriate)

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.
  • Create a pre-release (necessary if and only if the pre-release version was bumped).

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).

lwersiy added 14 commits May 1, 2025 14:12
…me instead of day ago, Included 2 additional columns that will show what user is assigned to an organization and what user did the assignement.
…om payload logs and display in the appropriate column
…g_schema model, and added a search_logs_filtered function to filter log entries based on advanced, user-specified criteria.

Added Pydantic models that structure and validate data for log searching and filtering to user_log_schema.py

Added a FastAPI route handler for the endpoint /logs/filtered-search, which allows clients to search logs with advanced filtering capabilities.

Refactored Logs.tsx to fetch log data from the backend /logs/filtered-search endpoint; or /logs/search for an unfiltered query.
… user and organizational fields: acting_user, acted_on_user, region, and organization. Replacing User Assigned and Assigned By. 2) Added the new fields to LogSearchFilter Pydantic model.
…rontend, refactored backend operator logics (contains and equals) to enhance filtering, replaced user field with user-type, refactored user log search to apply appropriate operators for timestamp filtering.
…ate_operator to enhance timestamp field filtering
…rt it to backend UTC, ran npm install date-fns-tz which updated package.json and package-lock.json
…_user_email, also made those fields filterable.
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.

1 participant