2019-11-25 09:15:11 +00:00
|
|
|
import { ReduxAction, ReduxActionTypes } from "constants/ReduxActionConstants";
|
2020-10-06 15:10:21 +00:00
|
|
|
import { EventLocation } from "utils/AnalyticsUtil";
|
2021-03-01 14:57:15 +00:00
|
|
|
import { ApiContentTypes } from "constants/ApiEditorConstants";
|
2021-09-22 16:59:47 +00:00
|
|
|
import { SlashCommandPayload } from "entities/Action";
|
2019-11-25 09:15:11 +00:00
|
|
|
|
2020-07-06 05:38:39 +00:00
|
|
|
export const changeApi = (
|
|
|
|
|
id: string,
|
2021-05-04 13:08:20 +00:00
|
|
|
isSaas: boolean,
|
2020-07-06 05:38:39 +00:00
|
|
|
newApi?: boolean,
|
2021-05-04 13:08:20 +00:00
|
|
|
): ReduxAction<{ id: string; isSaas: boolean; newApi?: boolean }> => {
|
2019-11-25 09:15:11 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.API_PANE_CHANGE_API,
|
2021-05-04 13:08:20 +00:00
|
|
|
payload: { id, isSaas, newApi },
|
2019-11-25 09:15:11 +00:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const initApiPane = (urlId?: string): ReduxAction<{ id?: string }> => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.INIT_API_PANE,
|
|
|
|
|
payload: { id: urlId },
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-04-20 08:26:19 +00:00
|
|
|
|
2020-04-28 10:47:59 +00:00
|
|
|
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 },
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-20 08:26:19 +00:00
|
|
|
export const createNewApiAction = (
|
|
|
|
|
pageId: string,
|
2020-10-06 15:10:21 +00:00
|
|
|
from: EventLocation,
|
|
|
|
|
): ReduxAction<{ pageId: string; from: EventLocation }> => ({
|
2020-04-20 08:26:19 +00:00
|
|
|
type: ReduxActionTypes.CREATE_NEW_API_ACTION,
|
2020-10-06 15:10:21 +00:00
|
|
|
payload: { pageId, from },
|
2020-04-20 08:26:19 +00:00
|
|
|
});
|
2020-05-07 07:56:37 +00:00
|
|
|
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
export const createNewQueryAction = (
|
|
|
|
|
pageId: string,
|
2020-10-06 15:10:21 +00:00
|
|
|
from: EventLocation,
|
|
|
|
|
): ReduxAction<{ pageId: string; from: EventLocation }> => ({
|
2020-05-28 10:12:02 +00:00
|
|
|
type: ReduxActionTypes.CREATE_NEW_QUERY_ACTION,
|
2020-10-06 15:10:21 +00:00
|
|
|
payload: { pageId, from },
|
2020-05-28 10:12:02 +00:00
|
|
|
});
|
2021-03-01 14:57:15 +00:00
|
|
|
|
|
|
|
|
export const updateBodyContentType = (
|
|
|
|
|
title: ApiContentTypes,
|
|
|
|
|
apiId: string,
|
|
|
|
|
): ReduxAction<{ title: ApiContentTypes; apiId: string }> => ({
|
|
|
|
|
type: ReduxActionTypes.UPDATE_API_ACTION_BODY_CONTENT_TYPE,
|
|
|
|
|
payload: { title, apiId },
|
|
|
|
|
});
|
2021-07-07 03:46:16 +00:00
|
|
|
|
|
|
|
|
export const redirectToNewIntegrations = (
|
|
|
|
|
applicationId: string,
|
|
|
|
|
pageId: string,
|
2021-07-29 08:13:10 +00:00
|
|
|
params?: any,
|
|
|
|
|
): ReduxAction<{ applicationId: string; pageId: string; params: any }> => ({
|
2021-07-07 03:46:16 +00:00
|
|
|
type: ReduxActionTypes.REDIRECT_TO_NEW_INTEGRATIONS,
|
2021-07-29 08:13:10 +00:00
|
|
|
payload: { applicationId, pageId, params },
|
2021-07-07 03:46:16 +00:00
|
|
|
});
|
2021-09-22 16:59:47 +00:00
|
|
|
|
|
|
|
|
export const executeCommandAction = (payload: SlashCommandPayload) => ({
|
|
|
|
|
type: ReduxActionTypes.EXECUTE_COMMAND,
|
|
|
|
|
payload: payload,
|
|
|
|
|
});
|