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

39 lines
817 B
TypeScript
Raw Normal View History

2019-09-27 16:05:33 +00:00
import {
ReduxActionTypes,
ReduxActionErrorTypes,
2019-11-25 05:07:27 +00:00
} from "constants/ReduxActionConstants";
import { WidgetCardProps } from "widgets/BaseWidget";
2019-08-21 12:49:16 +00:00
export const fetchWidgetCards = () => {
return {
type: ReduxActionTypes.FETCH_WIDGET_CARDS,
2019-09-09 09:08:54 +00:00
};
};
2019-08-21 12:49:16 +00:00
2019-08-26 12:41:21 +00:00
export const errorFetchingWidgetCards = (error: any) => {
2019-08-21 12:49:16 +00:00
return {
2019-09-27 16:05:33 +00:00
type: ReduxActionErrorTypes.FETCH_WIDGET_CARDS_ERROR,
2019-09-09 09:08:54 +00:00
error,
};
};
2019-08-21 12:49:16 +00:00
2019-09-09 09:08:54 +00:00
export const successFetchingWidgetCards = (cards: {
[id: string]: WidgetCardProps[];
}) => {
2019-08-21 12:49:16 +00:00
return {
2019-09-27 16:05:33 +00:00
type: ReduxActionTypes.FETCH_WIDGET_CARDS_SUCCESS,
2019-09-09 09:08:54 +00:00
cards,
};
};
2019-08-26 12:41:21 +00:00
export const forceOpenWidgetPanel = (flag: boolean) => ({
type: ReduxActionTypes.SET_FORCE_WIDGET_PANEL_OPEN,
payload: flag,
});
2019-08-26 12:41:21 +00:00
export default {
fetchWidgetCards,
errorFetchingWidgetCards,
2019-09-09 09:08:54 +00:00
successFetchingWidgetCards,
};