Skip to content

Commit e4d1735

Browse files
justinparksadpandajoe
authored andcommitted
fix(logging): missing path in event data (#32708)
(cherry picked from commit cd5a943)
1 parent ade8abb commit e4d1735

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

superset-frontend/src/middleware/loggerMiddleware.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ const loggerMiddleware = store => next => action => {
8181
const { eventName } = action.payload;
8282
let { eventData = {} } = action.payload;
8383

84-
if (dashboardInfo?.id && eventData.path?.includes('/dashboard/')) {
84+
const path = eventData.path || window?.location?.href;
85+
86+
if (dashboardInfo?.id && path?.includes('/dashboard/')) {
8587
logMetadata = {
8688
source: 'dashboard',
8789
source_id: dashboardInfo.id,
@@ -95,7 +97,7 @@ const loggerMiddleware = store => next => action => {
9597
...(explore.slice.slice_id && { slice_id: explore.slice.slice_id }),
9698
...logMetadata,
9799
};
98-
} else if (eventData.path?.includes('/sqllab/')) {
100+
} else if (path?.includes('/sqllab/')) {
99101
const editor = sqlLab.queryEditors.find(
100102
({ id }) => id === sqlLab.tabHistory.slice(-1)[0],
101103
);

0 commit comments

Comments
 (0)