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

[TSVB] Unify styles for YesNo components #97796

Merged
merged 5 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { i18n } from '@kbn/i18n';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import _ from 'lodash';
Expand All @@ -24,7 +25,6 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiFormLabel,
EuiSpacer,
EuiFieldText,
EuiTitle,
Expand Down Expand Up @@ -156,32 +156,36 @@ export class AnnotationsEditor extends Component {
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.annotationsEditor.ignoreGlobalFiltersLabel"
defaultMessage="Ignore global filters?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.annotationsEditor.ignoreGlobalFiltersLabel',
{
defaultMessage: 'Ignore global filters?',
}
)}
>
<YesNo
value={model.ignore_global_filters}
name="ignore_global_filters"
onChange={handleChange}
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<YesNo
value={model.ignore_global_filters}
name="ignore_global_filters"
onChange={handleChange}
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.annotationsEditor.ignorePanelFiltersLabel"
defaultMessage="Ignore panel filters?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.annotationsEditor.ignorePanelFiltersLabel',
{
defaultMessage: 'Ignore panel filters?',
}
)}
>
<YesNo
value={model.ignore_panel_filters}
name="ignore_panel_filters"
onChange={handleChange}
/>
</EuiFormLabel>
<EuiSpacer size="xs" />
<YesNo
value={model.ignore_panel_filters}
name="ignore_panel_filters"
onChange={handleChange}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const IndexPattern = ({
);
const isTimeSeries = model.type === PANEL_TYPES.TIMESERIES;
const isDataTimerangeModeInvalid =
!disabled &&
selectedTimeRangeOption &&
!isTimerangeModeEnabled(selectedTimeRangeOption.value, uiRestrictions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import React, { Component } from 'react';
import uuid from 'uuid';
import {
Expand All @@ -23,8 +24,7 @@ import {
EuiTitle,
EuiHorizontalRule,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

import type { Writable } from '@kbn/utility-types';

// @ts-ignore
Expand Down Expand Up @@ -157,18 +157,20 @@ export class GaugePanelConfig extends Component<
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.gauge.optionsTab.ignoreGlobalFilterLabel"
defaultMessage="Ignore global filter?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.gauge.optionsTab.ignoreGlobalFilterLabel',
{
defaultMessage: 'Ignore global filter?',
}
)}
>
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,20 @@ export class MarkdownPanelConfig extends Component<
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.markdown.optionsTab.ignoreGlobalFilterLabel"
defaultMessage="Ignore global filter?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.markdown.optionsTab.ignoreGlobalFilterLabel',
{
defaultMessage: 'Ignore global filter?',
}
)}
>
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
Expand Down Expand Up @@ -218,35 +220,34 @@ export class MarkdownPanelConfig extends Component<
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.markdown.optionsTab.showScrollbarsLabel"
defaultMessage="Show scrollbars?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.markdown.optionsTab.showScrollbarsLabel',
{
defaultMessage: 'Show scrollbars?',
}
)}
>
<YesNo
value={model.markdown_scrollbars}
name="markdown_scrollbars"
onChange={this.props.onChange}
/>
</EuiFormLabel>
</EuiFlexItem>
<EuiFlexItem>
<YesNo
value={model.markdown_scrollbars}
name="markdown_scrollbars"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>

<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.markdown.optionsTab.openLinksInNewTab"
defaultMessage="Open links in new tab?"
<EuiFormRow
label={i18n.translate('visTypeTimeseries.markdown.optionsTab.openLinksInNewTab', {
defaultMessage: 'Open links in new tab?',
})}
>
<YesNo
value={model.markdown_openLinksInNewTab}
name="markdown_openLinksInNewTab"
onChange={this.props.onChange}
/>
</EuiFormLabel>
</EuiFlexItem>
<EuiFlexItem>
<YesNo
value={model.markdown_openLinksInNewTab}
name="markdown_openLinksInNewTab"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel htmlFor={htmlId('valign')}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component } from 'react';
import uuid from 'uuid';
import {
Expand All @@ -16,12 +17,10 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiFormLabel,
EuiSpacer,
EuiTitle,
EuiHorizontalRule,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

// @ts-expect-error
import { SeriesEditor } from '../series_editor';
Expand Down Expand Up @@ -121,18 +120,20 @@ export class MetricPanelConfig extends Component<
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel>
<FormattedMessage
id="visTypeTimeseries.metric.optionsTab.ignoreGlobalFilterLabel"
defaultMessage="Ignore global filter?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.metric.optionsTab.ignoreGlobalFilterLabel',
{
defaultMessage: 'Ignore global filter?',
}
)}
>
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
EuiFormLabel,
EuiSpacer,
EuiFieldText,
EuiTitle,
Expand All @@ -28,6 +27,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { i18n } from '@kbn/i18n';
import { FieldSelect } from '../aggs/field_select';
// @ts-expect-error not typed yet
import { SeriesEditor } from '../series_editor';
Expand Down Expand Up @@ -246,18 +246,20 @@ export class TablePanelConfig extends Component<
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFormLabel htmlFor={htmlId('globalFilterOption')}>
<FormattedMessage
id="visTypeTimeseries.table.optionsTab.ignoreGlobalFilterLabel"
defaultMessage="Ignore global filter?"
<EuiFormRow
label={i18n.translate(
'visTypeTimeseries.table.optionsTab.ignoreGlobalFilterLabel',
{
defaultMessage: 'Ignore global filter?',
}
)}
>
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormLabel>
<EuiSpacer size="m" />
<YesNo
value={model.ignore_global_filter}
name="ignore_global_filter"
onChange={this.props.onChange}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
Expand Down
Loading