diff --git a/ghost/admin/app/components/gh-member-details.hbs b/ghost/admin/app/components/gh-member-details.hbs new file mode 100644 index 0000000000..ed94d1cb40 --- /dev/null +++ b/ghost/admin/app/components/gh-member-details.hbs @@ -0,0 +1,48 @@ +
+
+
+
+ {{#if (or @member.name @member.email)}} + + {{else}} +
+ N +
+ {{/if}} +
+

+ {{or @member.name @member.email}} + {{#unless (or @member.name @member.email)}} + {{#if @member.isNew}} + New member + {{/if}} + {{/unless}} +

+

+ {{#if (and @member.name @member.email)}} + {{@member.email}} + {{/if}} +

+ {{#unless @member.isNew}} +

+ {{#if @member.geolocation}} + {{#if (and (eq @member.geolocation.country_code "US") @member.geolocation.region)}} + {{@member.geolocation.region}}, US + {{else}} + {{or @member.geolocation.country "Unknown location"}} + {{/if}} + {{else}} + Unknown location + {{/if}} + – Created on {{moment-format @member.createdAtUTC "D MMM YYYY"}} +

+ {{/unless}} +
+
+
+
+
\ No newline at end of file diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index 993dd83a49..a1382c5c0b 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -1,53 +1,6 @@
-
-
-
-
- {{#if (or this.member.name this.member.email)}} - - {{else}} -
- N -
- {{/if}} -
-

- {{or this.member.name this.member.email}} - {{#unless (or this.member.name this.member.email)}} - {{#if this.member.isNew}} - New member - {{/if}} - {{/unless}} -

-

- {{#if (and this.member.name this.member.email)}} - {{this.member.email}} - {{/if}} -

- {{#unless this.member.isNew}} -

- {{#if this.member.geolocation}} - {{#if (and (eq this.member.geolocation.country_code "US") @member.geolocation.region)}} - {{this.member.geolocation.region}}, US - {{else}} - {{or this.member.geolocation.country "Unknown location"}} - {{/if}} - {{else}} - Unknown location - {{/if}} - – Created on {{moment-format @member.createdAtUTC "D MMM YYYY"}} -

- {{/unless}} -
-
-
-
-
+
diff --git a/ghost/admin/app/components/members-activity/no-events.hbs b/ghost/admin/app/components/members-activity/no-events.hbs index aa7b89f4ed..cb8f019f55 100644 --- a/ghost/admin/app/components/members-activity/no-events.hbs +++ b/ghost/admin/app/components/members-activity/no-events.hbs @@ -3,7 +3,7 @@ {{svg-jar "members-placeholder" class="gh-members-placeholder"}} {{#if @filter}}

No activities match the current filter

- + Show all activity {{else}} diff --git a/ghost/admin/app/components/members-activity/table-row.hbs b/ghost/admin/app/components/members-activity/table-row.hbs index e4d45c6e03..445a0e50f6 100644 --- a/ghost/admin/app/components/members-activity/table-row.hbs +++ b/ghost/admin/app/components/members-activity/table-row.hbs @@ -1,12 +1,14 @@ {{#let (parse-member-event @event) as |event|}} -
- - {{event.member.name}} -
- {{event.member.email}} -
-
+ {{#unless @hideMemberColumn}} +
+ + {{event.member.name}} +
+ {{event.member.email}} +
+
+ {{/unless}}
{{event.action}} {{event.object}} diff --git a/ghost/admin/app/components/members-activity/table.hbs b/ghost/admin/app/components/members-activity/table.hbs index 111759aaa4..91a9395f48 100644 --- a/ghost/admin/app/components/members-activity/table.hbs +++ b/ghost/admin/app/components/members-activity/table.hbs @@ -1,14 +1,14 @@ - + {{#unless @hideMemberColumn}}{{/unless}} {{#each @events as |event|}} - + {{/each}}
MemberMemberEvent Time
\ No newline at end of file diff --git a/ghost/admin/app/controllers/members-activity.js b/ghost/admin/app/controllers/members-activity.js index dc0ab48996..04d7a4f3d4 100644 --- a/ghost/admin/app/controllers/members-activity.js +++ b/ghost/admin/app/controllers/members-activity.js @@ -5,6 +5,7 @@ import {tracked} from '@glimmer/tracking'; export default class MembersActivityController extends Controller { @service router; + @service store; queryParams = ['excludedEvents', 'member']; @@ -20,6 +21,16 @@ export default class MembersActivityController extends Controller { return filterParts.filter(p => !!p).join('+'); } + get memberRecord() { + if (!this.member) { + return null; + } + + // TODO: {reload: true} here shouldn't be needed but without it + // the template renders nothing if the record is already in the store + return this.store.findRecord('member', this.member, {reload: true}); + } + @action updateExcludedEvents(newList) { this.router.transitionTo({queryParams: {excludedEvents: newList}}); diff --git a/ghost/admin/app/templates/members-activity.hbs b/ghost/admin/app/templates/members-activity.hbs index 1a1f71b8ca..016e45fbb7 100644 --- a/ghost/admin/app/templates/members-activity.hbs +++ b/ghost/admin/app/templates/members-activity.hbs @@ -13,10 +13,14 @@
+ {{#if this.memberRecord}} + + {{/if}} + {{#let (members-event-fetcher filter=this.filter pageSize=50) as |eventsFetcher|}}
{{#if eventsFetcher.data}} - + {{#unless (or eventsFetcher.isLoading eventsFetcher.hasReachedEnd)}}