PromucFlow_constructor/app/client/src/actions/apiPaneActions.ts
Nikhil Nandagopal 194f27aabb
Feature/analytics (#1022)
* added appname to PAGE_LOAD data and fixed getCurrentApplication method

* Fixed analytics to save and test datasources

* fixed analytics for create action

* added event for action execution

* added a type for event location
2020-10-06 20:40:21 +05:30

63 lines
1.5 KiB
TypeScript

import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants";
import { EventLocation } from "utils/AnalyticsUtil";
export const changeApi = (
id: string,
newApi?: boolean,
): ReduxAction<{ id: string; newApi?: boolean }> => {
return {
type: ReduxActionTypes.API_PANE_CHANGE_API,
payload: { id, newApi },
};
};
export const initApiPane = (urlId?: string): ReduxAction<{ id?: string }> => {
return {
type: ReduxActionTypes.INIT_API_PANE,
payload: { id: urlId },
};
};
export const setCurrentCategory = (
category: string,
): ReduxAction<{ category: string }> => {
return {
type: ReduxActionTypes.SET_CURRENT_CATEGORY,
payload: { category },
};
};
export const setLastUsedEditorPage = (
path: string,
): ReduxAction<{ path: string }> => {
return {
type: ReduxActionTypes.SET_LAST_USED_EDITOR_PAGE,
payload: { path },
};
};
export const setLastSelectedPage = (
selectedPageId: string,
): ReduxAction<{ selectedPageId: string }> => {
return {
type: ReduxActionTypes.SET_LAST_SELECTED_PAGE_PAGE,
payload: { selectedPageId },
};
};
export const createNewApiAction = (
pageId: string,
from: EventLocation,
): ReduxAction<{ pageId: string; from: EventLocation }> => ({
type: ReduxActionTypes.CREATE_NEW_API_ACTION,
payload: { pageId, from },
});
export const createNewQueryAction = (
pageId: string,
from: EventLocation,
): ReduxAction<{ pageId: string; from: EventLocation }> => ({
type: ReduxActionTypes.CREATE_NEW_QUERY_ACTION,
payload: { pageId, from },
});