Skip to content

Conversation

@omkarK06
Copy link
Contributor

@omkarK06 omkarK06 commented Jul 31, 2024

fix #3973

Summary by CodeRabbit

  • New Features

    • Introduced a new dynamic table component for enhanced data display and interaction.
    • Added support for Tailwind CSS, improving styling capabilities across the application.
    • Implemented interactive controls for managing log entries in the data table.
  • Improvements

    • Enhanced logging functionality with clearer error messaging, improved content wrapping, and optimized selection of log fields based on user input.
    • Streamlined user interface in the JSON preview and search result components for better usability and readability.
    • Improved performance and responsiveness of the search results table.
    • Refined column visibility management in the search results, enhancing user experience.
  • Bug Fixes

    • Updated column management logic in the search results for improved robustness.
    • Enhanced reliability of Playwright tests by refining timing and interaction steps.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 31, 2024

Walkthrough

Recent updates to the Vue.js application include enhancements in user interaction and data management, particularly in logging functionalities and user interface design. New dependencies for table management and virtual rendering have been added, along with Tailwind CSS for styling. The logging functionality features improved error handling, a dynamic table component with drag-and-drop column reordering, and refined test reliability for better synchronization with the UI.

Changes

File Change Summary
web/package.json Added dependencies: @tanstack/vue-table, @tanstack/vue-virtual, and reintroduced monaco-editor-vue.
web/src/composables/useLogs.ts Improved log data handling with better error messages; changed defaultObject.flagWrapContent to true and refactored column definitions.
web/src/main.ts Imported Tailwind CSS stylesheet to enhance styling capabilities.
web/src/plugins/logs/DetailTable.vue, web/src/plugins/logs/Index.vue, web/src/plugins/logs/JsonPreview.vue Enhanced component formatting and dropdown functionality for better user interaction.
web/src/plugins/logs/SearchResult.vue, web/src/plugins/logs/TenstackTable.vue Replaced <q-virtual-scroll> with <tenstack-table> for improved rendering; added drag-and-drop column reordering and virtual scrolling.
web/src/plugins/logs/SearchBar.vue Modified logic for managing selected fields based on dynamic data structures.
tests/ui-testing/playwright-tests/logsquickmode.spec.js, tests/ui-testing/playwright-tests/logsqueries.spec.js Improved test reliability by adjusting wait times and refining interaction steps for better synchronization with the UI.
tests/ui-testing/playwright-tests/schema.spec.js Enhanced test reliability by replacing click actions with visibility checks on specific selectors.
.github/workflows/playwright.yml Minor formatting adjustment in the workflow configuration file.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant TableComponent
    participant LogComponent

    User->>LogComponent: Interacts with logs
    LogComponent->>App: Fetch Logs
    App->>TableComponent: Render Logs
    TableComponent-->>User: Display Logs
    User->>TableComponent: Reorder Columns
    TableComponent->>TableComponent: Update Column Order
    TableComponent-->>User: Reflect Changes
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between db1ca05 and d208fb9.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (7)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (16 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (8 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (2)
  • web/src/main.ts
  • web/src/plugins/traces/Index.vue
Additional comments not posted (27)
web/package.json (3)

32-32: Addition of @tanstack/vue-table dependency looks good.

The version ^8.19.3 is appropriate for the project.


33-33: Addition of @tanstack/vue-virtual dependency looks good.

The version ^3.8.4 is appropriate for the project.


48-48: Relocation of monaco-editor-vue dependency looks good.

The dependency is correctly relocated to maintain the alphabetical order.

web/src/plugins/logs/JsonPreview.vue (7)

2-13: Improvement in the structure and presentation of the outermost <div> and copy button looks good.

The changes enhance readability and maintainability without affecting functionality.


21-105: Reorganization of the dropdown component looks good.

The changes maintain the same conditions and enhance readability and maintainability.


107-120: Improvement in the structure and presentation of the log content display looks good.

The changes enhance readability and maintainability without affecting functionality.


Line range hint 122-198: Improvement in the structure and presentation of the script section looks good.

The changes enhance readability and maintainability without affecting functionality.


Line range hint 199-210: Initialization of multiStreamFields in onBeforeMount lifecycle hook looks good.

The changes maintain functionality and improve the structure.


Line range hint 212-218: Scoped styles for .log_json_content look good.

The styles are appropriate and enhance the presentation.


Line range hint 2-218: Overall indentation and formatting improvements look good.

The changes enhance readability and maintainability without affecting functionality.

web/src/plugins/logs/TenstackTable.vue (7)

2-246: Template structure of the TenstackTable component looks good.

The structure is appropriate and enhances performance and user experience.


248-487: Script setup section of the TenstackTable component looks good.

The changes enhance readability and maintainability without affecting functionality.


412-424: useVirtualizer options look good.

The options are appropriate and enhance performance.


344-375: useVueTable options look good.

The options are appropriate and enhance performance.


377-390: Computed properties look good.

The computed properties are appropriate and enhance performance and readability.


324-342: Watch properties look good.

The watch properties are appropriate and enhance performance and readability.


488-581: Scoped styles look good.

The styles are appropriate and enhance the presentation.

web/src/plugins/logs/SearchResult.vue (5)

129-142: Integration of tenstack-table component looks good.

The props and event handlers are correctly defined. Ensure that the tenstack-table component handles these props and events as expected.


432-439: Dynamic table width calculation looks good.

The logic for calculating the table width based on window size and sidebar menu state is correct.


441-446: Watcher for splitterModel changes looks good.

The watcher correctly monitors changes to searchObj.config.splitterModel and logs them.


284-287: Change in closeColumn method looks good.

The method now references col.id instead of col.name, which is consistent with the updated column management logic.


201-201: Import and registration of TenstackTable component looks good.

The TenstackTable component is correctly imported and registered in the component.

web/src/composables/useLogs.ts (5)

21-21: Approved: Addition of cloneDeep import.

The cloneDeep function from lodash-es is useful for creating deep copies of objects, ensuring immutability.


126-126: Approved: Change of flagWrapContent to true.

This change will enable content wrapping by default, which may improve readability. Verify the impact on the UI to ensure it aligns with user expectations.


2891-2899: Approved: Update of timestamp column definition.

The change modernizes the column definitions by using id and accessorFn, improving data handling and formatting. Ensure the new naming convention is consistently applied across the codebase.


2916-2926: Approved: Update of source column definition.

The change enhances the column definition by adding id, accessorFn, and meta properties, improving data handling and formatting. Ensure the new naming convention is consistently applied across the codebase.


2934-2950: Approved: Update of timestamp column definition.

The change enhances the column definition by adding id, accessorFn, and meta properties, improving data handling and formatting. Ensure the new naming convention is consistently applied across the codebase.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between db1ca05 and d208fb9.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (7)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (16 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (8 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (1)
  • web/src/main.ts
Additional comments not posted (27)
web/package.json (3)

32-32: Dependency Addition: @tanstack/vue-table

The dependency @tanstack/vue-table has been added to improve table handling functionalities. Ensure that this addition is thoroughly tested.


33-33: Dependency Addition: @tanstack/vue-virtual

The dependency @tanstack/vue-virtual has been added to improve virtual rendering functionalities. Ensure that this addition is thoroughly tested.


48-48: Re-addition of Dependency: monaco-editor-vue

The dependency monaco-editor-vue has been re-added with version ^1.0.10. Verify that this re-addition is intentional and necessary.

web/src/plugins/logs/JsonPreview.vue (4)

2-13: Template Enhancement: Layout Reorganization

The layout has been reorganized, and the button for copying logs to the clipboard has been enhanced. Ensure that the new layout and functionality work as expected.


14-121: Template Enhancement: Dropdown Functionality

The dropdown functionality for including and excluding fields has been enhanced. Ensure that the new dropdown functionality works as expected.


Line range hint 122-196:
Script Enhancement: Event Handlers and Methods

The event handlers and methods have been adjusted and new methods have been added. Ensure that the new event handlers and methods work as expected.


Line range hint 197-205:
Style Enhancement: Class Names and Styles

The class names and styles have been adjusted. Ensure that the new styles work as expected.

web/src/plugins/logs/TenstackTable.vue (3)

2-246: New Component: Table Structure and Layout

The structure and layout of the new table component have been added. Ensure that the new table component works as expected.


247-487: New Component: Table Logic and Functionality

The logic and functionality of the new table component have been added. Ensure that the new table component works as expected.


488-581: New Component: Table Styles and Class Names

The styles and class names for the new table component have been added. Ensure that the new table component works as expected.

web/src/plugins/logs/SearchResult.vue (8)

129-142: Introduce the new <tenstack-table> component.

The new table component is well-integrated and enhances the table rendering logic. Ensure that the properties passed to the component are correctly defined and managed.


Line range hint 187-201: Add new imports for the <tenstack-table> component.

The new imports are correctly added to support the new table component.


Line range hint 201-215: Update the defineComponent function to include the new table component.

The defineComponent function is correctly updated to include the new table component.


284-287: Update the closeColumn method to use col.id.

The method is correctly updated to use col.id instead of col.name, enhancing the robustness of column management.


432-439: Add the getTableWidth computed property.

The computed property is correctly added to dynamically calculate the table width based on the sidebar's state.


441-446: Add a watch function for searchObj.config.splitterModel.

The watch function is correctly added to handle changes in the splitter model and dynamically adjust the table width.


479-479: Update the return statement to include new properties and methods.

The return statement is correctly updated to include new properties and methods to support the new table component and dynamic table width calculation.


479-479: Add new computed properties and watch functions.

The computed properties and watch functions are correctly added to handle the table width and the splitter model.

web/src/plugins/traces/Index.vue (1)

968-968: Rename the field property to accessorfn.

The property name is correctly changed from field to accessorfn, enhancing clarity regarding the purpose of this property in the context of data handling.

web/src/composables/useLogs.ts (8)

21-21: Approved: Import cloneDeep from lodash-es.

The cloneDeep function is useful for creating deep copies of objects to avoid unintended mutations.


126-126: Verify the impact of enabling content wrapping by default.

The flagWrapContent property has been changed from false to true. Ensure this change does not negatively impact the UI, especially in terms of content overflow and readability.


1199-1199: Approved: Reformatting error message for better readability.

Splitting the error message across multiple lines enhances readability and maintainability without altering the operational logic.


Line range hint 1227-1245:
Approved: Improved error handling logic.

The updated error handling logic ensures that error messages provide more context to the user, particularly when dealing with API response errors.

Tools
Biome

[error] 1231-1231: Do not access Object.prototype method 'hasOwnProperty' from target object.

It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.

(lint/suspicious/noPrototypeBuiltins)


Line range hint 1875-1898:
Approved: Reformatting error message for better readability.

Splitting the error message across multiple lines enhances readability and maintainability without altering the operational logic.


Line range hint 2154-2180:
Approved: Reformatting error message for better readability.

Splitting the error message across multiple lines enhances readability and maintainability without altering the operational logic.


2891-2909: Approved: Standardizing column definitions.

Replacing name and field properties with id and accessorFn standardizes how data is accessed and displayed in the grid, likely improving consistency and reliability. Verify the impact on data retrieval.


2934-2950: Approved: Standardizing column definitions.

Replacing name and field properties with id and accessorFn standardizes how data is accessed and displayed in the grid, likely improving consistency and reliability. Verify the impact on data retrieval.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d208fb9 and 900bec2.

Files selected for processing (2)
  • web/src/composables/useLogs.ts (17 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/TenstackTable.vue

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (4)
web/src/plugins/logs/data-table/CellActions.vue (3)

2-39: Ensure consistent class naming conventions.

The class names use both tw- and non-prefixed styles. Consider using a consistent naming convention for better maintainability.

- class="field_overlay tw-absolute tw-right-0 tw-top-[50%] table-cell-actions tw-translate-y-[-50%]"
+ class="field_overlay tw-absolute tw-right-0 tw-top-[50%] tw-table-cell-actions tw-translate-y-[-50%]"

8-15: Use consistent button sizes.

The q-btn components use a custom size of 6px. Ensure this size is appropriate for all screen sizes and consider using predefined sizes for consistency.


42-69: Ensure proper type annotations.

The copyLogToClipboard method uses any for the value parameter. Consider using a more specific type if possible.

- const copyLogToClipboard = (value: any) => {
+ const copyLogToClipboard = (value: string) => {
web/src/plugins/logs/SearchResult.vue (1)

290-293: Update type annotations for closeColumn method.

The closeColumn method now references col.id instead of col.name. Ensure that the type annotations reflect this change.

- closeColumn(col: any) {
+ closeColumn(col: { id: string }) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 900bec2 and 72fe106.

Files selected for processing (3)
  • web/src/plugins/logs/SearchResult.vue (8 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/plugins/logs/TenstackTable.vue
Additional comments not posted (6)
web/src/plugins/logs/data-table/CellActions.vue (2)

5-6: Ensure proper data binding and testing attributes.

The :title and :data-test attributes are correctly bound to dynamic values. Ensure these values are sanitized if they come from user input to prevent XSS attacks.


59-59: Ensure Vuex store usage is necessary.

The store constant is defined but not used in the script section. Ensure that Vuex store usage is necessary or remove the unused import.

web/src/plugins/logs/SearchResult.vue (4)

27-30: Ensure proper handling of error messages.

The v-if condition checks for searchObj.data.countErrorMsg != ''. Ensure that the error message is properly sanitized and displayed to prevent XSS attacks.


129-148: Optimize dynamic table rendering.

The tenstack-table component is used for dynamic table rendering. Ensure that the component is optimized for performance and handles large datasets efficiently.


Line range hint 193-207:
Ensure proper import paths.

The import paths for components and utilities should be verified to ensure they are correct and follow the project's directory structure.


438-445: Optimize getTableWidth computed property.

The getTableWidth computed property calculates the table width based on the window size. Ensure that this calculation is efficient and does not cause performance issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
tests/ui-testing/playwright-tests/sanity.spec.js (1)

Inconsistent pagination text update.

The old pagination text "fast_rewind12345fast_forward250arrow_drop_down" still exists in multiple places within the sanity.spec.js file. Please ensure that all instances of the old pagination text are replaced with the new pagination text "fast_rewind12345fast_forward100arrow_drop_down" to maintain consistency.

  • tests/ui-testing/playwright-tests/sanity.spec.js
Analysis chain

Line range hint 389-389:
Verify consistency of pagination change across the application.

The change from "fast_rewind12345fast_forward250arrow_drop_down" to "fast_rewind12345fast_forward100arrow_drop_down" should be consistent with the application's updated behavior.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of pagination change across the application.

# Test: Search for the pagination text. Expect: Only occurrences of the new pagination text.
rg --type javascript -A 5 $'fast_rewind12345fast_forward100arrow_drop_down'

Length of output: 109


Script:

#!/bin/bash
# Description: Verify consistency of pagination change across the application.

# Test: Search for the pagination text. Expect: Only occurrences of the new pagination text.
rg -t js -A 5 'fast_rewind12345fast_forward100arrow_drop_down'

Length of output: 553


Script:

#!/bin/bash
# Description: Verify that the old pagination text has been completely replaced across the application.

# Test: Search for the old pagination text. Expect: No occurrences of the old pagination text.
rg -t js -A 5 'fast_rewind12345fast_forward250arrow_drop_down'

Length of output: 2613

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 72fe106 and 8f18ee5.

Files selected for processing (1)
  • tests/ui-testing/playwright-tests/sanity.spec.js (1 hunks)
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/sanity.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (1)
tests/ui-testing/playwright-tests/sanity.spec.js (1)

166-168: Verify consistency of pagination change across the application.

The change from "Showing 1 to 250" to "Showing 1 to 100" should be consistent with the application's updated behavior.

Verification successful

Pagination change is consistent across the application.

The change from "Showing 1 to 250" to "Showing 1 to 100" is consistently applied in the relevant parts of the application.

  • tests/ui-testing/playwright-tests/sanity.spec.js: "Showing 1 to 100" is correctly updated.
  • Other pagination texts like "Showing 1 to 5 out of 5" are also present and consistent.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of pagination change across the application.

# Test: Search for the pagination text. Expect: Only occurrences of the new pagination text.
rg --type javascript -A 5 $'Showing 1 to 100'

Length of output: 81


Script:

#!/bin/bash
# Description: Verify consistency of pagination change across the application.

# Step 1: Find all JavaScript files.
fd -e js > js_files.txt

# Step 2: Search for the pagination text within those files.
rg 'Showing 1 to 100' -f js_files.txt

Length of output: 107


Script:

#!/bin/bash
# Description: Verify consistency of pagination change across the application.

# Step 1: Find all JavaScript files and pipe the output to rg.
fd -e js | xargs rg 'Showing 1 to 100'

Length of output: 143


Script:

#!/bin/bash
# Description: Verify if there are any remaining instances of the old pagination text "Showing 1 to 250" in the codebase.

# Step 1: Find all JavaScript files and pipe the output to rg.
fd -e js | xargs rg 'Showing 1 to 250'

Length of output: 40


Script:

#!/bin/bash
# Description: Verify if pagination-related text is consistent across the application.

# Step 1: Find all JavaScript files and pipe the output to rg.
fd -e js | xargs rg 'Showing 1 to'

Length of output: 432

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8f18ee5 and 9779e41.

Files selected for processing (1)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/plugins/logs/TenstackTable.vue

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Outside diff range, codebase verification and nitpick comments (9)
tests/ui-testing/playwright-tests/logsquickmode.spec.js (9)

Line range hint 8-9:
Remove console logging in production code.

Console logging should be removed before deploying to production.

- console.log("ZO_BASE_URL", process.env["ZO_BASE_URL"]);

Line range hint 10-11:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(1000);
+ await page.waitForSelector('[data-cy="login-user-id"]');

Line range hint 13-14:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForNavigation.

- await page.waitForTimeout(4000);
+ await page.waitForNavigation({ waitUntil: 'networkidle' });

Line range hint 18-19:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(4000);
+ await page.waitForSelector('[data-test="log-search-index-list-select-stream"]');

Line range hint 51-52:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(3000);
+ await page.waitForSelector("[data-test='logs-search-bar-refresh-btn']");

Line range hint 141-142:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector(".field-container");

Line range hint 161-162:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector(".field-container");

Line range hint 181-182:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(1000);
+ await page.waitForSelector('[data-cy="search-bar-refresh-button"] > .q-btn__content', { visible: true });

Line range hint 270-271:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-test="log-table-column-0-source"]');
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9779e41 and 2dd2a95.

Files selected for processing (2)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (2 hunks)
  • web/src/plugins/logs/SearchResult.vue (13 hunks)
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/logsquickmode.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (8)
web/src/plugins/logs/SearchResult.vue (8)

27-30: LGTM!

The changes improve error handling by displaying error messages.


129-148: LGTM!

The new <tenstack-table> component improves performance and maintainability.


217-220: LGTM!

The addition of the TenstackTable component improves the modularity of the code.


289-292: LGTM!

The changes enhance the robustness of column management by using unique identifiers.


437-444: LGTM!

The getTableWidth computed property improves the responsiveness of the table.


446-451: Remove debug logging.

The watch function for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.


484-484: LGTM!

The addition of the getTableWidth computed property to the returned object improves the modularity of the code.


437-444: LGTM!

The getTableWidth computed property improves the responsiveness of the table.

Comment on lines 191 to 189
await page.waitForTimeout(2000)
await expect(
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await page.waitForTimeout(2000)
await expect(
await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');
await expect(

Comment on lines 258 to 259
await page.waitForResponse(searchUrl);

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove redundant wait condition.

The redundant wait condition for the same URL can be removed to streamline the test.

- await page.waitForResponse(searchUrl);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await page.waitForResponse(searchUrl);

Comment on lines 187 to 175
test("should display selected interestesing field and order by - as default in editor", async ({
page,
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-test="logs-search-error-message"]', { timeout: 10000 });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test("should display selected interestesing field and order by - as default in editor", async ({
page,
test("should display selected interestesing field and order by - as default in editor", async ({
page,
// other code
await page.waitForSelector('[data-test="logs-search-error-message"]', { timeout: 10000 });
// other code

@omkarK06 omkarK06 force-pushed the fix/data_tables_ui branch from 2dd2a95 to 0a8faee Compare August 2, 2024 10:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2dd2a95 and 0a8faee.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (10)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (2 hunks)
  • tests/ui-testing/playwright-tests/sanity.spec.js (1 hunks)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (10 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (13 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review as they are similar to previous changes (9)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js
  • tests/ui-testing/playwright-tests/sanity.spec.js
  • web/package.json
  • web/src/composables/useLogs.ts
  • web/src/main.ts
  • web/src/plugins/logs/JsonPreview.vue
  • web/src/plugins/logs/TenstackTable.vue
  • web/src/plugins/logs/data-table/CellActions.vue
  • web/src/plugins/traces/Index.vue
Additional comments not posted (5)
web/src/plugins/logs/SearchResult.vue (5)

27-30: Conditional rendering for error message looks good.

The v-if directive ensures that the error message is only displayed when there is an actual error message.


53-55: Use of optional chaining looks good.

The optional chaining operator (?.) ensures that the code does not throw an error if partitionDetail or paginations is null or undefined.


129-148: Replacement of <q-virtual-scroll> with <tenstack-table> looks good.

The new component introduces a more structured way to handle the display of logs and improves performance. Ensure that the new component is fully integrated and tested.


193-195: Remove debug logging.

The watch function for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.


289-292: Use of unique identifiers for columns looks good.

Referencing col.id instead of col.name enhances the robustness of column management.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0a8faee and e8421ee.

Files selected for processing (1)
  • web/src/plugins/logs/SearchResult.vue (8 hunks)
Additional comments not posted (8)
web/src/plugins/logs/SearchResult.vue (8)

27-30: Error message handling looks good.

The conditional rendering and usage of SanitizedHtmlRenderer for displaying error messages are appropriate.


36-36: Conditional rendering for record count looks good.

The code correctly displays the number of records only when there is no error message.


129-148: Integration of tenstack-table component looks good.

The component is well-integrated with appropriate props and event handlers for managing table data and interactions.


193-195: Remove debug logging.

The watch function contains a console log statement. Remove this debug log before deploying to production.


207-207: Import of TenstackTable component looks good.

The import statement is necessary for the integration of the TenstackTable component.


221-221: Addition of TenstackTable component to components object looks good.

This is necessary for the usage of the component in the template.


290-293: Update to use col.id in closeColumn method looks good.

Using col.id instead of col.name enhances the robustness of column management by using unique identifiers.


438-445: Dynamic table width calculation looks good.

The getTableWidth computed property ensures that the table width is responsive to layout changes, enhancing the user experience. Remove the debug logging before deploying to production.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (8)
tests/ui-testing/playwright-tests/logsquickmode.spec.js (6)

Line range hint 47-50:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(3000);
+ await page.waitForSelector("[data-test='logs-search-bar-refresh-btn']", { timeout: 10000 });

Line range hint 11-13:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(1000);
+ await page.waitForSelector('[data-cy="login-user-id"]', { timeout: 10000 });

- await page.waitForTimeout(4000);
+ await page.waitForSelector('[data-cy="login-sign-in"]', { timeout: 10000 });

Also applies to: 20-21


Line range hint 26-27:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(4000);
+ await page.waitForSelector('[data-test="log-search-index-list-select-stream"]', { timeout: 10000 });

Line range hint 152-153:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-cy="index-field-search-input"]', { timeout: 10000 });

Line range hint 191-192:
Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-cy="index-field-search-input"]', { timeout: 10000 });

289-290: Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

- await page.waitForTimeout(2000);
+ await page.waitForSelector('[data-cy="index-field-search-input"]', { timeout: 10000 });
web/src/plugins/logs/SearchResult.vue (2)

438-445: Remove debug logging.

The getTableWidth computed property includes console log statements. Remove these debug logs before deploying to production.

- console.log("recalculate");

447-452: Remove debug logging.

The watch function for searchObj.config.splitterModel includes console log statements. Remove these debug logs before deploying to production.

- console.log(`splitterModel changed from ${oldValue} to ${newValue}`);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e8421ee and 505bf93.

Files selected for processing (2)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (3 hunks)
  • web/src/plugins/logs/SearchResult.vue (14 hunks)
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/logsquickmode.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (3)
web/src/plugins/logs/SearchResult.vue (3)

129-148: LGTM!

The integration of <tenstack-table> component enhances the table rendering logic and improves performance.


290-295: LGTM!

The closeColumn method now uses col.id instead of col.name, improving the robustness of column management.


Line range hint 207-221:
LGTM!

The components property now includes the TenstackTable component, which is necessary for the integration of the new table component.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 505bf93 and ece0cd7.

Files selected for processing (2)
  • web/src/composables/useLogs.ts (11 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/TenstackTable.vue

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ece0cd7 and 2fd0681.

Files selected for processing (2)
  • web/src/plugins/logs/SearchResult.vue (14 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/plugins/logs/TenstackTable.vue
Additional comments not posted (3)
web/src/plugins/logs/SearchResult.vue (3)

291-294: Update closeColumn method to use col.id.

The closeColumn method has been updated to use col.id instead of col.name. Ensure that col.id is correctly used throughout the method.

Verification successful

Update closeColumn method to use col.id.

The closeColumn method in web/src/plugins/logs/SearchResult.vue has been correctly updated to use col.id instead of col.name.

  • web/src/plugins/logs/SearchResult.vue: The method uses col.id as expected.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `col.id` in the `closeColumn` method.

# Test: Search for the `closeColumn` method definition and usage of `col.id`.
rg --type vue -A 10 $'closeColumn'

Length of output: 61


Script:

#!/bin/bash
# Description: Verify the usage of `col.id` in the `closeColumn` method.

# Test: Search for the `closeColumn` method definition and usage of `col.id` in .vue files.
rg 'closeColumn' --glob '*.vue' -A 10

Length of output: 4633


208-208: Ensure correct import of TenstackTable.

Verify that the TenstackTable component is correctly imported and used in the component's components section.

Verification successful

The TenstackTable component is correctly imported and registered.

  • The TenstackTable component is imported in web/src/plugins/logs/SearchResult.vue.
  • It is also registered in the components section of the same file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the import of the `TenstackTable` component.

# Test: Search for the `TenstackTable` component import statement.
rg --type vue -A 5 $'import TenstackTable'

Length of output: 71


Script:

#!/bin/bash
# Description: Verify the import and usage of the `TenstackTable` component.

# Test: Search for the `TenstackTable` component import statement.
rg 'import TenstackTable' -A 5 --glob '*.vue'

# Test: Search for the `TenstackTable` component in the components section.
rg 'components: {[^}]*TenstackTable' -A 5 --glob '*.vue'

Length of output: 599


Script:

#!/bin/bash
# Description: Verify the import and usage of the `TenstackTable` component.

# Test: Search for the `TenstackTable` component import statement.
rg 'import TenstackTable' -A 5 --glob '*.vue'

# Test: Search for the `TenstackTable` component in the components section.
rg 'components: \{[^}]*TenstackTable' -A 5 --glob '*.vue'

Length of output: 473


Script:

#!/bin/bash
# Description: Verify the usage of the `TenstackTable` component in the `components` section.

# Test: Search for the `components` section in the `SearchResult.vue` file.
rg 'components: \{' -A 10 web/src/plugins/logs/SearchResult.vue

Length of output: 502


129-149: Verify the integration of TenstackTable.

Ensure that the new TenstackTable component is correctly integrated and that all required properties are passed. Specifically, verify:

  • Columns and rows are correctly mapped.
  • The wrap, width, loading, and err-msg properties are correctly set.
  • Event handlers such as @copy, @add-field-to-table, @add-search-term, @close-column, and @click:data-row are correctly implemented.
Verification successful

The integration of TenstackTable in SearchResult.vue is correct.

The TenstackTable component properly handles the passed properties and emits the necessary events, ensuring correct functionality.

  • TenstackTable.vue correctly defines and handles the properties: rows, columns, wrap, width, loading, errMsg, functionErrorMsg.
  • It also correctly emits the events: copy, addSearchTerm, addFieldToTable, closeColumn, click:dataRow.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration and properties of the `TenstackTable` component.

# Test: Search for the `TenstackTable` component definition and usage.
rg --type vue -A 10 $'<tenstack-table'

Length of output: 67


Script:

#!/bin/bash
# Description: Verify the integration and properties of the `TenstackTable` component.

# Test: Search for the `TenstackTable` component definition and usage in .vue files.
rg '<tenstack-table' --glob '*.vue' -A 10

Length of output: 883


Script:

#!/bin/bash
# Description: Verify the definition of the `TenstackTable` component.

# Test: Search for the definition of the `TenstackTable` component.
rg 'TenstackTable' --glob '*.vue' -A 10

Length of output: 1487


Script:

#!/bin/bash
# Description: Inspect the `TenstackTable.vue` file to verify its implementation.

# Test: Search for the `TenstackTable.vue` file.
fd 'TenstackTable.vue' --exec cat {}

Length of output: 18985

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2fd0681 and bc60f92.

Files selected for processing (1)
  • .github/workflows/playwright.yml (2 hunks)
Additional comments not posted (2)
.github/workflows/playwright.yml (2)

87-87: Reordering of test filenames approved.

Reordering the test filenames in the matrix configuration improves readability and organization.


122-123: Addition of "Check OpenObserve logs" step approved.

Adding this step facilitates debugging and monitoring by allowing access to log outputs, which is essential for understanding test results or diagnosing issues.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bc60f92 and 68748a6.

Files selected for processing (2)
  • tests/ui-testing/playwright-tests/schema.spec.js (2 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/plugins/logs/JsonPreview.vue
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/schema.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (2)
tests/ui-testing/playwright-tests/schema.spec.js (2)

116-116: LGTM! Verify the wait duration.

The change ensures the element is visible before interaction, improving test reliability. Ensure the wait duration is reasonable to avoid unnecessary delays.


138-138: LGTM!

The change simplifies the text used to identify the element, ensuring accurate targeting.

@omkarK06 omkarK06 force-pushed the fix/data_tables_ui branch from 68748a6 to eef7ec5 Compare August 5, 2024 09:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range, codebase verification and nitpick comments (2)
web/src/plugins/logs/data-table/CellActions.vue (2)

4-4: Avoid inline conditional classes.

Using inline conditional classes can make the template harder to read. Consider using computed properties or methods to handle conditional classes.

-    :class="store.state.theme === 'dark' ? 'tw-bg-black' : 'tw-bg-white'"
+    :class="backgroundClass"
// In the script section
const backgroundClass = computed(() => store.state.theme === 'dark' ? 'tw-bg-black' : 'tw-bg-white');

11-11: Refactor inline event handlers.

Inline event handlers can be extracted to methods for better readability and maintainability.

-    @click.prevent.stop="copyLogToClipboard(row[column.id])"
-    @click.prevent.stop="addSearchTerm(`${column.id}='${row[column.id]}'`)"
-    @click.prevent.stop="addSearchTerm(`${column.id}!='${row[column.id]}'`)"
+    @click.prevent.stop="handleCopyLog(row[column.id])"
+    @click.prevent.stop="handleAddSearchTerm(column.id, row[column.id], true)"
+    @click.prevent.stop="handleAddSearchTerm(column.id, row[column.id], false)"
// In the script section
const handleCopyLog = (value) => {
  copyLogToClipboard(value);
};
const handleAddSearchTerm = (columnId, rowValue, include) => {
  const term = include ? `${columnId}='${rowValue}'` : `${columnId}!='${rowValue}'`;
  addSearchTerm(term);
};

Also applies to: 19-19, 30-30

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 68748a6 and eef7ec5.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (12)
  • .github/workflows/playwright.yml (2 hunks)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (3 hunks)
  • tests/ui-testing/playwright-tests/sanity.spec.js (1 hunks)
  • tests/ui-testing/playwright-tests/schema.spec.js (2 hunks)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (75 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (14 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (1)
  • web/src/main.ts
Files skipped from review as they are similar to previous changes (7)
  • .github/workflows/playwright.yml
  • tests/ui-testing/playwright-tests/schema.spec.js
  • web/package.json
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/JsonPreview.vue
  • web/src/plugins/logs/TenstackTable.vue
  • web/src/plugins/traces/Index.vue
Additional context used
Path-based instructions (2)
tests/ui-testing/playwright-tests/logsquickmode.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

tests/ui-testing/playwright-tests/sanity.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (7)
web/src/plugins/logs/data-table/CellActions.vue (1)

42-69: LGTM! Consider refactoring inline event handlers.

The script section is well-structured. However, as mentioned in the template review, consider refactoring inline event handlers for better readability and maintainability.

tests/ui-testing/playwright-tests/logsquickmode.spec.js (2)

167-167: Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

-    await page.waitForTimeout(1000);
+    await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');

Likely invalid or redundant comment.


197-197: Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

-    await page.waitForTimeout(2000);
+    await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');

Likely invalid or redundant comment.

web/src/plugins/logs/SearchResult.vue (2)

Line range hint 1-1: LGTM!

The style section is well-structured and does not require any changes.


439-446: Remove debug logging from getTableWidth.

The getTableWidth computed property contains console log statements. Remove these debug logs before deploying to production.

-      console.log("recalculate");

Likely invalid or redundant comment.

tests/ui-testing/playwright-tests/sanity.spec.js (2)

163-163: LGTM! Verify the pagination control text.

The pagination control text has been updated to "fast_rewind12345fast_forward100arrow_drop_down". Ensure that the pagination control settings in the application have been updated accordingly.


161-161: LGTM! Verify the pagination settings.

The expected text for pagination has been updated to "Showing 1 to 100". Ensure that the pagination settings in the application have been updated accordingly.

});
await page.reload();
await page.waitForTimeout(2000);
await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace hardcoded wait times with reliable wait conditions.

Hardcoded wait times can lead to flaky tests. Use more reliable wait conditions like waitForSelector.

-    await page.waitForTimeout(2000);
+    await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');
await page.waitForSelector('[data-test="logs-search-bar-query-editor"]');

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (7)
tests/ui-testing/playwright-tests/logsqueries.spec.js (7)

Line range hint 7-18:
Replace hardcoded wait times with explicit wait conditions.

Hardcoded wait times can lead to flaky tests. Use explicit wait conditions to ensure elements are ready for interaction.

-  await page.waitForTimeout(4000);
+  await page.waitForSelector('[data-cy="login-user-id"]');

-  await page.waitForTimeout(4000);
+  await page.waitForNavigation();

Line range hint 30-34:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(4000);
+  await page.waitForSelector('[data-test="log-search-index-list-select-stream"]');

-  "div.q-item").getByText(`${stream}`).first().click({ force: true });
+  await page.locator("div.q-item").getByText(`${stream}`).first().click();

Line range hint 42-50:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(3000);
+  await page.waitForSelector("[data-test='logs-search-bar-refresh-btn']");

-  await page.locator("[data-test='logs-search-bar-refresh-btn']").click({ force: true });
+  await page.locator("[data-test='logs-search-bar-refresh-btn']").click();

Line range hint 133-158:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(3000);
+  await page.waitForSelector('[data-test="log-table-column-0-source"]');

-  await page.locator(':nth-child(1) > [data-test="log-details-include-exclude-field-btn"] > .q-btn__content > .q-icon').click({ force: true });
+  await page.locator(':nth-child(1) > [data-test="log-details-include-exclude-field-btn"] > .q-btn__content > .q-icon').click();

-  await page.locator('.q-item__label').getByText(/timestamp/).first().click({force:true});
+  await page.locator('.q-item__label').getByText(/timestamp/).first().click();

Line range hint 160-189:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(5000);
+  await page.waitForSelector('[data-test="menu-link-\\/streams-item"]');

-  await page.locator('[data-test="menu-link-\\/streams-item"]').click({force:true});
+  await page.locator('[data-test="menu-link-\\/streams-item"]').click();

-  await page.waitForTimeout(3000);
+  await page.waitForSelector('[data-test="log-search-saved-view-field-search-input"]');

-  await page.locator('[data-test="log-search-saved-view-field-search-input"]').click({force:true});
+  await page.locator('[data-test="log-search-saved-view-field-search-input"]').click();

Line range hint 191-217:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(2000);
+  await page.waitForSelector('[data-cy="date-time-button"]');

-  await page.locator('[data-cy="date-time-button"]').click({ force: true });
+  await page.locator('[data-cy="date-time-button"]').click();

-  await page.waitForTimeout(2000);
+  await page.waitForSelector('[data-cy="search-bar-refresh-button"] > .q-btn__content');

-  await page.locator("[data-test='logs-search-bar-refresh-btn']").click({ force: true });
+  await page.locator("[data-test='logs-search-bar-refresh-btn']").click();

Line range hint 219-231:
Replace hardcoded wait times and avoid force clicks.

Hardcoded wait times and force clicks can lead to flaky tests. Use explicit wait conditions and proper element interactions.

-  await page.waitForTimeout(2000);
+  await page.waitForSelector('[data-cy="date-time-button"]');

-  await page.locator('[data-cy="date-time-button"]').click({ force: true });
+  await page.locator('[data-cy="date-time-button"]').click();

-  await page.waitForTimeout(2000);
+  await page.waitForSelector('[data-cy="search-bar-refresh-button"] > .q-btn__content');

-  await page.locator('[data-cy="search-bar-refresh-button"] > .q-btn__content').click({force: true });
+  await page.locator('[data-cy="search-bar-refresh-button"] > .q-btn__content').click();
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between eef7ec5 and bdca19d.

Files selected for processing (1)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js (3 hunks)
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/logsqueries.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (1)
tests/ui-testing/playwright-tests/logsqueries.spec.js (1)

Line range hint 36-40:
LGTM!

The function correctly removes UTF characters using a regular expression.

@omkarK06 omkarK06 force-pushed the fix/data_tables_ui branch from bdca19d to b6959f6 Compare August 5, 2024 10:12
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
web/src/plugins/logs/JsonPreview.vue (1)

122-124: Remove unused imports.

The ref import from vue is not used in the script section.

- import { defineComponent, ref, onBeforeMount } from "vue";
+ import { defineComponent, onBeforeMount } from "vue";
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bdca19d and 8d6d3be.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (12)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js (3 hunks)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (3 hunks)
  • tests/ui-testing/playwright-tests/sanity.spec.js (1 hunks)
  • tests/ui-testing/playwright-tests/schema.spec.js (2 hunks)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (75 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (14 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (2)
  • web/package.json
  • web/src/main.ts
Files skipped from review as they are similar to previous changes (8)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js
  • tests/ui-testing/playwright-tests/sanity.spec.js
  • tests/ui-testing/playwright-tests/schema.spec.js
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/TenstackTable.vue
  • web/src/plugins/logs/data-table/CellActions.vue
  • web/src/plugins/traces/Index.vue
Additional comments not posted (16)
web/src/plugins/logs/JsonPreview.vue (10)

107-119: Ensure correct rendering of JSON keys and values.

The v-if and v-else templates handle the rendering of JSON keys and values. Ensure that the logic correctly handles the last key-value pair without trailing commas.


32-56: Ensure correct conditional rendering and event handling.

The <q-item> components conditionally render based on searchObj.data.stream.selectedStreamFields and multiStreamFields. Validate the logic and event handling for adding search terms.

Verification successful

Ensure correct conditional rendering and event handling.

The addSearchTerm function in JsonPreview.vue is implemented correctly. It emits an event named addSearchTerm with the provided value, which aligns with the expected behavior for adding search terms.

  • web/src/plugins/logs/JsonPreview.vue:
    • addSearchTerm function implementation:
      const addSearchTerm = (value: string) => {
        emit("addSearchTerm", value);
      };
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the logic and event handling for adding search terms.

# Test: Search for the function `addSearchTerm` and check its implementation.
rg --type js --type ts 'function addSearchTerm'

Length of output: 49


Script:

#!/bin/bash
# Description: Search for the `addSearchTerm` method in the entire codebase.

# Test: Search for the `addSearchTerm` method definition.
rg 'addSearchTerm'

Length of output: 4133


Line range hint 126-127:
Ensure correct usage of imported components.

The EqualIcon and NotEqualIcon components are imported and used in the template. Ensure that these components are correctly implemented and available.

Verification successful

The EqualIcon and NotEqualIcon components are correctly implemented and available for use in JsonPreview.vue.

  • The components are defined in web/src/components/icons/EqualIcon.vue and web/src/components/icons/NotEqualIcon.vue.
  • They are correctly imported in JsonPreview.vue and used in the template.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `EqualIcon` and `NotEqualIcon` components.

# Test: Search for the implementation of `EqualIcon` and `NotEqualIcon` components.
rg --type vue 'EqualIcon'

Length of output: 53


Script:

#!/bin/bash
# Description: Verify the implementation of `EqualIcon` and `NotEqualIcon` components.

# Test: Search for the implementation of `EqualIcon` and `NotEqualIcon` components.
rg 'EqualIcon'
rg 'NotEqualIcon'

Length of output: 5852


2-3: Ensure proper use of class names.

The class copy-log-btn is added. Verify that this class is defined in the corresponding stylesheet.

Verification successful

The class copy-log-btn is defined in the codebase.

The class copy-log-btn is defined in the following Vue files:

  • web/src/plugins/logs/SearchResult.vue
  • web/src/plugins/logs/DetailTable.vue

This confirms that the class is properly defined and can be used in the JsonPreview.vue component.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the definition of the class `copy-log-btn` in the stylesheet.

# Test: Search for the class definition. Expect: The class should be defined in the stylesheet.
rg --type css --type scss --type less --type stylus '\.copy-log-btn'

Length of output: 99


Script:

#!/bin/bash
# Description: Verify the definition of the class `copy-log-btn` in the stylesheet.

# Test: Search for the class definition. Expect: The class should be defined in the stylesheet.
rg --type css --type less --type stylus '\.copy-log-btn'

Length of output: 58


Script:

#!/bin/bash
# Description: Verify the definition of the class `copy-log-btn` in Vue files.

# Test: Search for the class definition. Expect: The class should be defined in the Vue files.
rg --type vue '\.copy-log-btn'

Length of output: 60


Script:

#!/bin/bash
# Description: Verify the definition of the class `copy-log-btn` in Vue files.

# Test: Search for the class definition. Expect: The class should be defined in the Vue files.
rg '\.copy-log-btn' --glob '*.vue'

Length of output: 147


21-30: Validate dropdown button functionality.

The <q-btn-dropdown> component is used for managing visibility of fields. Ensure that the name property is correctly set and the image URL is valid.

Verification successful

The getImageURL function is implemented correctly and constructs the image URL by concatenating a base path with the provided image path. This ensures that the name property in the <q-btn-dropdown> component is set correctly with a valid image URL.

  • The getImageURL function is defined in web/src/utils/zincutils.ts and returns a URL constructed from a base path and the provided image_path.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the validity of the image URL used in the `name` property of `<q-btn-dropdown>`.

# Test: Search for the function `getImageURL` and check the returned URL.
rg --type js --type ts 'function getImageURL'

Length of output: 47


Script:

#!/bin/bash
# Description: Verify the validity of the image URL used in the `name` property of `<q-btn-dropdown>`.

# Test 1: Search for the function `getImageURL` in all files including Vue files.
rg 'getImageURL' -t js -t ts -t vue

# Test 2: Search for any variable declarations or imports of `getImageURL`.
rg 'const getImageURL|let getImageURL|import.*getImageURL' -t js -t ts -t vue

Length of output: 171


Script:

#!/bin/bash
# Description: Verify the validity of the image URL used in the `name` property of `<q-btn-dropdown>`.

# Test 1: Search for the function `getImageURL` in all files including Vue files.
rg 'getImageURL' --glob '*.js' --glob '*.ts' --glob '*.vue'

# Test 2: Search for any variable declarations or imports of `getImageURL`.
rg 'const getImageURL|let getImageURL|import.*getImageURL' --glob '*.js' --glob '*.ts' --glob '*.vue'

Length of output: 28548


Script:

#!/bin/bash
# Description: Retrieve the implementation of the `getImageURL` function from `web/src/utils/zincutils.ts`.

# Display the implementation of `getImageURL`.
rg 'export const getImageURL' -A 10 web/src/utils/zincutils.ts

Length of output: 407


60-86: Ensure correct conditional rendering and event handling.

The <q-item> components conditionally render based on searchObj.data.stream.selectedStreamFields and multiStreamFields. Validate the logic and event handling for excluding search terms.

Verification successful

Conditional rendering and event handling verified

The logic and event handling for excluding search terms in JsonPreview.vue are correctly implemented. The addSearchTerm function is defined as an arrow function that emits the addSearchTerm event, and the conditional rendering logic is consistent with the provided context.

  • The addSearchTerm function is correctly defined and used in JsonPreview.vue.
  • Conditional rendering based on searchObj.data.stream.selectedStreamFields and multiStreamFields is correctly implemented.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the logic and event handling for excluding search terms.

# Test: Search for the function `addSearchTerm` and check its implementation.
rg --type js --type ts 'function addSearchTerm'

Length of output: 49


Script:

#!/bin/bash
# Description: Verify the logic and event handling for excluding search terms.

# Test: Search for the function or method `addSearchTerm` in JavaScript and Vue files.
rg 'addSearchTerm' --type js --type vue -A 5

Length of output: 72


Script:

#!/bin/bash
# Description: Verify the logic and event handling for excluding search terms.

# Test: Search for the function or method `addSearchTerm` in JavaScript files.
rg 'addSearchTerm' --type js -A 5

# Test: Search for the function or method `addSearchTerm` in Vue files.
rg 'addSearchTerm' -g '*.vue' -A 5

Length of output: 35726


Line range hint 140-142:
Ensure correct handling of multi-stream fields.

The multiStreamFields ref is initialized and populated in the onBeforeMount lifecycle hook. Verify that searchObj.data.stream.selectedStreamFields is always an array.


Line range hint 128-129:
Ensure correct usage of the useLogs composable.

The useLogs composable is imported and used in the setup function. Verify its implementation and ensure that it provides the expected functionality.


14-19: Ensure proper handling of JSON keys.

The v-for loop iterates over the keys of the value object. Verify that value is always an object and not null or undefined.


87-103: Validate the addition of fields to the table.

The <q-item> component for adding fields to the table is introduced. Ensure that the addFieldToTable function is correctly implemented and handles the addition of fields properly.

Verification successful

The addFieldToTable function is correctly implemented and handles the addition of fields properly.

  • The addFieldToTable function correctly toggles the presence of fieldName in searchObj.data.stream.selectedFields.
  • The searchObj is initialized with a comprehensive defaultObject, ensuring proper structure and state management.
  • The functions updatedLocalLogFilterField, evaluateWrapContentFlag, and filterHitsColumns are defined and used appropriately within the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of the `addFieldToTable` function.

# Test: Search for the function `addFieldToTable` and check its implementation.
rg --type js --type ts 'function addFieldToTable'

Length of output: 139


Script:

#!/bin/bash
# Extract the implementation of the `addFieldToTable` function from `web/src/plugins/logs/SearchResult.vue`
rg --type js --type ts -A 20 'function addFieldToTable' web/src/plugins/logs/SearchResult.vue

Length of output: 881


Script:

#!/bin/bash
# Search for the definitions and implementations of `searchObj`, `updatedLocalLogFilterField`, `evaluateWrapContentFlag`, and `filterHitsColumns`

# Find the definition of `searchObj`
rg --type js --type ts 'searchObj'

# Find the implementation of `updatedLocalLogFilterField`
rg --type js --type ts 'function updatedLocalLogFilterField'

# Find the implementation of `evaluateWrapContentFlag`
rg --type js --type ts 'function evaluateWrapContentFlag'

# Find the implementation of `filterHitsColumns`
rg --type js --type ts 'function filterHitsColumns'

Length of output: 183756


Script:

#!/bin/bash
# Search for the import statements and definitions of `updatedLocalLogFilterField`, `evaluateWrapContentFlag`, and `filterHitsColumns`
rg --type js --type ts 'import .* from' | grep -E 'updatedLocalLogFilterField|evaluateWrapContentFlag|filterHitsColumns'

# Search for the initialization of `searchObj`
rg --type js --type ts 'searchObj ='

Length of output: 526


Script:

#!/bin/bash
# Extract the definition of `defaultObject`
rg --type js --type ts 'const defaultObject' -A 20

# Search for any indirect imports or definitions of the missing functions
rg --type js --type ts 'updatedLocalLogFilterField|evaluateWrapContentFlag|filterHitsColumns'

Length of output: 11598

web/src/plugins/logs/SearchResult.vue (6)

208-208: Remove redundant dynamic import.

The TenstackTable component is already imported statically. The dynamic import is redundant and can be removed.


439-446: Remove debug logging from getTableWidth.

The getTableWidth computed property contains console log statements. Remove these debug logs before deploying to production.


448-453: Remove debug logging from watch function.

The watcher for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.


27-30: Ensure proper handling of error messages.

The v-if condition checks for searchObj.data.countErrorMsg. Verify that this property is always a string and correctly handles error messages.

Verification successful

The searchObj.data.countErrorMsg is always a string and correctly handles error messages.

  • Initialized as an empty string in web/src/composables/useLogs.ts.
  • Consistently assigned string values or concatenated with strings.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `searchObj.data.countErrorMsg` is always a string.

# Test: Search for the initialization and usage of `searchObj.data.countErrorMsg`.
rg --type js --type ts 'countErrorMsg'

Length of output: 861


291-296: Fix the closeColumn method.

The closeColumn method references col.id instead of col.name. Ensure that col.id is always available and correctly used.

Verification successful

The closeColumn method correctly references col.id.

The col.id property is consistently used throughout the codebase, indicating that it is a standard and reliable attribute of the columnDef object.

  • web/src/plugins/logs/SearchResult.vue: The closeColumn method uses col.id to manipulate resultGrid.columns and stream.selectedFields.
  • web/src/plugins/logs/TenstackTable.vue: The columnDef object, which includes the id property, is passed to the closeColumn method.

No changes are necessary regarding the usage of col.id.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `col.id` is always available and correctly used in the `closeColumn` method.

# Test: Search for the usage of `closeColumn` and check the structure of `col`.
rg --type js --type ts 'closeColumn'

Length of output: 548


Script:

#!/bin/bash
# Extract the `closeColumn` method implementation in `web/src/plugins/logs/SearchResult.vue`
ast-grep --lang vue --pattern $'closeColumn($_) { $$$ }' --web src/plugins/logs/SearchResult.vue

# Find how `col` is structured and passed in `web/src/plugins/logs/TenstackTable.vue`
rg --type vue 'closeColumn' -A 5 web/src/plugins/logs/TenstackTable.vue

Length of output: 304


Script:

#!/bin/bash
# Extract the `closeColumn` method implementation in `web/src/plugins/logs/SearchResult.vue`
rg 'closeColumn' -A 10 web/src/plugins/logs/SearchResult.vue

# Find how `col` is structured and passed in `web/src/plugins/logs/TenstackTable.vue`
rg 'closeColumn' -A 10 web/src/plugins/logs/TenstackTable.vue

Length of output: 1665


Script:

#!/bin/bash
# Find the structure of `header.column.columnDef` in `web/src/plugins/logs/TenstackTable.vue`
rg 'columnDef' -A 10 web/src/plugins/logs/TenstackTable.vue

Length of output: 3974


129-149: Validate the integration of <tenstack-table>.

The <tenstack-table> component replaces <q-virtual-scroll>. Ensure that the new component is correctly implemented and handles the provided props and events.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8d6d3be and 37ed1bd.

Files selected for processing (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 37ed1bd and 080e6c8.

Files selected for processing (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (8 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js

@omkarK06 omkarK06 force-pushed the fix/data_tables_ui branch from 080e6c8 to 70e9808 Compare August 5, 2024 14:16
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Outside diff range, codebase verification and nitpick comments (5)
web/src/plugins/logs/JsonPreview.vue (3)

3-3: Use consistent class naming conventions.

The class name copy-log-btn is not following the BEM (Block Element Modifier) naming convention used elsewhere in the code. Consider renaming it for consistency.


87-100: Ensure consistent use of single quotes for strings.

The code uses both single and double quotes for strings. For consistency, use single quotes throughout.

-                  ><q-btn
-                    title="Add field to table"
-                    icon="visibility"
-                    size="6px"
-                    round
-                    class="q-mr-sm pointer"
-                  ></q-btn
-                  >{{ t("common.addFieldToTable") }}</q-item-label
+                  ><q-btn
+                    title='Add field to table'
+                    icon='visibility'
+                    size='6px'
+                    round
+                    class='q-mr-sm pointer'
+                  ></q-btn
+                  >{{ t('common.addFieldToTable') }}</q-item-label

Line range hint 194-196: Remove debug logging.

The watch function for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.

-        console.log(`splitterModel changed from ${oldValue} to ${newValue}`);
web/src/plugins/logs/SearchResult.vue (2)

27-30: Use meaningful class names.

The class name bg-warning is not descriptive of its purpose. Consider using a more meaningful class name.


291-294: Use consistent property names.

The closeColumn method uses col.id instead of col.name. Ensure consistency in property names across the codebase.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 080e6c8 and 70e9808.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (13)
  • .github/workflows/playwright.yml (1 hunks)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js (1 hunks)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (3 hunks)
  • tests/ui-testing/playwright-tests/sanity.spec.js (1 hunks)
  • tests/ui-testing/playwright-tests/schema.spec.js (1 hunks)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (76 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchResult.vue (14 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (3)
  • .github/workflows/playwright.yml
  • tests/ui-testing/playwright-tests/schema.spec.js
  • web/src/main.ts
Files skipped from review as they are similar to previous changes (7)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js
  • tests/ui-testing/playwright-tests/sanity.spec.js
  • web/package.json
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/TenstackTable.vue
  • web/src/plugins/logs/data-table/CellActions.vue
  • web/src/plugins/traces/Index.vue
Additional context used
Path-based instructions (1)
tests/ui-testing/playwright-tests/logsqueries.spec.js (1)

Pattern **/*.js: You are a smart javascript/typescript pull request reviewer.
You are going to review all the javascript/typescript files.
Be concise, and add a brief explanation to your suggestions

Make sure the responses are not too verbose and keep the suggestions to the point i.e. actionable.

Additional comments not posted (4)
tests/ui-testing/playwright-tests/logsqueries.spec.js (1)

100-100: Increase wait time only if necessary.

The wait time has been increased from 1000ms to 3000ms. Ensure this increase is necessary for the UI to load properly and does not introduce unnecessary delays.

web/src/plugins/logs/SearchResult.vue (3)

129-149: Ensure proper usage of computed properties.

The getTableWidth computed property is used to set the width of the table. Ensure it is correctly computed and does not introduce layout issues.


448-453: Remove debug logging from watch function.

The watcher for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.

-        console.log(`splitterModel changed from ${oldValue} to ${newValue}`);

Likely invalid or redundant comment.


439-446: Remove debug logging from getTableWidth.

The getTableWidth computed property contains console log statements. Remove these debug logs before deploying to production.

-      console.log("recalculate");

Likely invalid or redundant comment.

() => import("@/components/dashboards/panels/ChartRenderer.vue"),
),
SanitizedHtmlRenderer,
TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove redundant dynamic import.

The TenstackTable component is already imported statically. The dynamic import is redundant and can be removed.

-    TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
+    TenstackTable,
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
TenstackTable,

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 70e9808 and 0ed26e1.

Files selected for processing (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0ed26e1 and 201aca3.

Files selected for processing (4)
  • web/src/composables/useLogs.ts (78 hunks)
  • web/src/plugins/logs/SearchBar.vue (5 hunks)
  • web/src/plugins/logs/SearchResult.vue (19 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/TenstackTable.vue
Additional comments not posted (6)
web/src/plugins/logs/SearchResult.vue (5)

Line range hint 212-226:
Remove redundant dynamic import.

The TenstackTable component is already imported statically. The dynamic import is redundant and can be removed.


455-457: Remove debug logging from getTableWidth.

The getTableWidth computed property contains console log statements. Remove these debug logs before deploying to production.


464-469: Remove debug logging from watch function.

The watcher for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.


245-251: Ensure correct handling of column updates.

The methods handleColumnSizesUpdate and handleColumnOrderUpdate should correctly update the relevant data structures. Verify that these methods are correctly integrated with the table component's events.

Verification successful

Column Update Methods Are Correctly Integrated

The methods handleColumnSizesUpdate and handleColumnOrderUpdate are correctly integrated with the table component's events in SearchResult.vue. The methods are bound to the @update:columnSizes and @update:columnOrder events, respectively, ensuring they are triggered appropriately when column updates occur.

  • @update:columnSizes="handleColumnSizesUpdate"
  • @update:columnOrder="handleColumnOrderUpdate"

These bindings confirm that the methods will handle updates as expected.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the integration of column update methods with the table component.

# Test: Search for the usage of `handleColumnSizesUpdate` and `handleColumnOrderUpdate` methods.
rg --type vue -A 5 $'handleColumnSizesUpdate'

Length of output: 72


Script:

#!/bin/bash
# Description: Search for the usage of `handleColumnSizesUpdate` and `handleColumnOrderUpdate` methods in .vue files.

# Test: Search for the usage of `handleColumnSizesUpdate` method.
rg 'handleColumnSizesUpdate' --glob '*.vue' -A 5

# Test: Search for the usage of `handleColumnOrderUpdate` method.
rg 'handleColumnOrderUpdate' --glob '*.vue' -A 5

Length of output: 2198


130-152: Verify <tenstack-table> component configuration.

Ensure that all necessary properties and events are correctly configured for the new <tenstack-table> component. This includes verifying that the properties such as :columns, :rows, and events like @update:columnSizes are correctly linked to the component's logic.

web/src/plugins/logs/SearchBar.vue (1)

1955-1970: Verify logic for handling column order and selected fields.

Ensure that the logic correctly handles the assignment of selectedFields based on colOrder. This involves checking if the conditionals and data assignments are correctly implemented to reflect the intended behavior.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 201aca3 and ec3d82d.

Files selected for processing (4)
  • web/src/plugins/logs/Index.vue (24 hunks)
  • web/src/plugins/logs/SearchBar.vue (37 hunks)
  • web/src/plugins/logs/SearchResult.vue (18 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
Files skipped from review due to trivial changes (1)
  • web/src/plugins/logs/Index.vue
Files skipped from review as they are similar to previous changes (2)
  • web/src/plugins/logs/SearchBar.vue
  • web/src/plugins/logs/TenstackTable.vue
Additional comments not posted (5)
web/src/plugins/logs/SearchResult.vue (5)

211-221: Remove redundant dynamic import for TenstackTable.

The TenstackTable component is imported both statically and dynamically. Remove the dynamic import to avoid redundancy.


452-459: Remove debug logging from getTableWidth.

The getTableWidth computed property contains a console log statement. Remove this debug log before deploying to production.


461-466: Remove debug logging from watch function.

The watcher for searchObj.config.splitterModel contains console log statements. Remove these debug logs before deploying to production.


27-30: Ensure error message visibility logic is correct.

The conditional rendering for searchObj.data.countErrorMsg seems appropriate, but verify that this logic aligns with the intended user experience.

Verification successful

Error message logic is correctly implemented.

The conditional rendering for searchObj.data.countErrorMsg in SearchResult.vue is appropriate. The error message is displayed using <SanitizedHtmlRenderer> when countErrorMsg is not empty, ensuring correct user feedback.

  • File: web/src/plugins/logs/SearchResult.vue
  • Lines: 27-30
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the logic for displaying error messages related to countErrorMsg.

# Test: Ensure that error messages are displayed correctly.
rg --type vue -A 5 $'searchObj.data.countErrorMsg'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify the logic for displaying error messages related to countErrorMsg.

# Test: Ensure that error messages are displayed correctly in .vue files.
rg 'searchObj.data.countErrorMsg' --glob '*.vue' -A 5

Length of output: 791


129-153: Verify integration of <tenstack-table>.

The new <tenstack-table> component is integrated with several props and event handlers. Ensure that all props and events are correctly defined and handled within the component.

Comment on lines 303 to 327
const RGIndex = this.searchObj.data.resultGrid.columns.indexOf(col.id);
this.searchObj.data.resultGrid.columns.splice(RGIndex, 1);
const SFIndex = this.searchObj.data.stream.selectedFields.indexOf(
col.name
);
const SFIndex = this.searchObj.data.stream.selectedFields.indexOf(col.id);
this.searchObj.data.stream.selectedFields.splice(SFIndex, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Update type definition for closeColumn parameter.

The closeColumn method now uses col.id. Ensure that the parameter type reflects this change for better type safety.

-    closeColumn(col: any) {
+    closeColumn(col: { id: string }) {
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const RGIndex = this.searchObj.data.resultGrid.columns.indexOf(col.id);
this.searchObj.data.resultGrid.columns.splice(RGIndex, 1);
const SFIndex = this.searchObj.data.stream.selectedFields.indexOf(
col.name
);
const SFIndex = this.searchObj.data.stream.selectedFields.indexOf(col.id);
this.searchObj.data.stream.selectedFields.splice(SFIndex, 1);
closeColumn(col: { id: string }) {
const RGIndex = this.searchObj.data.resultGrid.columns.indexOf(col.id);
this.searchObj.data.resultGrid.columns.splice(RGIndex, 1);
const SFIndex = this.searchObj.data.stream.selectedFields.indexOf(col.id);
this.searchObj.data.stream.selectedFields.splice(SFIndex, 1);

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ec3d82d and e4eb10f.

Files selected for processing (1)
  • web/src/composables/useLogs.ts (78 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/composables/useLogs.ts

@omkarK06 omkarK06 force-pushed the fix/data_tables_ui branch from 2c699e5 to d1c57e3 Compare August 26, 2024 11:03
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Outside diff range, codebase verification and nitpick comments (2)
web/src/plugins/logs/SearchResult.vue (2)

112-116: Ensure error message is user-friendly.

The error message for fetching histogram data is displayed correctly. Ensure that the error message is user-friendly and provides actionable steps if possible.


Line range hint 320-328: Update type definition for closeColumn parameter.

The closeColumn method now uses col.id. Ensure that the parameter type reflects this change for better type safety.

-    closeColumn(col: any) {
+    closeColumn(col: { id: string }) {
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 149222e and d1c57e3.

Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
Files selected for processing (15)
  • .github/workflows/playwright.yml (1 hunks)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js (1 hunks)
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js (4 hunks)
  • tests/ui-testing/playwright-tests/schema.spec.js (1 hunks)
  • web/package.json (3 hunks)
  • web/src/composables/useLogs.ts (8 hunks)
  • web/src/main.ts (1 hunks)
  • web/src/plugins/logs/DetailTable.vue (6 hunks)
  • web/src/plugins/logs/Index.vue (6 hunks)
  • web/src/plugins/logs/JsonPreview.vue (1 hunks)
  • web/src/plugins/logs/SearchBar.vue (4 hunks)
  • web/src/plugins/logs/SearchResult.vue (13 hunks)
  • web/src/plugins/logs/TenstackTable.vue (1 hunks)
  • web/src/plugins/logs/data-table/CellActions.vue (1 hunks)
  • web/src/plugins/traces/Index.vue (1 hunks)
Files skipped from review due to trivial changes (3)
  • .github/workflows/playwright.yml
  • web/src/main.ts
  • web/src/plugins/logs/DetailTable.vue
Files skipped from review as they are similar to previous changes (11)
  • tests/ui-testing/playwright-tests/logsqueries.spec.js
  • tests/ui-testing/playwright-tests/logsquickmode.spec.js
  • tests/ui-testing/playwright-tests/schema.spec.js
  • web/package.json
  • web/src/composables/useLogs.ts
  • web/src/plugins/logs/Index.vue
  • web/src/plugins/logs/JsonPreview.vue
  • web/src/plugins/logs/SearchBar.vue
  • web/src/plugins/logs/TenstackTable.vue
  • web/src/plugins/logs/data-table/CellActions.vue
  • web/src/plugins/traces/Index.vue
Additional comments not posted (8)
web/src/plugins/logs/SearchResult.vue (8)

133-157: Good use of the new tenstack-table component.

The new tenstack-table component is integrated well. Ensure that all the props passed to it are correctly defined and used.


240-245: Ensure default value for expandedLogs is appropriate.

The default value for expandedLogs is set to an empty array. Ensure this default value is appropriate for all use cases.


Line range hint 275-316: Ensure getPageData method handles edge cases.

The getPageData method handles pagination well. Ensure it handles edge cases, such as invalid page numbers or unexpected data structures.


405-405: Ensure openLogDetails handles edge cases.

The openLogDetails method opens log details correctly. Ensure it handles edge cases, such as invalid index values.


436-436: Ensure expandLog handles edge cases.

The expandLog method emits the expandlog event correctly. Ensure it handles edge cases, such as invalid index values.


511-513: Ensure scrollTableToTop handles edge cases.

The scrollTableToTop method scrolls the table to the top correctly. Ensure it handles edge cases, such as invalid value or null reference.


Line range hint 526-548: Good use of the setup function.

The setup function is well-structured and uses Vue 3 composition API effectively. Ensure all refs and methods are correctly initialized and used.


503-509: Remove debug logging from getTableWidth.

The getTableWidth computed property contains console log statements. Remove these debug logs before deploying to production.

-      console.log("get search width", searchListContainer);

Likely invalid or redundant comment.

onUpdated(() => {
pageNumberInput.value = searchObj.data.resultGrid.currentPage;
});
const columnSizes = ref({});
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove unused columnSizes ref.

The columnSizes ref is defined but not used. Remove it to clean up the code.

-    const columnSizes = ref({});
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const columnSizes = ref({});

Comment on lines +221 to +231
import TenstackTable from "./TenstackTable.vue";
export default defineComponent({
name: "SearchResult",
components: {
HighLight,
DetailTable: defineAsyncComponent(() => import("./DetailTable.vue")),
EqualIcon,
NotEqualIcon,
JsonPreview: defineAsyncComponent(() => import("./JsonPreview.vue")),
ChartRenderer: defineAsyncComponent(
() => import("@/components/dashboards/panels/ChartRenderer.vue"),
),
SanitizedHtmlRenderer,
TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove redundant dynamic import.

The TenstackTable component is already imported statically. The dynamic import is redundant and can be removed.

-    TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
+    TenstackTable,
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import TenstackTable from "./TenstackTable.vue";
export default defineComponent({
name: "SearchResult",
components: {
HighLight,
DetailTable: defineAsyncComponent(() => import("./DetailTable.vue")),
EqualIcon,
NotEqualIcon,
JsonPreview: defineAsyncComponent(() => import("./JsonPreview.vue")),
ChartRenderer: defineAsyncComponent(
() => import("@/components/dashboards/panels/ChartRenderer.vue"),
),
SanitizedHtmlRenderer,
TenstackTable: defineAsyncComponent(() => import("./TenstackTable.vue")),
import TenstackTable from "./TenstackTable.vue";
export default defineComponent({
name: "SearchResult",
components: {
DetailTable: defineAsyncComponent(() => import("./DetailTable.vue")),
ChartRenderer: defineAsyncComponent(
() => import("@/components/dashboards/panels/ChartRenderer.vue"),
),
SanitizedHtmlRenderer,
TenstackTable,

Comment on lines +249 to +266
handleColumnSizesUpdate(newColSizes: any) {
//@ts-ignore
this.searchObj.data.resultGrid[
this.searchObj.data.stream.selectedStream
] = [newColSizes];
},
handleColumnOrderUpdate(newColOrder: any) {
if (this.searchObj.data.stream?.selectedStream.length === 1) {
const colOrderToStore = newColOrder.slice(1);
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [colOrderToStore];
} else {
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [newColOrder];
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Handle potential errors in handleColumnSizesUpdate and handleColumnOrderUpdate.

The methods handleColumnSizesUpdate and handleColumnOrderUpdate should handle potential errors gracefully. Consider adding error handling to these methods.

    handleColumnSizesUpdate(newColSizes: any) {
+     try {
      //@ts-ignore
      this.searchObj.data.resultGrid[
        this.searchObj.data.stream.selectedStream
      ] = [newColSizes];
+     } catch (error) {
+       console.error('Error updating column sizes:', error);
+     }
    },
    handleColumnOrderUpdate(newColOrder: any) {
+     try {
      if (this.searchObj.data.stream?.selectedStream.length === 1) {
        const colOrderToStore = newColOrder.slice(1);
        this.searchObj.data.resultGrid.colOrder[
          this.searchObj.data.stream.selectedStream
        ] = [colOrderToStore];
      } else {
        this.searchObj.data.resultGrid.colOrder[
          this.searchObj.data.stream.selectedStream
        ] = [newColOrder];
      }
+     } catch (error) {
+       console.error('Error updating column order:', error);
+     }
    },
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
handleColumnSizesUpdate(newColSizes: any) {
//@ts-ignore
this.searchObj.data.resultGrid[
this.searchObj.data.stream.selectedStream
] = [newColSizes];
},
handleColumnOrderUpdate(newColOrder: any) {
if (this.searchObj.data.stream?.selectedStream.length === 1) {
const colOrderToStore = newColOrder.slice(1);
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [colOrderToStore];
} else {
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [newColOrder];
}
},
handleColumnSizesUpdate(newColSizes: any) {
try {
//@ts-ignore
this.searchObj.data.resultGrid[
this.searchObj.data.stream.selectedStream
] = [newColSizes];
} catch (error) {
console.error('Error updating column sizes:', error);
}
},
handleColumnOrderUpdate(newColOrder: any) {
try {
if (this.searchObj.data.stream?.selectedStream.length === 1) {
const colOrderToStore = newColOrder.slice(1);
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [colOrderToStore];
} else {
this.searchObj.data.resultGrid.colOrder[
this.searchObj.data.stream.selectedStream
] = [newColOrder];
}
} catch (error) {
console.error('Error updating column order:', error);
}
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log results section rebuild for performance and column reordering

5 participants