diff --git a/src/App.js b/src/App.js index 58cdb22..1d61d84 100644 --- a/src/App.js +++ b/src/App.js @@ -8,26 +8,15 @@ import { 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, RoomShow } from "./components/rooms"; -import { ReportList, ReportShow } from "./components/EventReports"; +import users from "./components/users"; +import rooms from "./components/rooms"; +import userMediaStats from "./components/statistics"; +import reports from "./components/EventReports"; +import roomDirectory from "./components/RoomDirectory"; +import destinations from "./components/destinations"; +import registrationToken from "./components/RegistrationTokens"; import LoginPage from "./components/LoginPage"; -import ConfirmationNumberIcon from "@mui/icons-material/ConfirmationNumber"; -import CloudQueueIcon from "@mui/icons-material/CloudQueue"; -import EqualizerIcon from "@mui/icons-material/Equalizer"; -import UserIcon from "@mui/icons-material/Group"; -import { UserMediaStatsList } from "./components/statistics"; -import RoomIcon from "@mui/icons-material/ViewList"; -import ReportIcon from "@mui/icons-material/Warning"; -import FolderSharedIcon from "@mui/icons-material/FolderShared"; -import { DestinationList, DestinationShow } from "./components/destinations"; import { ImportFeature } from "./components/ImportFeature"; -import { - RegistrationTokenCreate, - RegistrationTokenEdit, - RegistrationTokenList, -} from "./components/RegistrationTokens"; -import { RoomDirectoryList } from "./components/RoomDirectory"; import { Route } from "react-router-dom"; import germanMessages from "./i18n/de"; import englishMessages from "./i18n/en"; @@ -59,43 +48,13 @@ const App = () => ( } /> - - - - - - - + + + + + + + diff --git a/src/components/EventReports.js b/src/components/EventReports.js index 8185960..7e67eb7 100644 --- a/src/components/EventReports.js +++ b/src/components/EventReports.js @@ -13,6 +13,7 @@ import { useTranslate, } from "react-admin"; import PageviewIcon from "@mui/icons-material/Pageview"; +import ReportIcon from "@mui/icons-material/Warning"; import ViewListIcon from "@mui/icons-material/ViewList"; const date_format = { @@ -118,3 +119,12 @@ export const ReportList = props => ( ); + +const resource = { + name: "reports", + icon: ReportIcon, + list: ReportList, + show: ReportShow, +}; + +export default resource; diff --git a/src/components/RegistrationTokens.js b/src/components/RegistrationTokens.js index 779feec..483d1d8 100644 --- a/src/components/RegistrationTokens.js +++ b/src/components/RegistrationTokens.js @@ -17,6 +17,7 @@ import { TextField, Toolbar, } from "react-admin"; +import RegistrationTokenIcon from "@mui/icons-material/ConfirmationNumber"; const date_format = { year: "numeric", @@ -121,3 +122,13 @@ export const RegistrationTokenEdit = props => ( ); + +const resource = { + name: "users", + icon: RegistrationTokenIcon, + list: RegistrationTokenList, + edit: RegistrationTokenEdit, + create: RegistrationTokenCreate, +}; + +export default resource; diff --git a/src/components/RoomDirectory.js b/src/components/RoomDirectory.js index 4fbcca7..6981889 100644 --- a/src/components/RoomDirectory.js +++ b/src/components/RoomDirectory.js @@ -1,5 +1,4 @@ import React from "react"; -import FolderSharedIcon from "@mui/icons-material/FolderShared"; import { BooleanField, BulkDeleteButton, @@ -22,6 +21,7 @@ import { useUnselectAll, } from "react-admin"; import { useMutation } from "react-query"; +import RoomDirectoryIcon from "@mui/icons-material/FolderShared"; import AvatarField from "./AvatarField"; const RoomDirectoryPagination = props => ( @@ -44,7 +44,7 @@ export const RoomDirectoryDeleteButton = props => { smart_count: 1, })} resource="room_directory" - icon={} + icon={} /> ); }; @@ -57,7 +57,7 @@ export const RoomDirectoryBulkDeleteButton = props => ( confirmTitle="resources.room_directory.action.title" confirmContent="resources.room_directory.action.content" resource="room_directory" - icon={} + icon={} /> ); @@ -91,7 +91,7 @@ export const RoomDirectoryBulkSaveButton = () => { onClick={handleSend} disabled={isloading} > - + ); }; @@ -125,7 +125,7 @@ export const RoomDirectorySaveButton = () => { onClick={handleSend} disabled={isloading} > - + ); }; @@ -194,3 +194,11 @@ export const RoomDirectoryList = () => ( ); + +const resource = { + name: "room_directory", + icon: RoomDirectoryIcon, + list: RoomDirectoryList, +}; + +export default resource; diff --git a/src/components/destinations.js b/src/components/destinations.js index cdd9e99..7f6ee02 100644 --- a/src/components/destinations.js +++ b/src/components/destinations.js @@ -20,6 +20,7 @@ import { useTranslate, } from "react-admin"; import AutorenewIcon from "@mui/icons-material/Autorenew"; +import DestinationsIcon from "@mui/icons-material/CloudQueue"; import FolderSharedIcon from "@mui/icons-material/FolderShared"; import ViewListIcon from "@mui/icons-material/ViewList"; @@ -177,3 +178,12 @@ export const DestinationShow = props => { ); }; + +const resource = { + name: "destinations", + icon: DestinationsIcon, + list: DestinationList, + show: DestinationShow, +}; + +export default resource; diff --git a/src/components/rooms.js b/src/components/rooms.js index deedfb1..8cfa793 100644 --- a/src/components/rooms.js +++ b/src/components/rooms.js @@ -34,6 +34,7 @@ import UserIcon from "@mui/icons-material/Group"; import ViewListIcon from "@mui/icons-material/ViewList"; import VisibilityIcon from "@mui/icons-material/Visibility"; import EventIcon from "@mui/icons-material/Event"; +import RoomIcon from "@mui/icons-material/ViewList"; import { RoomDirectoryBulkDeleteButton, RoomDirectoryBulkSaveButton, @@ -346,3 +347,12 @@ export const RoomList = props => { ); }; + +const resource = { + name: "rooms", + icon: RoomIcon, + list: RoomList, + show: RoomShow, +}; + +export default resource; diff --git a/src/components/statistics.js b/src/components/statistics.js index 1cadac6..90fd2fa 100644 --- a/src/components/statistics.js +++ b/src/components/statistics.js @@ -12,6 +12,7 @@ import { TopToolbar, useListContext, } from "react-admin"; +import EqualizerIcon from "@mui/icons-material/Equalizer"; import { DeleteMediaButton } from "./media"; const ListActions = props => { @@ -74,3 +75,11 @@ export const UserMediaStatsList = props => ( ); + +const resource = { + name: "user_media_statistics", + icon: EqualizerIcon, + list: UserMediaStatsList, +}; + +export default resource; diff --git a/src/components/users.js b/src/components/users.js index a2e240f..dcd3b87 100644 --- a/src/components/users.js +++ b/src/components/users.js @@ -7,6 +7,7 @@ import NotificationsIcon from "@mui/icons-material/Notifications"; import PermMediaIcon from "@mui/icons-material/PermMedia"; import PersonPinIcon from "@mui/icons-material/PersonPin"; import SettingsInputComponentIcon from "@mui/icons-material/SettingsInputComponent"; +import UserIcon from "@mui/icons-material/Group"; import ViewListIcon from "@mui/icons-material/ViewList"; import { ArrayInput, @@ -524,3 +525,13 @@ export const UserEdit = props => { ); }; + +const resource = { + name: "users", + icon: UserIcon, + list: UserList, + edit: UserEdit, + create: UserCreate, +}; + +export default resource;