🐛Changed "free_signups" to "signups" in Post Exporter (#18883)

ref https://github.com/TryGhost/Product/issues/4110

Made this change to increase clarity in data export

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 6c0508d</samp>

Renamed a column in posts export data and updated the corresponding test
case. This change makes the export data more consistent and clear for
users who have different member features enabled.
This commit is contained in:
Nick Moreton 2023-11-07 09:52:28 +00:00 committed by GitHub
parent 71d84c6a05
commit b9b1502772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View File

@ -1789,7 +1789,7 @@ Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-disposition": StringMatching /\\^Attachment; filename="post-analytics\\.\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}\\.csv"\\$/,
"content-length": "2721",
"content-length": "2716",
"content-type": "text/csv; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@ -1800,7 +1800,7 @@ Object {
exports[`Posts API Export Can export 2 1`] = `
Object {
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,free_signups,paid_conversions
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,signups,paid_conversions
6194d3ce51e2700162531a77,Start here for a quick overview of everything you need to know,http://127.0.0.1:2369/welcome/,Ghost,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,Getting Started,Public,,,,,0,0
6194d3ce51e2700162531a76,Customizing your brand and design settings,http://127.0.0.1:2369/design/,Ghost,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,Getting Started,Public,,,,,0,0
6194d3ce51e2700162531a75,\\"Writing and managing content in Ghost, an advanced guide\\",http://127.0.0.1:2369/write/,Ghost,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,Getting Started,Public,,,,,0,0
@ -1820,7 +1820,7 @@ Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-disposition": StringMatching /\\^Attachment; filename="post-analytics\\.\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}\\.csv"\\$/,
"content-length": "587",
"content-length": "582",
"content-type": "text/csv; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@ -1831,7 +1831,7 @@ Object {
exports[`Posts API Export Can export with filter 2 1`] = `
Object {
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,free_signups,paid_conversions
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,signups,paid_conversions
618ba1ffbe2896088840a6e7,\\"Not so short, bit complex\\",http://127.0.0.1:2369/not-so-short-bit-complex/,Joe Bloggs,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,true,,Public,,,,,0,0
618ba1ffbe2896088840a6e3,Short and Sweet,http://127.0.0.1:2369/short-and-sweet/,Joe Bloggs,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,true,chorizo,Public,,,,,0,0",
}
@ -1842,7 +1842,7 @@ Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-disposition": StringMatching /\\^Attachment; filename="post-analytics\\.\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}\\.csv"\\$/,
"content-length": "406",
"content-length": "401",
"content-type": "text/csv; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@ -1853,7 +1853,7 @@ Object {
exports[`Posts API Export Can export with limit 2 1`] = `
Object {
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,free_signups,paid_conversions
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,signups,paid_conversions
6194d3ce51e2700162531a77,Start here for a quick overview of everything you need to know,http://127.0.0.1:2369/welcome/,Ghost,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,Getting Started,Public,,,,,0,0",
}
`;
@ -1863,7 +1863,7 @@ Object {
"access-control-allow-origin": "http://127.0.0.1:2369",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-disposition": StringMatching /\\^Attachment; filename="post-analytics\\.\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}\\.csv"\\$/,
"content-length": "2721",
"content-length": "2716",
"content-type": "text/csv; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
@ -1874,7 +1874,7 @@ Object {
exports[`Posts API Export Can export with order 2 1`] = `
Object {
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,free_signups,paid_conversions
"text": "id,title,url,author,status,created_at,updated_at,published_at,featured,tags,post_access,email_recipients,sends,opens,clicks,signups,paid_conversions
618ba1ffbe2896088840a6df,HTML Ipsum,http://127.0.0.1:2369/html-ipsum/,Joe Bloggs,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,\\"kitchen sink, bacon\\",Public,,,,,0,0
618ba1ffbe2896088840a6e1,Ghostly Kitchen Sink,http://127.0.0.1:2369/ghostly-kitchen-sink/,Joe Bloggs,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,false,\\"kitchen sink, bacon\\",Public,,,,,0,0
618ba1ffbe2896088840a6e3,Short and Sweet,http://127.0.0.1:2369/short-and-sweet/,Joe Bloggs,published only,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,2050-01-01T00:00:00.000Z,true,chorizo,Public,,,,,0,0

View File

@ -96,7 +96,7 @@ class PostsExporter {
sends: email?.get('email_count') ?? null,
opens: trackOpens ? (email?.get('opened_count') ?? null) : null,
clicks: showEmailClickAnalytics ? (post.get('count__clicks') ?? 0) : null,
free_signups: membersTrackSources && published ? (post.get('count__signups') ?? 0) : null,
signups: membersTrackSources && published ? (post.get('count__signups') ?? 0) : null,
paid_conversions: membersTrackSources && paidMembersEnabled && published ? (post.get('count__paid_conversions') ?? 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
@ -126,7 +126,7 @@ class PostsExporter {
}
if (!membersTrackSources || !membersEnabled) {
removeableColumns.push('free_signups', 'paid_conversions');
removeableColumns.push('signups', 'paid_conversions');
} else if (!paidMembersEnabled) {
removeableColumns.push('paid_conversions');
}

View File

@ -190,7 +190,7 @@ describe('PostsExporter', function () {
assert.equal(posts[0].newsletter_name, null);
// Signups
assert.equal(posts[0].free_signups, null);
assert.equal(posts[0].signups, null);
assert.equal(posts[0].paid_conversions, null);
});
@ -209,7 +209,7 @@ describe('PostsExporter', function () {
assert.equal(posts[0].clicks, undefined);
// Signups
assert.equal(posts[0].free_signups, undefined);
assert.equal(posts[0].signups, undefined);
assert.equal(posts[0].paid_conversions, undefined);
});
@ -222,7 +222,7 @@ describe('PostsExporter', function () {
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);
assert.notEqual(posts[0].signups, undefined);
assert.notEqual(posts[0].paid_conversions, undefined);
assert.equal(posts[0].clicks, undefined);
@ -237,7 +237,7 @@ describe('PostsExporter', function () {
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);
assert.notEqual(posts[0].signups, undefined);
assert.notEqual(posts[0].paid_conversions, undefined);
assert.equal(posts[0].opens, undefined);
@ -252,7 +252,7 @@ describe('PostsExporter', function () {
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);
assert.notEqual(posts[0].signups, undefined);
assert.notEqual(posts[0].opens, undefined);
assert.equal(posts[0].paid_conversions, undefined);
@ -269,7 +269,7 @@ describe('PostsExporter', function () {
assert.equal(posts.length, 1);
assert.equal(posts[0].clicks, 0);
assert.equal(posts[0].free_signups, 0);
assert.equal(posts[0].signups, 0);
assert.equal(posts[0].paid_conversions, 0);
assert.equal(posts[0].feedback_more_like_this, 0);
assert.equal(posts[0].feedback_less_like_this, 0);