mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
Add switch for deciding whether to send email. (#316)
* Add switch for deciding whether to send email. * fix: align switch Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
This commit is contained in:
parent
ae38000cf7
commit
af81884992
@ -19,11 +19,12 @@ interface IAddUserFormData {
|
|||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
rootRole: number;
|
rootRole: number;
|
||||||
|
sendEmail: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EDITOR_ROLE_ID = 2;
|
const EDITOR_ROLE_ID = 2;
|
||||||
|
|
||||||
const initialData = { email: '', name: '', rootRole: EDITOR_ROLE_ID };
|
const initialData = { email: '', name: '', rootRole: EDITOR_ROLE_ID, sendEmail: true };
|
||||||
|
|
||||||
const AddUser = ({
|
const AddUser = ({
|
||||||
showDialog,
|
showDialog,
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import {
|
import {
|
||||||
TextField,
|
|
||||||
DialogContent,
|
DialogContent,
|
||||||
RadioGroup,
|
|
||||||
Radio,
|
|
||||||
FormControl,
|
FormControl,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
|
Switch,
|
||||||
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
|
|
||||||
@ -48,6 +49,13 @@ function AddUserForm({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toggleBooleanField = e => {
|
||||||
|
setData({
|
||||||
|
...data,
|
||||||
|
[e.target.name]: !data[e.target.name],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const updateNumberField = e => {
|
const updateNumberField = e => {
|
||||||
setData({
|
setData({
|
||||||
...data,
|
...data,
|
||||||
@ -167,6 +175,29 @@ function AddUserForm({
|
|||||||
))}
|
))}
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<div className={commonStyles.flexRow}>
|
||||||
|
<FormControl>
|
||||||
|
<Typography
|
||||||
|
variant="subtitle1"
|
||||||
|
className={styles.roleSubtitle}
|
||||||
|
data-loading
|
||||||
|
>
|
||||||
|
Should we send an email to your new team member
|
||||||
|
</Typography>
|
||||||
|
<div className={commonStyles.flexRow}>
|
||||||
|
<Switch
|
||||||
|
name="sendEmail"
|
||||||
|
onChange={toggleBooleanField}
|
||||||
|
checked={data.sendEmail}
|
||||||
|
/>
|
||||||
|
<Typography>
|
||||||
|
{data.sendEmail ? 'Yes' : 'No'}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
</FormControl>
|
||||||
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user