## Description **Problem** The table widget now supports the Select column type, which allows the column to contain both a label and a value. This could be useful for currency fields, foreign keys, or any other case where you want to display a different version of the column value. However, there is a problem with sorting. The table always sorts using the value, and does not give the user an option to sort using the label, where it makes sense in specific cases. **Solution** This PR adds a Sort By property to the table select cell, allowing the users to choose which value is used for sorting without affecting any functionality of the label or value of the select cell. [Additional Technical Documentation](https://www.notion.so/appsmith/Adding-sortBy-Property-to-Select-Columns-in-Table-Widget-V2-a5a41e6319a047378eb50a42be8c32ef?pvs=4) **Tested Cases** 1. Sort select column by default value Objective: Ensure that a newly added table with select column default sorts by the value **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., role) to select type. - Add selectOptions property - Verify that when sorted in ascending or descending order, the sorting is correct 2. Sort select column by label Objective: Ensure that a newly added table with select column and sortBy property set to label sorts correctly **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., role) to select type - Add selectOptions property - Set sortBy property to label - Verify that when sorted in ascending or descending order, the sorting is correct and based on the label value only 3. Verify that sorting of other table cells that are not select works as expected Objective: Ensure that every other cell type in the table sorts correctly **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., role) to select type - Add selectOptions property - Set sortBy property to label - Verify that when columns other that role are sorted, they are sorted correctly 4. Verify that sorting works as expected when table data is a binding Objective: Ensure that the sorting works for all columns while using data binding in table data **Steps:** - Drop a new table widget - Link a query binding to the table data property - Verify that all columns sort correctly 5. Verify that sorting works as expected when table data is a binding and select column sorting is set to label Objective: Ensure that the sorting works for all columns while using data binding in table data with a select column set to sort by the label **Steps:** - Drop a new table widget - Link a query binding to the table data property - Set a column (e.g., role) to select type - Add selectOptions property - Set sortBy property to label - Verify that all columns sort correctly 6. Verify that sortBy logic does not take effect or break user experience until the user adds selectOptions in select cell **Steps:** - Drop a new table widget - Link a query binding to the table data property or add raw data - Set a column (e.g., role) to select type - Do not add selectOptions - Set sortBy property to label - Verify that all other columns display and sort correctly 7. Verify that sorting by label and value works correctly in deployed mode **Steps:** - Drop a new table widget - Link a query binding to the table data property or add raw data - Set a column (e.g., role) to select type - Add selectOptions - Set sortBy property to label - Deploy application - Confirm that sorting works correctly for all columns Fixes #21993 ## Automation /ok-to-test tags="@tag.Table, @tag.Binding, @tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/10165119164> > Commit: 8a4e8b238adc0d78726a811b54a209caa4990606 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10165119164&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Table, @tag.Binding, @tag.Sanity` > Spec: > <hr>Tue, 30 Jul 2024 16:02:35 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [x] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a feature flag for dynamic table cell labeling. - Added a sorting option for select cells, allowing sort by value or label. - Enhanced user interface with new configuration options for select components. - Improved sorting functionality for select columns to sort by labels. - **Bug Fixes** - Improved sorting functionality in the table widget to ensure accurate data representation. - **Tests** - Expanded and clarified test cases for sorting functionality in the Table Widget V2. - Updated testing structure for better reliability and isolation of test scenarios. - Integrated dynamic testing capabilities based on feature flags. - **Documentation** - Added new locators for sorting controls to enhance UI interaction capabilities. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|---|---|---|
| .github | ||
| app | ||
| contributions | ||
| deploy | ||
| scripts | ||
| static | ||
| utils/observability | ||
| .coderabbit.yaml | ||
| .deepsource.toml | ||
| .editorconfig | ||
| .env.example | ||
| .gitignore | ||
| .imgbotconfig | ||
| .nojekyll | ||
| app.json | ||
| appsmith_events.md | ||
| appsmith_templates.md | ||
| ci-debug.sh | ||
| CODE_OF_CONDUCT.md | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| depot.json | ||
| Dockerfile | ||
| heroku.yml | ||
| IssuesReport.md | ||
| LICENSE | ||
| README.md | ||
| SECURITY.md | ||
Organizations build internal applications such as dashboards, database GUIs, admin panels, approval apps, customer support dashboards, and more to help their teams perform day-to-day operations. Appsmith is an open-source tool that enables the rapid development of these internal apps. Read more on our website.
Installation
There are two ways to start using Appsmith:
- Signup on Appsmith Cloud.
- Install Appsmith on your machine. See the installation guides below.
| Installation Methods | Documentation |
|---|---|
| Docker (Recommended) | |
| Kubernetes | |
| AWS AMI |
For other deployment options, see the Installation Guides documentation.
Development
To build and run Appsmith in your local dev environment, see Setup for local development.
Learning Resources
Need Help?
Contributing
We ❤️ our contributors. We're committed to fostering an open, welcoming, and safe environment in the community.
📕 We expect everyone participating in the community to abide by our Code of Conduct. Please read and follow it.
🤝 If you'd like to contribute, start by reading our Contribution Guide.
👾 Explore some good first issues.
Let's build great software together.
Top Contributors
License
Appsmith is licensed under the terms of Apache License 2.0.
