Skip to content

Commit

Permalink
make uptime filters responsive (#46560) (#46698)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Sep 27, 2019
1 parent 604a989 commit 48ebe3d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ const ListItem = styled.li`
background: ${props =>
props.selected ? theme.euiColorEmptyShade : theme.euiColorLightestShade};
}
@media only screen and (max-width: ${theme.euiBreakpoints.s}) {
margin-left: auto;
text-align: end;
}
}
`;

Expand All @@ -76,9 +80,16 @@ const Icon = styled.div`
`;

const TextValue = styled.div`
flex: 0 0 ${px(unit * 16)};
flex: 0 0 ${px(unit * 12)};
color: ${theme.euiColorDarkestShade};
padding: 0 ${px(units.half)};
@media only screen and (max-width: ${theme.euiBreakpoints.s}) {
flex: 0 0 ${px(unit * 8)};
}
@media only screen and (min-width: 1300px) {
flex: 0 0 ${px(unit * 16)};
}
`;

function getEuiIconType(type) {
Expand Down
18 changes: 14 additions & 4 deletions x-pack/legacy/plugins/uptime/public/pages/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query';
import React, { Fragment, useContext, useEffect, useState } from 'react';
import styled from 'styled-components';
import { getOverviewPageBreadcrumbs } from '../breadcrumbs';
import {
EmptyState,
Expand Down Expand Up @@ -44,6 +45,15 @@ export type UptimeSearchBarQueryChangeHandler = (queryChangedEvent: {
queryText?: string;
}) => void;

const EuiFlexItemStyled = styled(EuiFlexItem)`
&& {
min-width: 598px;
@media only screen and (max-width: 630px) {
min-width: initial;
}
}
`;

export const OverviewPage = ({ basePath, logOverviewPageLoad, setBreadcrumbs }: Props) => {
const { colors, setHeadingText } = useContext(UptimeSettingsContext);
const [getUrlParams, updateUrl] = useUrlParams();
Expand Down Expand Up @@ -118,11 +128,11 @@ export const OverviewPage = ({ basePath, logOverviewPageLoad, setBreadcrumbs }:
return (
<Fragment>
<EmptyState basePath={basePath} implementsCustomErrorState={true} variables={{}}>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem>
<EuiFlexGroup gutterSize="xs" wrap responsive>
<EuiFlexItem grow={1} style={{ flexBasis: 500 }}>
<KueryBar />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexItemStyled grow={true}>
<FilterGroup
currentFilter={urlFilters}
onFilterUpdate={(filtersKuery: string) => {
Expand All @@ -132,7 +142,7 @@ export const OverviewPage = ({ basePath, logOverviewPageLoad, setBreadcrumbs }:
}}
variables={sharedProps}
/>
</EuiFlexItem>
</EuiFlexItemStyled>
{error && <OverviewPageParsingErrorCallout error={error} />}
</EuiFlexGroup>
<EuiSpacer size="s" />
Expand Down
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/uptime/public/uptime_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const Application = (props: UptimeAppProps) => {
justifyContent="spaceBetween"
gutterSize="s"
>
<EuiFlexItem grow={false}>
<EuiFlexItem>
<EuiTitle>
<h1>{headingText}</h1>
</EuiTitle>
Expand Down

0 comments on commit 48ebe3d

Please sign in to comment.