mirror of
https://github.com/etkecc/synapse-admin.git
synced 2024-11-24 16:45:31 +03:00
Fix for empty user default tab after creation (#628)
This commit is contained in:
parent
dbcb4f92dc
commit
9fc005032c
1 changed files with 11 additions and 2 deletions
|
@ -47,6 +47,7 @@ import {
|
||||||
TopToolbar,
|
TopToolbar,
|
||||||
NumberField,
|
NumberField,
|
||||||
useListContext,
|
useListContext,
|
||||||
|
Identifier,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
@ -112,7 +113,10 @@ export const UserList = (props: ListProps) => (
|
||||||
actions={<UserListActions />}
|
actions={<UserListActions />}
|
||||||
pagination={<UserPagination />}
|
pagination={<UserPagination />}
|
||||||
>
|
>
|
||||||
<Datagrid rowClick="edit" bulkActionButtons={<UserBulkActionButtons />}>
|
<Datagrid
|
||||||
|
rowClick={(id: Identifier, resource: string) => `/${resource}/${id}`}
|
||||||
|
bulkActionButtons={<UserBulkActionButtons />}
|
||||||
|
>
|
||||||
<AvatarField source="avatar_src" sx={{ height: "40px", width: "40px" }} sortBy="avatar_url" />
|
<AvatarField source="avatar_src" sx={{ height: "40px", width: "40px" }} sortBy="avatar_url" />
|
||||||
<TextField source="id" sortBy="name" />
|
<TextField source="id" sortBy="name" />
|
||||||
<TextField source="displayname" />
|
<TextField source="displayname" />
|
||||||
|
@ -153,7 +157,12 @@ const UserEditActions = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const UserCreate = (props: CreateProps) => (
|
export const UserCreate = (props: CreateProps) => (
|
||||||
<Create {...props}>
|
<Create
|
||||||
|
{...props}
|
||||||
|
redirect={(resource: string | undefined, id: Identifier | undefined) => {
|
||||||
|
return `${resource}/${id}`;
|
||||||
|
}}
|
||||||
|
>
|
||||||
<SimpleForm>
|
<SimpleForm>
|
||||||
<TextInput source="id" autoComplete="off" validate={validateUser} />
|
<TextInput source="id" autoComplete="off" validate={validateUser} />
|
||||||
<TextInput source="displayname" validate={maxLength(256)} />
|
<TextInput source="displayname" validate={maxLength(256)} />
|
||||||
|
|
Loading…
Reference in a new issue