Skip to content

Commit

Permalink
[Metrics UI] Responsive fixes for Legend Options / Bottom Drawer (#86009
Browse files Browse the repository at this point in the history
) (#87505)

Responsive fixes for Legend Options / Bottom Drawer
  • Loading branch information
katefarrar authored Jan 6, 2021
1 parent 16aae3b commit 0987604
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
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

0 comments on commit 0987604

Please sign in to comment.