diff --git a/README.md b/README.md index 5e5c84b..4bae8a4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This project is built using [react-admin](https://marmelab.com/react-admin/). -It needs at least Synapse v1.13.0 for all functions to work as expected! +It needs at least Synapse v1.14.0 for all functions to work as expected! ## Step-By-Step install: diff --git a/src/App.js b/src/App.js index f943e3f..b3c40c3 100644 --- a/src/App.js +++ b/src/App.js @@ -4,7 +4,7 @@ import polyglotI18nProvider from "ra-i18n-polyglot"; import authProvider from "./synapse/authProvider"; import dataProvider from "./synapse/dataProvider"; import { UserList, UserCreate, UserEdit } from "./components/users"; -import { RoomList } from "./components/rooms"; +import { RoomList, RoomShow } from "./components/rooms"; import LoginPage from "./components/LoginPage"; import UserIcon from "@material-ui/icons/Group"; import { ViewListIcon as RoomIcon } from "@material-ui/icons/ViewList"; @@ -35,7 +35,7 @@ const App = () => ( edit={UserEdit} icon={UserIcon} /> - + diff --git a/src/components/rooms.js b/src/components/rooms.js index 4c598b9..fb30fa7 100644 --- a/src/components/rooms.js +++ b/src/components/rooms.js @@ -1,16 +1,23 @@ import React from "react"; import { + BooleanField, Datagrid, List, - TextField, Pagination, - BooleanField, + SelectField, + Show, + Tab, + TabbedShowLayout, + TextField, useTranslate, } from "react-admin"; import get from "lodash/get"; import { Tooltip, Typography } from "@material-ui/core"; import HttpsIcon from "@material-ui/icons/Https"; import NoEncryptionIcon from "@material-ui/icons/NoEncryption"; +import PageviewIcon from "@material-ui/icons/Pageview"; +import ViewListIcon from "@material-ui/icons/ViewList"; +import VisibilityIcon from "@material-ui/icons/Visibility"; const RoomPagination = props => ( @@ -48,7 +55,7 @@ export const RoomList = props => ( pagination={} sort={{ field: "name", order: "ASC" }} > - + ( ); + +const RoomTitle = ({ record }) => { + const translate = useTranslate(); + var name = "" + if (record) { + name = record.name !== "" ? record.name : record.id + } + + return ( + + {translate("resources.rooms.name", 1)} {name} + + ); +}; + +export const RoomShow = props => { + const translate = useTranslate(); + return ( + }> + + }> + + + + + + + } + path="detail" + > + + + + + + + + } + path="permission" + > + + + + + + + + + ); +}; diff --git a/src/i18n/de.js b/src/i18n/de.js index cc75b68..560e310 100644 --- a/src/i18n/de.js +++ b/src/i18n/de.js @@ -15,6 +15,15 @@ export default { invalid_user_id: "Muss eine vollständige Matrix Benutzer-ID sein, z.B. @benutzer_id:homeserver", }, + rooms: { + details: "Raumdetails", + tabs: { + basic: "Allgemein", + members: "Mitglieder", + detail: "Details", + permission: "Berechtigungen", + }, + }, }, resources: { users: { @@ -58,12 +67,36 @@ export default { name: "Name", canonical_alias: "Alias", joined_members: "Mitglieder", - joined_local_members: "lokale Mitglieder", + joined_local_members: "Lokale Mitglieder", state_events: "Ereignisse", version: "Version", is_encrypted: "Verschlüsselt", - federatable: "Fö­de­riert", + encryption: "Verschlüsselungs-Algorithmus", + federatable: "Fö­de­rierbar", public: "Öffentlich", + creator: "Ersteller", + join_rules: "Beitrittsregeln", + guest_access: "Gastzugriff", + history_visibility: "Historie-Sichtbarkeit", + }, + enums: { + join_rules: { + public: "Öffentlich", + knock: "Auf Anfrage", + invite: "Nur auf Einladung", + private: "Privat", + }, + guest_access: { + can_join: "Gäste können beitreten", + forbidden: "Gäste können nicht beitreten", + }, + history_visibility: { + invited: "Ab Einladung", + joined: "Ab Beitritt", + shared: "Ab Setzen der Einstellung", + world_readable: "Jeder", + }, + unencrypted: "Nicht verschlüsselt", }, }, connections: { diff --git a/src/i18n/en.js b/src/i18n/en.js index 3c0fd7c..12ba1ae 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -14,6 +14,14 @@ export default { invalid_user_id: "Must be a fully qualified Matrix user-id, e.g. @user_id:homeserver", }, + rooms: { + tabs: { + basic: "Basic", + members: "Members", + detail: "Details", + permission: "Permissions", + }, + }, }, resources: { users: { @@ -61,8 +69,32 @@ export default { state_events: "State events", version: "Version", is_encrypted: "Encrypted", + encryption: "Encryption", federatable: "Federatable", public: "Public", + creator: "Creator", + join_rules: "Join rules", + guest_access: "Guest access", + history_visibility: "History visibility", + }, + enums: { + join_rules: { + public: "Public", + knock: "Knock", + invite: "Invite", + private: "Private", + }, + guest_access: { + can_join: "Guests can join", + forbidden: "Guests can not join", + }, + history_visibility: { + invited: "Since invited", + joined: "Since joined", + shared: "Since shared", + world_readable: "Anyone", + }, + unencrypted: "Unencrypted", }, }, connections: {