PromucFlow_constructor/app/client/src/actions/editorActions.ts
akash-codemonk 22c272c210
feat: debugger error navigation (#25505)
## Description

Property pane navigation on click of a widget error or log from the
debugger. Navigation to a field works if the log has the required meta
data here it would be the property path. With the help of the property
pane config and the widget's properties we generate the payload to set
the required panel, tab, section states. Factory class to clearly
separate out the logic for the different entities.

#### PR fixes following issue(s)
Related to https://github.com/appsmithorg/appsmith/issues/16408
Fixes https://github.com/appsmithorg/appsmith/issues/25465
Fixes https://github.com/appsmithorg/appsmith/issues/25462
2023-08-01 09:32:41 +05:30

78 lines
1.8 KiB
TypeScript

import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
import type { EntityInfo } from "pages/Editor/EntityNavigation/types";
/**
* init action that sets preview mode. navigates to canvas when payload is true
* navigates back when the payload is false i.e when switched to edit mode
*
* @param payload
* @returns
*/
export const setPreviewModeInitAction = (payload: boolean) => ({
type: ReduxActionTypes.SET_PREVIEW_MODE_INIT,
payload,
});
/**
* action that sets preview mode
*
* @param payload
* @returns
*/
export const setPreviewModeAction = (payload: boolean) => ({
type: ReduxActionTypes.SET_PREVIEW_MODE,
payload,
});
/**
* action that sets visibility state of the canvas top section
*
* @param payload
* @returns
*/
export const setCanvasCardsState = (payload: string) => ({
type: ReduxActionTypes.SET_CANVAS_CARDS_STATE,
payload,
});
/**
* action that deletes/clears the visibility state of the canvas top section
*
* @param payload
* @returns
*/
export const deleteCanvasCardsState = () => ({
type: ReduxActionTypes.DELETE_CANVAS_CARDS_STATE,
});
/**
* action that update canvas layout
*
* @param width
* @returns
*/
export const updateCanvasLayoutAction = (width: number) => {
return {
type: ReduxActionTypes.UPDATE_CANVAS_LAYOUT,
payload: {
width,
},
};
};
/**
* This action when executed updates the status of saving entity to true
* This function was created to add a sync to the entity update and shortcut command being fired to execute any command.
*/
export const startingEntityUpdate = () => ({
type: ReduxActionTypes.ENTITY_UPDATE_STARTED,
});
export const navigateToEntity = (payload: EntityInfo) => {
return {
type: ReduxActionTypes.NAVIGATE_TO_ENTITY,
payload,
};
};