Skip to content

Commit

Permalink
Make sidebar and chart border align and remove datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Dec 14, 2020
1 parent f729bce commit 8701a94
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import { useRouteMatch } from 'react-router-dom';
import { UptimeDatePicker } from '../uptime_date_picker';
import { SyntheticsCallout } from '../../overview/synthetics_callout';
import { PageTabs } from './page_tabs';
import { CERTIFICATES_ROUTE, MONITOR_ROUTE, SETTINGS_ROUTE } from '../../../../common/constants';
import {
CERTIFICATES_ROUTE,
MONITOR_ROUTE,
SETTINGS_ROUTE,
STEP_DETAIL_ROUTE,
} from '../../../../common/constants';
import { CertRefreshBtn } from '../../certificates/cert_refresh_btn';
import { ToggleAlertFlyoutButton } from '../../overview/alerts/alerts_containers';

Expand All @@ -34,11 +39,12 @@ const StyledPicker = styled(EuiFlexItem)`
export const PageHeader = () => {
const isCertRoute = useRouteMatch(CERTIFICATES_ROUTE);
const isSettingsRoute = useRouteMatch(SETTINGS_ROUTE);
const isStepDetailRoute = useRouteMatch(STEP_DETAIL_ROUTE);

const DatePickerComponent = () =>
isCertRoute ? (
<CertRefreshBtn />
) : (
) : isStepDetailRoute ? null : (
<StyledPicker grow={false} style={{ flexBasis: 485 }}>
<UptimeDatePicker />
</StyledPicker>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const MAIN_GROW_SIZE = 8;
export const SIDEBAR_GROW_SIZE = 2;
// Axis height
// NOTE: This isn't a perfect solution - changes in font size etc within charts could change the ideal height here.
export const FIXED_AXIS_HEIGHT = 33;
export const FIXED_AXIS_HEIGHT = 32;
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const WaterfallChartFixedTopContainer = euiStyled.div`
position: sticky;
top: 0;
z-index: ${(props) => props.theme.eui.euiZLevel4};
border-bottom: ${(props) => `1px solid ${props.theme.eui.euiColorLightShade}`};
`;

export const WaterfallChartFixedTopContainerSidebarCover = euiStyled(EuiPanel)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const WaterfallChart = ({
<EuiFlexGroup gutterSize="none" responsive={false}>
{shouldRenderSidebar && (
<EuiFlexItem grow={SIDEBAR_GROW_SIZE}>
<WaterfallChartFixedTopContainerSidebarCover paddingSize="none" />
<WaterfallChartFixedTopContainerSidebarCover paddingSize="none" hasShadow={false} />
</EuiFlexItem>
)}
<EuiFlexItem grow={shouldRenderSidebar ? MAIN_GROW_SIZE : true}>
Expand All @@ -131,10 +131,13 @@ export const WaterfallChart = ({
tickFormat={tickFormat}
domain={domain}
showGridLines={true}
style={{
axisLine: {
visible: false,
},
}}
/>

<Axis id="values" position={Position.Left} tickFormat={() => ''} />

<BarSeries
id="waterfallItems"
xScaleType={ScaleType.Linear}
Expand All @@ -150,7 +153,7 @@ export const WaterfallChart = ({
</EuiFlexItem>
</EuiFlexGroup>
</WaterfallChartFixedTopContainer>
<EuiFlexGroup gutterSize="none" responsive={false}>
<EuiFlexGroup gutterSize="none" responsive={false} style={{ paddingTop: '10px' }}>
{shouldRenderSidebar && (
<Sidebar items={sidebarItems!} height={generatedHeight} render={renderSidebarItem!} />
)}
Expand All @@ -170,10 +173,13 @@ export const WaterfallChart = ({
tickFormat={tickFormat}
domain={domain}
showGridLines={true}
style={{
axisLine: {
visible: false,
},
}}
/>

<Axis id="values" position={Position.Left} tickFormat={() => ''} />

<BarSeries
id="waterfallItems"
xScaleType={ScaleType.Linear}
Expand Down

0 comments on commit 8701a94

Please sign in to comment.