1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: add label for the impression data

This commit is contained in:
Youssef 2022-02-11 09:34:34 +01:00
parent 16126433a4
commit ec9061586f

View File

@ -1,4 +1,10 @@
import { Button, FormControl, Switch, Typography } from '@material-ui/core'; import {
Button,
FormControl,
FormControlLabel,
Switch,
Typography,
} from '@material-ui/core';
import { useStyles } from './FeatureForm.styles'; import { useStyles } from './FeatureForm.styles';
import FeatureTypeSelect from '../FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect'; import FeatureTypeSelect from '../FeatureView/FeatureSettings/FeatureSettingsMetadata/FeatureTypeSelect/FeatureTypeSelect';
import { CF_DESC_ID, CF_NAME_ID, CF_TYPE_ID } from '../../../testIds'; import { CF_DESC_ID, CF_NAME_ID, CF_TYPE_ID } from '../../../testIds';
@ -55,7 +61,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
const styles = useStyles(); const styles = useStyles();
const { featureTypes } = useFeatureTypes(); const { featureTypes } = useFeatureTypes();
const history = useHistory(); const history = useHistory();
const { permissions } = useAuthPermissions() const { permissions } = useAuthPermissions();
const editable = mode !== 'Edit'; const editable = mode !== 'Edit';
const renderToggleDescription = () => { const renderToggleDescription = () => {
@ -114,10 +120,7 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
); );
}} }}
enabled={editable} enabled={editable}
filter={projectFilterGenerator( filter={projectFilterGenerator(permissions, CREATE_FEATURE)}
permissions,
CREATE_FEATURE
)}
IconComponent={KeyboardArrowDownOutlined} IconComponent={KeyboardArrowDownOutlined}
className={styles.selectInput} className={styles.selectInput}
/> />
@ -157,12 +160,20 @@ const FeatureForm: React.FC<IFeatureToggleForm> = ({
</a> </a>
</p> </p>
<div className={styles.flexRow}> <div className={styles.flexRow}>
<Switch <FormControlLabel
name="impressionData" labelPlacement="start"
onChange={() => setImpressionData(!impressionData)} style={{ marginLeft: 0 }}
checked={impressionData} control={
<Switch
name="impressionData"
onChange={() =>
setImpressionData(!impressionData)
}
checked={impressionData}
/>
}
label="Impression Data"
/> />
<Typography>{impressionData ? 'Yes' : 'No'}</Typography>
</div> </div>
</FormControl> </FormControl>
</div> </div>