This is an automated email from the ASF dual-hosted git repository.
graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 16f4721 [fix] minor fix for Superset logger (#6922)
16f4721 is described below
commit 16f4721a9257e3ff842258d3a2d5b9555f7e1fb4
Author: Grace Guo <[email protected]>
AuthorDate: Wed Feb 20 15:38:45 2019 -0800
[fix] minor fix for Superset logger (#6922)
---
superset/assets/src/components/OmniContainer.jsx | 18 +++++-------------
superset/assets/src/dashboard/components/Dashboard.jsx | 7 +------
superset/assets/src/dashboard/components/Header.jsx | 4 ++--
.../src/dashboard/components/gridComponents/Tabs.jsx | 2 +-
4 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/superset/assets/src/components/OmniContainer.jsx
b/superset/assets/src/components/OmniContainer.jsx
index 792d8ba..edf33b9 100644
--- a/superset/assets/src/components/OmniContainer.jsx
+++ b/superset/assets/src/components/OmniContainer.jsx
@@ -24,14 +24,11 @@ import { SupersetClient } from '@superset-ui/connection';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
import Omnibar from 'omnibar';
import {
- Logger,
- ActionLog,
LOG_ACTIONS_OMNIBAR_TRIGGERED,
} from '../logger/LogUtils';
const propTypes = {
- impressionId: PropTypes.string.isRequired,
- dashboardId: PropTypes.number.isRequired,
+ logEvent: PropTypes.func.isRequired,
};
const getDashboards = query =>
@@ -71,20 +68,15 @@ class OmniContainer extends React.Component {
if (controlOrCommand && isFeatureEnabled(FeatureFlag.OMNIBAR)) {
const isK = event.key === 'k' || event.keyCode === 83;
if (isK) {
+ this.props.logEvent(LOG_ACTIONS_OMNIBAR_TRIGGERED, {
+ show_omni: !this.state.showOmni,
+ });
+
this.setState({ showOmni: !this.state.showOmni });
document
.getElementsByClassName('Omnibar')[0]
.focus();
-
- Logger.send(
- new ActionLog({
- impressionId: this.props.impressionId, // impo
- source: 'dashboard',
- sourceId: this.props.dashboardId, // sourceId:
this.props.dashboardId
- eventNames: LOG_ACTIONS_OMNIBAR_TRIGGERED,
- }),
- );
}
}
}
diff --git a/superset/assets/src/dashboard/components/Dashboard.jsx
b/superset/assets/src/dashboard/components/Dashboard.jsx
index d884e9a..dc1f054 100644
--- a/superset/assets/src/dashboard/components/Dashboard.jsx
+++ b/superset/assets/src/dashboard/components/Dashboard.jsx
@@ -167,14 +167,9 @@ class Dashboard extends React.PureComponent {
}
render() {
- const {
- impressionId,
- dashboardInfo: { id },
- } = this.props;
-
return (
<React.Fragment>
- <OmniContainer impressionId={impressionId} dashboardId={id} />
+ <OmniContainer logEvent={this.props.actions.logEvent} />
<DashboardBuilder />
</React.Fragment>
);
diff --git a/superset/assets/src/dashboard/components/Header.jsx
b/superset/assets/src/dashboard/components/Header.jsx
index bba1a72..b2238d0 100644
--- a/superset/assets/src/dashboard/components/Header.jsx
+++ b/superset/assets/src/dashboard/components/Header.jsx
@@ -171,10 +171,10 @@ class Header extends React.PureComponent {
}
toggleEditMode() {
- this.props.setEditMode(!this.props.editMode);
this.props.logEvent(LOG_ACTIONS_TOGGLE_EDIT_DASHBOARD, {
- editMode: !this.props.editMode,
+ edit_mode: !this.props.editMode,
});
+ this.props.setEditMode(!this.props.editMode);
}
overwriteDashboard() {
diff --git a/superset/assets/src/dashboard/components/gridComponents/Tabs.jsx
b/superset/assets/src/dashboard/components/gridComponents/Tabs.jsx
index e899a4a..dc9d599 100644
--- a/superset/assets/src/dashboard/components/gridComponents/Tabs.jsx
+++ b/superset/assets/src/dashboard/components/gridComponents/Tabs.jsx
@@ -109,7 +109,7 @@ class Tabs extends React.PureComponent {
});
} else if (tabIndex !== this.state.tabIndex) {
this.props.logEvent(LOG_ACTIONS_SELECT_DASHBOARD_TAB, {
- id: component.id,
+ tab_id: component.id,
index: tabIndex,
});