PromucFlow_constructor/app/client/cypress/locators
Jacques Ikot 3b1c14a9f0
feat: add sortBy property to table select cell type (#35187)
## 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 -->
2024-08-02 08:37:00 +01:00
..
AdminsSettings.js test: Updating the locator for upgrade button on admin settings (#33872) 2024-05-31 21:07:28 +05:30
ApiEditor.js feat: cURL import now happens via a modal (#34830) 2024-07-10 14:22:39 +05:30
apiWidgetslocator.json fix: replaced all edit name with Rename (#34570) 2024-07-17 08:49:44 +05:30
Applications.json fix: Fork button text color/hover, and fork=true query param fix (#27336) 2023-09-26 07:38:05 +05:30
AppNavigation.json feat: [epic] appsmith design system version 2 deduplication (#22030) 2023-05-20 00:07:06 +05:30
CMSApplocators.js feat: enabled editor pane sidebar (#29882) 2024-01-12 20:13:58 +05:30
commonlocators.json feat: add sortBy property to table select cell type (#35187) 2024-08-02 08:37:00 +01:00
DatasourcesEditor.json fix: removed ab_mock_mongo_schema_enabled, ab_gsheet_schema_enabled flag code (#30113) 2024-01-16 14:00:51 +05:30
DynamicInput.json
EnterpriseAdminSettingsLocators.json feat: code split branding helpers, add auth locators in CE (#26379) 2023-08-16 18:08:10 +05:30
explorerlocators.json fix: replaced all edit name with Rename (#34570) 2024-07-17 08:49:44 +05:30
FirstTimeUserOnboarding.json feat: Create Query asks for Page (#29253) 2023-12-05 11:20:36 +05:30
FormControl.json feat: added trigger for collection property editor, making it dd for mongo (#24213) 2023-06-14 12:16:09 +05:30
FormWidgets.json feat: enabled editor pane sidebar (#29882) 2024-01-12 20:13:58 +05:30
GeneratePage.json test: Failing cypress tests due to removal of empty canvas prompts (#34037) 2024-06-07 15:24:07 +05:30
GithubForm.json chore: Add redirect and homepage URL on Github config page (#24395) 2023-06-13 19:23:33 +05:30
gitSyncLocators.js test: updated js methods to refer ts locators for Git Tests (#34577) 2024-06-28 16:34:07 +05:30
GlobalSearch.json feat: enabled editor pane sidebar (#29882) 2024-01-12 20:13:58 +05:30
GoogleForm.json fix: Adding a fix for copy clipboard URL not working on HTTP domain (#21313) 2023-03-14 11:41:52 +05:30
GuidedTour.json chore: Create tooltip Component (#23382) 2023-05-22 12:05:21 +03:00
HelpLocators.json
HomePage.js feat: Homepage experience v2 changes (#29282) 2024-01-25 19:11:48 +05:30
jsActionLocators.json feat: enabled editor pane sidebar (#29882) 2024-01-12 20:13:58 +05:30
JSEditor.json feat: js object v1 run and settings redesign (#11456) 2022-04-28 17:51:02 +01:00
jsonFormWidget.json feat: [epic] appsmith design system version 2 deduplication (#22030) 2023-05-20 00:07:06 +05:30
Layout.json feat: [epic] appsmith design system version 2 deduplication (#22030) 2023-05-20 00:07:06 +05:30
LoginPage.json fix: fork app button not opening the fork modal for non-signed in users (#12479) 2022-04-11 10:44:50 +05:30
ModalWidget.json fix: Update title casing for action selector fields (#22270) 2023-05-23 11:17:47 +05:30
Omnibar.json test: Cypress | Cy 12 upgrade + Flaky fixes (#23852) 2023-06-15 18:51:11 +05:30
Onboarding.json
OneClickBindingLocator.ts feat: JSON form widget one click binding integration (#25873) 2023-10-03 13:40:51 +05:30
Pages.json fix: replaced all edit name with Rename (#34570) 2024-07-17 08:49:44 +05:30
PgAdminlocators.json chore: Remove back button (#29312) 2023-12-09 07:17:23 +05:30
publishWidgetspage.json feat/Replace fusion charts with Echarts (#24249) 2023-07-28 18:59:16 +05:30
QueryEditor.json chore: show suggested widgets in response (#31008) 2024-02-13 13:52:04 +05:30
RatingWidgetLocators.ts test: Cypress - Rating widget (#25944) 2023-08-08 12:16:48 +05:30
ReconnectLocators.js feat: extend datasource reconnect modal tooltip to include title (#28696) 2023-11-15 07:39:29 +05:30
SignupPage.json fix: updated the design for the admin users (#29712) 2023-12-25 17:54:46 +05:30
TemplatesLocators.json test: Cypress | Helpers improved + Flaky fixes (#30735) 2024-02-01 16:42:53 +05:30
ThemeLocators.json chore: add color validation + native color picker (#25355) 2023-08-07 11:55:10 +03:00
ViewWidgets.json chore: [map chart widget] update the label counts and snapshot in spec (#31648) 2024-03-11 16:34:34 +05:30
welcomePage.json fix: updated the design for the admin users (#29712) 2023-12-25 17:54:46 +05:30
WidgetLocators.ts feat: Preliminary set of test cases and test utils for Anvil DnD and Space distribution. (#33827) 2024-05-30 12:46:56 +05:30
Widgets.json test: removed toggleBar command and replaced with ts helper (#33835) 2024-06-06 15:25:08 +05:30