Skip to content

Commit 915b52e

Browse files
committed
Added newsletters.button_style column
ref https://linear.app/ghost/issue/PROD-1717 - added `newsletters.button_style` column ready for controlling button styles in emails, with two options of `fill` (default, current production design) and `outline` which is a new option
1 parent 6609de9 commit 915b52e

File tree

6 files changed

+114
-52
lines changed

6 files changed

+114
-52
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const {createAddColumnMigration} = require('../../utils');
2+
3+
module.exports = createAddColumnMigration('newsletters', 'button_style', {
4+
type: 'string',
5+
maxlength: 50,
6+
nullable: false,
7+
defaultTo: 'fill'
8+
});

ghost/core/core/server/data/schema/schema.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ module.exports = {
4747
title_color: {type: 'string', maxlength: 50, nullable: true},
4848
created_at: {type: 'dateTime', nullable: false},
4949
updated_at: {type: 'dateTime', nullable: true},
50-
button_corners: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'rounded', validations: {isIn: [['square', 'rounded', 'pill']]}}
50+
button_corners: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'rounded', validations: {isIn: [['square', 'rounded', 'pill']]}},
51+
button_style: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'fill', validations: {isIn: [['fill', 'outline']]}}
5152
},
5253
posts: {
5354
id: {type: 'string', maxlength: 24, nullable: false, primary: true},

ghost/core/core/server/models/newsletter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const Newsletter = ghostBookshelf.Model.extend({
3131
title_color: null,
3232
feedback_enabled: false,
3333
show_excerpt: false,
34-
button_corners: 'rounded'
34+
button_corners: 'rounded',
35+
button_style: 'fill'
3536
};
3637
},
3738

ghost/core/test/e2e-api/admin/__snapshots__/members.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6122,7 +6122,7 @@ exports[`Members API Can subscribe to a newsletter 5: [headers] 1`] = `
61226122
Object {
61236123
"access-control-allow-origin": "http://127.0.0.1:2369",
61246124
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
6125-
"content-length": "4682",
6125+
"content-length": "4748",
61266126
"content-type": "application/json; charset=utf-8",
61276127
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
61286128
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,

0 commit comments

Comments
 (0)