)}
diff --git a/superset-frontend/src/dashboard/components/ColorComponentPane.jsx b/superset-frontend/src/dashboard/components/ColorComponentPane.jsx
deleted file mode 100644
index ee6aec5852..0000000000
--- a/superset-frontend/src/dashboard/components/ColorComponentPane.jsx
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-/* eslint-env browser */
-import PropTypes from 'prop-types';
-import React from 'react';
-import { getCategoricalSchemeRegistry } from '@superset-ui/color';
-import { t } from '@superset-ui/translation';
-
-import ColorSchemeControl from '../../explore/components/controls/ColorSchemeControl';
-import { BUILDER_PANE_TYPE } from '../util/constants';
-
-const propTypes = {
- showBuilderPane: PropTypes.func.isRequired,
- setColorSchemeAndUnsavedChanges: PropTypes.func.isRequired,
- colorScheme: PropTypes.string,
-};
-
-const defaultProps = {
- colorScheme: undefined,
-};
-
-class ColorComponentPane extends React.PureComponent {
- constructor(props) {
- super(props);
- this.state = { hovered: false };
- this.categoricalSchemeRegistry = getCategoricalSchemeRegistry();
- this.getChoices = this.getChoices.bind(this);
- this.getSchemes = this.getSchemes.bind(this);
- this.onCloseButtonClick = this.onCloseButtonClick.bind(this);
- this.onMouseEnter = this.setHover.bind(this, true);
- this.onMouseLeave = this.setHover.bind(this, false);
- }
-
- onCloseButtonClick() {
- this.props.showBuilderPane(BUILDER_PANE_TYPE.NONE);
- }
-
- getChoices() {
- return this.categoricalSchemeRegistry.keys().map(s => [s, s]);
- }
-
- getSchemes() {
- return this.categoricalSchemeRegistry.getMap();
- }
-
- setHover(hovered) {
- this.setState({ hovered });
- }
-
- render() {
- const { setColorSchemeAndUnsavedChanges, colorScheme } = this.props;
-
- return (
-
-
-
- {'Color Settings'}
-
-
-
-
-
-
-
- );
- }
-}
-
-ColorComponentPane.propTypes = propTypes;
-ColorComponentPane.defaultProps = defaultProps;
-
-export default ColorComponentPane;
diff --git a/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
new file mode 100644
index 0000000000..edbfa2adcd
--- /dev/null
+++ b/superset-frontend/src/dashboard/components/ColorSchemeControlWrapper.jsx
@@ -0,0 +1,72 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/* eslint-env browser */
+import PropTypes from 'prop-types';
+import React from 'react';
+import { getCategoricalSchemeRegistry } from '@superset-ui/color';
+import { t } from '@superset-ui/translation';
+
+import ColorSchemeControl from 'src/explore/components/controls/ColorSchemeControl';
+
+const propTypes = {
+ onChange: PropTypes.func.isRequired,
+ colorScheme: PropTypes.string,
+};
+
+const defaultProps = {
+ colorScheme: undefined,
+ onChange: () => {},
+};
+
+class ColorSchemeControlWrapper extends React.PureComponent {
+ constructor(props) {
+ super(props);
+ this.state = { hovered: false };
+ this.categoricalSchemeRegistry = getCategoricalSchemeRegistry();
+ this.choices = this.categoricalSchemeRegistry.keys().map(s => [s, s]);
+ this.schemes = this.categoricalSchemeRegistry.getMap();
+ }
+ setHover(hovered) {
+ this.setState({ hovered });
+ }
+
+ render() {
+ const { colorScheme } = this.props;
+ return (
+
+ );
+ }
+}
+
+ColorSchemeControlWrapper.propTypes = propTypes;
+ColorSchemeControlWrapper.defaultProps = defaultProps;
+
+export default ColorSchemeControlWrapper;
diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder.jsx b/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
index de9a94eddd..5ca6f2db11 100644
--- a/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
+++ b/superset-frontend/src/dashboard/components/DashboardBuilder.jsx
@@ -39,7 +39,6 @@ import getDragDropManager from '../util/getDragDropManager';
import findTabIndexByComponentId from '../util/findTabIndexByComponentId';
import {
- BUILDER_PANE_TYPE,
DASHBOARD_GRID_ID,
DASHBOARD_ROOT_ID,
DASHBOARD_ROOT_DEPTH,
@@ -56,7 +55,6 @@ const propTypes = {
deleteTopLevelTabs: PropTypes.func.isRequired,
editMode: PropTypes.bool.isRequired,
showBuilderPane: PropTypes.func.isRequired,
- builderPaneType: PropTypes.string.isRequired,
colorScheme: PropTypes.string,
setColorSchemeAndUnsavedChanges: PropTypes.func.isRequired,
handleComponentDrop: PropTypes.func.isRequired,
@@ -161,7 +159,6 @@ class DashboardBuilder extends React.Component {
dashboardLayout,
editMode,
showBuilderPane,
- builderPaneType,
setColorSchemeAndUnsavedChanges,
colorScheme,
} = this.props;
@@ -265,11 +262,10 @@ class DashboardBuilder extends React.Component {
)}
- {editMode && builderPaneType !== BUILDER_PANE_TYPE.NONE && (
+ {editMode && (
diff --git a/superset-frontend/src/dashboard/components/Header.jsx b/superset-frontend/src/dashboard/components/Header.jsx
index 3d04284829..89f2084ed8 100644
--- a/superset-frontend/src/dashboard/components/Header.jsx
+++ b/superset-frontend/src/dashboard/components/Header.jsx
@@ -21,20 +21,21 @@ import moment from 'moment';
import React from 'react';
import PropTypes from 'prop-types';
import styled from '@superset-ui/style';
+import { ButtonGroup } from 'react-bootstrap';
import { CategoricalColorNamespace } from '@superset-ui/color';
import { t } from '@superset-ui/translation';
+import Icon from 'src/components/Icon';
+
import HeaderActionsDropdown from './HeaderActionsDropdown';
import EditableTitle from '../../components/EditableTitle';
import Button from '../../components/Button';
import FaveStar from '../../components/FaveStar';
-import FilterScopeModal from './filterscope/FilterScopeModal';
import PublishedStatus from './PublishedStatus';
import UndoRedoKeylisteners from './UndoRedoKeylisteners';
import { chartPropShape } from '../util/propShapes';
import {
- BUILDER_PANE_TYPE,
UNDO_LIMIT,
SAVE_TYPE_OVERWRITE,
DASHBOARD_POSITION_DATA_LIMIT,
@@ -62,6 +63,7 @@ const propTypes = {
customCss: PropTypes.string.isRequired,
colorNamespace: PropTypes.string,
colorScheme: PropTypes.string,
+ setColorSchemeAndUnsavedChanges: PropTypes.func.isRequired,
isStarred: PropTypes.bool.isRequired,
isPublished: PropTypes.bool.isRequired,
isLoading: PropTypes.bool.isRequired,
@@ -75,7 +77,6 @@ const propTypes = {
editMode: PropTypes.bool.isRequired,
setEditMode: PropTypes.func.isRequired,
showBuilderPane: PropTypes.func.isRequired,
- builderPaneType: PropTypes.string.isRequired,
updateCss: PropTypes.func.isRequired,
logEvent: PropTypes.func.isRequired,
hasUnsavedChanges: PropTypes.bool.isRequired,
@@ -124,10 +125,6 @@ class Header extends React.PureComponent {
this.handleChangeText = this.handleChangeText.bind(this);
this.handleCtrlZ = this.handleCtrlZ.bind(this);
this.handleCtrlY = this.handleCtrlY.bind(this);
- this.onInsertComponentsButtonClick = this.onInsertComponentsButtonClick.bind(
- this,
- );
- this.onColorsButtonClick = this.onColorsButtonClick.bind(this);
this.toggleEditMode = this.toggleEditMode.bind(this);
this.forceRefresh = this.forceRefresh.bind(this);
this.startPeriodicRender = this.startPeriodicRender.bind(this);
@@ -162,14 +159,6 @@ class Header extends React.PureComponent {
clearTimeout(this.ctrlZTimeout);
}
- onInsertComponentsButtonClick() {
- this.props.showBuilderPane(BUILDER_PANE_TYPE.ADD_COMPONENTS);
- }
-
- onColorsButtonClick() {
- this.props.showBuilderPane(BUILDER_PANE_TYPE.COLORS);
- }
-
handleChangeText(nextText) {
const { updateDashboardTitle, onChange } = this.props;
if (nextText && this.props.dashboardTitle !== nextText) {
@@ -340,6 +329,7 @@ class Header extends React.PureComponent {
expandedSlices,
customCss,
colorNamespace,
+ setColorSchemeAndUnsavedChanges,
colorScheme,
onUndo,
onRedo,
@@ -350,7 +340,6 @@ class Header extends React.PureComponent {
updateCss,
editMode,
isPublished,
- builderPaneType,
dashboardInfo,
hasUnsavedChanges,
isLoading,
@@ -366,7 +355,6 @@ class Header extends React.PureComponent {
const refreshWarning =
dashboardInfo.common.conf
.SUPERSET_DASHBOARD_PERIODICAL_REFRESH_WARNING_MESSAGE;
- const popButton = hasUnsavedChanges;
return (
@@ -399,92 +387,63 @@ class Header extends React.PureComponent {
{userCanSaveAs && (