1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/adapters/member.js
Sanne de Vries 36baf94b24
Added activity feed to member details screen (#1796)
closes https://github.com/TryGhost/Ghost/issues/12461

Design changes:
- added activity feed to member details page
- rearranged Stripe info to display on the right
- added toggle buttons for Stripe subscription and customer info
- added box to display activity feed for received and opened emails

Functionality changes:
- added `queryRecord()` to member adapter so `queryRecord('member', {id: x})` will hit `/members/:id/?query` instead of `/members/?id=x&query`
- updated member route to query member with `?include=email_recipients`
- added `EmailRecipient` model for access to event timestamps and email relationship setup
- added `<GhMemberActivityFeed>` component that accepts an `EmailRecipient` array and converts that into an activity list
- added support for `@model=emailInstance` to the email preview modal
- fixed a timing issue with email preview that could result in it showing blank content until the mobile/desktop toggle is used
- fixed sometimes blank member location

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-12-10 11:38:38 +00:00

26 lines
772 B
JavaScript

import ApplicationAdapter from 'ghost-admin/adapters/application';
export default ApplicationAdapter.extend({
queryRecord(store, type, query) {
if (query && query.id) {
let {id} = query;
delete query.id;
let url = this.buildURL(type.modelName, id, query, 'findRecord');
return this.ajax(url, 'GET', {data: query});
}
return this._super(...arguments);
},
urlForDeleteRecord(id, modelName, snapshot) {
let url = this._super(...arguments);
let parsedUrl = new URL(url);
if (snapshot && snapshot.adapterOptions && snapshot.adapterOptions.cancel) {
parsedUrl.searchParams.set('cancel', 'true');
}
return parsedUrl.toString();
}
});