feat: Allow table search to include label and value for tables with select column type
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.BindingSpec:
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.
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.tsfile, 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.tsfile, 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?
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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere 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.
@jacquesikot Please check failure.
/build-deploy-preview skip-tests=true
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: .
Deploy-Preview-URL: https://ce-36061.dp.appsmith.com