Skip to content

Commit

Permalink
[dashboard perf logging] add dashboard url anchor component id (#9202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo committed Feb 26, 2020
1 parent 57321dc commit 883b0d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion superset-frontend/src/dashboard/components/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import OmniContainer from '../../components/OmniContainer';
import { areObjectsEqual } from '../../reduxUtils';

import '../stylesheets/index.less';
import getLocationHash from '../util/getLocationHash';

const propTypes = {
actions: PropTypes.shape({
Expand Down Expand Up @@ -83,7 +84,12 @@ class Dashboard extends React.PureComponent {
}

componentDidMount() {
this.props.actions.logEvent(LOG_ACTIONS_MOUNT_DASHBOARD);
const eventData = {};
const directLinkComponentId = getLocationHash();
if (directLinkComponentId) {
eventData.target_id = directLinkComponentId;
}
this.props.actions.logEvent(LOG_ACTIONS_MOUNT_DASHBOARD, eventData);
}

UNSAFE_componentWillReceiveProps(nextProps) {
Expand Down

0 comments on commit 883b0d0

Please sign in to comment.