Commit Graph

11681 Commits

Author SHA1 Message Date
Renovate Bot
fd2a49a366 Update dependency jwks-rsa to v1.9.0 2020-08-24 15:29:07 +01:00
Renovate Bot
48144df5a8
Update dependency @sentry/node to v5.21.4 2020-08-24 12:25:00 +00:00
Daniel Lockyer
f6a1c330c9 v3.31.0 2020-08-24 11:33:22 +01:00
Daniel Lockyer
50a10a4903 Updated Ghost-Admin to v3.31.0 2020-08-24 11:33:22 +01:00
Peter Zimon
75f5ab637d Added minor member newsletter customisations via config
no issue
- adds a `members:emailTemplate` config object
  - `showSiteHeader` - defaults to `true`, shows the site title and icon in member emails
  - `showPoweredBy` - defaults to `false`, adds a "Publish with Ghost" button to member email footer
- updates member newsletter email template with hideable site header and "powered by" badge
2020-08-24 10:44:22 +01:00
Rish
297b63edce 🐛 Fixed response for members API update endpoint
closes https://github.com/TryGhost/members.js/issues/87

- The `update` method in members-api package was edited to return Model object instead of JSON directly [here](a28bcc5b2a)
- This caused the update member API on member endpoint to return partial response only as most properties couldn't be fetched
- Fix updates the middleware to correctly call `toJSON` before formatting response
2020-08-24 13:38:21 +05:30
Nazar Gargol
91d1417df2 Fixed email newsletter error when post has no content
closes #12158
2020-08-24 19:46:46 +12:00
Nazar Gargol
b8197023b3 🐛 Fixed ignored created_at and subscribed fields in Members API
closes #12156

- When adding new member through `POST /members` API or importing members with CSV importer `POST /members/upload` API created_at and subscribed were ignored
- Similar problem but only with `subscribed` field was present in `PUT /members/:id` API
- The regression was introduced with a bump of @tryghost/members-api to 0.26.0, specifically this change in upstream - a28bcc5b2a (diff-3daeef67d07a2a0f94c89a86cafcede9R44)
- Bumped @tryghost/members-api package to 0.28.2 fixing the underlying issue - 7b5f2e3cb7
2020-08-24 19:35:20 +12:00
Renovate Bot
679616026f
Update dependency @tryghost/members-api to v0.28.2 2020-08-24 06:33:55 +00:00
Kevin Ansfield
cbe2817c72 🐛 Fixed bookmark card display in member emails when using Outlook
closes https://github.com/TryGhost/Ghost/issues/12148

- updates `@tryghost/kg-default-cards`, new version includes Outlook-specific bookmark card template and styling
2020-08-22 11:13:54 +01:00
Renovate Bot
2b635ab318 Update dependency @sentry/node to v5.21.3 2020-08-21 22:08:16 +00:00
Daniel Lockyer
e56921eeb7 Fixed merging of 3.30.2 into master
v3.30.2

* tag '3.30.2':
  v3.30.2
  Updated Ghost-Admin to v3.30.2
2020-08-21 12:20:51 +01:00
Daniel Lockyer
0ab190e83c Merged 3.30.2 into master
* 3.30.2:
  Bumped @tryghost/members-api to 0.28.1 in lockfile
  Bumbed @tryghost/members-api to 0.28.1
  🐛 Fixed unable to delete member when stripe is connected
2020-08-21 12:06:01 +01:00
Daniel Lockyer
d975714138 v3.30.2 2020-08-21 12:03:37 +01:00
Daniel Lockyer
e51ab7707d Updated Ghost-Admin to v3.30.2 2020-08-21 12:03:37 +01:00
Rish
7177da6a4e Bumped @tryghost/members-api to 0.28.1 in lockfile
refs https://github.com/TryGhost/Ghost/issues/12150

- Adds the updated lockfile for previous commit which bumps members-api to 0.28.1
2020-08-21 12:01:31 +01:00
Rish
acd34c9bcb Bumbed @tryghost/members-api to 0.28.1
refs https://github.com/TryGhost/Ghost/issues/12150

- Fixes incorrect stripe cancellation method for member `destroy` call
2020-08-21 11:57:31 +01:00
Rish
4657941095 Bumped @tryghost/members-api to 0.28.1 in lockfile
refs https://github.com/TryGhost/Ghost/issues/12150

- Adds the updated lockfile for previous commit which bumps members-api to 0.28.1
2020-08-21 16:23:37 +05:30
Rish
bf84d42966 Bumbed @tryghost/members-api to 0.28.1
refs https://github.com/TryGhost/Ghost/issues/12150

