chore: Revert "Add dynamic property path for sourceData in SelectWidget (#34574)" (#34618)

**/test binding**



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/9754334718>
> Commit: 2c67d23abd75ce763c6e8eac2b1d9582bccca875
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9754334718&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Binding`

<!-- end of auto-generated comment: Cypress test results  -->



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Refactor**
- Improved the internal handling of `sourceData` within the Select
widget for better performance and maintainability.

- **Tests**
- Updated test cases for the Select widget to reflect the new handling
of `sourceData`.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Shrikant Sharat Kandula 2024-07-02 09:45:30 +05:30 committed by GitHub
parent c7088e734e
commit b5c5fb2fb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 12 deletions

View File

@ -9,7 +9,6 @@ const {
agHelper, agHelper,
assertHelper, assertHelper,
dataSources, dataSources,
propPane,
} = require("../../../../../support/Objects/ObjectsCore"); } = require("../../../../../support/Objects/ObjectsCore");
const { const {
default: EditorNavigation, default: EditorNavigation,
@ -92,7 +91,6 @@ describe("Select widget", { tags: ["@tag.Widget", "@tag.Select"] }, () => {
cy.get("@dsName").then((dsName) => { cy.get("@dsName").then((dsName) => {
EditorNavigation.SelectEntityByName("Select1", EntityType.Widget); EditorNavigation.SelectEntityByName("Select1", EntityType.Widget);
propPane.ToggleJSMode("sourcedata", false);
oneClickBinding.ChooseAndAssertForm( oneClickBinding.ChooseAndAssertForm(
`${dsName}`, `${dsName}`,

View File

@ -93,15 +93,11 @@ class SelectWidget extends BaseWidget<SelectWidgetProps, WidgetState> {
labelPosition: LabelPosition.Top, labelPosition: LabelPosition.Top,
labelAlignment: Alignment.LEFT, labelAlignment: Alignment.LEFT,
labelWidth: 5, labelWidth: 5,
sourceData: JSON.stringify( sourceData: [
[ { name: "Blue", code: "BLUE" },
{ name: "Blue", code: "BLUE" }, { name: "Green", code: "GREEN" },
{ name: "Green", code: "GREEN" }, { name: "Red", code: "RED" },
{ name: "Red", code: "RED" }, ],
],
null,
2,
),
optionLabel: "name", optionLabel: "name",
optionValue: "code", optionValue: "code",
serverSideFiltering: false, serverSideFiltering: false,
@ -115,7 +111,6 @@ class SelectWidget extends BaseWidget<SelectWidgetProps, WidgetState> {
labelTextSize: "0.875rem", labelTextSize: "0.875rem",
responsiveBehavior: ResponsiveBehavior.Fill, responsiveBehavior: ResponsiveBehavior.Fill,
minWidth: FILL_WIDGET_MIN_WIDTH, minWidth: FILL_WIDGET_MIN_WIDTH,
dynamicPropertyPathList: [{ key: "sourceData" }],
}; };
} }