From d02bf0faa1a60c42e87ea27d8a40a7c2d1da98b1 Mon Sep 17 00:00:00 2001 From: Ian Morland <16573496+imorland@users.noreply.github.com> Date: Mon, 8 Aug 2022 20:26:16 +0200 Subject: [PATCH] feat: Delete all notifications (#3529) * Add delete all notifications option * chore: `DELETE /api/notifications` as per conventions * test: can delete all notifications Co-authored-by: Sami Mazouz --- .../src/forum/components/NotificationList.js | 34 +++++++-- .../src/forum/states/NotificationListState.ts | 16 +++++ .../core/less/forum/NotificationList.less | 4 ++ framework/core/locale/core.yml | 2 + .../DeleteAllNotificationsController.php | 41 +++++++++++ framework/core/src/Api/routes.php | 7 ++ .../Command/DeleteAllNotifications.php | 30 ++++++++ .../Command/DeleteAllNotificationsHandler.php | 54 ++++++++++++++ .../src/Notification/Event/DeletedAll.php | 32 +++++++++ .../Notification/NotificationRepository.php | 5 ++ .../api/notifications/DeleteTest.php | 72 +++++++++++++++++++ 11 files changed, 291 insertions(+), 6 deletions(-) create mode 100644 framework/core/src/Api/Controller/DeleteAllNotificationsController.php create mode 100644 framework/core/src/Notification/Command/DeleteAllNotifications.php create mode 100644 framework/core/src/Notification/Command/DeleteAllNotificationsHandler.php create mode 100644 framework/core/src/Notification/Event/DeletedAll.php create mode 100644 framework/core/tests/integration/api/notifications/DeleteTest.php diff --git a/framework/core/js/src/forum/components/NotificationList.js b/framework/core/js/src/forum/components/NotificationList.js index 8c63fc328..abfd52423 100644 --- a/framework/core/js/src/forum/components/NotificationList.js +++ b/framework/core/js/src/forum/components/NotificationList.js @@ -6,6 +6,7 @@ import Link from '../../common/components/Link'; import LoadingIndicator from '../../common/components/LoadingIndicator'; import Discussion from '../../common/models/Discussion'; import ItemList from '../../common/utils/ItemList'; +import Tooltip from '../../common/components/Tooltip'; /** * The `NotificationList` component displays a list of the logged-in user's @@ -34,15 +35,36 @@ export default class NotificationList extends Component { items.add( 'mark_all_as_read', -