Add a room view

Change-Id: I20056d997e7a94fd10d03e7d1a8051030ecf7ca4
This commit is contained in:
Manuel Stahl 2020-02-07 16:19:01 +01:00
parent 26cfa80bde
commit 1e6d43e291
4 changed files with 34 additions and 0 deletions

View file

@ -4,8 +4,10 @@ import polyglotI18nProvider from "ra-i18n-polyglot";
import authProvider from "./synapse/authProvider"; import authProvider from "./synapse/authProvider";
import dataProvider from "./synapse/dataProvider"; import dataProvider from "./synapse/dataProvider";
import { UserList, UserCreate, UserEdit } from "./components/users"; import { UserList, UserCreate, UserEdit } from "./components/users";
import { RoomList } from "./components/rooms";
import LoginPage from "./components/LoginPage"; import LoginPage from "./components/LoginPage";
import UserIcon from "@material-ui/icons/Group"; import UserIcon from "@material-ui/icons/Group";
import { ViewListIcon as RoomIcon } from "@material-ui/icons/ViewList";
import germanMessages from "./i18n/de"; import germanMessages from "./i18n/de";
import englishMessages from "./i18n/en"; import englishMessages from "./i18n/en";
@ -33,6 +35,7 @@ const App = () => (
edit={UserEdit} edit={UserEdit}
icon={UserIcon} icon={UserIcon}
/> />
<Resource name="rooms" list={RoomList} icon={RoomIcon} />
</Admin> </Admin>
); );

13
src/components/rooms.js Normal file
View file

@ -0,0 +1,13 @@
import React from "react";
import { Datagrid, List, TextField } from "react-admin";
export const RoomList = props => (
<List {...props}>
<Datagrid>
<TextField source="room_id" />
<TextField source="name" />
<TextField source="canonical_alias" />
<TextField source="joined_members" />
</Datagrid>
</List>
);

View file

@ -29,5 +29,14 @@ export default {
password: "Passwort", password: "Passwort",
}, },
}, },
rooms: {
name: "Raum |||| Räume",
fields: {
room_id: "Raum-ID",
name: "Name",
canonical_alias: "Alias",
joined_members: "Mitglieder",
},
},
}, },
}; };

View file

@ -29,5 +29,14 @@ export default {
password: "Password", password: "Password",
}, },
}, },
rooms: {
name: "Room |||| Rooms",
fields: {
room_id: "Room-ID",
name: "Name",
canonical_alias: "Alias",
joined_members: "Members",
},
},
}, },
}; };