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

@@ -21,8 +21,9 @@ import PropTypes from 'prop-types';
import { FormControl, FormGroup, Row, Col } from 'react-bootstrap';
import { t } from '@superset-ui/translation';
import Button from '../../components/Button';
import ModalTrigger from '../../components/ModalTrigger';
import Button from 'src/components/Button';
import FormLabel from 'src/components/FormLabel';
import ModalTrigger from 'src/components/ModalTrigger';
const propTypes = {
query: PropTypes.object,
@@ -91,9 +92,9 @@ class SaveQuery extends React.PureComponent {
<Row>
<Col md={12}>
<small>
<label className="control-label" htmlFor="embed-height">
<FormLabel className="control-label" htmlFor="embed-height">
{t('Label')}
</label>
</FormLabel>
</small>
<FormControl
type="text"
@@ -107,9 +108,9 @@ class SaveQuery extends React.PureComponent {
<Row>
<Col md={12}>
<small>
<label className="control-label" htmlFor="embed-height">
<FormLabel className="control-label" htmlFor="embed-height">
{t('Description')}
</label>
</FormLabel>
</small>
<FormControl
componentClass="textarea"

View File

@@ -23,8 +23,9 @@ import chrono from 'chrono-node';
import { Col, FormControl, FormGroup, Row } from 'react-bootstrap';
import { t } from '@superset-ui/translation';
import Button from '../../components/Button';
import ModalTrigger from '../../components/ModalTrigger';
import Button from 'src/components/Button';
import ModalTrigger from 'src/components/ModalTrigger';
import FormLabel from 'src/components/FormLabel';
import './ScheduleQueryButton.less';
const validators = {
@@ -134,9 +135,9 @@ class ScheduleQueryButton extends React.PureComponent {
<FormGroup>
<Row style={{ paddingBottom: '10px' }}>
<Col md={12}>
<label className="control-label" htmlFor="embed-height">
<FormLabel className="control-label" htmlFor="embed-height">
{t('Label')}
</label>
</FormLabel>
<FormControl
type="text"
placeholder={t('Label for your query')}
@@ -147,9 +148,9 @@ class ScheduleQueryButton extends React.PureComponent {
</Row>
<Row style={{ paddingBottom: '10px' }}>
<Col md={12}>
<label className="control-label" htmlFor="embed-height">
<FormLabel className="control-label" htmlFor="embed-height">
{t('Description')}
</label>
</FormLabel>
<FormControl
componentClass="textarea"
placeholder={t('Write a description for your query')}