Wired referrer information on member detail page

refs https://github.com/TryGhost/Ghost/pull/15463
This commit is contained in:
Rishabh 2022-09-23 20:50:11 +05:30 committed by Rishabh Garg
parent 6c85c75b86
commit e5fb7b805f
4 changed files with 16 additions and 3 deletions

View File

@ -73,7 +73,7 @@
</p>
<p>
{{svg-jar "earth"}}
Coming from&nbsp;<p title="Social: Twitter">Twitter / Social</p>
Coming from&nbsp;<p title="Social: Twitter">{{this.referrerAttribution.source}} / {{this.referrerAttribution.medium}}</p>
</p>
</div>
{{/if}}

View File

@ -3,4 +3,12 @@ import {inject as service} from '@ember/service';
export default class extends Component {
@service settings;
}
get referrerAttribution() {
const attribution = this.args.member?.attribution;
return {
source: attribution?.referrer_source || 'Unknown',
medium: attribution?.referrer_medium || '-'
};
}
}

View File

@ -217,7 +217,7 @@
<div class="gh-membertier-details">
<div class="gh-membertier-detail">
<h4>Subscription Source</h4>
<p><span class="fw6">Twitter / Social</span></p>
<p><span class="fw6">{{sub.attribution.referrerSource}} / {{sub.attribution.referrerMedium}}</span></p>
</div>
{{#if (and sub.attribution sub.attribution.url sub.attribution.title)}}
<div class="gh-membertier-detail">

View File

@ -73,6 +73,11 @@ export default class extends Component {
}).map((sub) => {
const data = {
...sub,
attribution: {
...sub.attribution,
referrerSource: sub.attribution?.referrer_source || 'Unknown',
referrerMedium: sub.attribution?.referrer_medium || '-'
},
startDate: sub.start_date ? moment(sub.start_date).format('D MMM YYYY') : '-',
validUntil: sub.current_period_end ? moment(sub.current_period_end).format('D MMM YYYY') : '-',
cancellationReason: sub.cancellation_reason,