appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

feat: Allow table search to include label and value for tables with select column type

Open jacquesikot opened this issue 1 year ago β€’ 5 comments

Description

Problem The search functionality in the table widget does not properly search through the label values in columns with the select type. Currently, it only searches using the underlying value property, leading to inconsistent and inaccurate search results.

Root Cause A recent PR updated the table widget to display label values instead of the raw values in select columns. However, this change inadvertently caused the search logic to overlook these label values, continuing to search only by the value property.

Solution To address this, the search functionality in the derived.js file within tablev2 has been updated. The solution involves retrieving the label value associated with the select column's value property and passing this label into the search logic. This ensures that the search functionality accurately reflects what is displayed in the table, providing correct search results based on the label values.

Fixes #35406

Automation

/ok-to-test tags="@tag.Sanity, @tag.Widget, @tag.Table, @tag.Binding"

:mag: Cypress test results

[!TIP] 🟒 🟒 🟒 All cypress tests have passed! πŸŽ‰ πŸŽ‰ πŸŽ‰ Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10785740935 Commit: fcf8a4379eb7fa6ff88db518fc9135c7beb308b4 Cypress dashboard. Tags: @tag.Sanity, @tag.Widget, @tag.Table, @tag.Binding Spec:


Tue, 10 Sep 2024 05:46:50 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • [ ] Yes
  • [x] No

Summary by CodeRabbit

  • New Features

    • Enhanced search functionality in the TableWidgetV2 to include label values for select column types.
    • Improved test specifications for the TableV2 component, incorporating feature flags and complex data interactions.
  • Bug Fixes

    • Added test cases to verify the correct behavior of the table filtering and searching mechanisms.
  • Documentation

    • Updated test suite to reflect new functionalities and ensure comprehensive testing coverage.

jacquesikot avatar Sep 03 '24 01:09 jacquesikot

Walkthrough

The changes enhance the functionality of the TableV2 component by integrating feature flags and improving the search capabilities for select widget columns. A new dataset structure is introduced for testing, and the search functionality now correctly identifies both label and value entries in select columns. These modifications aim to resolve issues related to searching within data tables.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2Filter1_1_Spec.ts Added imports for feature flags and editor navigation, defined demo data, and expanded test cases to verify search functionality for select columns.
app/client/src/widgets/TableWidgetV2/widget/derived.js Enhanced the component to handle select column types, allowing label values to be included in the search functionality.
app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts Modified input data structure for testing, changing from an object containing an array to a direct array of objects to accommodate new specifications.

Assessment against linked issues

Objective Addressed Explanation
Search functionality should apply to label fields of select widget columns (#[35406]) βœ…

Possibly related issues

  • appsmithorg/appsmith#35563: The changes may help address the flakiness of tests in the Select1_spec.ts file, as improvements to the test structure could stabilize the tests.

Possibly related PRs

  • #36228: The changes in this PR involve modifications to the Select1_spec.ts file, which is directly related to the main PR's focus on enhancing the test specifications for the TableV2 component.

Suggested labels

Task, Query & JS Pod, Integrations Product, Integrations Pod General

Poem

In tables where colors brightly shine,
The search now finds both label and line.
With flags that guide and data that flows,
A seamless experience, as everyone knows!
So let’s celebrate this code's new dance,
Where searching brings joy, not just a chance! 🌈


Recent review details

Configuration used: .coderabbit.yaml Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5fe966d56cc9cc01dc2dfe3f1968da8706fd91e9 and f921efc65232c164d0249904ec1ae66dfbb39eae.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts (10 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/TableV2/columnTypes/Select1_spec.ts

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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

coderabbitai[bot] avatar Sep 03 '24 01:09 coderabbitai[bot]

@jacquesikot Please check failure.

sagar-qa007 avatar Sep 03 '24 04:09 sagar-qa007

/build-deploy-preview skip-tests=true

jacquesikot avatar Sep 03 '24 10:09 jacquesikot

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/10680871261. Workflow: On demand build Docker image and deploy preview. skip-tests: true. env: ``. PR: 36061. recreate: .

github-actions[bot] avatar Sep 03 '24 10:09 github-actions[bot]

Deploy-Preview-URL: https://ce-36061.dp.appsmith.com

github-actions[bot] avatar Sep 03 '24 10:09 github-actions[bot]