Commit Graph

32265 Commits

Author SHA1 Message Date
Simon Backx
f568b35f26 Fixed 2023 snapshot tests
no issue

Updated the snapshot files for the email preview test snapshots that contain 2023 in the email footer.
2023-01-02 11:18:07 +01:00
Ghost CI
65252c361a v5.26.4 2022-12-30 16:00:45 +00:00
Ghost CI
85db1838d9 v5.26.3 2022-12-23 16:01:11 +00:00
Ghost CI
42f5743e86 v5.26.2 2022-12-20 12:15:51 +00:00
Hannah Wolfe
1b5aa390f1
🐛 Fixed meta is missing error with revue imports (#16033)
refs:
5f90baf6fe

- The check for hasIssuesCSV didn't normalize the filename first,
meaning the importer is super sensitive to zip structure
- This allows for zips that contain a directory, so that it will still
be processed as a revue import, not a Ghost import
2022-12-20 11:56:07 +00:00
Ghost CI
1f5a752b71 v5.26.1 2022-12-16 16:01:00 +00:00
Ghost CI
26be3b9ccd v5.26.0 2022-12-16 12:49:22 +00:00
Ghost CI
571874d2cc 🎨 Updated Casper to v5.4.4 2022-12-16 12:49:21 +00:00
Rishabh Garg
2eac41b1f4
🐛 Fixed invalid email getting saved for members (#16021)
refs https://github.com/TryGhost/Team/issues/2235

We found some cases which can cause a site to have member emails that have invalid characters like `member@example.com�`. This happened due to the `validator` version used by Ghost not able to catch some specific cases as invalid email, allowing members to be created with them either via Admin or Importer or direct signup. Portal UI already blocked these email as invalid. This change:

- updates `@tryghost/validator` to include a latest version of email validator that catches these invalid cases
- doesn't allow member creation with invalid email like above
- doesn't allow existing member emails to be edited to invalid
2022-12-16 16:47:52 +05:30
Simon Backx
6a266be239
🐛 Fixed archived offers return button not working (#16023)
fixes https://github.com/TryGhost/Team/issues/2374

When clicking 'Show active offers' in the archived offers view, it would
always return to an empty offers list, even when there are active
offers.
2022-12-16 11:32:05 +01:00
renovate[bot]
9ec6a7320a
Update dependency sinon to v15.0.1 2022-12-15 21:03:48 +00:00
Kevin Ansfield
4a6a2f8ded Added missing @tryghost/importer-revue
no issue

- publishing Ghost wasn't correctly bundling the required package due to a missing dependency in package.json
2022-12-15 21:00:43 +00:00
Hannah Wolfe
3ee0b813b6
Updated to use proper members importer for Revue (#16018)
refs:
5f90baf6fe

- The OG implementation of importing revue subscribers was very naive
- This sures it up to use our proper member importer, which makes sure
everything works perfectly:
  - adds an import label
  - ensures members are subscribed to newsletters

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-12-15 20:29:08 +00:00
Paul Davis
ecd2083745
Handle blockquotes & empty paragraphs (#16019)
refs: 5f90baf6fe

- Blockquotes without any wrapping tag get converted to Mobiledoc weirdly. Wrapping them in `<p>` tags helps solve that
- Also removes empty paragraph tags which cause unwanted large blank spaces in content
- Remove internal #revue from Revue content
2022-12-15 19:28:48 +00:00
Hannah Wolfe
5f90baf6fe
Added Revue Importer (#16012)
refs: https://www.getrevue.co/app/offboard

- Revue is stopping all paid subscriptions on 20th Dec, and shutting down on Jan 18th.
- This update allows Ghost to accept and handle the zip file Revue are providing as an export in Labs > Importer
- It will import posts (as best as we can with the data provided) and subscribers as free members
- At present it doesn't import paid subscribers, as we don't have that info, but you can disconnect Revue from your Stripe account to prevent all your subscriptions being cancelled & there's the option this can be fixed later
- There will be further updates to polish up this tooling - this is just a first pass to try to get something in people's hands

Co-authored-by: Paul Davis <PaulAdamDavis@users.noreply.github.com>
2022-12-15 17:22:54 +00:00
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