superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccwilli...@apache.org
Subject [incubator-superset] 01/02: [top-level-tabs] add 'Collapse tab content' to delete tabs button
Date Sat, 17 Mar 2018 00:08:34 GMT
This is an automated email from the ASF dual-hosted git repository.

ccwilliams pushed a commit to branch chris--top-level-tabs
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 2b532f6392e3766a8db1f63defd2567c1cfe94f1
Author: Chris Williams <chris.williams@airbnb.com>
AuthorDate: Fri Mar 16 14:58:54 2018 -0700

    [top-level-tabs] add 'Collapse tab content' to delete tabs button
---
 .../javascripts/dashboard/v2/components/DashboardBuilder.jsx | 10 ++++++++--
 .../javascripts/dashboard/v2/components/IconButton.jsx       | 12 ++++++++----
 .../assets/javascripts/dashboard/v2/stylesheets/buttons.less |  6 ++++++
 .../dashboard/v2/stylesheets/components/tabs.less            |  5 +++--
 superset/assets/stylesheets/superset.less                    |  2 +-
 5 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/superset/assets/javascripts/dashboard/v2/components/DashboardBuilder.jsx b/superset/assets/javascripts/dashboard/v2/components/DashboardBuilder.jsx
index 4f4fe33..51e1897 100644
--- a/superset/assets/javascripts/dashboard/v2/components/DashboardBuilder.jsx
+++ b/superset/assets/javascripts/dashboard/v2/components/DashboardBuilder.jsx
@@ -6,7 +6,7 @@ import { DragDropContext } from 'react-dnd';
 import BuilderComponentPane from './BuilderComponentPane';
 import DashboardHeader from '../containers/DashboardHeader';
 import DashboardGrid from './DashboardGrid';
-import DeleteComponentButton from './DeleteComponentButton';
+import IconButton from './IconButton';
 import DragDroppable from './dnd/DragDroppable';
 import DashboardComponent from '../containers/DashboardComponent';
 import WithPopoverMenu from './menu/WithPopoverMenu';
@@ -86,7 +86,13 @@ class DashboardBuilder extends React.Component {
         {topLevelTabs &&
           <WithPopoverMenu
             shouldFocus={DashboardBuilder.shouldFocusTabs}
-            menuItems={[<DeleteComponentButton onDelete={deleteTopLevelTabs} />]}
+            menuItems={[
+              <IconButton
+                className="fa fa-level-down"
+                label="Collapse tab content"
+                onClick={deleteTopLevelTabs}
+              />,
+            ]}
           >
             <DashboardComponent
               id={topLevelTabs.id}
diff --git a/superset/assets/javascripts/dashboard/v2/components/IconButton.jsx b/superset/assets/javascripts/dashboard/v2/components/IconButton.jsx
index 98044c9..18fd3b1 100644
--- a/superset/assets/javascripts/dashboard/v2/components/IconButton.jsx
+++ b/superset/assets/javascripts/dashboard/v2/components/IconButton.jsx
@@ -1,14 +1,15 @@
 import React from 'react';
 import PropTypes from 'prop-types';
-import cx from 'classnames';
 
 const propTypes = {
   onClick: PropTypes.func.isRequired,
   className: PropTypes.string,
+  label: PropTypes.string,
 };
 
 const defaultProps = {
   className: null,
+  label: null,
 };
 
 export default class IconButton extends React.PureComponent {
@@ -24,14 +25,17 @@ export default class IconButton extends React.PureComponent {
   }
 
   render() {
-    const { className } = this.props;
+    const { className, label } = this.props;
     return (
       <div
-        className={cx('icon-button', className)}
+        className="icon-button"
         onClick={this.handleClick}
         tabIndex="0"
         role="button"
-      />
+      >
+        <span className={className} />
+        {label && <span className="icon-button-label">{label}</span>}
+      </div>
     );
   }
 }
diff --git a/superset/assets/javascripts/dashboard/v2/stylesheets/buttons.less b/superset/assets/javascripts/dashboard/v2/stylesheets/buttons.less
index 7ab4118..41ca478 100644
--- a/superset/assets/javascripts/dashboard/v2/stylesheets/buttons.less
+++ b/superset/assets/javascripts/dashboard/v2/stylesheets/buttons.less
@@ -15,3 +15,9 @@
   outline: none;
   text-decoration: none;
 }
+
+.icon-button-label {
+  color: @gray-dark;
+  padding-left: 8px;
+  font-size: 0.9em;
+}
diff --git a/superset/assets/javascripts/dashboard/v2/stylesheets/components/tabs.less b/superset/assets/javascripts/dashboard/v2/stylesheets/components/tabs.less
index e70459e..f67c151 100644
--- a/superset/assets/javascripts/dashboard/v2/stylesheets/components/tabs.less
+++ b/superset/assets/javascripts/dashboard/v2/stylesheets/components/tabs.less
@@ -22,6 +22,7 @@
   border: none;
   padding: 12px 0 14px 0;
   font-size: 15px;
+  margin-right: 0;
 }
 
 .dashboard-component-tabs .nav-tabs > li.active > a {
@@ -72,8 +73,8 @@
   opacity: 0.4;
 }
 
-.dashboard-component-tabs li .fa {
-  color: @almost-black;
+.dashboard-component-tabs li .fa-plus {
+  color: @gray-dark;
   font-size: 14px;
   margin-top: 3px;
 }
diff --git a/superset/assets/stylesheets/superset.less b/superset/assets/stylesheets/superset.less
index 14e8475..a7a69b1 100644
--- a/superset/assets/stylesheets/superset.less
+++ b/superset/assets/stylesheets/superset.less
@@ -232,7 +232,7 @@ table.table-no-hover tr:hover {
   background: transparent;
   border: none;
   box-shadow: none;
-  padding-left: 0;
+  padding: 0;
 }
 
 .editable-title input[type="button"] {

-- 
To stop receiving notification emails like this one, please contact
ccwilliams@apache.org.

Mime
View raw message