Commit Graph

32250 Commits

Author SHA1 Message Date
Simon Backx
0825a2d7f4
🐛 Fixed importing existing member resetting newsletters (#16017)
fixes https://github.com/TryGhost/Team/issues/2386

**Issue:**
- When trying to import a member that already exists, and has
'subscribed' set to 'true' in the CSV, the newsletters the member is
subscribed to are reset to the default newsletters.
- When ediging a member with the API and setting `subscribed` to true,
the same happens.

**Cause:**
A faulty check for the `status` property of a newsletter.

Fixed and added a new E2E test.
2022-12-15 17:45:11 +01:00
Hannah Wolfe
5fad27a3c0
Added html -> mobiledoc conversion to the importer (#16016)
- Now that the importer runs in a job, it seems sensble that we should
do this
- If posts are imported with HTML set, but not mobiledoc, we now convert html -> mobiledoc
- Note: This also converts the mobiledoc -> html so _may_ be lossy
- Without this, imports that only have HTML, not mobiledoc, would have
resulted in empty posts, so lossy > empty
2022-12-15 16:10:36 +00:00
Sodbileg Gansukh
74cb362f87
Added theme docs link to the design settings (#16014)
no refs

- this adds a theme documentation link to the design settings footer if there's an URL set in the package.json of the theme. An example of the package.json property: "docs": "https://example.com"
2022-12-15 20:06:08 +08:00
Ronald Langeveld
ce53c76fdf
Added newsletter subscription filtering to members (#16006)
closes https://github.com/TryGhost/Team/issues/2012

- Members can now be filtered based on the newsletters they are
subscribed to.
- Defaults to the existing newsletter filtering if user does not have
more than 1 newsletter.
2022-12-15 16:06:47 +07:00
Ghost CI
64e44444c1 v5.25.5 2022-12-14 17:21:38 +00:00
Ghost CI
5bafe3df3f 🎨 Updated Casper to v5.4.2 2022-12-14 17:21:38 +00:00
Paul Davis
0a40f1742d
Changed tag for imported content to be internal (#15934)
refs: 8ed5f9784d

- When importing content from a JSON file in Settings > Labs, a public tag
like `Import 2022-12-03 19:57` gets added to each newly imported post.
- This tag should not be public. It definitely serves a useful
purpose but has no useful function for readers of the site and should
not be shown to readers.
2022-12-14 16:51:51 +00:00
Simon Backx
94e85dc09e
Reduced webhook calls when updating last_seen_at for email opens (#16008)
refs https://ghost.slack.com/archives/C02G9E68C/p1670960248186789

This reverts a change that was made here:

f4fdb4fa6c (r93071549),
but it still moved the original code to a new location in the
LastSeenAtUpdater

It includes a new E2E test to make sure timezones are supported
correctly.

- By not using Bookshelf, we no longer fire webhook calls
- By not using the member repository, we don't fetch and update the
member model and the labels relation in a forUpdate transaction, which
caused deadlock issues on the labels/members_labels tables which were
hard to resolve. Until now I was unable to find the other conflicting
transaction that caused this deadlock. Moving to raw knex (instead of
Bookshelf) and only updating the last_updated_at column should remove
the deadlock issue.

This removed the test for the email service wrapper, since it started
failing for an unknown reason and the test didn't make much sense (was
added earlier only to bump test threshold).
2022-12-14 17:50:42 +01:00
Elena Baidakova
00c2b71502
🐛 Fixed slug saving in editor (#16007)
refs TryGhost/Team#2294
- If user enter the slug name and then leave the post page, we should
wait until the slug would be saved on backend. The problem can be
reproduced with slow internet connection.
2022-12-14 19:39:01 +04:00
Hannah Wolfe
270f288c48 Added a timeout to the get helper
- The get helper can sometimes take a long time, and in themes that have many get helpers, the request can take far too long to respond
- This adds a timeout to the get helper, so that the page render doesn't block forever
- This won't abort the request to the DB, but instead just means the page will render sooner, and without the get block
2022-12-14 15:35:07 +00:00
Kevin Ansfield
a69ffb94c1 Added playwright test for publishing posts for specific tiers
refs https://github.com/TryGhost/Team/issues/2371

- test publishes a post with access for a single tier then checks the front-end with no member, member on wrong tier, and member on right tier
2022-12-14 12:20:55 +00:00
Hannah Wolfe
abc7e64941 Added new unique tag to all mailgun requests
refs: https://github.com/TryGhost/Ghost/issues/15725

- our users are having difficulties getting onboarded with mailgun
- we're adding an explicit and unique tag to all requests, to help mailgun detect when mail is being sent from Ghost
2022-12-14 12:20:25 +00:00
Kevin Ansfield
8e7d6400b0 Updated .lint-todo file
refs c3487fea41
2022-12-14 12:09:33 +00:00
Kevin Ansfield
b402b1643e Prevented throwing errors unnecessarily in editor plus menu and link toolbar
closes sentry Admin-423

- there may be times when the mousemove event handler fires when the document is not in a ready state resulting in an attempt to get a document position that doesn't exist
- should fix `Could not find parent section from element node` errors
2022-12-14 11:57:54 +00:00
Kevin Ansfield
c3487fea41 Refactored <GhBenefitItem>
refs https://github.com/TryGhost/Ghost/issues/14101

- migrated component to Glimmer
- swapped usage of `ValidationState` mixin for `{{validation-status}}` modifier
  - updated modifier to accept custom error/success classes
- removed unnecessary/unused code in the `gh-benefit-item.js` backing class
2022-12-14 11:57:54 +00:00
Rishabh
25c530293f Added playwright tests for forever and multiple month offers
- adds test that cover creating and signing up to multiple-month/forever offers
- checks that the offer information is shown to members during signup and in account detail
2022-12-14 17:13:20 +05:30
Rishabh
199d8644a5 Fixed offers playwright test for one-time discount
refs aa693039a3

- one-time offer discounts are no longer shown to member in Portal settings, as portal shows only the next payment info.
2022-12-14 16:27:01 +05:30
Rishabh
521b25fa84 Added suppression and offer UI changes to Portal
- bumps portal to latest to include changes for suppression and offer UI
2022-12-14 16:14:39 +05:30
Rishabh
45705e4bb2 Released Portal v2.22.0 2022-12-14 16:12:20 +05:30
Rishabh Garg
a09e86da05
Fixed email preview text with new stability flow (#15996)
closes https://github.com/TryGhost/Team/issues/2382

The preview text is getting set to subject line in the new email flow so it repeats multiple times in the inbox(subject+preview+title). This was because the new flow doesn't use the post serialisation that the old system did, causing excerpt to be empty in the email rendering.

Old system was using post serialisation here -
a721e4f2d7/ghost/core/core/server/services/mega/post-email-serializer.js (L136-L139).

This change adds explicit method to calculate the preview text for email in email renderer service using same logic as used in old system.

Co-authored-by: Simon Backx <git@simonbackx.com>
2022-12-14 15:54:26 +05:30
Simon Backx
47cd7a7095
🐛 Handled unknown Mailgun events (#15995)
refs https://ghost.slack.com/archives/C02G9E68C/p1670916538764019

- We receive events that don't have an emailId or providerId.
- We filter those events now and log them as an error
2022-12-14 11:17:45 +01:00
Rishabh
aa693039a3 🐛 Removed expired offers shown in portal account detail
closes https://github.com/TryGhost/Team/issues/2376#event-8026429598

- if an offer is expired/in past, we no longer show it in member account info against the price
- one-time offers are never showed in portal in member account detail, as the payment information shown to member in Portal points to charge at next payment
- if trial days are over for a subscription, portal doesn't show any offer data on member account detail
2022-12-14 15:27:49 +05:30
Simon Backx
237d4d53d4
Added catch to unhandled promises rejections (#15994)
refs https://github.com/TryGhost/Team/issues/2370

Reduces amount of unhandled promise rejections
2022-12-14 10:48:46 +01:00
Daniel Lockyer
3bd5dd66e0
Fixed jest snapshot highlighting for nested properties
fixes https://github.com/TryGhost/Toolbox/issues/449

- this bumps the lockfile to update jest-snapshot to >=29.2.2, which
  contains a fix for highlighting on nested properties
2022-12-14 12:08:20 +07:00
Daniel Lockyer
919a8345a1
Added missing dev dependency
- this should be explicitly added to the package.json as we use it in
  the core package
2022-12-14 11:42:46 +07:00
Daniel Lockyer
6f4e663d74
Updated @tryghost dependencies (#16005)
- also includes `knex-migrator` with a simple `sqlite3` bump
2022-12-14 11:18:55 +07:00
renovate[bot]
7c3dc6f3ed Update sentry-javascript monorepo to v7.26.0 2022-12-14 08:07:58 +07:00
renovate[bot]
8977fe5ac9 Update dependency @types/express to v4.17.15 2022-12-14 07:33:05 +07:00
Daniel Lockyer
0482db4818
Merged v5.25.4 into main 2022-12-14 07:25:47 +07:00
Ghost CI
fa9f6007bf v5.25.4 2022-12-13 15:16:49 +00:00
Sodbileg Gansukh
6878b18341
Added Taste and Episode themes (#15991)
no refs

- added two new themes, Taste and Episode to the admin
- updated theme screenshots that weren't up-to-date with the latest changes added to the themes
- some theme screenshot files were JPGs and replaced them with PNGs for consistency
2022-12-13 23:03:21 +08:00
Simon Backx
b14e234576
🐛 Reverted Sentry to v7.11.1 to fix unhandled promise rejection crashes (#15998)
refs https://github.com/TryGhost/Team/issues/2370

Due to a possible bug in either `@sentry/node` (mainly the Express
middlewares and the usage of deprectated Domain) and Node v16+,
unhandled promise rejections are transformed into uncaught exceptions
and cause Ghost to crash in unexpected situations.

Reverting to `v7.11.1` fixes this (but definitely not ideal at all)
because errors are caught in the Express middleware.

Reproduction repo:
https://github.com/SimonBackx/sentry-node-unhandled-rejection-crash
2022-12-13 15:53:27 +01:00
Simon Backx
a721e4f2d7
🐛 Fixed 'Invalid status code: undefined' in members api (#15973)
fixes https://github.com/TryGhost/Team/issues/2377

When there is an error thrown that is not a Ghost error, there is no
status code in the error. Calling res.writeHead with an undefined status
code, throws an error and crashes Ghost.

This change fixes that and adds logging for those errors.
2022-12-13 12:32:05 +01:00
Simon Backx
520b19e313
Added try catch for errors in all domain event listeners (#15976)
refs https://github.com/TryGhost/Team/issues/2370

Reduces the amount of unhandled errors that could cause a crash in Ghost
2022-12-13 11:28:02 +01:00
Elena Baidakova
9579791185
Resubscribe member to default newsletters after removing from suppression list (#15974)
refs TryGhost/Team#2372
2022-12-13 13:31:50 +04:00
Elena Baidakova
1c74d3304a
Added url to help doc for disabled emails (#15993)
refs TryGhost/Team#2323
2022-12-13 12:57:51 +04:00
renovate[bot]
ed6abe60be Update peter-evans/create-or-update-comment digest to 69c3c2d 2022-12-13 11:04:20 +07:00
renovate[bot]
f94d8fdcc2 Update dependency fs-extra to v11 2022-12-13 10:59:55 +07:00
renovate[bot]
102f2f39c7 Update dependency sqlite3 to v5.1.4 2022-12-13 10:59:30 +07:00
renovate[bot]
a8610b524b Update sentry-javascript monorepo to v7.25.0 2022-12-13 10:59:06 +07:00
renovate[bot]
607ca90bca
Update dependency sanitize-html to v2.8.0 2022-12-12 20:20:22 +00:00
renovate[bot]
4275090cc0
Update metascraper to v5.32.3 2022-12-12 17:13:29 +00:00
renovate[bot]
13abcf6c9d
Update dependency mocha to v10.2.0 2022-12-12 13:20:22 +00:00
Elena Baidakova
7ef157b17f
Improved count of items in e2e tests (#15986)
refs TryGhost/Team#2371
- We need to wait selectors before count them
https://github.com/microsoft/playwright/issues/14278

These changes needed to make the results of tests more stable on the CI
2022-12-12 16:51:31 +04:00
Elena Baidakova
8d2418578d
🐛 Removed horizontal scroll for long author's name (#15985)
closes TryGhost/Team#2272
- Show all name's text due to poor support `text-overflow: ellipsis` in
email clients
2022-12-12 15:36:58 +04:00
Daniel Lockyer
7f8f5205e2
Updated suggested fix when yarn dev fails
- `yarn fix` is much more likely to fix dependency problems because it
  clears the cache and re-runs `yarn`
2022-12-12 17:23:51 +07:00
Peter Zimon
bd92b3ac89 Added UI refinements
refs. https://github.com/TryGhost/Team/issues/2348

- spacing and typography was off on the receiving FAQ page
- longform popup size missed mobile sizes
2022-12-12 15:09:32 +05:30
Rishabh
ce45571dc0 Updated email faqs in portal to show sender email address
refs https://github.com/TryGhost/Team/issues/2348

- updates email faqs to show the sender email from newsletter data
2022-12-12 15:09:32 +05:30
Rishabh
14bdb58694 Added newsletter sender email to content API
refs https://github.com/TryGhost/Team/issues/2348

The suppressions FAQ on portal needs to show the newsletter's sender address, which wasn't exposed to the content API so far.
2022-12-12 15:09:32 +05:30
Rishabh Garg
d7fc3a5e48
Cleaned up old plan UI code in portal (#15805)
closes https://github.com/TryGhost/Team/issues/1889

Portal's UI, specially for Signup and Account Upgrade, has changed a lot as we went from single tier -> multiple prices -> multiple tiers. This change removes the old unused `PlansSection` and related components that are no longer in use anywhere in Portal UI since we transitioned to Products(tiers).

- removes unused `ChangeProductPlansSection` component
- removes unused `PlanSectionStyles` to cleanup unused styles
2022-12-12 14:54:03 +05:30