mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-23 10:26:40 +00:00
feat: add delete button to invite user flow (#8993)
This commit is contained in:
parent
3999a64c64
commit
10c6e1fac7
@ -1,4 +1,4 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Form,
|
Form,
|
||||||
@ -30,7 +30,7 @@ function InviteTeamMembers({ form, onFinish }: Props): JSX.Element {
|
|||||||
initialValues={{ members: [{ email: '', name: '', role: 'VIEWER' }] }}
|
initialValues={{ members: [{ email: '', name: '', role: 'VIEWER' }] }}
|
||||||
>
|
>
|
||||||
<Form.List name="members">
|
<Form.List name="members">
|
||||||
{(fields, { add }): JSX.Element => (
|
{(fields, { add, remove }): JSX.Element => (
|
||||||
<SpaceContainer direction="vertical" align="center" size="middle">
|
<SpaceContainer direction="vertical" align="center" size="middle">
|
||||||
{fields.map(({ key, name }) => (
|
{fields.map(({ key, name }) => (
|
||||||
<Space key={key} direction="horizontal" align="start">
|
<Space key={key} direction="horizontal" align="start">
|
||||||
@ -56,6 +56,14 @@ function InviteTeamMembers({ form, onFinish }: Props): JSX.Element {
|
|||||||
<Select.Option value="EDITOR">EDITOR</Select.Option>
|
<Select.Option value="EDITOR">EDITOR</Select.Option>
|
||||||
</SelectDrawer>
|
</SelectDrawer>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Button
|
||||||
|
type="text"
|
||||||
|
icon={<DeleteOutlined />}
|
||||||
|
onClick={(): void => remove(name)}
|
||||||
|
danger
|
||||||
|
data-testid={`delete-member-${name}`}
|
||||||
|
disabled={fields.length === 1}
|
||||||
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
))}
|
))}
|
||||||
<Form.Item>
|
<Form.Item>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user