mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-12-23 13:33:18 +00:00
Add confirmation when deleting rooms
Change-Id: I5dce8ebfb7cab988e0e6664c704c04b44a4d2f92
This commit is contained in:
parent
26b8cea6a5
commit
4324ebfdb8
3 changed files with 18 additions and 0 deletions
|
@ -2,6 +2,7 @@ import React, { Fragment } from "react";
|
|||
import { connect } from "react-redux";
|
||||
import {
|
||||
BooleanField,
|
||||
BulkDeleteWithConfirmButton,
|
||||
Datagrid,
|
||||
Filter,
|
||||
List,
|
||||
|
@ -181,6 +182,13 @@ export const RoomShow = props => {
|
|||
</Show>
|
||||
);
|
||||
};
|
||||
|
||||
const RoomBulkActionButtons = props => (
|
||||
<Fragment>
|
||||
<BulkDeleteWithConfirmButton {...props} />
|
||||
</Fragment>
|
||||
);
|
||||
|
||||
const RoomFilter = ({ ...props }) => {
|
||||
const translate = useTranslate();
|
||||
return (
|
||||
|
@ -220,6 +228,7 @@ const FilterableRoomList = ({ ...props }) => {
|
|||
const stateEventsFilter = filter && filter.state_events ? true : false;
|
||||
const versionFilter = filter && filter.version ? true : false;
|
||||
const federateableFilter = filter && filter.federatable ? true : false;
|
||||
const translate = useTranslate();
|
||||
|
||||
return (
|
||||
<List
|
||||
|
@ -227,6 +236,7 @@ const FilterableRoomList = ({ ...props }) => {
|
|||
pagination={<RoomPagination />}
|
||||
sort={{ field: "name", order: "ASC" }}
|
||||
filters={<RoomFilter />}
|
||||
bulkActionButtons={<RoomBulkActionButtons confirmTitle={translate("synapseadmin.rooms.delete.title")} confirmContent={translate("synapseadmin.rooms.delete.message")}/>}
|
||||
>
|
||||
<Datagrid rowClick="show">
|
||||
<EncryptionField
|
||||
|
|
|
@ -23,6 +23,10 @@ export default {
|
|||
detail: "Details",
|
||||
permission: "Berechtigungen",
|
||||
},
|
||||
delete: {
|
||||
title: "Raum löschen",
|
||||
message: "Sind Sie sicher dass Sie den Raum löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden. Alle Nachrichten und Medien, die der Raum beinhaltet werden vom Server gelöscht!",
|
||||
},
|
||||
},
|
||||
},
|
||||
resources: {
|
||||
|
|
|
@ -21,6 +21,10 @@ export default {
|
|||
detail: "Details",
|
||||
permission: "Permissions",
|
||||
},
|
||||
delete: {
|
||||
title: "Delete room",
|
||||
message: "Are you sure you want to delete the room? This cannot be undone. All messages and shared media in the room will be deleted from the server!",
|
||||
},
|
||||
},
|
||||
},
|
||||
resources: {
|
||||
|
|
Loading…
Reference in a new issue