0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Renamed reacted_with_more/less_like_this to feedback_more/less_like_this in post export

no issue
This commit is contained in:
Simon Backx 2023-03-28 11:44:52 +02:00
parent 37397e88b6
commit 3ac2d72ea6
2 changed files with 20 additions and 20 deletions

View file

@ -89,8 +89,8 @@ class PostsExporter {
clicks: showEmailClickAnalytics ? (post.get('count__clicks') ?? 0) : null,
free_signups: membersTrackSources && published ? (post.get('count__signups') ?? 0) : null,
paid_conversions: membersTrackSources && paidMembersEnabled && published ? (post.get('count__paid_conversions') ?? 0) : null,
reacted_with_more_like_this: feedbackEnabled ? (post.get('count__positive_feedback') ?? 0) : null,
reacted_with_less_like_this: feedbackEnabled ? (post.get('count__negative_feedback') ?? 0) : null
feedback_more_like_this: feedbackEnabled ? (post.get('count__positive_feedback') ?? 0) : null,
feedback_less_like_this: feedbackEnabled ? (post.get('count__negative_feedback') ?? 0) : null
};
});
@ -103,9 +103,9 @@ class PostsExporter {
}
if (!membersEnabled) {
removeableColumns.push('email_recipients', 'sends', 'opens', 'clicks', 'reacted_with_more_like_this', 'reacted_with_less_like_this');
removeableColumns.push('email_recipients', 'sends', 'opens', 'clicks', 'feedback_more_like_this', 'feedback_less_like_this');
} else if (!hasNewslettersWithFeedback) {
removeableColumns.push('reacted_with_more_like_this', 'reacted_with_less_like_this');
removeableColumns.push('feedback_more_like_this', 'feedback_less_like_this');
}
if (membersEnabled && !trackClicks) {

View file

@ -138,8 +138,8 @@ describe('PostsExporter', function () {
assert.equal(posts[1].newsletter_name, 'Weekly Newsletter');
// Shows feedback columns
assert.equal(posts[0].reacted_with_more_like_this, post.count__positive_feedback);
assert.equal(posts[0].reacted_with_less_like_this, post.count__negative_feedback);
assert.equal(posts[0].feedback_more_like_this, post.count__positive_feedback);
assert.equal(posts[0].feedback_less_like_this, post.count__negative_feedback);
});
it('Hides feedback columns if feedback disabled for all newsletters', async function () {
@ -147,8 +147,8 @@ describe('PostsExporter', function () {
const posts = await exporter.export({});
// Hides feedback columns
assert.equal(posts[0].reacted_with_more_like_this, undefined);
assert.equal(posts[0].reacted_with_less_like_this, undefined);
assert.equal(posts[0].feedback_more_like_this, undefined);
assert.equal(posts[0].feedback_less_like_this, undefined);
});
it('Hides email related analytics when post status is draft', async function () {
@ -162,8 +162,8 @@ describe('PostsExporter', function () {
const posts = await exporter.export({});
// No feedback columns
assert.equal(posts[0].reacted_with_more_like_this, undefined);
assert.equal(posts[0].reacted_with_less_like_this, undefined);
assert.equal(posts[0].feedback_more_like_this, undefined);
assert.equal(posts[0].feedback_less_like_this, undefined);
// Sends etc
assert.equal(posts[0].sends, undefined);
@ -182,8 +182,8 @@ describe('PostsExporter', function () {
assert.equal(posts[0].email_recipients, undefined);
// No feedback columns
assert.equal(posts[0].reacted_with_more_like_this, undefined);
assert.equal(posts[0].reacted_with_less_like_this, undefined);
assert.equal(posts[0].feedback_more_like_this, undefined);
assert.equal(posts[0].feedback_less_like_this, undefined);
// Sends etc
assert.equal(posts[0].sends, undefined);
@ -200,8 +200,8 @@ describe('PostsExporter', function () {
const posts = await exporter.export({});
assert.notEqual(posts[0].email_recipients, undefined);
assert.notEqual(posts[0].reacted_with_more_like_this, undefined);
assert.notEqual(posts[0].reacted_with_less_like_this, undefined);
assert.notEqual(posts[0].feedback_more_like_this, undefined);
assert.notEqual(posts[0].feedback_less_like_this, undefined);
assert.notEqual(posts[0].sends, undefined);
assert.notEqual(posts[0].opens, undefined);
assert.notEqual(posts[0].free_signups, undefined);
@ -215,8 +215,8 @@ describe('PostsExporter', function () {
const posts = await exporter.export({});
assert.notEqual(posts[0].email_recipients, undefined);
assert.notEqual(posts[0].reacted_with_more_like_this, undefined);
assert.notEqual(posts[0].reacted_with_less_like_this, undefined);
assert.notEqual(posts[0].feedback_more_like_this, undefined);
assert.notEqual(posts[0].feedback_less_like_this, undefined);
assert.notEqual(posts[0].sends, undefined);
assert.notEqual(posts[0].clicks, undefined);
assert.notEqual(posts[0].free_signups, undefined);
@ -230,8 +230,8 @@ describe('PostsExporter', function () {
const posts = await exporter.export({});
assert.notEqual(posts[0].email_recipients, undefined);
assert.notEqual(posts[0].reacted_with_more_like_this, undefined);
assert.notEqual(posts[0].reacted_with_less_like_this, undefined);
assert.notEqual(posts[0].feedback_more_like_this, undefined);
assert.notEqual(posts[0].feedback_less_like_this, undefined);
assert.notEqual(posts[0].sends, undefined);
assert.notEqual(posts[0].clicks, undefined);
assert.notEqual(posts[0].free_signups, undefined);
@ -253,8 +253,8 @@ describe('PostsExporter', function () {
assert.equal(posts[0].clicks, 0);
assert.equal(posts[0].free_signups, 0);
assert.equal(posts[0].paid_conversions, 0);
assert.equal(posts[0].reacted_with_more_like_this, 0);
assert.equal(posts[0].reacted_with_less_like_this, 0);
assert.equal(posts[0].feedback_more_like_this, 0);
assert.equal(posts[0].feedback_less_like_this, 0);
});
});