2019-11-25 05:07:27 +00:00
|
|
|
import { ReduxActionTypes, ReduxAction } from "constants/ReduxActionConstants";
|
|
|
|
|
import { RenderMode } from "constants/WidgetConstants";
|
2020-04-13 08:24:13 +00:00
|
|
|
import { BatchAction, batchAction } from "actions/batchActions";
|
2019-09-18 10:19:50 +00:00
|
|
|
|
2020-02-26 12:44:56 +00:00
|
|
|
export const updateWidgetPropertyRequest = (
|
2019-09-18 10:19:50 +00:00
|
|
|
widgetId: string,
|
|
|
|
|
propertyName: string,
|
|
|
|
|
propertyValue: any,
|
2019-11-08 11:02:00 +00:00
|
|
|
renderMode: RenderMode,
|
2020-02-26 12:44:56 +00:00
|
|
|
): ReduxAction<UpdateWidgetPropertyRequestPayload> => {
|
2019-09-18 10:19:50 +00:00
|
|
|
return {
|
2019-11-06 06:35:15 +00:00
|
|
|
type: ReduxActionTypes.UPDATE_WIDGET_PROPERTY_REQUEST,
|
2019-09-18 10:19:50 +00:00
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
propertyName,
|
|
|
|
|
propertyValue,
|
2019-11-08 11:02:00 +00:00
|
|
|
renderMode,
|
2019-09-18 10:19:50 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-02-26 12:44:56 +00:00
|
|
|
export const updateWidgetProperty = (
|
|
|
|
|
widgetId: string,
|
|
|
|
|
propertyName: string,
|
|
|
|
|
propertyValue: any,
|
2020-04-13 08:24:13 +00:00
|
|
|
): BatchAction<UpdateWidgetPropertyPayload> => {
|
|
|
|
|
return batchAction({
|
2020-02-26 12:44:56 +00:00
|
|
|
type: ReduxActionTypes.UPDATE_WIDGET_PROPERTY,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
propertyName,
|
|
|
|
|
propertyValue,
|
|
|
|
|
},
|
2020-04-13 08:24:13 +00:00
|
|
|
});
|
2020-02-26 12:44:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const setWidgetDynamicProperty = (
|
|
|
|
|
widgetId: string,
|
|
|
|
|
propertyName: string,
|
|
|
|
|
isDynamic: boolean,
|
|
|
|
|
): ReduxAction<SetWidgetDynamicPropertyPayload> => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SET_WIDGET_DYNAMIC_PROPERTY,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId,
|
|
|
|
|
propertyName,
|
|
|
|
|
isDynamic,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export interface UpdateWidgetPropertyRequestPayload {
|
2019-09-18 10:19:50 +00:00
|
|
|
widgetId: string;
|
|
|
|
|
propertyName: string;
|
|
|
|
|
propertyValue: any;
|
2019-11-08 11:02:00 +00:00
|
|
|
renderMode: RenderMode;
|
2020-02-26 12:44:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface UpdateWidgetPropertyPayload {
|
|
|
|
|
widgetId: string;
|
|
|
|
|
propertyName: string;
|
|
|
|
|
propertyValue: any;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface SetWidgetDynamicPropertyPayload {
|
|
|
|
|
widgetId: string;
|
|
|
|
|
propertyName: string;
|
|
|
|
|
isDynamic: boolean;
|
2019-11-14 09:28:51 +00:00
|
|
|
}
|