chore: fix prop name in options control (#37130)

/ok-to-test tags="@tag.Widget"

The options control was using `options` as the property name for the
options array even when thee prop name was not `options`. This was
causing issues when the property name was different.

<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11590623056>
> Commit: 1e16edb367a0bbbfb54db681cb34283f01724e0a
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11590623056&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Widget`
> Spec:
> <hr>Wed, 30 Oct 2024 11:11:49 UTC
<!-- end of auto-generated comment: Cypress test results  -->


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

- **New Features**
- Enhanced the `OptionControl` component to support dynamic property
updates based on component props.

- **Bug Fixes**
- Improved the handling of property updates, allowing for more flexible
and accurate updates.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Pawan Kumar 2024-10-30 16:43:00 +05:30 committed by GitHub
parent 502d21b274
commit 764d8f3cb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ class OptionControl extends BaseControl<ControlProps> {
options: SegmentedControlOption[],
isUpdatedViaKeyboard = false,
) => {
this.updateProperty("options", options, isUpdatedViaKeyboard);
this.updateProperty(this.props.propertyName, options, isUpdatedViaKeyboard);
};
static getControlType() {