Revert "Add sync meta property update function"

This reverts commit 54f158694f.
This commit is contained in:
hetunandu 2021-03-01 14:53:21 +05:30
parent 54f158694f
commit 557618a2bb
2 changed files with 2 additions and 20 deletions

View File

@ -18,10 +18,6 @@ export interface WithMeta {
propertyValue: any,
actionExecution?: DebouncedExecuteActionPayload,
) => void;
syncUpdateWidgetMetaProperty: (
propertyName: string,
propertyValue: any,
) => void;
}
const withMeta = (WrappedWidget: typeof BaseWidget) => {
@ -34,7 +30,7 @@ const withMeta = (WrappedWidget: typeof BaseWidget) => {
this.handleUpdateWidgetMetaProperty.bind(this),
200,
{
leading: false,
leading: true,
trailing: true,
},
);
@ -92,19 +88,6 @@ const withMeta = (WrappedWidget: typeof BaseWidget) => {
);
};
syncUpdateWidgetMetaProperty = (
propertyName: string,
propertyValue: any,
): void => {
const { updateWidgetMetaProperty } = this.context;
const { widgetId, widgetName } = this.props;
this.setState({
[propertyName]: propertyValue,
});
clearEvalPropertyCache(`${widgetName}.${propertyName}`);
updateWidgetMetaProperty(widgetId, propertyName, propertyValue);
};
handleUpdateWidgetMetaProperty() {
const { updateWidgetMetaProperty, executeAction } = this.context;
const { widgetId, widgetName } = this.props;
@ -139,7 +122,6 @@ const withMeta = (WrappedWidget: typeof BaseWidget) => {
...this.props,
...this.state,
updateWidgetMetaProperty: this.updateWidgetMetaProperty,
syncUpdateWidgetMetaProperty: this.syncUpdateWidgetMetaProperty,
};
};

View File

@ -694,7 +694,7 @@ class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
JSON.stringify(this.props.filteredTableData)
) {
// Update filteredTableData meta property
this.props.syncUpdateWidgetMetaProperty(
this.props.updateWidgetMetaProperty(
"filteredTableData",
filteredTableData,
);