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";
|
2019-09-17 10:11:50 +00:00
|
|
|
|
|
|
|
|
export const executeAction = (
|
2020-02-18 10:41:52 +00:00
|
|
|
payload: ExecuteActionPayload,
|
|
|
|
|
): ReduxAction<ExecuteActionPayload> => {
|
2019-09-17 10:11:50 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.EXECUTE_ACTION,
|
2020-02-18 10:41:52 +00:00
|
|
|
payload,
|
2019-09-17 10:11:50 +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,
|
|
|
|
|
});
|
|
|
|
|
|
2019-12-11 15:24:27 +00:00
|
|
|
export const executePageLoadActions = (
|
2020-01-30 10:55:37 +00:00
|
|
|
payload: PageAction[][],
|
|
|
|
|
): ReduxAction<PageAction[][]> => ({
|
2019-12-11 15:24:27 +00:00
|
|
|
type: ReduxActionTypes.EXECUTE_PAGE_LOAD_ACTIONS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
2020-01-09 11:39:26 +00:00
|
|
|
export const disableDragAction = (
|
|
|
|
|
disable: boolean,
|
2020-01-20 09:00:37 +00:00
|
|
|
): ReduxAction<{ disable: boolean }> => {
|
2020-01-09 11:39:26 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.DISABLE_WIDGET_DRAG,
|
|
|
|
|
payload: {
|
2020-01-20 09:00:37 +00:00
|
|
|
disable,
|
2020-01-09 11:39:26 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-20 08:10:01 +00:00
|
|
|
export type WidgetLoadingState = {
|
|
|
|
|
areLoading: boolean;
|
|
|
|
|
widgetIds: string[];
|
|
|
|
|
};
|