PromucFlow_constructor/app/client/src/actions/widgetActions.tsx

64 lines
1.4 KiB
TypeScript
Raw Normal View History

2020-01-30 13:23:04 +00:00
import {
ReduxActionTypes,
ReduxAction,
ReduxActionErrorTypes,
} from "constants/ReduxActionConstants";
import {
2020-02-18 10:41:52 +00:00
ExecuteActionPayload,
2020-01-30 13:23:04 +00:00
ExecuteErrorPayload,
PageAction,
} from "constants/ActionConstants";
2020-04-17 16:15:09 +00:00
import { BatchAction, batchAction } from "actions/batchActions";
export const executeAction = (
2020-02-18 10:41:52 +00:00
payload: ExecuteActionPayload,
2020-04-17 16:15:09 +00:00
): BatchAction<ExecuteActionPayload> =>
batchAction({
type: ReduxActionTypes.EXECUTE_ACTION,
2020-02-18 10:41:52 +00:00
payload,
2020-04-17 16:15:09 +00:00
});
2019-11-20 08:10:01 +00:00
2020-01-30 13:23:04 +00:00
export const executeActionError = (
executeErrorPayload: ExecuteErrorPayload,
): ReduxAction<ExecuteErrorPayload> => ({
type: ReduxActionErrorTypes.EXECUTE_ACTION_ERROR,
payload: executeErrorPayload,
});
export const executePageLoadActions = (
2020-01-30 10:55:37 +00:00
payload: PageAction[][],
2020-04-17 16:15:09 +00:00
): BatchAction<PageAction[][]> =>
batchAction({
type: ReduxActionTypes.EXECUTE_PAGE_LOAD_ACTIONS,
payload,
});
export const disableDragAction = (
2020-05-07 10:51:37 +00:00
isDraggingDisabled: boolean,
): ReduxAction<{ isDraggingDisabled: boolean }> => {
return {
type: ReduxActionTypes.DISABLE_WIDGET_DRAG,
payload: {
2020-05-07 10:51:37 +00:00
isDraggingDisabled,
},
};
};
2020-04-03 09:32:13 +00:00
export const createModalAction = (
modalName: string,
): ReduxAction<{ modalName: string }> => {
return {
type: ReduxActionTypes.CREATE_MODAL_INIT,
2020-04-03 09:32:13 +00:00
payload: {
modalName,
},
};
};
2020-04-13 08:24:13 +00:00
export const focusWidget = (
widgetId?: string,
2020-04-13 14:00:50 +00:00
): ReduxAction<{ widgetId?: string }> => ({
type: ReduxActionTypes.FOCUS_WIDGET,
payload: { widgetId },
});