Allow to set a usertype

Change-Id: Ibfaa383b95dc5acc3b4dcd61f3f506f7c81f7dea
This commit is contained in:
Michael Albert 2020-09-18 17:40:39 +02:00
parent fb8cff3e3e
commit c604b47adc
3 changed files with 32 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import {
SearchInput,
ReferenceField,
ReferenceManyField,
SelectField,
SelectInput,
BulkDeleteButton,
DeleteButton,
@ -149,6 +150,13 @@ export const UserList = props => {
<TextField source="displayname" />
<BooleanField source="is_guest" sortable={false} />
<BooleanField source="admin" sortable={false} />
<SelectField
source="user_type"
choices={[
{ id: null, name: "resources.users.type.default" },
{ id: "free", name: "resources.users.type.free" },
]}
/>
<BooleanField source="deactivated" sortable={false} />
</Datagrid>
</List>
@ -261,6 +269,13 @@ export const UserCreate = props => (
<TextInput source="displayname" />
<PasswordInput source="password" autoComplete="new-password" />
<BooleanInput source="admin" />
<SelectInput
source="user_type"
choices={[
{ id: null, name: "resources.users.type.default" },
{ id: "free", name: "resources.users.type.free" },
]}
/>
<ArrayInput source="threepids">
<SimpleFormIterator>
<SelectInput
@ -307,6 +322,14 @@ export const UserEdit = props => {
<TextInput source="id" disabled />
<TextInput source="displayname" />
<PasswordInput source="password" autoComplete="new-password" />
<SelectInput
source="user_type"
choices={[
{ id: null, name: "resources.users.type.default" },
{ id: "free", name: "resources.users.type.free" },
]}
emptyText="resources.users.type.default"
/>
<BooleanInput source="admin" />
<BooleanInput
source="deactivated"

View File

@ -64,12 +64,17 @@ export default {
address: "Adresse",
creation_ts_ms: "Zeitpunkt der Erstellung",
consent_version: "Zugestimmte Geschäftsbedingungen",
user_type: "Kontotyp",
// Devices:
device_id: "Geräte-ID",
display_name: "Gerätename",
last_seen_ts: "Zeitstempel",
last_seen_ip: "IP-Adresse",
},
type: {
default: "Standard",
free: "Basic",
},
helper: {
deactivate: "Deaktivierte Nutzer können nicht wieder aktiviert werden.",
erase: "DSGVO konformes Löschen der Benutzerdaten",

View File

@ -70,6 +70,10 @@ export default {
last_seen_ts: "Timestamp",
last_seen_ip: "IP address",
},
type: {
default: "Standard",
free: "Basic",
},
helper: {
deactivate: "Deactivated users cannot be reactivated",
erase: "Mark the user as GDPR-erased",