Commit Graph

33505 Commits

Author SHA1 Message Date
Ghost CI
4ca61837f4 Merged v5.40.2 into main 2023-03-28 13:20:27 +01:00
Ghost CI
370ec93736 v5.40.2 2023-03-28 13:20:23 +01:00
Simon Backx
d811440b54 Fixed batch sending snapshot date matching
no issue

The replacement didn't match dates with only one number.
2023-03-28 17:16:39 +05:30
Rishabh Garg
0fb7abae87 🐛 Fixed LinkReplacer bug causing broken links on published post/page (#16514)
refs TryGhost/Team#2840

- moves the `entities.decode()` step to the `LinkReplacer` class so that
it's applied to all links, not just the ones that are replaced in the
email service
- adds a test case to `LinkReplacer` to ensure that the
`entities.decode()` step is applied to all links correctly, decoding any
URLs with HTML entities in them

---------

Co-authored-by: Chris Raible <chris@ghost.org>
2023-03-28 16:15:51 +05:30
Simon Backx
109cdeb492 Fixed exporting post metrics without email
no issue

Bookshelf by default returns an empty model when requesting .related('email') for a post without an email. So we need to be a bit smarter to know if a post has an email or not. This fixed an issue where we always showed 'published and emailed' instead of 'published only'.

Since this change also included some changes to test helpers, it also made some changes to the email service because coverage dropped below 100% as a result of fixing the .related method mocking. Ideally we want to move test test helpers to a seperate package in the future.
2023-03-28 12:41:32 +02:00
Sanne de Vries
4cebceb0d8 Added transitions to newsletter color pickers
Refs https://github.com/TryGhost/Team/issues/2830
2023-03-28 12:39:33 +02:00
Rishabh Garg
2e2b3c7c0f
Fixed LinkReplacer bug causing broken links on published post/page (#16514)
refs TryGhost/Team#2840

- moves the `entities.decode()` step to the `LinkReplacer` class so that
it's applied to all links, not just the ones that are replaced in the
email service
- adds a test case to `LinkReplacer` to ensure that the
`entities.decode()` step is applied to all links correctly, decoding any
URLs with HTML entities in them

---------

Co-authored-by: Chris Raible <chris@ghost.org>
2023-03-28 15:59:15 +05:30
Daniel Lockyer
ec9181921b
Fixed preventing git submodules from being committed
- because we now ignore git submodule changes, they didn't show up in
  `git diff --cached...`, so it was possible to get submodules to be
  committed
- you can re-enable submodules to be shown with `--ignore-submodules=none`
- this implements that
- we never want to allow submodules to be committed, so I've removed the
  prompt for faster feedback
2023-03-28 12:16:46 +02:00
Simon Backx
7366f726e5 Removed post access copy in post exporter
no issue
2023-03-28 12:08:00 +02:00
Simon Backx
1f39040649 Added support for exportign posts with email recipients to specific tiers
no issue

Support for tiers was missing when traslating the email recipients NQL filter to a string. This is fixed now. It also improved some copy.
2023-03-28 12:06:01 +02:00
Naz
2dd94d4300
Fixed self-serve api key type
refs https://github.com/TryGhost/Ghost/pull/16461

- The referenced migration had an incorrect 'type' assigned to the self-serve integration's api key. Should have been "admin" instead of "core"
2023-03-28 11:59:17 +02:00
Simon Backx
3ac2d72ea6 Renamed reacted_with_more/less_like_this to feedback_more/less_like_this in post export
no issue
2023-03-28 11:44:52 +02:00
Simon Backx
37397e88b6 Renamed paid_signups to paid_conversions in post metrics export
no issue
2023-03-28 11:43:37 +02:00
Simon Backx
147e0cc0d5 Renamed newsletter to newsletter_name in post metrics export
no issue
2023-03-28 11:42:30 +02:00
Simon Backx
59f94e552a
Added newsletter color columns (#16506)
fixes https://github.com/TryGhost/Team/issues/2825

Adds 3 new columns to the newsletters table to allow more customisation:
- background_color, default to 'light'
- border_color, nullable, null = no border
- title_color, nullable, null = auto
2023-03-28 11:38:43 +02:00
Daniel Lockyer
7a050f596f
Reverted "Removed Casper from being tracked by git"
This reverts commit 99df2a418d.
2023-03-28 11:26:17 +02:00
Daniel Lockyer
99df2a418d
Removed Casper from being tracked by git
refs https://ghost.slack.com/archives/C02G9E68C/p1658491521456569

- I've added the submodule to the gitignore and `.gitmodules` has been
  configured to ignore the submodule, but it's still included when you
  do `git add -A`
- I think this should fix it by removing the folder from being tracked
  by git
2023-03-28 11:15:29 +02:00
Elena Baidakova
f40c3ae01a
Added tenor config to lexical editor context (#16513)
refs TryGhost/Team#2764
2023-03-28 11:56:52 +04:00
Ronald Langeveld
fe31898dcd Bumped koenig lexical packages
no issue

- Bumped kg-default-nodes to make compatible with the latest cards
2023-03-28 15:47:46 +08:00
Chris Raible
ec966ac3c3
Added www.federalreserve.gov to the blockedReferrerDomains list (#16511)
refs TryGhost/Team#2742

- The federal reserve's website returns a 404 for any URLs that include
query params, so our member attribution/outbound link tagging was
breaking any links to the federal reserve's website
- This adds the federal reserve's website to the list of blocked domains
so that we don't append ?ref= to any links to the federal reserve's
website
2023-03-27 20:30:35 -07:00
Fabien "egg" O'Carroll
349f3b01eb Fixed snapshots for post stats export e2e-api test
The Content-Disposition header was not matching because we use the date in the
filename for the exported CSV file. I haven't created a new matcher here because
it's quite unique, and we don't want an `anyContentDisposition` matcher because
the filename is a part of the API.
2023-03-28 09:48:17 +07:00
Sanne de Vries
7928b53fbd Updated color settings UI in email newsletter
Refs https://github.com/TryGhost/Team/issues/2830
2023-03-27 16:00:24 +02:00
Sodbileg Gansukh
0e998c2a74 Fixed the footer of newsletter click breaking in certain width
refs https://github.com/TryGhost/Team/issues/2619

- the footer text "Sent a broken link? You can update it" of the newsletter clicks was breaking in certain browser width
- this fixes it by adding extra media queries to the already existing solution of hiding the normal text in small screen
2023-03-27 19:30:37 +08:00
Sanne de Vries
11656ea696 Added UI for changing newsletter colors to email settings
Refs https://github.com/TryGhost/Team/issues/2830
2023-03-27 13:15:51 +02:00
Sam Lord
a65dc2de61 Replaced environment variable with config option
no issue

This change moves the way that we enable developer experiments in the browser-based test suite from being an environment variable into the config file for that environment. Just a tidy-up, no functional change.
2023-03-27 11:04:47 +01:00
Sam Lord
14d4d2bf6b Set the log level for test environments to log errors
refs: https://github.com/TryGhost/Toolbox/issues/389

The number of error logs has been reduced massively. There are 4 remaining logs in the unit test suite, and 200~ in the e2e test suite. A lot of the e2e test suite error logs are relating to Stripe, but after that they're mostly individual error log lines caused by testing a failure case. These can be resolved by stubbing the error log and testing that it is called exactly 1 time.
2023-03-27 11:01:37 +01:00
Simon Backx
465c2ee8d5 Updated post export E2E test ordering
no issue

Ordering on title differs between MySQL and SQLite, so replaced it with published_at.
2023-03-27 11:22:33 +02:00
Simon Backx
2fedce8a37 Added E2E tests for post export endpoint
fixes https://github.com/TryGhost/Team/issues/2788
2023-03-27 11:11:49 +02:00
Simon Backx
868adf30fd Fixed batch sending snapshot date matching
no issue

The replacement didn't match dates with only one number.
2023-03-27 10:24:34 +02:00
Simon Backx
11abac9c58 Added 100% unit test coverage for PostsExporter
fixes https://github.com/TryGhost/Team/issues/2796
2023-03-27 10:17:03 +02:00
Ronald Langeveld
a057a4cb3d Added "file" fileType to lexical uploader
refs https://github.com/TryGhost/Team/issues/2634

Added suport for type "file" which refers to basically any non-specific
file type for use on the file card.
Bypasses validation when a file gets uploaded.
2023-03-27 10:33:55 +08:00
Ghost CI
234853aebf v5.40.1 2023-03-24 18:04:56 +00:00
Rishabh Garg
0c743d67af
🐛 Fixed member newsletter subscription not saving in Admin (#16490)
fixes https://github.com/TryGhost/Team/issues/2783 
refs cb05fae5a3

The root cause of the issue was the fact we no longer checked for lack of `newsletters` property on member data before checking its `subscribed` property which is now deprecated. This caused a cascading effect where `subscribed:false` property on a member overrides the value for `newsletters` data. The check was accidentally removed in a previous bug fix.

So for members that were not subscribed to any newsletters, saving a newsletter subscription failed as they had their `subscribed` set to `false`, and it was resetting the newsletter subscription to empty always.
2023-03-24 23:29:49 +05:30
Ghost CI
e096fbc8dd v5.40.0 2023-03-24 16:03:04 +00:00
Sanne de Vries
387dfa59c9
Fixed issue with email template in Outlook (#16486)
Refs https://github.com/TryGhost/Team/issues/2801

- It was not possible to click latest post links in Outlook due to <a>
tag wrapping around a table
- The post meta data wouldn't display properly when centered in Outlook

---------

Co-authored-by: Simon Backx <simon@ghost.org>
2023-03-24 14:54:16 +01:00
Paul Davis
751f7d5278
Added default email to send import reports to (#16485)
refs https://github.com/TryGhost/Team/issues/2790

- When a Self-Serve integration does content/members import it failed
because there was no "user" to get the email from - needed to send the
import report
- The fix defaults to the instance's owner email when an integration
does the request

Co-authored-by: Naz <hi@nazavo.com>
2023-03-24 13:33:24 +00:00
Chris Raible
64c9e66b56
🐛 Fixed broken link tracking in newsletters (#16473)
refs https://github.com/TryGhost/Team/issues/2805

When we render mobiledoc to HTML, it automatically escapes HTML entities in the process, so a button or directly pasted link with href="https://example.com?code=test" will be rendered as href="https://example.com?code&#x3Dtest" as the url is encoded in the rendered HTML. Our link tracking was using the encoded URL as the redirect URL in newsletters, causing certain links to break.

This change updates the link tracking to decode the URL with `entities.decode(url)` so we store the correct redirect URL in our DB and ensure link tracking redirects to the correct url from newsletters.

---------

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2023-03-24 18:44:55 +05:30
Sam Lord
8856822092 Prevent errors during the verification trigger tests
no issue

These tests were erroring because they subscribed to events but didn't have the handler injected.
2023-03-24 12:32:28 +00:00
Daniel Lockyer
c7928827a0
Ignored changes to Casper in git
- we don't want to allow developers to accidentally commit changes to
  Casper, so this excludes those changes
- the release script has been updated to force add the submodule so it
  can be bumped
2023-03-24 13:08:04 +01:00
Sagar Gupta
5bd558ddf1 Added Toggle Card (first version) 2023-03-24 12:42:58 +01:00
Simon Backx
d9c92816e0 Added dynamic text truncation in email latest posts
refs https://github.com/TryGhost/Team/issues/2675

Truncate text depending on mobile/desktop and feature image.
2023-03-24 12:15:16 +01:00
Daniel Lockyer
045e1ee33d Disabled got retries in testing environment
- by default, got retries failed requests, which is causing issues in
  tests because we've disabled the network with `nock`
- this is causing huge idle time because got pauses before retrying
- this change disables the retries if we're running tests, so things are
  more stable
2023-03-24 11:55:57 +01:00
Naz
2231981880
Added e2e test checking integration access
refs https://github.com/TryGhost/Team/issues/2790

- The Self-Serve Integration should only be accessible to the Owner and Admin user roles otherwise we risk accidental indirect increase in role permissions - Self-Serve Integration has permissions which editors/contributors don't have.
2023-03-24 11:31:25 +01:00
Naz
fe4e9897fc
Added migration for Self-Serve Integration permissions
refs https://github.com/TryGhost/Team/issues/2790

- This migration adds permissions for Self-Serve Migration Integration to have access to Admin APIs:

POST /ghost/api/admin/db
POST /ghost/api/admin/db/media/inline
POST /ghost/api/admin/members/upload
GET  /ghost/api/admin/tags/:id
GET  /ghost/api/admin/tags/slug/:slug
2023-03-24 11:31:25 +01:00
Naz
0b107f5af5
Added migrations for Self-Serve Migration Integration and API key
refs https://github.com/TryGhost/Team/issues/2790
refs 3747df1bc8 (diff-396038cecd7a381616d00954ae18a655ae2a8af71ea65866bf09d2c7cc1b5235)

- This integration will be used to perform self-serve migrations.
- The integration will be limited to these Admin API endpoints:
POST /ghost/api/admin/db
POST /ghost/api/admin/db/media/inline
POST /ghost/api/admin/members/upload
GET   /ghost/api/admin/tags/:id
GET   /ghost/api/admin/tags/slug/:slug
2023-03-24 11:28:29 +01:00
Simon Backx
317b9aee20 Copied over preview labs change
no refs

Change should be applied for labs and no labs preview page.
2023-03-24 11:00:52 +01:00
Chris Raible
2a876ac7a8
🐛 Fixed UI bug when choosing email recipients (#16481)
- closes https://github.com/TryGhost/Team/issues/2786

- when trying to deselect all recipients, the UI would pass null as the filter to publish-options
- publish-options would then fallback to the default options, which is all recipients, and then the UI wouldn't update which made things even weirder
- we want to fallback to the default recipients when the recipientFilter is undefined (e.g. hasn't been set at all), but not when it is explicitly set to null (e.g. when the user has deselected all recipients)
2023-03-24 15:25:35 +05:30
Simon Backx
07b6cda3db Added subscription details to newsletters
fixes https://github.com/TryGhost/Team/issues/2674

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-03-24 10:54:45 +01:00
Simon Backx
104a81d8c3 Added latests posts to newsletters
fixes https://github.com/TryGhost/Team/issues/2675

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2023-03-24 10:54:45 +01:00
Sanne de Vries
cd7f4bdb09 Fixed sans-serif body font not displaying correctly in email preview
No ref
2023-03-24 10:53:37 +01:00