From 3a9ea112139002db45bad98f07a48bf5268922e9 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 8 Mar 2022 20:21:49 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20"Last=20seen"=20filter=20to?= =?UTF-8?q?=20members=20screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../app/components/gh-member-details.hbs | 24 +++++++++---------- ghost/admin/app/components/members/filter.js | 2 +- ghost/admin/app/services/feature.js | 3 --- ghost/admin/app/templates/settings/labs.hbs | 13 ---------- .../tests/acceptance/members/filter-test.js | 1 - 5 files changed, 12 insertions(+), 31 deletions(-) diff --git a/ghost/admin/app/components/gh-member-details.hbs b/ghost/admin/app/components/gh-member-details.hbs index bf471437af..6b80ed5af5 100644 --- a/ghost/admin/app/components/gh-member-details.hbs +++ b/ghost/admin/app/components/gh-member-details.hbs @@ -44,18 +44,16 @@

{{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"}} +

+

+ {{svg-jar "eye"}} + {{#if (not (is-empty @member.lastSeenAtUTC))}} + Last seen on {{moment-format (moment-site-tz @member.lastSeenAtUTC) "D MMM YYYY"}} + {{else}} + Not seen yet + {{/if}}

- {{#if (feature "membersLastSeenFilter")}} -

- {{svg-jar "eye"}} - {{#if (not (is-empty @member.lastSeenAtUTC))}} - Last seen on {{moment-format @member.lastSeenAtUTC "D MMM YYYY"}} - {{else}} - Not seen yet - {{/if}} -

- {{/if}} {{#if (and (not-eq this.settings.membersSignupAccess "none") (not-eq this.settings.editorDefaultEmailRecipients "disabled"))}}
@@ -64,9 +62,9 @@

{{#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}}

diff --git a/ghost/admin/app/components/members/filter.js b/ghost/admin/app/components/members/filter.js index 7a6c5d5782..560202a58a 100644 --- a/ghost/admin/app/components/members/filter.js +++ b/ghost/admin/app/components/members/filter.js @@ -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 diff --git a/ghost/admin/app/services/feature.js b/ghost/admin/app/services/feature.js index f234e14c9d..b84e794b2f 100644 --- a/ghost/admin/app/services/feature.js +++ b/ghost/admin/app/services/feature.js @@ -90,9 +90,6 @@ export default class FeatureService extends Service { @feature('membersTableStatus') membersTableStatus; - @feature('membersLastSeenFilter') - membersLastSeenFilter; - @feature('membersContainsFilters') membersContainsFilters; diff --git a/ghost/admin/app/templates/settings/labs.hbs b/ghost/admin/app/templates/settings/labs.hbs index 045ad5d69f..47c8148b77 100644 --- a/ghost/admin/app/templates/settings/labs.hbs +++ b/ghost/admin/app/templates/settings/labs.hbs @@ -365,19 +365,6 @@
-
-
-
-

Members "Last seen" filter

-

- Filter members by the date they were last seen (logged in or read an email) -

-
-
- -
-
-
diff --git a/ghost/admin/tests/acceptance/members/filter-test.js b/ghost/admin/tests/acceptance/members/filter-test.js index 4b2c2c6fe7..dfed59b883 100644 --- a/ghost/admin/tests/acceptance/members/filter-test.js +++ b/ghost/admin/tests/acceptance/members/filter-test.js @@ -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