From f2206fb23265104b29c531f38d9283a93fb377f0 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Thu, 22 Aug 2024 17:26:46 +0700 Subject: [PATCH] Added one-time payments under "payments" for filtering (#20807) ref PLG-153 - Scoped one-time payments (`donation_event`) under the "payments" category in the member activity feed filter. - Updated `toggleEventType` logic to ensure that toggling "payments" also toggles one-time payments when the `tipsAndDonations` feature is enabled. - Refactored event type handling into utility functions for easier testing. - Added unit tests for the new utility functions to ensure correct behaviour. - Added acceptance testing. --- .../members-activity/event-type-filter.hbs | 5 +- .../members-activity/event-type-filter.js | 54 ++------------- ghost/admin/app/utils/member-event-types.js | 57 ++++++++++++++++ .../mirage/factories/member-activity-event.js | 1 + .../tests/acceptance/members-activity-test.js | 60 +++++++++++++++- .../unit/utils/member-event-types-test.js | 68 +++++++++++++++++++ 6 files changed, 193 insertions(+), 52 deletions(-) create mode 100644 ghost/admin/app/utils/member-event-types.js create mode 100644 ghost/admin/tests/unit/utils/member-event-types-test.js diff --git a/ghost/admin/app/components/members-activity/event-type-filter.hbs b/ghost/admin/app/components/members-activity/event-type-filter.hbs index 112e84bfda..9a3a1419c8 100644 --- a/ghost/admin/app/components/members-activity/event-type-filter.hbs +++ b/ghost/admin/app/components/members-activity/event-type-filter.hbs @@ -1,5 +1,5 @@ - + {{svg-jar "filter"}} Filter events @@ -13,7 +13,7 @@ {{#if type.divider}}
  • {{/if}} -
  • +