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

@@ -34,6 +34,7 @@ import rison from 'rison';
import { t } from '@superset-ui/translation';
import { SupersetClient } from '@superset-ui/connection';
import Chart from 'src/types/Chart';
import FormLabel from 'src/components/FormLabel';
import getClientErrorObject from '../../utils/getClientErrorObject';
export type Slice = {
@@ -182,9 +183,9 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
<Col md={6}>
<h3>{t('Basic Information')}</h3>
<FormGroup>
<label className="control-label" htmlFor="name">
<FormLabel htmlFor="name" required>
{t('Name')}
</label>
</FormLabel>
<FormControl
name="name"
type="text"
@@ -197,9 +198,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
/>
</FormGroup>
<FormGroup>
<label className="control-label" htmlFor="description">
{t('Description')}
</label>
<FormLabel htmlFor="description">{t('Description')}</FormLabel>
<FormControl
name="description"
type="text"
@@ -222,9 +221,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
<Col md={6}>
<h3>{t('Configuration')}</h3>
<FormGroup>
<label className="control-label" htmlFor="cacheTimeout">
{t('Cache Timeout')}
</label>
<FormLabel htmlFor="cacheTimeout">{t('Cache Timeout')}</FormLabel>
<FormControl
name="cacheTimeout"
type="text"
@@ -243,9 +240,7 @@ function PropertiesModal({ slice, onHide, onSave }: InternalProps) {
</FormGroup>
<h3 style={{ marginTop: '1em' }}>{t('Access')}</h3>
<FormGroup>
<label className="control-label" htmlFor="owners">
{t('Owners')}
</label>
<FormLabel htmlFor="owners">{t('Owners')}</FormLabel>
<AsyncSelect
isMulti
name="owners"