PromucFlow_constructor/app/client/src/components/propertyControls/ActionSelectorControl.tsx
Aswath K c29fd2db19
chore: Adds canDisplayValue to property controls (#13309)
* Adds canDisplayValue to property controls

* Adds tests

* add fn for LocationSearch & ActionSelector

* Adds CSV value support in ButtonTabControl
2022-06-03 10:37:02 +05:30

35 lines
986 B
TypeScript

import React from "react";
import BaseControl, { ControlData, ControlProps } from "./BaseControl";
// import DynamicActionCreator from "components/editorComponents/DynamicActionCreator";
import { ActionCreator } from "components/editorComponents/ActionCreator";
class ActionSelectorControl extends BaseControl<ControlProps> {
handleValueUpdate = (newValue: string) => {
const { propertyName } = this.props;
this.updateProperty(propertyName, newValue);
};
render() {
const { propertyValue } = this.props;
return (
<ActionCreator
additionalAutoComplete={this.props.additionalAutoComplete}
onValueChange={this.handleValueUpdate}
value={propertyValue}
/>
);
}
static getControlType() {
return "ACTION_SELECTOR";
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
static canDisplayValueInUI(config: ControlData, value: any): boolean {
return true;
}
}
export default ActionSelectorControl;