Skip to content

Commit 34ebb8a

Browse files
authored
chore(sqllab): add logging for switching south panel tabs (#36168) (#36369)
1 parent 853143a commit 34ebb8a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

superset-frontend/src/SqlLab/components/SouthPane/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import Icons from 'src/components/Icons';
2929
import { SqlLabRootState } from 'src/SqlLab/types';
3030
import { useExtensionsContext } from 'src/extensions/ExtensionsContext';
3131
import ExtensionsManager from 'src/extensions/ExtensionsManager';
32+
import useLogAction from 'src/logger/useLogAction';
33+
import { LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB } from 'src/logger/LogUtils';
3234
import QueryHistory from '../QueryHistory';
3335
import {
3436
STATUS_OPTIONS,
@@ -128,8 +130,10 @@ const SouthPane = ({
128130
);
129131
const innerTabContentHeight = height - TAB_HEIGHT;
130132
const southPaneRef = createRef<HTMLDivElement>();
133+
const logAction = useLogAction({ sqlEditorId: queryEditorId });
131134
const switchTab = (id: string) => {
132135
dispatch(setActiveSouthPaneTab(id));
136+
logAction(LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB, { tab: id });
133137
};
134138
const removeTable = useCallback(
135139
(key, action) => {

superset-frontend/src/logger/LogUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export const LOG_ACTIONS_SQLLAB_COPY_RESULT_TO_CLIPBOARD =
8585
'sqllab_copy_result_to_clipboard';
8686
export const LOG_ACTIONS_SQLLAB_CREATE_CHART = 'sqllab_create_chart';
8787
export const LOG_ACTIONS_SQLLAB_LOAD_TAB_STATE = 'sqllab_load_tab_state';
88+
export const LOG_ACTIONS_SQLLAB_SWITCH_SOUTH_PANE_TAB =
89+
'sqllab_switch_south_pane_tab';
8890

8991
// Log event types --------------------------------------------------------------
9092
export const LOG_EVENT_TYPE_TIMING = new Set([

0 commit comments

Comments
 (0)