Skip to content

Commit

Permalink
fix(dashobard-edge-cutting): make to be not cut without Filter (#19080)
Browse files Browse the repository at this point in the history
  • Loading branch information
prosdev0107 committed Mar 10, 2022
1 parent 2726816 commit 158396f
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const StyledContent = styled.div<{
const StyledDashboardContent = styled.div<{
dashboardFiltersOpen: boolean;
editMode: boolean;
nativeFiltersEnabled: boolean;
}>`
display: flex;
flex-direction: row;
Expand All @@ -171,8 +172,13 @@ const StyledDashboardContent = styled.div<{
margin-top: ${({ theme }) => theme.gridUnit * 6}px;
margin-right: ${({ theme }) => theme.gridUnit * 8}px;
margin-bottom: ${({ theme }) => theme.gridUnit * 6}px;
margin-left: ${({ theme, dashboardFiltersOpen, editMode }) => {
if (!dashboardFiltersOpen && !editMode) {
margin-left: ${({
theme,
dashboardFiltersOpen,
editMode,
nativeFiltersEnabled,
}) => {
if (!dashboardFiltersOpen && !editMode && nativeFiltersEnabled) {
return 0;
}
return theme.gridUnit * 8;
Expand Down Expand Up @@ -289,9 +295,10 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {

const draggableStyle = useMemo(
() => ({
marginLeft: dashboardFiltersOpen || editMode ? 0 : -32,
marginLeft:
dashboardFiltersOpen || editMode || !nativeFiltersEnabled ? 0 : -32,
}),
[dashboardFiltersOpen, editMode],
[dashboardFiltersOpen, editMode, nativeFiltersEnabled],
);

const renderDraggableContent = useCallback(
Expand Down Expand Up @@ -402,6 +409,7 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
className="dashboard-content"
dashboardFiltersOpen={dashboardFiltersOpen}
editMode={editMode}
nativeFiltersEnabled={nativeFiltersEnabled}
>
{showDashboard ? (
<DashboardContainer topLevelTabs={topLevelTabs} />
Expand Down

0 comments on commit 158396f

Please sign in to comment.