diff --git a/ghost/admin/.lint-todo b/ghost/admin/.lint-todo index 5e04e47fec..d53ee2426d 100644 --- a/ghost/admin/.lint-todo +++ b/ghost/admin/.lint-todo @@ -1231,3 +1231,4 @@ add|ember-template-lint|no-action|290|48|290|48|9ba0927837b1ab440136aff1d92f0b69 add|ember-template-lint|no-action|291|45|291|45|3c80294f3c8009bf5e59ff31d44e18cbc4c0ab89|1647993600000|1650582000000|1653174000000|app/components/settings/members-email.hbs add|ember-template-lint|no-action|148|60|148|60|9ba0927837b1ab440136aff1d92f0b694752dea8|1648080000000|1650668400000|1653260400000|app/components/settings/members-email.hbs add|ember-template-lint|no-action|149|57|149|57|3c80294f3c8009bf5e59ff31d44e18cbc4c0ab89|1648080000000|1650668400000|1653260400000|app/components/settings/members-email.hbs +remove|ember-template-lint|no-implicit-this|2|50|2|50|bd48f6e7d00782426eb9404abb796a62e1b1fddd|1646611200000|1649199600000|1651791600000|app/components/member/activity-feed.hbs diff --git a/ghost/admin/app/components/dashboard/latest-member-activity.hbs b/ghost/admin/app/components/dashboard/latest-member-activity.hbs index 9ea59828f2..cc7bccc0b7 100644 --- a/ghost/admin/app/components/dashboard/latest-member-activity.hbs +++ b/ghost/admin/app/components/dashboard/latest-member-activity.hbs @@ -6,7 +6,7 @@
- {{#let (members-event-fetcher filter=(if (feature "membersActivityFeed") (members-event-filter excludeEmailEvents=true)) pageSize=5) as |eventsFetcher|}} + {{#let (members-event-fetcher filter=(members-event-filter excludeEmailEvents=true) pageSize=5) as |eventsFetcher|}} {{#if eventsFetcher.isLoading}} Loading... {{/if}} @@ -55,11 +55,9 @@ {{/if}}
- {{#if (feature "membersActivityFeed")}} - - {{/if}} + {{/unless}} {{/let}} diff --git a/ghost/admin/app/components/dashboard/v5/recent-activity.hbs b/ghost/admin/app/components/dashboard/v5/recent-activity.hbs index 7c5120669b..08f2fcd57b 100644 --- a/ghost/admin/app/components/dashboard/v5/recent-activity.hbs +++ b/ghost/admin/app/components/dashboard/v5/recent-activity.hbs @@ -2,7 +2,7 @@

Recent activity

- {{#let (members-event-fetcher filter=(if (feature "membersActivityFeed") (members-event-filter excludeEmailEvents=true)) pageSize=5) as |eventsFetcher|}} + {{#let (members-event-fetcher filter=(members-event-filter excludeEmailEvents=true) pageSize=5) as |eventsFetcher|}} {{#if eventsFetcher.isError}}

There was an error loading events @@ -49,11 +49,9 @@ {{/if}}

- {{#if (feature "membersActivityFeed")}} - - {{/if}} + {{/if}} {{/let}}
diff --git a/ghost/admin/app/components/gh-member-activity-feed-item.hbs b/ghost/admin/app/components/gh-member-activity-feed-item.hbs deleted file mode 100644 index 591278caf4..0000000000 --- a/ghost/admin/app/components/gh-member-activity-feed-item.hbs +++ /dev/null @@ -1,9 +0,0 @@ -
- {{svg-jar @activity.icon class=@activity.iconClass}} - {{#if @activity.email}} - {{@activity.message}} - {{else}} - {{@activity.message}} - {{/if}} - {{moment-format @activity.timestamp "D MMM YYYY"}} -
\ No newline at end of file diff --git a/ghost/admin/app/components/gh-member-activity-feed.hbs b/ghost/admin/app/components/gh-member-activity-feed.hbs deleted file mode 100644 index fc98eedbe8..0000000000 --- a/ghost/admin/app/components/gh-member-activity-feed.hbs +++ /dev/null @@ -1,43 +0,0 @@ -{{#if this.activities}}

Activity

{{/if}} -
-
-
-
- {{#if this.activities}} - {{#each this.firstActivities as |activity|}} - - {{/each}} - - {{#liquid-if this.isShowingAll class="show-overflow"}} - {{#each this.remainingActivities as |activity|}} - - {{/each}} - {{/liquid-if}} - - {{#if (feature "membersActivityFeed")}} - View all activity - {{else}} - {{#if (and this.remainingActivities (not this.isShowingAll))}} - - {{/if}} - {{/if}} - {{else}} -
-
{{svg-jar "no-data-list"}}
-

Activity

-

- All events related to this member will be shown here. -

-
- {{/if}} -
-
-
-
\ No newline at end of file diff --git a/ghost/admin/app/components/gh-member-activity-feed.js b/ghost/admin/app/components/gh-member-activity-feed.js deleted file mode 100644 index dd7573653b..0000000000 --- a/ghost/admin/app/components/gh-member-activity-feed.js +++ /dev/null @@ -1,94 +0,0 @@ -import Component from '@glimmer/component'; -import {action} from '@ember/object'; -import {tracked} from '@glimmer/tracking'; - -class MemberActivity { - eventProperties = { - sent: { - icon: 'send-email', - iconClass: 'midgrey', - tooltip: 'Received email' - }, - opened: { - icon: 'eye', - iconClass: 'green-d2', - tooltip: 'Opened email' - }, - failed: { - icon: 'cross-circle', - iconClass: 'red-d2', - tooltip: 'Email delivery failed' - } - }; - - constructor(props) { - Object.assign(this, props); - } - - get icon() { - return this.eventProperties[this.event].icon; - } - - get iconClass() { - return this.eventProperties[this.event].iconClass; - } - - get tooltip() { - return this.eventProperties[this.event].tooltip; - } - - get message() { - if (this.email) { - return this.email.subject; - } - - return this.eventProperties[this.event].message; - } -} - -export default class MemberActivityFeedComponent extends Component { - @tracked isShowingAll = false; - - get activities() { - const activities = []; - - (this.args.emailRecipients || []).forEach((emailRecipient) => { - if (emailRecipient.openedAtUTC) { - activities.push(new MemberActivity({ - event: 'opened', - email: emailRecipient.email, - timestamp: emailRecipient.openedAtUTC - })); - } else if (emailRecipient.failedAtUTC) { - activities.push(new MemberActivity({ - event: 'failed', - email: emailRecipient.email, - timestamp: emailRecipient.failedAtUTC - })); - } else if (emailRecipient.processedAtUTC) { - activities.push(new MemberActivity({ - event: 'sent', - email: emailRecipient.email, - timestamp: emailRecipient.processedAtUTC - })); - } - }); - - return activities.sort((a, b) => { - return b.timestamp.valueOf() - a.timestamp.valueOf(); - }); - } - - get firstActivities() { - return this.activities.slice(0, 5); - } - - get remainingActivities() { - return this.activities.slice(5, this.activities.length); - } - - @action - showAll() { - this.isShowingAll = true; - } -} diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index c944b8f45c..da88678d04 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -303,14 +303,7 @@ {{/if}} {{/if}} - {{#if (feature "membersActivityFeed")}} - - {{else}} - - {{/if}} + diff --git a/ghost/admin/app/components/member/activity-feed.hbs b/ghost/admin/app/components/member/activity-feed.hbs index 1becbcb554..1338e84c20 100644 --- a/ghost/admin/app/components/member/activity-feed.hbs +++ b/ghost/admin/app/components/member/activity-feed.hbs @@ -1,6 +1,6 @@ {{#if @member.isNew}} -
-
+
+
@@ -8,7 +8,7 @@ {{#let (members-event-fetcher filter=(members-event-filter member=@member.id) pageSize=5) as |eventsFetcher|}} {{#if eventsFetcher.data}}

Activity

{{/if}}
-
+
{{#if eventsFetcher.isLoading}} @@ -16,7 +16,7 @@ {{else if eventsFetcher.data}} {{#each eventsFetcher.data as |rawEvent|}} {{#let (parse-member-event rawEvent) as |event|}} -
+
{{svg-jar event.icon class=event.iconClass}} diff --git a/ghost/admin/app/controllers/dashboard.js b/ghost/admin/app/controllers/dashboard.js index 473ba064c6..645f538350 100644 --- a/ghost/admin/app/controllers/dashboard.js +++ b/ghost/admin/app/controllers/dashboard.js @@ -12,20 +12,10 @@ export default class DashboardController extends Controller { @service settings; @service whatsNew; - @tracked topMembersData = null; - @tracked topMembersError = null; - @tracked topMembersLoading = false; - @tracked whatsNewEntries = null; @tracked whatsNewEntriesLoading = null; @tracked whatsNewEntriesError = null; - get topMembersDataHasOpenRates() { - return this.topMembersData && this.topMembersData.find((member) => { - return member.emailOpenRate !== null; - }); - } - get showMembersData() { return this.settings.get('membersSignupAccess') !== 'none'; } @@ -43,40 +33,10 @@ export default class DashboardController extends Controller { } initialise() { - this.loadTopMembers(); this.loadWhatsNew(); this.checkMemberCountTask.perform(); } - loadTopMembers() { - if (this.feature.membersActivityFeed) { - return; - } - - this.topMembersLoading = true; - let query = { - filter: 'email_open_rate:-null', - order: 'email_open_rate desc', - limit: 5 - }; - this.store.query('member', query).then((result) => { - if (!result.length) { - return this.store.query('member', { - filter: 'status:paid', - order: 'created_at asc', - limit: 5 - }); - } - return result; - }).then((result) => { - this.topMembersData = result; - this.topMembersLoading = false; - }).catch((error) => { - this.topMembersError = error; - this.topMembersLoading = false; - }); - } - loadWhatsNew() { this.whatsNewEntriesLoading = true; this.whatsNew.fetchLatest.perform().then(() => { diff --git a/ghost/admin/app/controllers/member.js b/ghost/admin/app/controllers/member.js index 88d6994153..d5aee79492 100644 --- a/ghost/admin/app/controllers/member.js +++ b/ghost/admin/app/controllers/member.js @@ -194,7 +194,7 @@ export default class MemberController extends Controller { this.member = yield this.store.queryRecord('member', { id: memberId, - include: 'email_recipients,products' + include: 'products' }); this.isLoading = false; diff --git a/ghost/admin/app/routes/member.js b/ghost/admin/app/routes/member.js index 8543a88c90..24235e4115 100644 --- a/ghost/admin/app/routes/member.js +++ b/ghost/admin/app/routes/member.js @@ -19,11 +19,7 @@ export default class MembersRoute extends AdminRoute { this._requiresBackgroundRefresh = false; if (params.member_id) { - if (this.feature.membersActivityFeed) { - return this.store.queryRecord('member', {id: params.member_id, include: 'products'}); - } else { - return this.store.queryRecord('member', {id: params.member_id, include: 'email_recipients,products'}); - } + return this.store.queryRecord('member', {id: params.member_id, include: 'products'}); } else { return this.store.createRecord('member'); } diff --git a/ghost/admin/app/routes/members-activity.js b/ghost/admin/app/routes/members-activity.js index 3551393e81..cba9631438 100644 --- a/ghost/admin/app/routes/members-activity.js +++ b/ghost/admin/app/routes/members-activity.js @@ -1,14 +1,4 @@ import AdminRoute from 'ghost-admin/routes/admin'; -import {inject as service} from '@ember/service'; export default class MembersActivityRoute extends AdminRoute { - @service feature; - - beforeModel() { - super.beforeModel(...arguments); - - if (!this.feature.membersActivityFeed) { - return this.transitionTo('home'); - } - } } diff --git a/ghost/admin/app/services/feature.js b/ghost/admin/app/services/feature.js index 5dfb442358..41b0ddac07 100644 --- a/ghost/admin/app/services/feature.js +++ b/ghost/admin/app/services/feature.js @@ -81,9 +81,6 @@ export default class FeatureService extends Service { @feature('tweetGridCard') tweetGridCard; - @feature('membersActivityFeed') - membersActivityFeed; - @feature('improvedOnboarding') improvedOnboarding; diff --git a/ghost/admin/app/styles/layouts/dashboard.css b/ghost/admin/app/styles/layouts/dashboard.css index f3a2108522..a739ed56f3 100644 --- a/ghost/admin/app/styles/layouts/dashboard.css +++ b/ghost/admin/app/styles/layouts/dashboard.css @@ -550,107 +550,6 @@ a.gh-dashboard-container { max-height: 150px; } -/* Top members */ -.gh-dashboard-area.top-members { - grid-column: 3 / 4; - grid-row: 1 / 3; -} - -.gh-dashboard-area.top-members .gh-dashboard-list { - justify-content: space-between; -} - -.gh-dashboard-top-members { - display: flex; - flex-direction: column; - align-items: stretch; - list-style: none; - padding: 0; - margin: 8px 0 0; - width: 100%; -} - -.gh-dashboard-top-member { - display: flex; - align-items: center; - flex-grow: 1; - width: 100%; - justify-content: stretch; - margin: 8px 0; - padding: 0; -} - -.gh-dashboard-top-member .member-details { - display: flex; - align-items: center; - flex-grow: 1; -} - -.gh-dashboard-top-member .gh-member-gravatar { - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2); - width: 34px; - height: 34px; -} - -.gh-dashboard-top-member .gh-member-initials { - width: 34px; - height: 34px; -} - -.gh-dashboard-top-member .gh-member-list-avatar { - font-size: 1.5rem; - font-weight: 500; - text-align: center; - line-height: 1; -} - -.gh-dashboard-top-member .name, -.gh-dashboard-top-member .email { - font-size: 1.4rem; - font-weight: 500; - color: var(--black); -} - -.gh-dashboard-top-member .open-rate { - white-space: nowrap; - margin-left: 12px; - color: var(--midgrey); - font-size: 1.3rem; - text-align: right; - line-height: 1.35em; -} - -.gh-dashboard-top-member .open-rate span { - color: var(--midlightgrey); - font-size: 1.2rem; -} - -.gh-dashboard-top-members-footer { - display: flex; - justify-content: flex-end; - border-top: 1px solid var(--whitegrey-d2); - padding-top: 12px; - margin-bottom: -4px; - margin-top: 8px; -} - -.gh-dashboard-top-members-footer a { - display: flex; - align-items: center; - color: var(--black); - font-weight: 500; -} - -.gh-dashboard-top-members-footer a svg { - width: 12px; - height: 12px; - margin-left: 4px; -} - -.gh-dashboard-top-members-footer a svg path { - fill: var(--black); -} - .gh-dashboard-header-container { display: flex; align-items: center; diff --git a/ghost/admin/app/styles/layouts/members.css b/ghost/admin/app/styles/layouts/members.css index 51ce15d38c..63e08800f0 100644 --- a/ghost/admin/app/styles/layouts/members.css +++ b/ghost/admin/app/styles/layouts/members.css @@ -1015,10 +1015,6 @@ textarea.gh-member-details-textarea { } .gh-member-feed { - margin: -12px 0 -8px; -} - -.gh-member-settings .gh-member-feed-labs { margin: 0; padding: 16px 20px; background: var(--white); @@ -1036,14 +1032,9 @@ textarea.gh-member-details-textarea { .gh-member-feed-row { display: flex; align-items: center; - height: 52px; padding: 0; } -.gh-member-feed-row-labs { - height: unset; -} - .gh-member-feed-activity { display: flex; align-items: center; @@ -1096,10 +1087,6 @@ textarea.gh-member-details-textarea { color: var(--darkgrey); } -.gh-member-btn-expandfeed { - margin-top: 16px; -} - .gh-member-feed-row:first-child .gh-member-feed-container { padding-top: 0; } diff --git a/ghost/admin/app/templates/dashboard.hbs b/ghost/admin/app/templates/dashboard.hbs index d0e1af20bc..9f13a8c1be 100644 --- a/ghost/admin/app/templates/dashboard.hbs +++ b/ghost/admin/app/templates/dashboard.hbs @@ -133,58 +133,6 @@
{{#if this.showMembersData}} - {{#if (not (feature "membersActivityFeed"))}} - {{#if this.topMembersData}} -
-
-

Top members

- {{#if this.topMembersDataHasOpenRates}} -

Open rate

- {{else}} -

Member since

- {{/if}} -
-
- {{#if this.topMembersLoading}} - Loading... - {{else}} - {{#if this.topMembersError}} -

- There was an error loading member events. - -

- {{else}} -
    - {{#each this.topMembersData as |member|}} -
  • - - - {{#if member.name}} - {{member.name}} - {{else}} - - {{/if}} - - {{#if member.emailOpenRate}} - {{member.emailOpenRate}}% - {{else}} - - {{moment-format member.createdAtUTC "D MMM YYYY"}} - - {{/if}} -
  • - {{/each}} -
- {{/if}} - {{/if}} - -
-
- {{/if}} - {{/if}} - {{/if}} diff --git a/ghost/admin/app/templates/settings/labs.hbs b/ghost/admin/app/templates/settings/labs.hbs index da52cad1d2..eccc632685 100644 --- a/ghost/admin/app/templates/settings/labs.hbs +++ b/ghost/admin/app/templates/settings/labs.hbs @@ -283,19 +283,6 @@
-
-
-
-

Members activity feed

-

- Separate activity feed screen showing all member activity. -

-
-
- -
-
-
diff --git a/ghost/admin/tests/acceptance/members-activity-test.js b/ghost/admin/tests/acceptance/members-activity-test.js index 5554b34ae1..a62b6f9ffa 100644 --- a/ghost/admin/tests/acceptance/members-activity-test.js +++ b/ghost/admin/tests/acceptance/members-activity-test.js @@ -1,7 +1,6 @@ import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support'; import {currentURL} from '@ember/test-helpers'; import {describe, it} from 'mocha'; -import {disableLabsFlag, enableLabsFlag} from '../helpers/labs-flag'; import {expect} from 'chai'; import {setupApplicationTest} from 'ember-mocha'; import {setupMirage} from 'ember-cli-mirage/test-support'; @@ -11,10 +10,6 @@ describe('Acceptance: Members activity', function () { const hooks = setupApplicationTest(); setupMirage(hooks); - beforeEach(function () { - enableLabsFlag(this.server, 'membersActivityFeed'); - }); - it('redirects when not authenticated', async function () { await invalidateSession(); await visit('/members-activity'); @@ -44,11 +39,5 @@ describe('Acceptance: Members activity', function () { await visit('/members-activity'); expect(currentURL()).to.equal('/members-activity'); }); - - it('requires feature flag', async function () { - disableLabsFlag(this.server, 'membersActivityFeed'); - await visit('/members-activity'); - expect(currentURL()).to.equal('/dashboard'); - }); }); });