chore: wiring ControlLabel to a new FormLabel (#10388)

* chore: wiring ControlLabel to a new FormLabel

Creating new simple <FormLabel /> component and wiring all <label>
and react-bootstrap.ControlLabel towards it.

FormLabel becomes a pivotal point that can be altered to point to AntD
when we're ready.

* lint

* ViewportControl

* addressing comments
This commit is contained in:
Maxime Beauchemin
2020-07-23 00:27:22 -07:00
committed by GitHub
parent ea53916730
commit b438ba9ed5
16 changed files with 113 additions and 70 deletions

View File

@@ -19,8 +19,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { t } from '@superset-ui/translation';
import { ControlLabel, OverlayTrigger, Tooltip } from 'react-bootstrap';
import { OverlayTrigger, Tooltip } from 'react-bootstrap';
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
import FormLabel from 'src/components/FormLabel';
const propTypes = {
name: PropTypes.string,
@@ -83,7 +84,7 @@ export default class ControlHeader extends React.Component {
return (
<div className="ControlHeader" data-test={`${this.props.name}-header`}>
<div className="pull-left">
<ControlLabel>
<FormLabel>
{this.props.leftNode && <span>{this.props.leftNode}</span>}
<span
role="button"
@@ -133,7 +134,7 @@ export default class ControlHeader extends React.Component {
</span>
)}
{this.renderOptionalIcons()}
</ControlLabel>
</FormLabel>
</div>
{this.props.rightNode && (
<div className="pull-right">{this.props.rightNode}</div>