Enable modify user external_ids (#179)

* Enable modify user `external_ids`

* add input validation
This commit is contained in:
Dirk Klimpel 2021-11-15 20:40:05 +01:00 committed by GitHub
parent 0ff4b30d71
commit 79ef38ee6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View file

@ -5,7 +5,7 @@
This project is built using [react-admin](https://marmelab.com/react-admin/).
It needs at least Synapse v1.38.0 for all functions to work as expected!
It needs at least Synapse v1.41.0 for all functions to work as expected!
You get your server version with the request `/_synapse/admin/v1/server_version`.
See also [Synapse version API](https://matrix-org.github.io/synapse/develop/admin_api/version_api.html).

View file

@ -37,6 +37,7 @@ import {
DeleteButton,
SaveButton,
regex,
required,
useTranslate,
Pagination,
CreateButton,
@ -262,6 +263,16 @@ export const UserCreate = props => (
<TextInput source="address" />
</SimpleFormIterator>
</ArrayInput>
<ArrayInput source="external_ids" label="synapseadmin.users.tabs.sso">
<SimpleFormIterator>
<TextInput source="auth_provider" validate={required()} />
<TextInput
source="external_id"
label="resources.users.fields.id"
validate={required()}
/>
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
@ -339,16 +350,16 @@ export const UserEdit = props => {
icon={<AssignmentIndIcon />}
path="sso"
>
<ArrayField source="external_ids" label={false}>
<Datagrid style={{ width: "100%" }}>
<TextField source="auth_provider" sortable={false} />
<TextField
<ArrayInput source="external_ids" label={false}>
<SimpleFormIterator>
<TextInput source="auth_provider" validate={required()} />
<TextInput
source="external_id"
label="resources.users.fields.id"
sortable={false}
validate={required()}
/>
</Datagrid>
</ArrayField>
</SimpleFormIterator>
</ArrayInput>
</FormTab>
<FormTab