mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-11-22 06:21:28 +00:00
Add delete button to room detail page (#97)
* Add delete button to room detail page * Add confirmation dialog for room deletion
This commit is contained in:
parent
b184954ffa
commit
425c210cfc
1 changed files with 19 additions and 1 deletions
|
@ -4,6 +4,7 @@ import {
|
|||
BooleanField,
|
||||
BulkDeleteWithConfirmButton,
|
||||
Datagrid,
|
||||
DeleteButton,
|
||||
Filter,
|
||||
List,
|
||||
Pagination,
|
||||
|
@ -15,6 +16,7 @@ import {
|
|||
Tab,
|
||||
TabbedShowLayout,
|
||||
TextField,
|
||||
TopToolbar,
|
||||
useTranslate,
|
||||
} from "react-admin";
|
||||
import get from "lodash/get";
|
||||
|
@ -70,10 +72,26 @@ const RoomTitle = ({ record }) => {
|
|||
);
|
||||
};
|
||||
|
||||
const RoomShowActions = ({ basePath, data, resource }) => {
|
||||
const translate = useTranslate();
|
||||
return (
|
||||
<TopToolbar>
|
||||
<DeleteButton
|
||||
basePath={basePath}
|
||||
record={data}
|
||||
resource={resource}
|
||||
undoable={false}
|
||||
confirmTitle={translate("synapseadmin.rooms.delete.title")}
|
||||
confirmContent={translate("synapseadmin.rooms.delete.message")}
|
||||
/>
|
||||
</TopToolbar>
|
||||
);
|
||||
};
|
||||
|
||||
export const RoomShow = props => {
|
||||
const translate = useTranslate();
|
||||
return (
|
||||
<Show {...props} title={<RoomTitle />}>
|
||||
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
|
||||
<TabbedShowLayout>
|
||||
<Tab label="synapseadmin.rooms.tabs.basic" icon={<ViewListIcon />}>
|
||||
<TextField source="room_id" />
|
||||
|
|
Loading…
Reference in a new issue