feat: add role name in edit & invite user dialog.

This commit is contained in:
elforjani13
2021-11-25 12:21:29 +02:00
parent d45005d8c2
commit 8b4dfe4ded
6 changed files with 67 additions and 20 deletions

View File

@@ -11,7 +11,7 @@ import { FormattedMessage as T } from 'components';
import { CLASSES } from 'common/classes';
import classNames from 'classnames';
import { inputIntent } from 'utils';
import { FieldRequiredHint } from 'components';
import { ListSelect, FieldRequiredHint } from 'components';
import { useUserFormContext } from './UserFormProvider';
import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
@@ -88,6 +88,29 @@ function UserFormContent({
</FormGroup>
)}
</FastField>
{/* ----------- Role name ----------- */}
<FastField name={'role_name'}>
{({ form, field: { value }, meta: { error, touched } }) => (
<FormGroup
label={<T id={'roles.label.role_name'} />}
labelInfo={<FieldRequiredHint />}
className={classNames('form-group--role_name', CLASSES.FILL)}
intent={inputIntent({ error, touched })}
>
<ListSelect
items={[]}
// onItemSelect={(item) => {
// form.setFieldValue('role_name', item.role_id);
// }}
selectedItem={value}
selectedItemProp={'role_id '}
// textProp={'role_name'}
// labelProp={'role_id '}
popoverProps={{ minimal: true }}
/>
</FormGroup>
)}
</FastField>
</div>
<div className={CLASSES.DIALOG_FOOTER}>