0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Added spam event to feed in frontend admin (#15847)

closes TryGhost/Team#2248
This commit is contained in:
Elena Baidakova 2022-11-18 14:33:48 +04:00 committed by GitHub
parent 8283de99c8
commit 9d6bcdba47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 104 additions and 9 deletions

View file

@ -6,7 +6,7 @@
</div>
</div>
{{else}}
{{#let (members-event-fetcher filter=(members-event-filter member=@member.id excludedEvents=this.excludedEventTypes) pageSize=5) as |eventsFetcher|}}
{{#let (members-event-fetcher filter=(members-event-filter member=@member.id excludedEvents=this.excludedEventTypes) pageSize=5 memberId=@member.id) as |eventsFetcher|}}
<div class="gh-main-section-content grey {{if eventsFetcher.data "" "mt8"}}">
<div class="gh-member-feed {{if eventsFetcher.data "" "gh-member-feed-no-data"}}" ...attributes>
<div class="flex-auto flex flex-column items-stretch {{if eventsFetcher.data "justify-between" "h-100 justify-center"}}">

View file

@ -2,7 +2,8 @@ import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
const ALL_EVENT_TYPES = [
// todo: replace function with const after suppressionList feature flag will be removed
const ALL_EVENT_TYPES = feature => ([
{event: 'signup_event', icon: 'event-filter-signup', name: 'Signups'},
{event: 'login_event', icon: 'event-filter-login', name: 'Logins'},
{event: 'subscription_event', icon: 'event-filter-subscription', name: 'Paid subscriptions'},
@ -10,15 +11,18 @@ const ALL_EVENT_TYPES = [
{event: 'newsletter_event', icon: 'event-filter-newsletter', name: 'Email subscriptions'},
{event: 'email_opened_event', icon: 'event-filter-email-opened', name: 'Email opens'},
{event: 'email_delivered_event', icon: 'event-filter-email-delivered', name: 'Email deliveries'},
{event: 'email_failed_event', icon: 'event-filter-email-failed', name: 'Email failures'}
];
{event: 'email_failed_event', icon: 'event-filter-email-failed', name: feature.suppressionList ? 'Email bounces' : 'Email failures'}
]);
export default class MembersActivityEventTypeFilter extends Component {
@service settings;
@service feature;
get availableEventTypes() {
const extended = [...ALL_EVENT_TYPES];
const extended = [...ALL_EVENT_TYPES(this.feature)];
if (this.feature.suppressionList) {
extended.push({event: 'email_complaint_event', icon: 'event-filter-email-spam', name: 'Email spam'});
}
if (this.settings.commentsEnabled !== 'off') {
extended.push({event: 'comment_event', icon: 'event-comment', name: 'Comments'});
}

File diff suppressed because one or more lines are too long

View file

@ -3,7 +3,7 @@ import classic from 'ember-classic-decorator';
import {isBlank} from '@ember/utils';
import {inject as service} from '@ember/service';
export const EMAIL_EVENTS = ['email_sent_event', 'email_delivered_event', 'email_opened_event','email_failed_event'];
export const EMAIL_EVENTS = ['email_sent_event', 'email_delivered_event', 'email_opened_event','email_failed_event', 'email_complaint_event'];
export const NEWSLETTER_EVENTS = ['newsletter_event'];
@classic

View file

@ -84,6 +84,10 @@ export default class ParseMemberEventHelper extends Helper {
icon = 'email-delivery-failed';
}
if (event.type === 'email_complaint_event') {
icon = 'email-delivery-spam';
}
if (event.type === 'comment_event') {
icon = 'comment';
}
@ -158,7 +162,11 @@ export default class ParseMemberEventHelper extends Helper {
}
if (event.type === 'email_failed_event') {
return 'failed to receive email';
return this.feature.get('suppressionList') ? 'bounced email' : 'failed to receive email';
}
if (event.type === 'email_complaint_event') {
return 'flagged as spam email';
}
if (event.type === 'comment_event') {

View file

@ -30,12 +30,12 @@
</div>
</GhCanvasHeader>
<div class="view-container">
{{#let (members-event-fetcher filter=(members-event-filter excludedEvents=this.fullExcludedEvents member=this.member) pageSize=50) as |eventsFetcher|}}
{{#let (members-event-fetcher filter=(members-event-filter excludedEvents=this.fullExcludedEvents member=this.member) pageSize=50 memberId=this.member) as |eventsFetcher|}}
{{#if eventsFetcher.data}}
{{#if this.memberRecord}}
<GhMemberDetailsActivity @member={{this.memberRecord}} />
{{/if}}
<div class="gh-list-scrolling">
<div class="gh-list-scrolling">
<MembersActivity::Table @hideMemberColumn={{if this.member true}} @events={{eventsFetcher.data}} @hasMultipleNewsletters={{eventsFetcher.hasMultipleNewsletters}} />
{{#if (not (or eventsFetcher.isLoading eventsFetcher.hasReachedEnd))}}

View file

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
<path d="M14.412 18.978a1.22 1.22 0 0 1-1.163-.332l-2.414-2.404-2.592 1.34.1-3.843-3.036-3.035a1.219 1.219 0 0 1-.332-1.108 1.24 1.24 0 0 1 .82-.953L17.68 4.678a1.24 1.24 0 0 1 1.595 1.595l-1.307 3.919M18.917 4.926 8.339 13.743" stroke="#6C747D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.634 13.35v2.869" stroke="#F50B23" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="17.639" cy="18.75" r=".75" fill="#F50B23"/>
</svg>

After

Width:  |  Height:  |  Size: 580 B

View file

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none">
<path d="M14.412 18.978a1.22 1.22 0 0 1-1.163-.332l-2.414-2.404-2.592 1.34.1-3.843-3.036-3.035a1.219 1.219 0 0 1-.332-1.108 1.24 1.24 0 0 1 .82-.953L17.68 4.678a1.24 1.24 0 0 1 1.595 1.595l-1.307 3.919M18.917 4.926 8.339 13.743" stroke="#6C747D" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.634 13.35v2.869" stroke="#F50B23" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="17.639" cy="18.75" r=".75" fill="#F50B23"/>
</svg>

After

Width:  |  Height:  |  Size: 580 B