Skip to content

Commit

Permalink
[TSVB] Unify styles for YesNo components (#97796) (#98271)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
alexwizp and kibanamachine authored Apr 26, 2021
1 parent c27c7e7 commit 9777763
Show file tree
Hide file tree
Showing 11 changed files with 213 additions and 205 deletions.
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

0 comments on commit 9777763

Please sign in to comment.