2022-04-12 10:50:01 +00:00
|
|
|
import { ReduxActionTypes } from "@appsmith/constants/ReduxActionConstants";
|
2021-08-16 11:03:27 +00:00
|
|
|
import { ENTITY_TYPE, Log, Message } from "entities/AppsmithConsole";
|
2021-07-08 05:31:08 +00:00
|
|
|
import { EventName } from "utils/AnalyticsUtil";
|
|
|
|
|
|
|
|
|
|
export interface LogDebuggerErrorAnalyticsPayload {
|
|
|
|
|
entityName: string;
|
|
|
|
|
entityId: string;
|
|
|
|
|
entityType: ENTITY_TYPE;
|
|
|
|
|
eventName: EventName;
|
|
|
|
|
propertyPath: string;
|
2021-08-16 11:03:27 +00:00
|
|
|
errorMessages?: Message[];
|
|
|
|
|
errorMessage?: Message["message"];
|
|
|
|
|
errorType?: Message["type"];
|
2021-08-23 13:47:17 +00:00
|
|
|
errorSubType?: Message["subType"];
|
2021-08-16 11:03:27 +00:00
|
|
|
analytics?: Log["analytics"];
|
2021-07-08 05:31:08 +00:00
|
|
|
}
|
2021-04-23 13:50:55 +00:00
|
|
|
|
2021-08-16 11:03:27 +00:00
|
|
|
export const debuggerLogInit = (payload: Log) => ({
|
2021-04-23 13:50:55 +00:00
|
|
|
type: ReduxActionTypes.DEBUGGER_LOG_INIT,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
2021-08-16 11:03:27 +00:00
|
|
|
export const debuggerLog = (payload: Log) => ({
|
2021-04-23 13:50:55 +00:00
|
|
|
type: ReduxActionTypes.DEBUGGER_LOG,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const clearLogs = () => ({
|
|
|
|
|
type: ReduxActionTypes.CLEAR_DEBUGGER_LOGS,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const showDebugger = (payload?: boolean) => ({
|
|
|
|
|
type: ReduxActionTypes.SHOW_DEBUGGER,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
2021-08-16 11:03:27 +00:00
|
|
|
// Add an error
|
|
|
|
|
export const addErrorLogInit = (payload: Log) => ({
|
|
|
|
|
type: ReduxActionTypes.DEBUGGER_ADD_ERROR_LOG_INIT,
|
2021-04-23 13:50:55 +00:00
|
|
|
payload,
|
|
|
|
|
});
|
|
|
|
|
|
2021-08-16 11:03:27 +00:00
|
|
|
export const addErrorLog = (payload: Log) => ({
|
|
|
|
|
type: ReduxActionTypes.DEBUGGER_ADD_ERROR_LOG,
|
2021-04-23 13:50:55 +00:00
|
|
|
payload,
|
|
|
|
|
});
|
2021-07-08 05:31:08 +00:00
|
|
|
|
2021-08-16 11:03:27 +00:00
|
|
|
export const deleteErrorLogInit = (
|
|
|
|
|
id: string,
|
|
|
|
|
analytics?: Log["analytics"],
|
|
|
|
|
) => ({
|
|
|
|
|
type: ReduxActionTypes.DEBUGGER_DELETE_ERROR_LOG_INIT,
|
|
|
|
|
payload: {
|
|
|
|
|
id,
|
|
|
|
|
analytics,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const deleteErrorLog = (id: string) => ({
|
|
|
|
|
type: ReduxActionTypes.DEBUGGER_DELETE_ERROR_LOG,
|
|
|
|
|
payload: id,
|
|
|
|
|
});
|
|
|
|
|
|
2021-07-08 05:31:08 +00:00
|
|
|
// Only used for analytics
|
|
|
|
|
export const logDebuggerErrorAnalytics = (
|
|
|
|
|
payload: LogDebuggerErrorAnalyticsPayload,
|
|
|
|
|
) => ({
|
|
|
|
|
type: ReduxActionTypes.DEBUGGER_ERROR_ANALYTICS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
2021-08-25 04:34:42 +00:00
|
|
|
|
|
|
|
|
export const hideDebuggerErrors = (payload: boolean) => ({
|
|
|
|
|
type: ReduxActionTypes.HIDE_DEBUGGER_ERRORS,
|
|
|
|
|
payload,
|
|
|
|
|
});
|
2021-09-20 11:20:22 +00:00
|
|
|
|
2021-10-07 06:53:58 +00:00
|
|
|
export const setCurrentTab = (payload: string) => ({
|
2021-09-20 11:20:22 +00:00
|
|
|
type: ReduxActionTypes.SET_CURRENT_DEBUGGER_TAB,
|
|
|
|
|
payload,
|
|
|
|
|
});
|