- Fixes incorrect stripe cancellation method for member `destroy` call
2020-08-21 16:18:01 +05:30
Rish
87e8298ca7 🐛 Fixed unable to delete member when stripe is connected
closes https://github.com/TryGhost/Ghost/issues/12150

- The `destroy` method on members-api method was called incorrectly with not enough params
- It expects both `data` and `options` passed down [here](https://github.com/TryGhost/Members/blob/master/packages/members-api/lib/users.js#L14)
- Missing `options` in method call throws error as we read `cancelStripeSubscriptions` property on options if stripe is connected
- Fix passes both data and options to the destroy method
2020-08-21 11:13:07 +01:00
Rishabh Garg
c7f3837c54
Added admin endpoint for editing member subscription (#12145)
refs #12127

- Adds new `editSubscription` endpoint for members admin API which allows updating individual subscription for a member - `PUT /members/:id/subscriptions/:subscription_id/`
- `editSubscription` has same permissions as member's `edit` endpoint
- Currently allows toggling of cancellation at period end for an active subscription
2020-08-20 17:28:11 +05:30
Renovate Bot
4fff93f9e0
Update dependency @tryghost/members-api to v0.28.0 2020-08-20 09:14:32 +00:00
Daniel Lockyer
441d345759 v3.30.1 2020-08-20 09:28:09 +01:00
Daniel Lockyer
04f42732c8 Updated Ghost-Admin to v3.30.1 2020-08-20 09:28:09 +01:00
Nazar Gargol
5670d99f46 Improved error handling for batch deleted records
no issue

- Similar handling to one introduced in 8418c829de
- Having granular tracking for failed to remove id's would make it possible to return more specific errors to the client
2020-08-20 19:11:41 +12:00
Nazar Gargol
8418c829de Improved error handling for batch inserted records
no issue

- Similar to 3a594ce22e this adds error handling to batch operations done outside models
2020-08-20 19:01:17 +12:00
Nazar Gargol
f8adb4a672 Refactored bulk insert/delete operations into separate module
no issue

- Moved bulk db operations outside of importer module to create clearer separation of responsibilities
2020-08-20 18:42:38 +12:00
naz
3a594ce22e
Improved error handling for batch inserted member records (#12146)
no issue

- When batch insert fails handling should be more granular and aim to retry and insert as many records from the batch as possible.  
- Added retry logic for failed member's batch inserts. It's a sequential insert for each record in the batch. This implementation was chosen to keep it as simple as possible
- Added filtering of "toCreate" records when member fails to insert. We should not try inserting related members_labels/members_stripe_customers/members_stripe_customer_subscriptions records because they would definitely fail insertion without associated member record
2020-08-20 17:41:47 +12:00
Nazar Gargol
2e769e3122 Fixed handling for Stripe connected members import
no issue

- When stripe is disconnected and there are Stripe-connected records present in imported set they should not be processed and proper error should be thrown
2020-08-20 17:08:19 +12:00
Nazar Gargol
4498b4624a Fixed label serialization in members bulk importer
no issue

- After a refactor logic was missing trimming logic and handling for empty labels
2020-08-20 16:43:42 +12:00
Nazar Gargol
32fd913ac3 Fixed default subscribed value for member model in the importer
no issue

- The default value should not be a string but rather a boolean
2020-08-19 23:42:48 +12:00
Kevin Ansfield
d8e319af88 🐛 Fixed card spacing and caption styling for member emails in Outlook
closes https://github.com/TryGhost/Ghost/issues/12139

- once the email content has been rendered in the post serializer, perform some whole-content transformation of `figure` and `figcaption` to `div` using cheerio
- juiced will have already inlined the elements styles so there's no need to adjust the template's stylesheet
2020-08-19 12:34:14 +01:00
Nazar Gargol
616767d0ec Fixed members bulk import's createdBy field assignment
no issue

- Method signature has been changed with cada88975a, the call needed an update as well
2020-08-19 17:14:45 +12:00
Nazar Gargol
6512b98049 Updated flaky member import tests
no issue

- Because there's concurrency involved during member import the order cannot be guaranteed.
2020-08-19 16:43:58 +12:00
Renovate Bot
090d977c8e
Update dependency @tryghost/kg-markdown-html-renderer to v2.0.2 2020-08-18 18:05:37 +00:00
Renovate Bot
52c4292ad7
Update dependency @tryghost/kg-default-atoms to v2.0.2 2020-08-18 16:56:11 +00:00
Renovate Bot
daf79e367d
Update dependency @tryghost/kg-card-factory to v2.1.2 2020-08-18 15:36:49 +00:00
Daniel Lockyer
08a72d38a9 v3.30.0 2020-08-18 16:35:02 +01:00
Daniel Lockyer
78fe4f8bf9 Updated Ghost-Admin to v3.30.0 2020-08-18 16:35:02 +01:00
Jeremy Davidson
681c96b5e9
🐛 Fixed bookmark card author/publisher spacing in member emails (#12134)
closes #12078

- Root cause was that pseudo class .kg-bookmark-author:after was not getting inlined to email newsletter or its preview.
  - That is where the margin and bullet-point content are added between author and publisher.
- Dependency juice supports an option inlinePseudoElements which is false by default.
- Fix was to set inlinePseudoElements to true when serializing post email.

Co-authored-by: Jeremy Davidson <jeremy@crossingcontour.com>
2020-08-18 16:18:44 +01:00
Hannah Wolfe
9f291b2d10 Improved testmode logging of shutdown status
- testmode allows us to test Ghost's behaviour with long running requests and jobs
- moved all the testmode logging to only happen if Ghost starts successfully to make it clearer what is happening
- added a (currently very dirty) bit of code to fetch the jobService and output the queue status giving us a similar
     output for both open connections and jobs
- all of this allows for debugging exactly what Ghost is doing whilst it is processing a shutdown request
2020-08-18 15:48:42 +01:00
Kevin Ansfield
cefcdad090 🐛 Fixed emails appearing very wide in Outlook and improved email image sizes
closes https://github.com/TryGhost/Ghost/issues/11536

- bumps `@tryghost/kg-default-cards`
  - image and gallery cards now output `width/height` attributes on `img` elements with a max width of 600px
  - uses resized images where possible to keep email weight down
- adds `height: auto` style to image card images so that the `height` attribute does not cause distortion at smaller screen widths
2020-08-18 15:33:54 +01:00
Fabien 'egg' O'Carroll
cada88975a
Updated bulk importer to improve performance (#12128)
no-issue

* Added bulkAdd method to Member,Customer&Subscription model
  This allows us to keep the db access in the model layer
* Updated @tryghost/members-api to 0.27.2
  This includes fixes for rate-limiting of requests, and exposes necessary
  Stripe methods for creating customers and complimentary subscriptions,
  without affecting the database.
* Refactored importer to parallelise tasks where possible
  By parallelising our tasks we are able to improve the speed at which the
  entire import completes.
2020-08-18 13:39:45 +01:00
Daniel Lockyer
8fa9536122 Updated test labelling in GitHub Action workflow
- I'm expecting to add other v2 tests soon, so it's good to specify
  which v2 we're testing here
2020-08-18 13:10:34 +01:00
Daniel Lockyer
e8081f6691 Pinned Ubuntu version for tests & release workflows
- we were using `ubuntu-latest`, which is an alias for 18.04, but there's an
  increasingly likely chance that the default becomes 20.04 soon.
- we don't officially support 20.04 yet, so we want to pin to our
  supported version until we're ready
2020-08-18 13:08:22 +01:00
Daniel Lockyer
3a46aafcbb Merged 3.29.2 into master
v3.29.2

* tag '3.29.2':
  v3.29.2
  Updated Ghost-Admin to v3.29.2
  🐛 Fixed failing migration from <2.34 to 3.29
  🐛 Fixed published time and modified time for structured data (#12085)
  🐛 Fixed meta data when using tag data in collection (#12137)
  Updated Stripe JS to load async in head
  🐛 Removed [http://url/] output in member email preview text
  🐛 Fixed apostrophes not displaying correctly in Outlook for member emails
2020-08-18 12:17:35 +01:00
Daniel Lockyer
0b0e9aa5fc v3.29.2 2020-08-18 12:15:49 +01:00
Daniel Lockyer
0a65471008 Updated Ghost-Admin to v3.29.2 2020-08-18 12:15:49 +01:00
Kevin Ansfield
69612e38ff 🐛 Fixed failing migration from <2.34 to 3.29
closes https://github.com/TryGhost/Ghost/issues/12129

Migrations were failing when upgrading from a version that didn't include stripe member subscriptions table. The `up` migration was checking for the existence of a unique index that was added to the schema in 3.29 but it was using the wrong variable name which meant that it would never return true for an existing index. For most migrations this worked because the index existed but when through 2.34 the table was created from scratch and did included the index at that point.

- fixed variable name and re-ordered variable assignment for better code locality that would have made the typo more visible
2020-08-18 11:34:12 +01:00
Roshan Dash
c66304f66a 🐛 Fixed published time and modified time for structured data (#12085)
closes #12059

- Published Time and Modified Time were not populating for 'page' context because it is an extension of 'post' and hence there was no context 'page'. 
- Fixed it by using the common contextObject & `getContextObject` utility. 
- Should also fix some other missing parameters.
2020-08-18 11:34:06 +01:00