mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
fix: externalize e2e testings and profile name trim (#318)
* fix: externalize e2e testings * fix: externalize e2e tests. * refactor: improve e2e workflow. * chore: upgrade workflow action version. * fix: createEnv by adding emptyStringAsUndefined (#317) * chore: release 1.18.2 --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charlesgte31@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(layout): guard undefined user.name in avatar fallbacks (#320) * fix(layout): guard undefined user.name in avatar fallbacks * fix: AUTH_DEFAULT_USER as zod email --------- Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com> * fix: profile name trim --------- Co-authored-by: killian-larcher <killian.larcher@soluce-technologies.com> Co-authored-by: Charles GTE <charlesgte31@gmail.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michael Kutý <6du1ro.n@gmail.com> Co-authored-by: charles-gauthereau <charles.gauthereau@soluce-technologies.com>
This commit is contained in:
co-authored by
killian-larcher
Charles GTE
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
charles-gauthereau
github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Michael Kutý
parent
87f8a50326
commit
51bf9cf679
@@ -33,7 +33,7 @@ export const LoggedInButtonClient = ({ user, sessions, currentSession, accounts,
|
||||
<SidebarMenuButton type="button" className="h-auto justify-between py-2" data-testid="profile-dropdown">
|
||||
<div className="flex items-center gap-2">
|
||||
<Avatar className="size-6">
|
||||
<AvatarFallback>{user.name[0].toUpperCase()}</AvatarFallback>
|
||||
<AvatarFallback>{(user.name?.[0] ?? user.email?.[0] ?? "?").toUpperCase()}</AvatarFallback>
|
||||
{user.image && <AvatarImage src={user.image} />}
|
||||
</Avatar>
|
||||
<div className="flex flex-col items-start">
|
||||
|
||||
@@ -72,7 +72,7 @@ export const AvatarWithUpload = (props: AvatarWithUploadProps) => {
|
||||
|
||||
<Avatar className="w-24 h-24 lg:w-32 lg:h-32 border-4 border-muted/20">
|
||||
<AvatarImage className="object-cover" src={user.image || undefined}/>
|
||||
<AvatarFallback className="text-3xl">{user.name.charAt(0).toUpperCase()}</AvatarFallback>
|
||||
<AvatarFallback className="text-3xl">{(user.name?.charAt(0) ?? user.email?.charAt(0) ?? "?").toUpperCase()}</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div
|
||||
|
||||
@@ -2,7 +2,7 @@ import z from "zod";
|
||||
import {zString} from "@/lib/zod";
|
||||
|
||||
export const ProfileSchema = z.object({
|
||||
name: zString().nonempty(),
|
||||
name: zString().trim().nonempty(),
|
||||
role: zString().nonempty(),
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {userAction} from "@/lib/safe-actions/actions";
|
||||
import {ApiKey} from "@better-auth/api-key";
|
||||
|
||||
const UpdateProfileSchema = z.object({
|
||||
name: z.string().optional(),
|
||||
name: z.string().trim().nonempty().optional(),
|
||||
});
|
||||
|
||||
export const updateProfileSettingsAction = userAction.schema(UpdateProfileSchema).action(async ({ parsedInput }): Promise<ServerActionResult<{}>> => {
|
||||
|
||||
Reference in New Issue
Block a user