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-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,
|
2022-01-29 07:26:19 +00:00
|
|
|
datasourceId: string,
|
|
|
|
|
): ReduxAction<{
|
|
|
|
|
pageId: string;
|
|
|
|
|
from: EventLocation;
|
|
|
|
|
datasourceId: string;
|
|
|
|
|
}> => ({
|
2020-05-28 10:12:02 +00:00
|
|
|
type: ReduxActionTypes.CREATE_NEW_QUERY_ACTION,
|
2022-01-29 07:26:19 +00:00
|
|
|
payload: { pageId, from, datasourceId },
|
2020-05-28 10:12:02 +00:00
|
|
|
});
|
2021-03-01 14:57:15 +00:00
|
|
|
|
|
|
|
|
export const updateBodyContentType = (
|
feat: Support body in GET API requests (#7127)
* WIP
* Refactoring HTTP Method & Content Type to be objects instead of arrays
TODO:
1. Set the default content-type for Get request to "None". Currently, it's raw
2. For None content-type, don't send the body field in the API request
* Almost working implementation for the None type
Currently, the body still gets sent in non-GET requests even if the None tab is selected.
* Adding object.freeze to prevent any modifications to HTTP_METHOD_ENUM
* WIP: Using enum & const for ts autocomplete
* working implementation for NONE type, apiContentType prop added to API actions
* WIP
* Refactoring HTTP Method & Content Type to be objects instead of arrays
TODO:
1. Set the default content-type for Get request to "None". Currently, it's raw
2. For None content-type, don't send the body field in the API request
* Almost working implementation for the None type
Currently, the body still gets sent in non-GET requests even if the None tab is selected.
* Adding object.freeze to prevent any modifications to HTTP_METHOD_ENUM
* WIP: Using enum & const for ts autocomplete
* working implementation for NONE type, apiContentType prop added to API actions
* adds apiContentType to actionConfiguration.formData object
* Handling apiContentType property in Rest API formData
* change apiContentType when user types content-type value and switches http method
* makes api editor as similar as possible to postman, project postman.
* Correcting the import in ApiEditorConstants
* Resolved all merge conflicts
* replay DSL functtionality
* removes unneccessary files from worker
* Fixes type declarations, naming e.t.c.
* fix server side merge conflicts
* fix client side merge conflicts
* fix failing cypress tests
Co-authored-by: Irongade <adeoluayangade@yahoo.com>
Co-authored-by: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com>
2022-02-15 11:13:48 +00:00
|
|
|
title: string,
|
2021-03-01 14:57:15 +00:00
|
|
|
apiId: string,
|
feat: Support body in GET API requests (#7127)
* WIP
* Refactoring HTTP Method & Content Type to be objects instead of arrays
TODO:
1. Set the default content-type for Get request to "None". Currently, it's raw
2. For None content-type, don't send the body field in the API request
* Almost working implementation for the None type
Currently, the body still gets sent in non-GET requests even if the None tab is selected.
* Adding object.freeze to prevent any modifications to HTTP_METHOD_ENUM
* WIP: Using enum & const for ts autocomplete
* working implementation for NONE type, apiContentType prop added to API actions
* WIP
* Refactoring HTTP Method & Content Type to be objects instead of arrays
TODO:
1. Set the default content-type for Get request to "None". Currently, it's raw
2. For None content-type, don't send the body field in the API request
* Almost working implementation for the None type
Currently, the body still gets sent in non-GET requests even if the None tab is selected.
* Adding object.freeze to prevent any modifications to HTTP_METHOD_ENUM
* WIP: Using enum & const for ts autocomplete
* working implementation for NONE type, apiContentType prop added to API actions
* adds apiContentType to actionConfiguration.formData object
* Handling apiContentType property in Rest API formData
* change apiContentType when user types content-type value and switches http method
* makes api editor as similar as possible to postman, project postman.
* Correcting the import in ApiEditorConstants
* Resolved all merge conflicts
* replay DSL functtionality
* removes unneccessary files from worker
* Fixes type declarations, naming e.t.c.
* fix server side merge conflicts
* fix client side merge conflicts
* fix failing cypress tests
Co-authored-by: Irongade <adeoluayangade@yahoo.com>
Co-authored-by: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com>
2022-02-15 11:13:48 +00:00
|
|
|
): ReduxAction<{ title: string; apiId: string }> => ({
|
2021-03-01 14:57:15 +00:00
|
|
|
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,
|
2021-10-18 14:03:44 +00:00
|
|
|
): 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,
|
|
|
|
|
});
|