Update account management features and improve test configurations
Multiple updates are made to refine the account management features, including updating the 'Your Teams' text to show the number of teams, and modifying the form data validation process in the 'deletePersonalAccountAction' service. Additionally, improvements have been made in test configurations including updating the test timeout settings, taking screenshots when a test fails, and adjusting the location for saving Playwright reports.
This commit is contained in:
@@ -4,6 +4,8 @@ import { useTransition } from 'react';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
import { Button } from '@kit/ui/button';
|
||||
import {
|
||||
@@ -28,6 +30,7 @@ export const UpdateTeamAccountNameForm = (props: {
|
||||
path: string;
|
||||
}) => {
|
||||
const [pending, startTransition] = useTransition();
|
||||
const { t } = useTranslation('teams');
|
||||
|
||||
const form = useForm({
|
||||
resolver: zodResolver(TeamNameFormSchema),
|
||||
@@ -43,12 +46,18 @@ export const UpdateTeamAccountNameForm = (props: {
|
||||
data-test={'update-team-account-name-form'}
|
||||
className={'flex flex-col space-y-4'}
|
||||
onSubmit={form.handleSubmit((data) => {
|
||||
startTransition(async () => {
|
||||
await updateTeamAccountName({
|
||||
startTransition(() => {
|
||||
const promise = updateTeamAccountName({
|
||||
slug: props.account.slug,
|
||||
name: data.name,
|
||||
path: props.path,
|
||||
});
|
||||
|
||||
toast.promise(promise, {
|
||||
loading: t('updateTeamLoadingMessage'),
|
||||
success: t('updateTeamSuccessMessage'),
|
||||
error: t('updateTeamErrorMessage'),
|
||||
});
|
||||
});
|
||||
})}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user