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:
giancarlo
2024-04-12 20:52:35 +08:00
parent 24a6190f51
commit 2bad506d75
15 changed files with 93 additions and 51 deletions

View File

@@ -18,6 +18,7 @@ import {
} from '@kit/ui/command';
import { If } from '@kit/ui/if';
import { Popover, PopoverContent, PopoverTrigger } from '@kit/ui/popover';
import { Separator } from '@kit/ui/separator';
import { Trans } from '@kit/ui/trans';
import { cn } from '@kit/ui/utils';
@@ -177,7 +178,14 @@ export function AccountSelector({
<If condition={features.enableTeamAccounts}>
<If condition={accounts.length > 0}>
<CommandGroup heading={<Trans i18nKey={'teams:yourTeams'} />}>
<CommandGroup
heading={
<Trans
i18nKey={'teams:yourTeams'}
values={{ teamsCount: accounts.length }}
/>
}
>
{(accounts ?? []).map((account) => (
<CommandItem
data-test={'account-selector-team-' + account.value}
@@ -218,32 +226,30 @@ export function AccountSelector({
</CommandItem>
))}
</CommandGroup>
<CommandSeparator />
</If>
</If>
<If condition={features.enableTeamCreation}>
<CommandGroup>
<Button
data-test={'create-team-account-trigger'}
variant="ghost"
className="w-full justify-start"
onClick={() => {
setIsCreatingAccount(true);
setOpen(false);
}}
>
<Plus className="mr-3 h-4 w-4" />
<span>
<Trans i18nKey={'teams:createTeam'} />
</span>
</Button>
</CommandGroup>
</If>
</CommandList>
</Command>
<Separator />
<If condition={features.enableTeamCreation}>
<Button
data-test={'create-team-account-trigger'}
variant="ghost"
className="w-full justify-start"
onClick={() => {
setIsCreatingAccount(true);
setOpen(false);
}}
>
<Plus className="mr-3 h-4 w-4" />
<span>
<Trans i18nKey={'teams:createTeam'} />
</span>
</Button>
</If>
</PopoverContent>
</Popover>