Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions superset-frontend/src/dashboard/components/DashboardBuilder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { Sticky, StickyContainer } from 'react-sticky';
import { TabContainer, TabContent, TabPane } from 'react-bootstrap';
import { styled } from '@superset-ui/core';

import BuilderComponentPane from './BuilderComponentPane';
import DashboardHeader from '../containers/DashboardHeader';
Expand Down Expand Up @@ -70,6 +71,44 @@ const defaultProps = {
colorScheme: undefined,
};

const StyledDashboardContent = styled.div`
display: flex;
flex-direction: row;
flex-wrap: nowrap;
height: auto;

.grid-container .dashboard-component-tabs {
box-shadow: none;
padding-left: 0;
}

& > div:first-child {
width: 100%;
flex-grow: 1;
position: relative;
}

.dashboard-component-chart-holder {
// transitionable traits to show filter relevance
transition: all 0.2s;
border: 2px solid transparent;
box-shadow: 0px 0px 0px #fff;
}
&.focused-filter-field {
.dashboard-component-chart-holder {
background: none;
filter: blur(2px);
opacity: 0.3;
&.scoped-to-focused-filter {
border-color: ${({ theme }) => theme.colors.primary.light2};
filter: blur(0);
opacity: 1;
box-shadow: 0px 0px 8px ${({ theme }) => theme.colors.primary.light2};
}
}
}
`;

class DashboardBuilder extends React.Component {
static shouldFocusTabs(event, container) {
// don't focus the tabs when we click on a tab
Expand Down Expand Up @@ -224,9 +263,8 @@ class DashboardBuilder extends React.Component {
)}
</Sticky>

<div
<StyledDashboardContent
className={cx(
'dashboard-content',
focusedFilterField && 'focused-filter-field',
)}
>
Expand Down Expand Up @@ -284,7 +322,7 @@ class DashboardBuilder extends React.Component {
colorScheme={colorScheme}
/>
)}
</div>
</StyledDashboardContent>
<ToastPresenter />
</StickyContainer>
);
Expand Down
18 changes: 0 additions & 18 deletions superset-frontend/src/dashboard/stylesheets/builder.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
box-shadow: 0 4px 4px 0 fade(@darkest, @opacity-light); /* @TODO color */
}

.dashboard-content {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
height: auto;
}

/* only top-level tabs have popover, give it more padding to match header + tabs */
.dashboard > .with-popover-menu > .popover-menu {
left: 24px;
Expand All @@ -49,17 +42,6 @@
padding-left: 8px; /* note this is added to tab-level padding, to match header */
}

.dashboard-content .grid-container .dashboard-component-tabs {
box-shadow: none;
padding-left: 0;
}

.dashboard-content > div:first-child {
width: 100%;
flex-grow: 1;
position: relative;
}

.dropdown-toggle.btn.btn-primary .caret {
color: @lightest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@
box-shadow: none;
transition: box-shadow 1s ease-in-out;
}

&.scoped-to-focused-filter {
border: 1px solid green;
}

&.unscoped-to-focused-filter {
border: 1px solid red;
}
}

.dashboard-chart {
Expand Down