Commit Graph

11567 Commits

Author SHA1 Message Date
Rish
cbb3664bdd Added handling for new members support/reply email addresses
no issue

- Updated magic link generation and validation methods for email update API to handle new support address
- Updated importer to ignore the new support address as it can only be updated via verification
- Updated members service to listen on settings edit for new support/reply address fields as well
- Updated tests to include the new settings
2020-08-31 18:09:38 +05:30
John O'Nolan
8784769f60
Remove sponsor 2020-08-31 19:00:19 +07:00
Rishabh Garg
bc2f6eb8e9 Added migrations for support and reply email address setting (#12163)
no issue

- Added default settings for the two new setting fields - `members_support_address` and `members_reply_address`
- Added migrations for setting group for new email settings
- Migration sets current from address as new support address default
- Added migration to set new support address same as from address
- Updated tests for new settings
- `members_support_address` - How members can reach for help with their account, public setting
- `members_reply_address` - Where you receive responses to newsletters
2020-08-31 17:16:53 +05:30
Daniel Lockyer
902b55f338 v3.31.3 2020-08-31 10:37:02 +01:00
Daniel Lockyer
4e3bc19b24 Updated Ghost-Admin to v3.31.3 2020-08-31 10:37:01 +01:00
Nazar Gargol
0f81e5e84a Fixed regression tests for Tags APIs
refs #12167

- The reason for failing tests was  https://github.com/TryGhost/Ghost/issues/6104 . As we already test for ordering elsewhere, didn't include more "if/else" logic in tests just for the sake of passing. Refactored them to be order-independent instead
2020-08-31 21:09:12 +12:00
Rish
8cf9dc05e3 Revert "Added migrations for support and reply email address setting (#12163)"
This reverts commit 2216019a86.
2020-08-31 14:25:29 +05:30
Nazar Gargol
eb8c0fcff9 🐛 Fixed Tags API v2 to return posts count
closes #12167

- Tags API v2 was ignoring `count.posts` include parameter.
- Regression was introduced with a3f693b472
- Introduced regression tests across all Content API versions to avoid similar bug in the future
2020-08-31 18:46:35 +12:00
Nazar Gargol
791bcc6adb Improved tests for "include=posts.count" query parameter
refs #12167

- Updated tests to check for concrete post counts numbers. This would allow catching more regression bugs in the future
- Made sure check is performed consistently in tests where posts.count
parameter is present
2020-08-31 17:30:21 +12:00
Renovate Bot
55aab9063d
Update dependency mocha to v8.1.3 2020-08-28 21:04:14 +00:00
Renovate Bot
437cdf05b9
Update dependency @sentry/node to v5.22.3 2020-08-28 16:35:10 +00:00
Renovate Bot
8bc1891ae6
Update dependency @sentry/node to v5.22.2 2020-08-28 13:56:01 +00:00
Renovate Bot
3dd9a5bb6a
Update dependency @sentry/node to v5.22.1 2020-08-28 12:35:48 +00:00
Rishabh Garg
2216019a86
Added migrations for support and reply email address setting (#12163)
no issue

- Added default settings for the two new setting fields - `members_support_address` and `members_reply_address`
- Added migrations for setting group for new email settings
- Migration sets current from address as new support address default
- Added migration to set new support address same as from address
- Updated tests for new settings
- `members_support_address` - How members can reach for help with their account
- `members_reply_address` - Where you receive responses to newsletters
2020-08-27 20:27:50 +05:30
Renovate Bot
98be0a9a9f
Update dependency @sentry/node to v5.22.0 2020-08-27 10:54:58 +00:00
Nazar Gargol
e8248cdc9e Refactored members imporeter in preparation for jobs
no issue

- This refactor extracts labels related code into a separate module for easier reuse by the "job-aware" batched importer
2020-08-27 21:47:00 +12:00
Nazar Gargol
bcca59ffbe Fixed regression tests for members importer
refs 262d33b73c

- Added missing test changes from referenced commit
2020-08-27 19:28:18 +12:00
Nazar Gargol
262d33b73c Improved import_label creation logic
no issue

- When an import was done and there were no "global labels" present Ghost created generic `import-[data]` label which later helped to find a specific batch of imported data
- It did not make sense to create such generic label when user provided their own unique label
- The rules that work now are:
1. When there is no global provided Ghost generates on and removes it in case there are no imported records
2. When there is a unique new global label provided no new label is generated, but the label stays even if there are no imported records
2020-08-27 19:07:27 +12:00
Kevin Ansfield
f30d3cd2c2 Switched to bookshelf count in getTotalMembers()
no issue

- tested performance between knex raw, knex `count()` and bookshelf `count()` and found no difference over 1000 iterations of each (each ~19,500ms +- 500ms for 104k members locally)
- switched to using bookshelf as the code is the simplest
2020-08-27 01:52:36 +01:00
Kevin Ansfield
a995e9cc89 Allowed custom and search queries to be used with .findAll()
no issue

- extract filtering of an collection into a separate function
- use extracted function in `findAll()` so that it's query behaviour matches `findPage()`
2020-08-27 01:09:07 +01:00
Kevin Ansfield
5e64f113d5 Skipped separate count query in .findPage() for limit="all" requests
no issue

- for large result sets or complex queries the count query itself can be quite time consuming
- when `limit: 'all'` is passed as an option there's no need to perform a separate count query because we can determine the pagination data from the final result set
- skipped count query when `limit: 'all'` option is present
- re-ordered comments to be closer to the code they reference (ie, why we have our own count query instead of Bookshelf's `.count()`
2020-08-27 01:09:07 +01:00
Daniel Lockyer
e3eed7c02d Revert "Update dependency oembed-parser to v1.4.1"
- this reverts commit 054689ee4e.
- this update cannot be merged until Ghost's minimum Node versions are
  bumped
- somehow it snook through our CI checks and got merged by Renovate
2020-08-26 17:33:35 +01:00
Renovate Bot
054689ee4e Update dependency oembed-parser to v1.4.1 2020-08-26 16:27:57 +00:00
Renovate Bot
9e8d3828b6
Update dependency sanitize-html to v1.27.4 2020-08-26 14:59:35 +00:00
Nazar Gargol
9fe5007929 Removed date handling validation in members importer logic
no issue

- This is handled on input sanitization layer with date
format check in JSON schema validation, so there's no need to do this
check again in the importer.
2020-08-26 17:25:24 +12:00
Nazar Gargol
544382b651 Updated boolean values validations for members uploads
no issue

- When the value is part of `enum` the `null` value is no longer
recognized by `null` type in JSON schema validator.
2020-08-26 17:23:36 +12:00
Nazar Gargol
95044e3ba0 Added error handling for failed member imports
no issue

- When bulk insert fails there is no transactional logic to revert
related records form being inserted. Also, previously there were no
attempts to "retry" the insert.
- To avoid complex retry logic, an iterative one-by-one insert retry
approach was taken. If this becomes a bottleneck in the future, the
retry algorithm could be improved.
- To avoid a lot of code duplication refactored model's `bulkAdd` & `bulkDestroy`
methods to use 'bulk-operations' module.
- Updated error handling and logging for bulk delete operations. It's very
unlikely for error to happen here,  but still need to make sure there is
a proper logging in place to trace back the failure.
- Added debug logs. This should improve debugging experience and
performance measurements.
- Added handling for unrecognized errors. Handling inspired by current unrecognized
error handling by ghost importer -10e5d5f3d4/core/server/data/importer/importers/data/base.js (L148-L154)
2020-08-26 17:11:35 +12:00
Renovate Bot
9e991fb47c
Update dependency mocha to v8.1.2 2020-08-25 19:51:28 +00:00
Renovate Bot
c50b677a50 Update dependency grunt to v1.3.0 2020-08-25 13:56:18 +01:00
Daniel Lockyer
10e5d5f3d4 v3.31.2 2020-08-25 12:57:57 +01:00
Daniel Lockyer
d9700ba9bc Updated Ghost-Admin to v3.31.2 2020-08-25 12:57:57 +01:00
Nazar Gargol
45bca2b104 Fixed linting for await statements
refs 9d65de4b10
2020-08-25 19:30:02 +12:00
Nazar Gargol
9d65de4b10 Removed created import labels when no records were imported
no issue

- When no members are succesfully imported through CSV import process the import label should not be created. Otherwise after multiple failed attempts to import there are orphaned labels in the system
2020-08-25 19:23:05 +12:00
Kevin Ansfield
e07e0a17c6 🐛 Fixed bookmark card display in member emails when using Gmail+Chrome
no issue

- updates `@tryghost/kg-default-cards` which contains two fixes
  - removes email-specific output being added to post html (had no visual impact due to use of conditional comments but keeps rendered html smaller+cleaner)
  - adds a background-url style to the thumbnail container to give two options for styling
- updates member email template styling to hide the `<img>` element in bookmark cards and use a background image instead to get consistent rendering across email clients
2020-08-24 18:21:09 +01:00
Daniel Lockyer
8b9c161ff9 v3.31.1 2020-08-24 16:29:08 +01:00
Daniel Lockyer
24c5c32fa8 Updated Ghost-Admin to v3.31.1 2020-08-24 16:29:08 +01:00
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