diff --git a/superset/assets/src/explore/components/controls/DatasourceControl.css b/superset/assets/src/explore/components/controls/DatasourceControl.css new file mode 100644 index 000000000000..87ea089ef119 --- /dev/null +++ b/superset/assets/src/explore/components/controls/DatasourceControl.css @@ -0,0 +1,35 @@ +/** + * 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. + */ +#datasource_menu { + border-radius: 2px; + padding-left: 8px; + padding-right: 8px; +} + +#datasource_menu .caret { + position: relative; + padding-right: 8px; + margin-left: 4px; + color: #fff; + top: -8px; +} + +#datasource_menu + ul { + margin-top: 26px; +} diff --git a/superset/assets/src/explore/components/controls/DatasourceControl.jsx b/superset/assets/src/explore/components/controls/DatasourceControl.jsx index fc04ee978df8..a2a35c2271d2 100644 --- a/superset/assets/src/explore/components/controls/DatasourceControl.jsx +++ b/superset/assets/src/explore/components/controls/DatasourceControl.jsx @@ -36,6 +36,8 @@ import ColumnOption from '../../../components/ColumnOption'; import MetricOption from '../../../components/MetricOption'; import DatasourceModal from '../../../datasource/DatasourceModal'; import ChangeDatasourceModal from '../../../datasource/ChangeDatasourceModal'; +import TooltipWrapper from '../../../components/TooltipWrapper'; +import './DatasourceControl.css'; const propTypes = { onChange: PropTypes.func, @@ -115,56 +117,45 @@ class DatasourceControl extends React.PureComponent { } render() { - const { menuExpanded, showChangeDatasourceModal, showEditDatasourceModal } = this.state; + const { showChangeDatasourceModal, showEditDatasourceModal } = this.state; const { datasource, onChange, onDatasourceSave, value } = this.props; return (
- {t('Click to change the datasource')} - } - > -
- -
-
- - - } - className="label label-btn m-r-5" - bsSize="sm" - id="datasource_menu" + - - {t('Change Datasource')} - - {datasource.type === 'table' && - {t('Explore in SQL Lab')} - } - - {t('Edit Datasource')} - - + {t('Change Datasource')} + + {datasource.type === 'table' && + + {t('Explore in SQL Lab')} + } + + {t('Edit Datasource')} + + +