diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx
index 6b0cbe3a3..3a0d25d60 100644
--- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx
+++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx
@@ -23,9 +23,9 @@ import userEvent from '@testing-library/user-event';
import fetchMock from 'fetch-mock';
import { HeaderDropdownProps } from 'src/dashboard/components/Header/types';
import injectCustomCss from 'src/dashboard/util/injectCustomCss';
-import HeaderActionsDropdown from '.';
+import { HeaderActionsDropdown } from '.';
-const createProps = () => ({
+const createProps = (): HeaderDropdownProps => ({
addSuccessToast: jest.fn(),
addDangerToast: jest.fn(),
customCss: '.ant-menu {margin-left: 100px;}',
@@ -66,6 +66,7 @@ const createProps = () => ({
userCanCurate: false,
lastModifiedTime: 0,
isDropdownVisible: true,
+ manageEmbedded: jest.fn(),
dataMask: {},
logEvent: jest.fn(),
});
@@ -228,9 +229,9 @@ test('should show the properties modal', async () => {
describe('UNSAFE_componentWillReceiveProps', () => {
let wrapper: any;
+
const mockedProps = createProps();
const props = { ...mockedProps, customCss: '' };
-
beforeEach(() => {
wrapper = shallow();
wrapper.setState({ css: props.customCss });
diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
index 8008558de..73d136e81 100644
--- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
+++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx
@@ -19,6 +19,7 @@
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { isEmpty } from 'lodash';
+import { connect } from 'react-redux';
import { t } from '@superset-ui/core';
import { Menu } from 'src/components/Menu';
import { URL_PARAMS } from 'src/constants';
@@ -46,6 +47,7 @@ const propTypes = {
customCss: PropTypes.string,
colorNamespace: PropTypes.string,
colorScheme: PropTypes.string,
+ directPathToChild: PropTypes.array,
onChange: PropTypes.func.isRequired,
updateCss: PropTypes.func.isRequired,
forceRefreshAllCharts: PropTypes.func.isRequired,
@@ -77,7 +79,11 @@ const defaultProps = {
refreshWarning: null,
};
-class HeaderActionsDropdown extends PureComponent {
+const mapStateToProps = state => ({
+ directPathToChild: state.dashboardState.directPathToChild,
+});
+
+export class HeaderActionsDropdown extends PureComponent {
static discardChanges() {
window.location.reload();
}
@@ -173,6 +179,7 @@ class HeaderActionsDropdown extends PureComponent {
addDangerToast,
setIsDropdownVisible,
isDropdownVisible,
+ directPathToChild,
...rest
} = this.props;
@@ -191,6 +198,8 @@ class HeaderActionsDropdown extends PureComponent {
const refreshIntervalOptions =
dashboardInfo.common?.conf?.DASHBOARD_AUTO_REFRESH_INTERVALS;
+ const dashboardComponentId = [...(directPathToChild || [])].pop();
+
return (