* 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> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
1f1a0da400
commit
8d8d3a009f
|
@ -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;
|
||||||
|
`;
|
|
@ -5,8 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
EuiDatePicker,
|
|
||||||
EuiDatePickerProps,
|
|
||||||
EuiDescribedFormGroup,
|
EuiDescribedFormGroup,
|
||||||
EuiFlexGroup,
|
EuiFlexGroup,
|
||||||
EuiFormControlLayout,
|
EuiFormControlLayout,
|
||||||
|
@ -16,8 +14,7 @@ import { i18n } from '@kbn/i18n';
|
||||||
import { FormattedMessage } from '@kbn/i18n/react';
|
import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
import moment, { Moment } from 'moment';
|
import moment, { Moment } from 'moment';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
import { FixedDatePicker } from '../../../fixed_datepicker';
|
||||||
import { euiStyled } from '../../../../../../../common/eui_styled_components';
|
|
||||||
|
|
||||||
const startTimeLabel = i18n.translate('xpack.infra.analysisSetup.startTimeLabel', {
|
const startTimeLabel = i18n.translate('xpack.infra.analysisSetup.startTimeLabel', {
|
||||||
defaultMessage: 'Start time',
|
defaultMessage: 'Start time',
|
||||||
|
@ -138,18 +135,3 @@ export const AnalysisSetupTimerangeForm: React.FunctionComponent<{
|
||||||
</EuiDescribedFormGroup>
|
</EuiDescribedFormGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const FixedDatePicker = euiStyled(
|
|
||||||
({
|
|
||||||
className,
|
|
||||||
inputClassName,
|
|
||||||
...datePickerProps
|
|
||||||
}: {
|
|
||||||
className?: string;
|
|
||||||
inputClassName?: string;
|
|
||||||
} & EuiDatePickerProps) => (
|
|
||||||
<EuiDatePicker {...datePickerProps} className={inputClassName} popperClassName={className} />
|
|
||||||
)
|
|
||||||
)`
|
|
||||||
z-index: 3 !important;
|
|
||||||
`;
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { i18n } from '@kbn/i18n';
|
||||||
import { FormattedMessage } from '@kbn/i18n/react';
|
import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
import moment, { Moment } from 'moment';
|
import moment, { Moment } from 'moment';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { FixedDatePicker } from '../fixed_datepicker';
|
||||||
|
|
||||||
const noop = () => undefined;
|
const noop = () => undefined;
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ export class LogTimeControls extends React.PureComponent<LogTimeControlsProps> {
|
||||||
return (
|
return (
|
||||||
<EuiFlexGroup gutterSize="s">
|
<EuiFlexGroup gutterSize="s">
|
||||||
<EuiFlexItem>
|
<EuiFlexItem>
|
||||||
<EuiDatePicker
|
<FixedDatePicker
|
||||||
dateFormat="L LTS"
|
dateFormat="L LTS"
|
||||||
onChange={this.handleChangeDate}
|
onChange={this.handleChangeDate}
|
||||||
popperPlacement="top-end"
|
popperPlacement="top-end"
|
||||||
|
|
Loading…
Reference in a new issue