ensure users MXID is encoded in the datagrid links and create/edit form redirects, fixes #477

This commit is contained in:
Aine 2025-04-08 18:29:06 +03:00
parent bac962c127
commit e2d3c0792b
No known key found for this signature in database
GPG Key ID: 34969C908CCA2804

View File

@ -178,7 +178,7 @@ export const UserList = (props: ListProps) => (
perPage={50} perPage={50}
> >
<DatagridConfigurable <DatagridConfigurable
rowClick={(id: Identifier, resource: string) => `/${resource}/${id}`} rowClick={(id: Identifier, resource: string) => `/${resource}/${encodeURIComponent(id)}`}
bulkActionButtons={<UserBulkActionButtons />} bulkActionButtons={<UserBulkActionButtons />}
> >
<AvatarField <AvatarField
@ -283,7 +283,7 @@ export const UserCreate = (props: CreateProps) => {
onSuccess: (resource: User) => { onSuccess: (resource: User) => {
notify("ra.notification.created", { messageArgs: { smart_count: 1 } }); notify("ra.notification.created", { messageArgs: { smart_count: 1 } });
redirect(() => { redirect(() => {
return `users/${resource.id}`; return `users/${encodeURIComponent(resource.id)}`;
}); });
}, },
} }
@ -307,7 +307,7 @@ export const UserCreate = (props: CreateProps) => {
onSuccess: (resource: User) => { onSuccess: (resource: User) => {
notify("ra.notification.updated", { messageArgs: { smart_count: 1 } }); notify("ra.notification.updated", { messageArgs: { smart_count: 1 } });
redirect(() => { redirect(() => {
return `users/${resource.id}`; return `users/${encodeURIComponent(resource.id)}`;
}); });
}, },
} }