diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index 0747c5b86a4..77c6e8a5b3a 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -31,6 +31,8 @@ import { SqlLabRootState } from 'src/SqlLab/types'; import { useExtensionsContext } from 'src/extensions/ExtensionsContext'; import ExtensionsManager from 'src/extensions/ExtensionsManager'; import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor'; +import useLogAction from 'src/logger/useLogAction'; +import { LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB } from 'src/logger/LogUtils'; import QueryHistory from '../QueryHistory'; import { STATUS_OPTIONS, @@ -126,8 +128,10 @@ const SouthPane = ({ [pinnedTables], ); const southPaneRef = createRef(); + const logAction = useLogAction({ sqlEditorId: queryEditorId }); const switchTab = (id: string) => { dispatch(setActiveSouthPaneTab(id)); + logAction(LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB, { tab: id }); }; const removeTable = useCallback( (key, action) => { diff --git a/superset-frontend/src/logger/LogUtils.ts b/superset-frontend/src/logger/LogUtils.ts index 913a3d5af7b..784be5af50e 100644 --- a/superset-frontend/src/logger/LogUtils.ts +++ b/superset-frontend/src/logger/LogUtils.ts @@ -85,6 +85,8 @@ export const LOG_ACTIONS_SQLLAB_COPY_RESULT_TO_CLIPBOARD = 'sqllab_copy_result_to_clipboard'; export const LOG_ACTIONS_SQLLAB_CREATE_CHART = 'sqllab_create_chart'; export const LOG_ACTIONS_SQLLAB_LOAD_TAB_STATE = 'sqllab_load_tab_state'; +export const LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB = + 'sqllab_switch_south_pane_tab'; // Log event types -------------------------------------------------------------- export const LOG_EVENT_TYPE_TIMING = new Set([