mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 07:39:08 +08:00
chore: default value is added when on unmount (#1041)
This commit is contained in:
parent
bdf9333dcf
commit
e217ea0c9c
@ -29,6 +29,14 @@ function EditMembersDetails({
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
const [state, copyToClipboard] = useCopyToClipboard();
|
||||
|
||||
useEffect(() => {
|
||||
return (): void => {
|
||||
setName('');
|
||||
setRole('VIEWER');
|
||||
setEmailAddress('');
|
||||
};
|
||||
}, [setEmailAddress, setName, setRole]);
|
||||
|
||||
const getPasswordLink = (token: string): string => {
|
||||
return `${window.location.origin}${ROUTES.PASSWORD_RESET}?token=${token}`;
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import { Button, Form, Input, Select, Space, Typography } from 'antd';
|
||||
import React, { useCallback } from 'react';
|
||||
import React, { useCallback, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { InviteTeamMembersProps } from '../PendingInvitesContainer/index';
|
||||
@ -11,6 +11,18 @@ const { Option } = Select;
|
||||
function InviteTeamMembers({ allMembers, setAllMembers }: Props): JSX.Element {
|
||||
const { t } = useTranslation('organizationsettings');
|
||||
|
||||
useEffect(() => {
|
||||
return (): void => {
|
||||
setAllMembers([
|
||||
{
|
||||
email: '',
|
||||
name: '',
|
||||
role: 'VIEWER',
|
||||
},
|
||||
]);
|
||||
};
|
||||
}, [setAllMembers]);
|
||||
|
||||
const onAddHandler = (): void => {
|
||||
setAllMembers((state) => [
|
||||
...state,
|
||||
|
@ -180,6 +180,7 @@ function UserFunction({
|
||||
onOk={(): void => onModalToggleHandler(setIsModalVisible, false)}
|
||||
onCancel={(): void => onModalToggleHandler(setIsModalVisible, false)}
|
||||
centered
|
||||
destroyOnClose
|
||||
footer={[
|
||||
<Button
|
||||
key="back"
|
||||
|
@ -225,6 +225,7 @@ function PendingInvitesContainer(): JSX.Element {
|
||||
visible={isInviteTeamMemberModalOpen}
|
||||
onCancel={(): void => toggleModal(false)}
|
||||
centered
|
||||
destroyOnClose
|
||||
footer={[
|
||||
<Button key="back" onClick={(): void => toggleModal(false)} type="default">
|
||||
{t('cancel', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user