mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[input controls] use KuiCheckBoxLabel to ensure proper spacing between checkbox and label (#15301) (#15330)
* use KuiCheckBoxLabel to ensure proper spacing between checkbox and label * upper case Kibana * fix broken jest test
This commit is contained in:
parent
1f99c049bc
commit
de8988397c
3 changed files with 18 additions and 22 deletions
|
@ -14,16 +14,13 @@ exports[`renders OptionsTab 1`] = `
|
|||
<KuiFieldGroupSection
|
||||
isWide={false}
|
||||
>
|
||||
<label>
|
||||
<input
|
||||
checked={false}
|
||||
className="kuiCheckBox"
|
||||
data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"
|
||||
onChange={[Function]}
|
||||
type="checkbox"
|
||||
/>
|
||||
Update kibana filters on each change
|
||||
</label>
|
||||
<KuiCheckBoxLabel
|
||||
data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"
|
||||
isChecked={false}
|
||||
isDisabled={false}
|
||||
onChange={[Function]}
|
||||
text="Update Kibana filters on each change"
|
||||
/>
|
||||
</KuiFieldGroupSection>
|
||||
</KuiFieldGroup>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import _ from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { KuiFieldGroup, KuiFieldGroupSection } from 'ui_framework/components';
|
||||
import {
|
||||
KuiFieldGroup,
|
||||
KuiFieldGroupSection,
|
||||
KuiCheckBoxLabel } from 'ui_framework/components';
|
||||
|
||||
export class OptionsTab extends Component {
|
||||
constructor(props) {
|
||||
|
@ -28,16 +31,12 @@ export class OptionsTab extends Component {
|
|||
<div className="vis-editor-agg-header">
|
||||
<KuiFieldGroup>
|
||||
<KuiFieldGroupSection>
|
||||
<label>
|
||||
<input
|
||||
className="kuiCheckBox"
|
||||
type="checkbox"
|
||||
checked={this.props.scope.vis.params.updateFiltersOnChange}
|
||||
onChange={this.handleUpdateFiltersChange}
|
||||
data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"
|
||||
/>
|
||||
Update kibana filters on each change
|
||||
</label>
|
||||
<KuiCheckBoxLabel
|
||||
text="Update Kibana filters on each change"
|
||||
isChecked={this.props.scope.vis.params.updateFiltersOnChange}
|
||||
onChange={this.handleUpdateFiltersChange}
|
||||
data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"
|
||||
/>
|
||||
</KuiFieldGroupSection>
|
||||
</KuiFieldGroup>
|
||||
</div>
|
||||
|
|
|
@ -32,7 +32,7 @@ test('updateFiltersOnChange', () => {
|
|||
scope={scopeMock}
|
||||
stageEditorParams={stageEditorParams}
|
||||
/>);
|
||||
const checkbox = component.find('[data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"]');
|
||||
const checkbox = component.find('[data-test-subj="inputControlEditorUpdateFiltersOnChangeCheckbox"] input[type="checkbox"]');
|
||||
checkbox.simulate('change', { target: { checked: true } });
|
||||
const expectedParams = {
|
||||
updateFiltersOnChange: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue