mirror of
https://github.com/UA-Fediland/synapse-admin.git
synced 2024-12-22 04:53:17 +00:00
Allow deletion of event reports (#462)
* feat: Allow event reports to get deleted * chore: Change german translation of reports name to be more fitting
This commit is contained in:
parent
3116b4e07a
commit
9d26a1ce3a
3 changed files with 34 additions and 2 deletions
|
@ -2,6 +2,7 @@ import React from "react";
|
|||
import {
|
||||
Datagrid,
|
||||
DateField,
|
||||
DeleteButton,
|
||||
List,
|
||||
NumberField,
|
||||
Pagination,
|
||||
|
@ -10,6 +11,8 @@ import {
|
|||
Tab,
|
||||
TabbedShowLayout,
|
||||
TextField,
|
||||
TopToolbar,
|
||||
useRecordContext,
|
||||
useTranslate,
|
||||
} from "react-admin";
|
||||
import PageviewIcon from "@mui/icons-material/Pageview";
|
||||
|
@ -32,7 +35,7 @@ const ReportPagination = () => (
|
|||
export const ReportShow = props => {
|
||||
const translate = useTranslate();
|
||||
return (
|
||||
<Show {...props}>
|
||||
<Show {...props} actions={<ReportShowActions />}>
|
||||
<TabbedShowLayout>
|
||||
<Tab
|
||||
label={translate("synapseadmin.reports.tabs.basic", {
|
||||
|
@ -99,6 +102,21 @@ export const ReportShow = props => {
|
|||
);
|
||||
};
|
||||
|
||||
const ReportShowActions = () => {
|
||||
const record = useRecordContext();
|
||||
|
||||
return (
|
||||
<TopToolbar>
|
||||
<DeleteButton
|
||||
record={record}
|
||||
mutationMode="pessimistic"
|
||||
confirmTitle="resources.reports.action.erase.title"
|
||||
confirmContent="resources.reports.action.erase.content"
|
||||
/>
|
||||
</TopToolbar>
|
||||
);
|
||||
};
|
||||
|
||||
export const ReportList = props => (
|
||||
<List
|
||||
{...props}
|
||||
|
|
|
@ -188,7 +188,7 @@ const de = {
|
|||
},
|
||||
},
|
||||
reports: {
|
||||
name: "Ereignisbericht |||| Ereignisberichte",
|
||||
name: "Gemeldetes Ereignis |||| Gemeldete Ereignisse",
|
||||
fields: {
|
||||
id: "ID",
|
||||
received_ts: "Meldezeit",
|
||||
|
@ -210,6 +210,13 @@ const de = {
|
|||
},
|
||||
},
|
||||
},
|
||||
action: {
|
||||
erase: {
|
||||
title: "Gemeldetes Event löschen",
|
||||
content:
|
||||
"Sind Sie sicher dass Sie das gemeldete Event löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",
|
||||
},
|
||||
},
|
||||
},
|
||||
connections: {
|
||||
name: "Verbindungen",
|
||||
|
|
|
@ -207,6 +207,13 @@ const en = {
|
|||
},
|
||||
},
|
||||
},
|
||||
action: {
|
||||
erase: {
|
||||
title: "Delete reported event",
|
||||
content:
|
||||
"Are you sure you want to delete the reported event? This cannot be undone.",
|
||||
},
|
||||
},
|
||||
},
|
||||
connections: {
|
||||
name: "Connections",
|
||||
|
|
Loading…
Reference in a new issue