From 9d26a1ce3a2d45818f899401b86f4fefa4719fd1 Mon Sep 17 00:00:00 2001 From: Steffo <41108856+SteffoSpieler@users.noreply.github.com> Date: Wed, 7 Feb 2024 16:34:50 +0100 Subject: [PATCH] Allow deletion of event reports (#462) * feat: Allow event reports to get deleted * chore: Change german translation of reports name to be more fitting --- src/components/EventReports.jsx | 20 +++++++++++++++++++- src/i18n/de.js | 9 ++++++++- src/i18n/en.js | 7 +++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/components/EventReports.jsx b/src/components/EventReports.jsx index ffece71..0f0810d 100644 --- a/src/components/EventReports.jsx +++ b/src/components/EventReports.jsx @@ -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 ( - + }> { ); }; +const ReportShowActions = () => { + const record = useRecordContext(); + + return ( + + + + ); +}; + export const ReportList = props => (