This commit is contained in:
Andy Mikulski 2017-11-13 07:56:26 -07:00
Родитель df492d65e6
Коммит 9a0abbf140
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A530EAD3CD3EFB3C
4 изменённых файлов: 8 добавлений и 30 удалений

Просмотреть файл

@ -1,18 +1,12 @@
import { Checkbox as AntCheckbox } from 'antd';
import { Checkbox } from 'antd';
import autobind from 'autobind-decorator';
import LabeledInput from './LabeledInput';
@autobind
export default class CheckBox extends LabeledInput {
handleLabelClick() {
const newValue = !this.props.value;
this.props.onChange(newValue);
}
export default class LabeledCheckbox extends LabeledInput {
getElement() {
return AntCheckbox;
return Checkbox;
}
getElementProps() {

Просмотреть файл

@ -1,6 +1,6 @@
// eslint does not detect that aria roles come from `getLabelProps`,
// ignoring the rule here to disable lint errors.
/* eslint-disable jsx-a11y/interactive-supports-focus */
/* eslint-disable jsx-a11y/no-static-element-interactions */
import autobind from 'autobind-decorator';
import PropTypes from 'prop-types';
@ -12,14 +12,12 @@ export default class LabeledInput extends React.Component {
children: PropTypes.node,
element: PropTypes.node,
onChange: PropTypes.func,
value: PropTypes.any,
};
static defaultProps = {
children: null,
element: undefined,
onChange: () => {},
value: undefined,
}
getElement() { throw new Error('LabeledInput#getElement must be overridden.'); }
@ -33,7 +31,6 @@ export default class LabeledInput extends React.Component {
render() {
const {
children,
value,
onChange,
} = this.props;

Просмотреть файл

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import DocumentUrlInput from 'control/components/forms/DocumentUrlInput';
import SwitchBox from 'control/components/forms/SwitchBox';
import CheckBox from 'control/components/forms/CheckBox';
import FormItem from 'control/components/forms/FormItem';
import { connectFormProps } from 'control/utils/forms';
@ -91,11 +91,12 @@ export default class ShowHeartbeatFields extends React.PureComponent {
</FormItem>
<FormItem
name="arguments.includeTelemetryUUID"
label="Include Telemetry UUID?"
initialValue={recipeArguments.get('includeTelemetryUUID', false)}
>
<SwitchBox disabled={disabled}>
<CheckBox disabled={disabled}>
Include UUID in Post-Answer URL and Telemetry
</SwitchBox>
</CheckBox>
</FormItem>
</Col>
<Col sm={24}>

Просмотреть файл

@ -63,20 +63,6 @@
}
}
.recipe-form {
.ant-form .ant-checkbox-wrapper {
line-height: 1em;
}
.post-answer-url {
margin-bottom: 0;
}
.post-answer-url-checkbox {
margin-bottom: 1em;
}
}
fieldset {
border: none;