mirror of
https://github.com/Awesome-Technologies/synapse-admin.git
synced 2024-10-31 06:55:15 +03: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 {
|
import {
|
||||||
Datagrid,
|
Datagrid,
|
||||||
DateField,
|
DateField,
|
||||||
|
DeleteButton,
|
||||||
List,
|
List,
|
||||||
NumberField,
|
NumberField,
|
||||||
Pagination,
|
Pagination,
|
||||||
|
@ -10,6 +11,8 @@ import {
|
||||||
Tab,
|
Tab,
|
||||||
TabbedShowLayout,
|
TabbedShowLayout,
|
||||||
TextField,
|
TextField,
|
||||||
|
TopToolbar,
|
||||||
|
useRecordContext,
|
||||||
useTranslate,
|
useTranslate,
|
||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import PageviewIcon from "@mui/icons-material/Pageview";
|
import PageviewIcon from "@mui/icons-material/Pageview";
|
||||||
|
@ -32,7 +35,7 @@ const ReportPagination = () => (
|
||||||
export const ReportShow = props => {
|
export const ReportShow = props => {
|
||||||
const translate = useTranslate();
|
const translate = useTranslate();
|
||||||
return (
|
return (
|
||||||
<Show {...props}>
|
<Show {...props} actions={<ReportShowActions />}>
|
||||||
<TabbedShowLayout>
|
<TabbedShowLayout>
|
||||||
<Tab
|
<Tab
|
||||||
label={translate("synapseadmin.reports.tabs.basic", {
|
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 => (
|
export const ReportList = props => (
|
||||||
<List
|
<List
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
@ -188,7 +188,7 @@ const de = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
reports: {
|
reports: {
|
||||||
name: "Ereignisbericht |||| Ereignisberichte",
|
name: "Gemeldetes Ereignis |||| Gemeldete Ereignisse",
|
||||||
fields: {
|
fields: {
|
||||||
id: "ID",
|
id: "ID",
|
||||||
received_ts: "Meldezeit",
|
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: {
|
connections: {
|
||||||
name: "Verbindungen",
|
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: {
|
connections: {
|
||||||
name: "Connections",
|
name: "Connections",
|
||||||
|
|
Loading…
Reference in a new issue