Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metrics UI] Responsive fixes for Legend Options / Bottom Drawer #86009

Merged
merged 11 commits into from
Jan 6, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup alignItems={'center'}>
<EuiFlexGroup alignItems={'center'} responsive={false}>
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize={'s'} alignItems={'center'}>
<EuiFlexGroup gutterSize={'s'} alignItems={'center'} responsive={false}>
<EuiFlexItem grow={false}>
<EuiIcon color={colorTransformer(chartMetric.color)} type={'dot'} />
</EuiFlexItem>
Expand All @@ -240,7 +240,7 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize={'s'} alignItems={'center'}>
<EuiFlexGroup gutterSize={'s'} alignItems={'center'} responsive={false}>
<EuiFlexItem
grow={false}
style={{ backgroundColor: '#D36086', height: 5, width: 10 }}
Expand Down Expand Up @@ -317,6 +317,9 @@ const TimelineHeader = euiStyled.div`
width: 100%;
padding: ${(props) => props.theme.eui.paddingSizes.s} ${(props) =>
props.theme.eui.paddingSizes.m};
@media only screen and (max-width: 767px) {
margin-top: 30px;
}
`;

const TimelineChartContainer = euiStyled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ export const LegendControls = ({
button={buttonComponent}
>
<EuiPopoverTitle>Legend Options</EuiPopoverTitle>
<EuiForm style={{ width: 500 }}>
<EuiForm style={{ minWidth: 400 }}>
<EuiFormRow
fullWidth
display="columnCompressed"
label={i18n.translate('xpack.infra.legendControls.colorPaletteLabel', {
defaultMessage: 'Color palette',
Expand All @@ -211,7 +210,6 @@ export const LegendControls = ({
</>
</EuiFormRow>
<EuiFormRow
fullWidth
display="columnCompressed"
label={i18n.translate('xpack.infra.legendControls.stepsLabel', {
defaultMessage: 'Number of colors',
Expand All @@ -220,12 +218,11 @@ export const LegendControls = ({
<EuiRange
id="steps"
min={2}
max={20}
max={18}
step={1}
value={draftLegend.steps}
onChange={handleStepsChange}
showValue
compressed
fullWidth
/>
</EuiFormRow>
Expand All @@ -243,6 +240,10 @@ export const LegendControls = ({
checked={draftLegend.reverseColors}
onChange={handleReverseColors}
compressed
style={{
position: 'relative',
top: '8px',
}}
/>
</EuiFormRow>
<EuiFormRow
Expand All @@ -259,6 +260,10 @@ export const LegendControls = ({
checked={draftAuto}
onChange={handleAutoChange}
compressed
style={{
position: 'relative',
top: '8px',
}}
/>
</EuiFormRow>
<EuiFormRow
Expand Down Expand Up @@ -316,7 +321,7 @@ export const LegendControls = ({
</div>
</EuiFormRow>
<EuiSpacer size="m" />
<EuiFlexGroup justifyContent="flexEnd">
<EuiFlexGroup justifyContent="flexEnd" responsive={false}>
<EuiFlexItem grow={false}>
<EuiButtonEmpty type="submit" size="s" onClick={handleCancelClick}>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const PalettePreview = ({ steps, palette, reverse }: Props) => {
};

const Swatch = euiStyled.div`
width: 16px;
width: 15px;
height: 12px;
flex: 0 0 auto;
&:first-child {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Props {

export const SwatchLabel = ({ label, color }: Props) => {
return (
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<EuiFlexItem grow={false}>
<EuiColorPickerSwatch color={color} />
</EuiFlexItem>
Expand Down