Added "Last seen" filter to members screen

refs https://github.com/TryGhost/Team/issues/1418

- adds "Last seen" option to members filtering that lets you filter by date a member last logged in or opened an email with `before`, `on or before`, `on or after`, and `after` options
- adds "Last seen on x" data to the member details screen
This commit is contained in:
Kevin Ansfield 2022-03-08 20:21:49 +00:00
parent 4562476d4e
commit 3a9ea11213
5 changed files with 12 additions and 31 deletions

View File

@ -44,18 +44,16 @@
</p>
<p>
{{svg-jar "member-add"}}
Created on {{moment-format @member.createdAtUTC "D MMM YYYY"}}
Created on {{moment-format (moment-site-tz @member.createdAtUTC) "D MMM YYYY"}}
</p>
<p class="gh-member-last-seen">
{{svg-jar "eye"}}
{{#if (not (is-empty @member.lastSeenAtUTC))}}
Last seen on {{moment-format (moment-site-tz @member.lastSeenAtUTC) "D MMM YYYY"}}
{{else}}
<span>Not seen yet</span>
{{/if}}
</p>
{{#if (feature "membersLastSeenFilter")}}
<p class="gh-member-last-seen">
{{svg-jar "eye"}}
{{#if (not (is-empty @member.lastSeenAtUTC))}}
Last seen on {{moment-format @member.lastSeenAtUTC "D MMM YYYY"}}
{{else}}
<span>Not seen yet</span>
{{/if}}
</p>
{{/if}}
</div>
{{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled"))}}
<div class="gh-member-details-stats-container">
@ -64,9 +62,9 @@
<div class="gh-members-no-stats">
<p>
{{#if @member.name}}
We'll show {{first-name @member.name}}'s email stats here once they receive their first newsletter.
We'll show {{first-name @member.name}}'s email stats here once they receive their first newsletter.
{{else}}
We'll show this member's email stats here once they receive their first newsletter.
We'll show this member's email stats here once they receive their first newsletter.
{{/if}}
</p>
</div>

View File

@ -14,7 +14,7 @@ const FILTER_PROPERTIES = [
// {label: 'Location', name: 'location', group: 'Basic'},
{label: 'Label', name: 'label', group: 'Basic', valueType: 'array'},
{label: 'Newsletter subscription', name: 'subscribed', group: 'Basic'},
{label: 'Last seen', name: 'last_seen_at', group: 'Basic', valueType: 'date', feature: 'membersLastSeenFilter'},
{label: 'Last seen', name: 'last_seen_at', group: 'Basic', valueType: 'date'},
{label: 'Created', name: 'created_at', group: 'Basic', valueType: 'date'},
// Member subscription

View File

@ -90,9 +90,6 @@ export default class FeatureService extends Service {
@feature('membersTableStatus')
membersTableStatus;
@feature('membersLastSeenFilter')
membersLastSeenFilter;
@feature('membersContainsFilters')
membersContainsFilters;

View File

@ -365,19 +365,6 @@
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Members "Last seen" filter</h4>
<p class="gh-expandable-description">
Filter members by the date they were last seen (logged in or read an email)
</p>
</div>
<div class="for-switch">
<GhFeatureFlag @flag="membersLastSeenFilter" />
</div>
</div>
</div>
<div class="gh-expandable-block">
<div class="gh-expandable-header">
<div>

View File

@ -19,7 +19,6 @@ describe('Acceptance: Members filtering', function () {
beforeEach(async function () {
this.server.loadFixtures('configs');
this.server.loadFixtures('settings');
enableLabsFlag(this.server, 'membersLastSeenFilter');
enableLabsFlag(this.server, 'multipleProducts');
// test with stripe connected and email turned on