2020-02-07 02:32:52 +00:00
|
|
|
import { ReduxActionTypes, ReduxAction } from "constants/ReduxActionConstants";
|
2020-04-13 08:24:13 +00:00
|
|
|
import { BatchAction, batchAction } from "actions/batchActions";
|
2020-02-07 02:32:52 +00:00
|
|
|
|
2020-03-06 09:45:21 +00:00
|
|
|
export interface UpdateWidgetMetaPropertyPayload {
|
|
|
|
|
widgetId: string;
|
|
|
|
|
propertyName: string;
|
|
|
|
|
propertyValue: any;
|
|
|
|
|
}
|
2020-02-07 02:32:52 +00:00
|
|
|
export const updateWidgetMetaProperty = (
|
|
|
|
|
widgetId: string,
|
|
|
|
|
propertyName: string,
|
|
|
|
|
propertyValue: any,
|
2020-04-13 08:24:13 +00:00
|
|
|
): BatchAction<UpdateWidgetMetaPropertyPayload> => {
|
|
|
|
|
return batchAction({
|
2020-02-07 02:32:52 +00:00
|
|
|
type: ReduxActionTypes.SET_META_PROP,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
propertyName,
|
|
|
|
|
propertyValue,
|
|
|
|
|
},
|
2020-04-13 08:24:13 +00:00
|
|
|
});
|
2020-02-07 02:32:52 +00:00
|
|
|
};
|
|
|
|
|
|
2020-03-06 09:45:21 +00:00
|
|
|
export const resetWidgetMetaProperty = (
|
|
|
|
|
widgetId: string,
|
2020-04-13 08:24:13 +00:00
|
|
|
): BatchAction<{ widgetId: string }> => {
|
|
|
|
|
return batchAction({
|
2020-03-06 09:45:21 +00:00
|
|
|
type: ReduxActionTypes.RESET_WIDGET_META,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
},
|
2020-04-13 08:24:13 +00:00
|
|
|
});
|
2020-03-06 09:45:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const resetChildrenMetaProperty = (
|
|
|
|
|
widgetId: string,
|
|
|
|
|
): ReduxAction<{ widgetId: string }> => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.RESET_CHILDREN_WIDGET_META,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|