2020-01-30 13:23:04 +00:00
|
|
|
import {
|
|
|
|
|
ReduxActionTypes,
|
|
|
|
|
ReduxAction,
|
2021-08-03 08:06:48 +00:00
|
|
|
WidgetReduxActionTypes,
|
2022-04-12 10:50:01 +00:00
|
|
|
} from "@appsmith/constants/ReduxActionConstants";
|
2021-08-27 09:25:28 +00:00
|
|
|
import { ExecuteTriggerPayload } from "constants/AppsmithActionConstants/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";
|
2021-07-26 16:44:10 +00:00
|
|
|
import { WidgetProps } from "widgets/BaseWidget";
|
2019-09-17 10:11:50 +00:00
|
|
|
|
2021-08-27 09:25:28 +00:00
|
|
|
export const executeTrigger = (
|
|
|
|
|
payload: ExecuteTriggerPayload,
|
|
|
|
|
): BatchAction<ExecuteTriggerPayload> =>
|
2020-04-17 16:15:09 +00:00
|
|
|
batchAction({
|
2021-08-27 09:25:28 +00:00
|
|
|
type: ReduxActionTypes.EXECUTE_TRIGGER_REQUEST,
|
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-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
|
|
|
|
2021-03-29 15:47:22 +00:00
|
|
|
export const closePropertyPane = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.HIDE_PROPERTY_PANE,
|
|
|
|
|
payload: {
|
|
|
|
|
force: false,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-07-20 05:18:58 +00:00
|
|
|
export const closeTableFilterPane = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.HIDE_TABLE_FILTER_PANE,
|
|
|
|
|
payload: {
|
|
|
|
|
force: false,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-09-16 10:28:01 +00:00
|
|
|
export const copyWidget = (isShortcut: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.COPY_SELECTED_WIDGET_INIT,
|
|
|
|
|
payload: {
|
|
|
|
|
isShortcut: !!isShortcut,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2022-05-04 07:58:57 +00:00
|
|
|
export const pasteWidget = (
|
|
|
|
|
groupWidgets = false,
|
|
|
|
|
mouseLocation: { x: number; y: number },
|
|
|
|
|
) => {
|
2020-09-16 10:28:01 +00:00
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.PASTE_COPIED_WIDGET_INIT,
|
2021-08-25 05:00:31 +00:00
|
|
|
payload: {
|
|
|
|
|
groupWidgets: groupWidgets,
|
2022-05-04 07:58:57 +00:00
|
|
|
mouseLocation,
|
2021-08-25 05:00:31 +00:00
|
|
|
},
|
2020-09-16 10:28:01 +00:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const deleteSelectedWidget = (
|
|
|
|
|
isShortcut: boolean,
|
|
|
|
|
disallowUndo = false,
|
|
|
|
|
) => {
|
|
|
|
|
return {
|
2021-08-03 08:06:48 +00:00
|
|
|
type: WidgetReduxActionTypes.WIDGET_DELETE,
|
2020-09-16 10:28:01 +00:00
|
|
|
payload: {
|
|
|
|
|
isShortcut,
|
|
|
|
|
disallowUndo,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const cutWidget = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.CUT_SELECTED_WIDGET,
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-10-15 07:21:00 +00:00
|
|
|
|
2021-07-26 16:44:10 +00:00
|
|
|
export const addSuggestedWidget = (payload: Partial<WidgetProps>) => {
|
2020-10-15 07:21:00 +00:00
|
|
|
return {
|
2021-07-26 16:44:10 +00:00
|
|
|
type: ReduxActionTypes.ADD_SUGGESTED_WIDGET,
|
|
|
|
|
payload,
|
2020-10-15 07:21:00 +00:00
|
|
|
};
|
|
|
|
|
};
|
2021-08-25 05:00:31 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* action to group selected widgets into container
|
|
|
|
|
*
|
|
|
|
|
* @param queryName
|
|
|
|
|
* @returns
|
|
|
|
|
*/
|
|
|
|
|
export const groupWidgets = () => {
|
|
|
|
|
return {
|
|
|
|
|
type: ReduxActionTypes.GROUP_WIDGETS_INIT,
|
|
|
|
|
};
|
|
|
|
|
};
|