Skip to content

Commit

Permalink
[Logs UI] Fix z-index of logs page toolbar (elastic#54469)
Browse files Browse the repository at this point in the history
* Fix z-index of logs page toolbar

* Extract `FixedDatePicker` from log setup page, and use it in the stream page

* Clean unused import

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
Alejandro Fernández and elasticmachine committed Jan 20, 2020
1 parent 6d85a9e commit f2d5910
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 20 deletions.
25 changes: 25 additions & 0 deletions x-pack/legacy/plugins/infra/public/components/fixed_datepicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';

import { EuiDatePicker, EuiDatePickerProps } from '@elastic/eui';
import euiStyled from '../../../../common/eui_styled_components';

export const FixedDatePicker = euiStyled(
({
className,
inputClassName,
...datePickerProps
}: {
className?: string;
inputClassName?: string;
} & EuiDatePickerProps) => (
<EuiDatePicker {...datePickerProps} className={inputClassName} popperClassName={className} />
)
)`
z-index: 3 !important;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/

import {
EuiDatePicker,
EuiDatePickerProps,
EuiDescribedFormGroup,
EuiFlexGroup,
EuiFormControlLayout,
Expand All @@ -16,8 +14,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import moment, { Moment } from 'moment';
import React, { useMemo } from 'react';

import { euiStyled } from '../../../../../../../common/eui_styled_components';
import { FixedDatePicker } from '../../../fixed_datepicker';

const startTimeLabel = i18n.translate('xpack.infra.analysisSetup.startTimeLabel', {
defaultMessage: 'Start time',
Expand Down Expand Up @@ -138,18 +135,3 @@ export const AnalysisSetupTimerangeForm: React.FunctionComponent<{
</EuiDescribedFormGroup>
);
};

const FixedDatePicker = euiStyled(
({
className,
inputClassName,
...datePickerProps
}: {
className?: string;
inputClassName?: string;
} & EuiDatePickerProps) => (
<EuiDatePicker {...datePickerProps} className={inputClassName} popperClassName={className} />
)
)`
z-index: 3 !important;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import moment, { Moment } from 'moment';
import React from 'react';
import { FixedDatePicker } from '../fixed_datepicker';

const noop = () => undefined;

Expand Down Expand Up @@ -56,7 +57,7 @@ export class LogTimeControls extends React.PureComponent<LogTimeControlsProps> {
return (
<EuiFlexGroup gutterSize="s">
<EuiFlexItem>
<EuiDatePicker
<FixedDatePicker
dateFormat="L LTS"
onChange={this.handleChangeDate}
popperPlacement="top-end"
Expand Down

0 comments on commit f2d5910

Please sign in to comment.