Skip to content
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

Fix/check the flows of toggling logs timestamp and body columns #6992

Merged

Conversation

ahmadshaheer
Copy link
Collaborator

@ahmadshaheer ahmadshaheer commented Jan 30, 2025

Summary

  • fix the issue of body/timestamp not visible in live logs
  • fix the issue of selected columns lost when we visit any other page and then visit logs explorer
  • remove the selected columns when we clear a view

Related Issues / PR's

Screenshots

NA

Affected Areas and Manually Tested Areas


Important

Fix and enhance logs explorer by ensuring default columns are visible and preserved across sessions and views.

  • Behavior:
    • Fix visibility of body and timestamp in live logs by ensuring defaultLogsSelectedColumns are always included in LiveLogsList and ContextLogRenderer.
    • Preserve selected columns across page visits in LogsExplorer by migrating options query to include defaultLogsSelectedColumns if missing.
    • Clear selected columns when clearing a view in ExplorerOptions by resetting to defaultLogsSelectedColumns or defaultTraceSelectedColumns.
  • Functions:
    • migrateOptionsQuery in LogsExplorer ensures required columns are present in the query.
    • handleClearSelect in ExplorerOptions resets columns to defaults based on sourcepage.
  • Misc:
    • Add utility functions hasRequiredColumns and mergeWithRequiredColumns in LogsExplorer to manage column defaults.
    • Minor refactoring in ContextLogRenderer to use defaultLogsSelectedColumns for selected fields.

This description was created by Ellipsis for ba5c27f. It will automatically update as commits are pushed.

@ahmadshaheer ahmadshaheer requested a review from YounixM as a code owner January 30, 2025 23:29
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to ba5c27f in 1 minute and 29 seconds

More details
  • Looked at 196 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. frontend/src/container/LiveLogs/LiveLogsList/index.tsx:57
  • Draft comment:
    Consider refactoring the repeated pattern of merging defaultLogsSelectedColumns with options.selectColumns using convertKeysToColumnFields into a utility function to avoid redundancy. This pattern is also present in ContextLogRenderer.tsx.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The code in LiveLogsList and ContextLogRenderer uses convertKeysToColumnFields with defaultLogsSelectedColumns and options.selectColumns. This pattern is repeated in multiple files, indicating a potential for refactoring to avoid redundancy.
2. frontend/src/container/LogDetailedView/ContextView/ContextLogRenderer.tsx:114
  • Draft comment:
    Consider refactoring the repeated pattern of using convertKeysToColumnFields with defaultLogsSelectedColumns into a utility function to avoid redundancy. This pattern is also present in LiveLogsList/index.tsx.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The ContextLogRenderer component uses convertKeysToColumnFields with defaultLogsSelectedColumns, which is a pattern repeated in other files. This indicates a potential for refactoring to avoid redundancy.
3. frontend/src/pages/LogsExplorer/index.tsx:130
  • Draft comment:
    Good use of mergeWithRequiredColumns to ensure required columns are present in the query. This utility function helps maintain code clarity and reuse.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The migrateOptionsQuery function in LogsExplorer is responsible for ensuring the query has the required columns. It uses a utility function mergeWithRequiredColumns to handle this, which is a good practice for code reuse and clarity.
4. frontend/src/pages/LogsExplorer/index.tsx:142
  • Draft comment:
    Avoid using inline styles. Move the styles to an external stylesheet or use styled components. This is also applicable at line 138.
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_C4S7bVOKuiXha1y9


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@ahmadshaheer ahmadshaheer force-pushed the fix/check-the-flows-of-toggling-logs-timestamp-and-body-columns branch from ba5c27f to be4ec10 Compare January 30, 2025 23:31
@github-actions github-actions bot added the bug Something isn't working label Jan 30, 2025
@YounixM YounixM merged commit a84e462 into main Jan 31, 2025
15 of 16 checks passed
@YounixM YounixM deleted the fix/check-the-flows-of-toggling-logs-timestamp-and-body-columns branch January 31, 2025 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants