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";
|
2020-04-17 16:15:09 +00:00
|
|
|
import { BatchAction, batchAction } from "actions/batchActions";
|
2020-09-28 05:12:23 +00:00
|
|
|
import PerformanceTracker, {
|
|
|
|
|
PerformanceTransactionName,
|
|
|
|
|
} from "utils/PerformanceTracker";
|
2019-09-17 10:11:50 +00:00
|
|
|
|
|
|
|
|
export const executeAction = (
|
2020-02-18 10:41:52 +00:00
|
|
|
payload: ExecuteActionPayload,
|
2020-04-17 16:15:09 +00:00
|
|
|
): BatchAction<ExecuteActionPayload> =>
|
|
|
|
|
batchAction({
|
2019-09-17 10:11:50 +00:00
|
|
|
type: ReduxActionTypes.EXECUTE_ACTION,
|
2020-02-18 10:41:52 +00:00
|
|
|
payload,
|
2020-04-17 16:15:09 +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[][],
|
2020-11-03 10:16:11 +00:00
|
|
|
): ReduxAction<PageAction[][]> => ({
|
|
|
|
|
type: ReduxActionTypes.EXECUTE_PAGE_LOAD_ACTIONS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
2019-12-11 15:24:27 +00:00
|
|
|
|
2020-01-09 11:39:26 +00:00
|
|
|
export const disableDragAction = (
|
2020-05-07 10:51:37 +00:00
|
|
|
isDraggingDisabled: boolean,
|
|
|
|
|
): ReduxAction<{ isDraggingDisabled: boolean }> => {
|
2020-01-09 11:39:26 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.DISABLE_WIDGET_DRAG,
|
|
|
|
|
payload: {
|
2020-05-07 10:51:37 +00:00
|
|
|
isDraggingDisabled,
|
2020-01-09 11:39:26 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-03-27 09:02:11 +00:00
|
|
|
|
2020-04-03 09:32:13 +00:00
|
|
|
export const createModalAction = (
|
|
|
|
|
modalName: string,
|
|
|
|
|
): ReduxAction<{ modalName: string }> => {
|
2020-03-27 09:02:11 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CREATE_MODAL_INIT,
|
2020-04-03 09:32:13 +00:00
|
|
|
payload: {
|
|
|
|
|
modalName,
|
|
|
|
|
},
|
2020-03-27 09:02:11 +00:00
|
|
|
};
|
|
|
|
|
};
|
2020-04-13 08:24:13 +00:00
|
|
|
|
|
|
|
|
export const focusWidget = (
|
|
|
|
|
widgetId?: string,
|
2020-04-13 14:00:50 +00:00
|
|
|
): ReduxAction<{ widgetId?: string }> => ({
|
|
|
|
|
type: ReduxActionTypes.FOCUS_WIDGET,
|
|
|
|
|
payload: { widgetId },
|
|
|
|
|
});
|
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 showModal = (id: string) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SHOW_MODAL,
|
|
|
|
|
payload: {
|
|
|
|
|
modalId: id,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const closeAllModals = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CLOSE_MODAL,
|
|
|
|
|
payload: {},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const forceOpenPropertyPane = (id: string) => {
|
2020-09-28 05:12:23 +00:00
|
|
|
PerformanceTracker.startTracking(
|
|
|
|
|
PerformanceTransactionName.OPEN_PROPERTY_PANE,
|
|
|
|
|
);
|
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
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.SHOW_PROPERTY_PANE,
|
|
|
|
|
payload: {
|
|
|
|
|
widgetId: id,
|
|
|
|
|
force: true,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-09-16 10:28:01 +00:00
|
|
|
|
|
|
|
|
export const copyWidget = (isShortcut: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.COPY_SELECTED_WIDGET_INIT,
|
|
|
|
|
payload: {
|
|
|
|
|
isShortcut: !!isShortcut,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const pasteWidget = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.PASTE_COPIED_WIDGET_INIT,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteSelectedWidget = (
|
|
|
|
|
isShortcut: boolean,
|
|
|
|
|
disallowUndo = false,
|
|
|
|
|
) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.WIDGET_DELETE,
|
|
|
|
|
payload: {
|
|
|
|
|
isShortcut,
|
|
|
|
|
disallowUndo,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const cutWidget = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CUT_SELECTED_WIDGET,
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-10-15 07:21:00 +00:00
|
|
|
|
|
|
|
|
export const addTableWidgetFromQuery = (queryName: string) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.ADD_TABLE_WIDGET_FROM_QUERY,
|
|
|
|
|
payload: queryName,
|
|
|
|
|
};
|
|
|
|
|
};
|