Skip to content

Commit

Permalink
[Infra UI] Work around IE11 flexbox alignment problems (elastic#25224)
Browse files Browse the repository at this point in the history
This works around some IE11 bugs with flexbox alignment, particularly [Flexbug #4](https://github.com/philipwalton/flexbugs#4-flex-shorthand-declarations-with-unitless-flex-basis-values-are-ignored) and a misinterpretation of the default alignment.

fixes elastic#24758
fixes elastic#24839
fixes elastic#24791
fixes elastic#24757
  • Loading branch information
weltenwort committed Nov 7, 2018
1 parent d68e9a7 commit 9187d58
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
7 changes: 6 additions & 1 deletion x-pack/plugins/infra/public/components/empty_page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import React from 'react';
import styled from 'styled-components';

interface EmptyPageProps {
message: string;
Expand All @@ -22,7 +23,7 @@ export const EmptyPage: React.SFC<EmptyPageProps> = ({
title,
...rest
}) => (
<EuiEmptyPrompt
<CenteredEmptyPrompt
title={<h2>{title}</h2>}
body={<p>{message}</p>}
actions={
Expand All @@ -33,3 +34,7 @@ export const EmptyPage: React.SFC<EmptyPageProps> = ({
{...rest}
/>
);

const CenteredEmptyPrompt = styled(EuiEmptyPrompt)`
align-self: center;
`;
6 changes: 3 additions & 3 deletions x-pack/plugins/infra/public/components/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export const ColumnarPage = styled.div`
display: flex;
flex-direction: column;
align-items: stretch;
flex: 1 0 0;
flex: 1 0 0%;
`;

export const PageContent = styled.div`
flex: 1 0 0;
flex: 1 0 0%;
display: flex;
flex-direction: row;
background-color: ${props => props.theme.eui.euiColorEmptyShade};
`;

export const FlexPage = styled(EuiPage)`
flex: 1 0 0;
flex: 1 0 0%;
`;
8 changes: 6 additions & 2 deletions x-pack/plugins/infra/public/components/waffle/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class Waffle extends React.Component<Props, {}> {
return <InfraLoadingPanel height="100%" width="100%" text="Loading data" />;
} else if (!loading && map && map.length === 0) {
return (
<EuiEmptyPrompt
<CenteredEmptyPrompt
title={<h2>There is no data to display.</h2>}
titleSize="m"
body={<p>Try adjusting your time or filter.</p>}
Expand Down Expand Up @@ -206,7 +206,7 @@ export class Waffle extends React.Component<Props, {}> {
}

const WaffleMapOuterContiner = styled.div`
flex: 1 0 0;
flex: 1 0 0%;
display: flex;
justify-content: center;
flex-direction: column;
Expand All @@ -222,3 +222,7 @@ const WaffleMapInnerContainer = styled.div`
align-content: flex-start;
padding: 10px;
`;

const CenteredEmptyPrompt = styled(EuiEmptyPrompt)`
align-self: center;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class InfraKibanaFrameworkAdapter implements InfraFrameworkAdapter {
template: `
<div
id="${ROOT_ELEMENT_ID}"
style="display: flex; flex-direction: column; align-items: stretch; flex: 1 0 0; overflow: hidden;"
style="display: flex; flex-direction: column; align-items: stretch; flex: 1 0 0%; overflow: hidden;"
></div>
`,
}));
Expand All @@ -140,7 +140,7 @@ export class InfraKibanaFrameworkAdapter implements InfraFrameworkAdapter {
uiRoutes.otherwise({
reloadOnSearch: false,
template:
'<infra-ui-kibana-adapter style="display: flex; align-items: stretch; flex: 1 0 0;"></infra-ui-kibana-adapter>',
'<infra-ui-kibana-adapter style="display: flex; align-items: stretch; flex: 1 0 0%;"></infra-ui-kibana-adapter>',
});
};
}
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/pages/logs/page_content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ export const LogsPageContent: React.SFC = () => (
);

const LogPageEventStreamColumn = styled.div`
flex: 1 0 0;
flex: 1 0 0%;
overflow: hidden;
display: flex;
flex-direction: column;
`;

const LogPageMinimapColumn = styled.div`
flex: 1 0 0;
flex: 1 0 0%;
overflow: hidden;
min-width: 100px;
max-width: 100px;
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/public/pages/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const EuiSideNavContainer = styled.div`
`;

const MetricsDetailsPageColumn = styled.div`
flex: 1 0 0;
flex: 1 0 0%;
display: flex;
flex-direction: column;
`;
Expand Down

0 comments on commit 9187d58

Please sign in to comment.