Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: display label in table select cell (appsmithorg#35124)
## Description **Issue** In the table widget, the select column currently displays the value from the dropdown when a user makes a selection, rather than the label. This behaviour is inconsistent with the standalone select widget, which correctly renders the label upon selection. **Fix** This PR addresses the inconsistency by modifying the table widget's select column to display the label of the selected item, while maintaining the table cell value and ensuring alignment with the behaviour of the standalone select widget. **Tested Cases** Manual Test Cases for Table Select Widget Improvement 1. Default Value Display **Objective:** Ensure that a new table displays the correct default label key from the selectOptions in the cell. **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., gender) to select type. - Verify that the table cell displays the value from the label key of the `selectOptions` by default. 2. Binding Check for Selected Row **Objective:** Ensure that the table binding for the selected row reflects the correct value key from the selectOptions. **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., gender) to select type. - Select a row and verify that `Table1.selectedRow.gender` matches the value key from the `selectOptions`. 3. Updating Table Cell Content **Objective:** Verify that updating the table cell content via the dropdown updates the cell with the correct label key property. **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., gender) to select type. - Change the content of the table cell using the dropdown. - Confirm that the cell content updates accordingly with the value key property. 4. Add New Row Functionality **Objective:** Ensure that adding a new row works as expected with the enhanced functionality. **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., gender) to select type. - Add a new row to the table. - Verify that the new row uses the label key property from the `selectOptions` in the table display. 5. Deployed Mode Verification **Objective:** Verify that the display functionality works correctly in deployed mode. **Steps:** - Drop a new table widget. - Add sample data to the table. - Set a column (e.g., gender) to select type. - Change the displayAs property to both value and label. - Deploy the table. - Verify that the table displays correctly in both value and label modes in the deployed environment. Fixes appsmithorg#26188 ## 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/10080592979> > Commit: 78b268d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10080592979&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Table, @tag.Binding, @tag.Sanity` > Spec: > <hr>Wed, 24 Jul 2024 17:17:06 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved display of selected options in table widgets by showing the corresponding label instead of the raw value. - Introduced a feature flag to toggle the table cell label value functionality. - **Bug Fixes** - Enhanced test cases to ensure accurate validation of select options behavior within the table widget. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information