diff --git a/src/components/rooms.js b/src/components/rooms.js index 5e7606a..238cfdd 100644 --- a/src/components/rooms.js +++ b/src/components/rooms.js @@ -1,15 +1,17 @@ import React from "react"; import { - BooleanField, + AutocompleteArrayInput, BooleanInput, Create, Datagrid, + FormTab, List, Pagination, ReferenceArrayField, + ReferenceArrayInput, Show, - SimpleForm, Tab, + TabbedForm, TabbedShowLayout, TextField, TextInput, @@ -100,20 +102,37 @@ const validateHasAliasIfPublic = formdata => { export const RoomCreate = props => ( - - - replaceAllWhitespace(removeLeadingSigil(fv))} - validate={validateAlias} - placeholder="#" - /> - - + + }> + + replaceAllWhitespace(removeLeadingSigil(fv))} + validate={validateAlias} + placeholder="#" + /> + + + } + > + ({ user_id: searchText })} + > + + + + ); diff --git a/src/i18n/de.js b/src/i18n/de.js index f4a4c38..9d0dac5 100644 --- a/src/i18n/de.js +++ b/src/i18n/de.js @@ -65,6 +65,8 @@ export default { name: "Name", canonical_alias: "Alias", joined_members: "Mitglieder", + invite_members: "Mitglieder einladen", + invitees: "Einladungen", }, }, connections: { diff --git a/src/i18n/en.js b/src/i18n/en.js index f8cc133..137b181 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -65,6 +65,9 @@ export default { name: "Name", canonical_alias: "Alias", joined_members: "Members", + invite_members: "Invite Members", + + invitees: "Invitations", }, }, connections: { diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js index 742214d..00d14be 100644 --- a/src/synapse/dataProvider.js +++ b/src/synapse/dataProvider.js @@ -23,6 +23,7 @@ const resourceMap = { is_guest: !!u.is_guest, admin: !!u.admin, deactivated: !!u.deactivated, + displayname: u.display_name || u.displayname, }), data: "users", total: json => json.total, @@ -40,16 +41,23 @@ const resourceMap = { }), data: "rooms", total: json => json.total_rooms, - create: params => ({ - method: "POST", - endpoint: "/_matrix/client/r0/createRoom", - body: { - name: params.data.name, - room_alias_name: params.data.canonical_alias, - visibility: params.data.public ? "public" : "private", - }, - map: r => ({ id: r.room_id }), - }), + create: params => { + let invitees = params.data.invitees; + return { + method: "POST", + endpoint: "/_matrix/client/r0/createRoom", + body: { + name: params.data.name, + room_alias_name: params.data.canonical_alias, + visibility: params.data.public ? "public" : "private", + invite: + Array.isArray(invitees) && invitees.length > 0 + ? invitees + : undefined, + }, + map: r => ({ id: r.room_id }), + }; + }, }, connections: { path: "/_synapse/admin/v1/whois",