Commit Graph

2966 Commits

Author SHA1 Message Date
Simon Backx
b916300ceb
Added aggregated click events (#15713)
fixes https://github.com/TryGhost/Team/issues/2175

- New event type `aggregated_click_event` that is disabled by default in all the existing activity feeds
- This returns click events, but only the first click events for each member/post combination.
- It includes the total count of unique link clicks for that member on that post combination
- Had to resort to some custom knex queries to make this work easily
- Requires `@tryghost/bookshelf-pagination@0.1.31`, included in `@tryghost/bookshelf-plugins@0.6.1` (this fixes an issue with custom selects breaking the total count query of pages)
- Went a bit overboard with the pagination tests to cover as much unknown edge cases as possible
2022-10-27 17:23:45 +02:00
Simon Backx
076e3c02b2
Added linking between member and subscription created events (#15693)
fixes https://github.com/TryGhost/Team/issues/2160

- Adds a `batch_id` to both events that contain the same ID if they were created at the same time.
- Removes duplicate signup/conversion events using the batch_id
- Requires an update in mongo-knex to work (refs https://ghost.slack.com/archives/C02G9E68C/p1666773313272409?thread_ts=1666767872.375009&cid=C02G9E68C)
- Some dependencies needed an update to load the latest mongo-knex
- Added tiers to membersUtils, loaded on startup (we can start to use this instead of fetching it every time)
2022-10-27 11:44:19 +02:00
Sam Lord
28b11e6fed
Added command to generate demo data (#15691)
refs: https://github.com/TryGhost/Toolbox/issues/440

New command to generate demo data, creates data for over 20 tables in
Ghost, suitable for testing most features of the dashboard, as well as
making guided product tours using newsletters, tiers, many posts and
tags.

Usage: `yarn start generate-data`

Optionally, keep your existing posts / tags with: `yarn start generate-data --use-existing-tags --use-existing-posts`
2022-10-26 17:55:08 +01:00
renovate[bot]
d034526fe6
Update dependency supertest to v6.3.1 2022-10-26 02:54:43 +00:00
renovate[bot]
f8cf220762
Update dependency mailgun.js to v8.0.2 2022-10-25 20:20:41 +00:00
renovate[bot]
0d3d85df64 Update dependency html-validate to v7.7.1 2022-10-25 10:40:33 +07:00
renovate[bot]
68f1df545c
Update dependency express-jwt to v7.7.7 2022-10-24 21:21:25 +00:00
renovate[bot]
bbd6c47d01 Update dependency html-validate to v7.7.0 2022-10-24 11:36:30 +07:00
renovate[bot]
603c78755d
Updated @tryghost dependencies (#15631)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-24 10:30:40 +07:00
renovate[bot]
5f08c1b713 Update dependency ember-svg-jar to v2.4.2 2022-10-24 10:28:20 +07:00
renovate[bot]
9b2e4eb73c Update dependency @babel/plugin-proposal-decorators to v7.19.6 2022-10-24 10:25:41 +07:00
renovate[bot]
c8c89a9fa3 Update dependency concurrently to v7.5.0 2022-10-24 10:23:48 +07:00
renovate[bot]
44f54fa4cc Update dependency inquirer to v8.2.5 2022-10-24 10:22:16 +07:00
renovate[bot]
66f92e6eaf Update dependency ember-auto-import to v2.4.3 2022-10-24 10:20:44 +07:00
renovate[bot]
3021a7dc50 Update dependency eslint to v8.26.0 2022-10-24 10:19:56 +07:00
renovate[bot]
ed12634b26
Lock file maintenance 2022-10-24 00:17:22 +00:00
renovate[bot]
eaf6c5d1b7 Update dependency ember-svg-jar to v2.4.1 2022-10-20 10:14:41 +07:00
renovate[bot]
93e999ec1c
Update dependency mocha to v10.1.0 2022-10-19 17:53:57 +00:00
Fabien "egg" O'Carroll
fbc23a624e Refactored Tiers logic into separate package
refs https://github.com/TryGhost/Team/issues/2078

This pulls the current Tiers logic into its own package, the persistence part of
the work has not been done yet, that will be handled in core, so all bookshelf
model specific stuff is kept together.
2022-10-19 11:05:09 +07:00
renovate[bot]
6eaeaad5f2
Update dependency ember-template-lint to v4.16.1 2022-10-18 23:25:57 +00:00
renovate[bot]
2f43e71f7f
Update dependency ember-template-lint to v4.16.0 2022-10-18 10:21:09 +00:00
Kevin Ansfield
95cfb48c2d Fixed broken ember-svg-jar asset viewer
no issue

- downgraded to `2.3.4` because `2.4.0` is missing the asset viewer assets, see https://github.com/voltidev/ember-svg-jar/issues/233
2022-10-18 11:18:20 +01:00
Daniel Lockyer
b6d2d97af2
Merged v5.19.1 into main
v5.19.1
2022-10-17 17:48:02 +07:00
Naz
66c2d3748a
🐛 Fixed 404 collection links for new tags
closes https://github.com/TryGhost/Ghost/issues/15608
closes https://github.com/TryGhost/Toolbox/issues/437
refs https://github.com/bookshelf/bookshelf/issues/2111
refs https://github.com/knex/knex/issues/1641

- When new tag was attached to the post the tag collection link returned 404 - instead of a collection with one post
- The root cause of the issue and it's flaky behavior (sometimes the collection link was returning correctly) was a race condition between event propagation in routing for "tag.attached" event and the post+tag+relations transaction completion
- The race condition was happening as the bookshelf-transaction-events plugin was emitting the 'committed' event BEFORE the transaction was committed!
2022-10-17 18:21:10 +08:00
renovate[bot]
e9587e02d0
Update dependency mocha to v10.1.0 2022-10-17 08:41:28 +00:00
renovate[bot]
f63fef11ed Update dependency util to v0.12.5 2022-10-17 15:37:56 +07:00
Ronald Langeveld
6b7088ba20 Bumped kg-lexical-html-renderer version
no issue

- Bumped from 0.0.8 to 0.0.9
2022-10-17 08:44:30 +07:00
renovate[bot]
63f90c2305
Pinned dependencies (#15612)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-13 18:48:09 +07:00
jbenezech
75811f35bc
🐛 Fixed embedded cards for non-utf8 content (#15578)
closes: https://github.com/TryGhost/Ghost/issues/14973

- When fetching content using a non-standard charset, characters were notproperly decoded to utf-8 resulting in mangled text in the editor -> Detect charset and use iconv to decode the page text

- When requesting a non bookmark card, if no oembed data could be foundand we fallback to bookmark, a second network request to fetch the content was issued. This seemed unnecessary -> refactored to avoid that
2022-10-13 12:19:47 +01:00
renovate[bot]
3917a058a4 Update dependency ember-classic-decorator to v3.0.1 2022-10-13 09:07:30 +07:00
renovate[bot]
f5774fad0c Update dependency postcss to v8.4.18 2022-10-13 08:08:05 +07:00
renovate[bot]
fd2b068e3f
Update dependency cron-validate to v1.4.4 2022-10-12 21:11:14 +00:00
renovate[bot]
178df69ae2 Update dependency @playwright/test to v1.27.1 2022-10-12 17:55:29 +07:00
Daniel Lockyer
5aeaa977fd
Pinned moment dependency
- this shouldn't make any difference because `moment` has a resolution but we take
  the approach of pinning all our dependencies in this repository
2022-10-12 15:42:46 +07:00
renovate[bot]
ab598dd7ea Update dependency minimist to v1.2.7 2022-10-12 10:16:31 +07:00
renovate[bot]
6fc497743d
Updated @tryghost dependencies (#15479)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-12 10:16:05 +07:00
renovate[bot]
2857fc5e67 Update dependency ember-ajax to v5.1.2 2022-10-12 10:15:02 +07:00
Simon Backx
08309f8d88 Fixed audience feedback package dependencies
refs e540344ef2
2022-10-11 16:53:54 +02:00
Sam Lord
6ff34fb49f Added logging & metrics to mailgun API calls
refs: https://github.com/TryGhost/Toolbox/issues/439

Adds timed metrics to ensure we know how long Mailgun takes to respond to queries - as well as the status codes we hit.
2022-10-11 15:11:46 +01:00
renovate[bot]
4145b85b44
Update dependency eslint-plugin-react to v7.31.10 2022-10-11 04:51:25 +00:00
renovate[bot]
3b62e8c52f Update sentry-javascript monorepo to v7.15.0 2022-10-11 09:24:03 +07:00
renovate[bot]
aa29478057 Update dependency @playwright/test to v1.27.0 2022-10-11 09:23:33 +07:00
renovate[bot]
9f5ca0ede0 Update dependency jwks-rsa to v2.1.5 2022-10-11 09:23:12 +07:00
Daniel Lockyer
8ec071a47c
Update dependency eslint-plugin-ghost to v2.16.0 (#15551)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-10 10:23:24 +01:00
renovate[bot]
9cd15ec9fb Update dependency husky to v8.0.1 2022-10-10 15:49:51 +07:00
Daniel Lockyer
a37b2cd24e Switched to Husky + lint-staged for git hooks
- up until this commit, git hooks were only used by a handful of people
  because they were a pain:
  - they'd only be set up when you did `yarn setup`
  - the existing hooks ran `yarn lint` on all projects, which was
    incredibly slow
- as a result, not many of us actually had them enabled, but this would
  cause issues in CI because people were pushing un-linted commits
- other JS projects tend to use husky to automate the git hook setup and
  lint-staged to speed up linting on changed files
- this commit switches to using them both
  - `lint-staged` only runs `eslint` on staged JS files that are about to
    be committed - if there's a linting error, it will stop the commit
  - I've configured the pre-commit hook to successfully exit in CI because we
    don't want to run pre-commit hooks right now
- this means we can remove Grunt - yay!
2022-10-10 15:10:48 +07:00
renovate[bot]
34439f2e28 Update dependency html-validate to v7.6.0 2022-10-10 10:33:10 +07:00
renovate[bot]
82441e943d Update dependency express to v4.18.2 2022-10-10 10:29:34 +07:00
renovate[bot]
84549838a4 Update sentry-javascript monorepo to v7.14.2 2022-10-07 08:41:20 +07:00
renovate[bot]
12801a4574 Update dependency ember-svg-jar to v2.4.0 2022-10-07 08:28:53 +07:00
renovate[bot]
4aa8be2e1c Update dependency @embroider/macros to v1.9.0 2022-10-07 08:25:31 +07:00
renovate[bot]
0370dd258d
Update dependency body-parser to v1.20.1 2022-10-06 21:20:56 +00:00
renovate[bot]
57f09fc8b7 Update dependency semver to v7.3.8 2022-10-05 23:34:22 +00:00
renovate[bot]
ce495969d1
Update dependency terser to v5.15.1 2022-10-05 18:29:24 +00:00
renovate[bot]
fa7a582c78
Update dependency knex-migrator to v5.0.7 2022-10-05 15:06:09 +00:00
Naz
d817e5830d
Added header snapshots to webhook e2e tests
refs https://github.com/TryGhost/Toolbox/issues/320

- Header snapshot matching was missing from webhook e2e tests. With a bumped version of webhook-mock-receiver it's now possible to record and match webhook request headers.
2022-10-05 17:23:02 +08:00
Daniel Lockyer
08cef79674
Updated lockfile 2022-10-05 15:07:12 +07:00
renovate[bot]
2c2ee81adb
Update Test & linting packages 2022-10-05 00:36:08 +00:00
renovate[bot]
8751245fa5 Update sentry-javascript monorepo to v7.14.1 2022-10-04 08:07:37 +07:00
renovate[bot]
5140f8a887 Update dependency sqlite3 to v5.1.2 2022-10-03 14:21:24 +07:00
renovate[bot]
cf5dbb6981 Lock file maintenance 2022-10-03 08:30:32 +07:00
renovate[bot]
828ad5915d Update dependency postcss to v8.4.17 2022-10-03 07:38:42 +07:00
renovate[bot]
839a61bacd Update dependency @babel/plugin-proposal-decorators to v7.19.3 2022-09-29 11:47:34 +07:00
renovate[bot]
5176aa8a7b Update dependency @types/mocha to v10 2022-09-29 11:42:45 +07:00
renovate[bot]
68ad829e1f Update sentry-javascript monorepo to v7.14.0 2022-09-29 07:44:21 +07:00
renovate[bot]
b61c13e228 Update dependency @playwright/test to v1.26.1 2022-09-28 12:38:09 +07:00
renovate[bot]
9eb3c84a23
Updated @tryghost dependencies (#15434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-27 08:31:35 +07:00
renovate[bot]
7d21e192b2
Update metascraper to v5.31.1 2022-09-26 20:28:26 +00:00
renovate[bot]
d02401c1f0
Update dependency eslint to v8.24.0 2022-09-26 06:58:26 +00:00
Naz
7b009bf1fe Enabled shared caching of 404 error responses
refs https://github.com/TryGhost/Toolbox/issues/410

- The 'private' value in 'Cache-Control' response header for all errors made it impossible for shared caches (e.g.: Fastly, Cloudflare) to cache 404 responses efficiently.
- The change substitutes 'max-age=0' which should not effect the browser cache behavior but would allow shared caches to process such requests efficiently.
- A more loose caching logic only applies to 404 responses from GET requests that are not user-specific (non-authenticated, non-cookie containing requests)
2022-09-26 14:54:50 +08:00
renovate[bot]
7045eef930
Update dependency ember-css-transitions to v4.2.0 (#15453)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 18:20:57 +02:00
renovate[bot]
8aa4308866
Update ember-basic-dropdown addons to v6 (major) (#15159)
Update ember-basic-dropdown addons to v6

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-24 15:37:06 +02:00
renovate[bot]
65a74f41c8
Update dependency ember-power-select to v4.1.7 (#15157)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2022-09-24 15:08:42 +02:00
Kevin Ansfield
fa84808048 Dropped ember-cli-moment-shim dependency
no issue

Since `ember-moment@10.0` it's not been necessary to use the `ember-cli-moment-shim` package, with `moment` instead being usable directly via `ember-auto-import`. Getting rid of the shim package is necessary for compatibility with `embroider`, Ember's new build tooling.

- dropped `ember-cli-moment-shim` dependency
- added `moment-timezone` dependency and updated all imports to reflect the different package
- worked around `ember-power-calendar` having `ember-cli-moment-shim` as a sub-dependency
  - added empty in-repo-addon `ember-power-calendar-moment` to avoid `ember-power-calendar` complaining about a missing package
  - added `ember-power-calendar-utils` in-repo-addon that is a copy of `ember-power-calendar-moment` but without the build-time renaming of the tree for better compatibility with embroider
2022-09-24 13:28:23 +02:00
Daniel Lockyer
2bff2a22e0
Extracted dev tooling to separate script
refs https://github.com/TryGhost/Toolbox/issues/426

- we're going to need to support more complex combinations of dev
  commands soon, with other packages optionally running and env
  variables being altered
- this command pulls out a lot of the dev env scripting into a single
  scripts
- also cleans up the use of grunt-shell so we can remove the dependency
2022-09-23 15:02:35 +02:00
Kevin Ansfield
c59ea73a80 🐛 Fixed distorted images in newsletters for product cards
refs https://github.com/TryGhost/Team/issues/1949

- bumps `@tryghost/kg-default-cards` which updates the rendered output for emails
- added `height: auto` style to the img element so clients don't render the image at the fixed image height retrieved from the `height="x"` attribute
2022-09-22 16:02:04 +02:00
Kevin Ansfield
9f0bf7e40c Added aside and blockquote lexical rendering support
no issue

- bumped `@tryghost/kg-lexical-html-renderer` with support for `quote` and `aside` node types
2022-09-21 08:30:30 +01:00
renovate[bot]
5573e111cd Update dependency @playwright/test to v1.26.0 2022-09-21 07:31:56 +01:00
renovate[bot]
19e21a1e78
Update Test & linting packages 2022-09-20 18:01:42 +00:00
renovate[bot]
061f0ab062
Update dependency c8 to v7.12.0 2022-09-20 14:48:51 +00:00
Sam Lord
364f92f021 Added mailgun as transaction email transport
refs: https://github.com/TryGhost/Toolbox/issues/281

As well as SMTP, we can now use Mailgun's API to send transactional email.
2022-09-20 15:44:26 +01:00
Daniel Lockyer
abe9811c6c
Remove typescript files and dependencies
- these are not currently used/needed in this repo
2022-09-20 14:54:23 +01:00
renovate[bot]
017bbd89c3
Pinned dependencies (#15441)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-20 14:29:59 +01:00
Daniel Lockyer
cd7aa42f5d
Updated knex dependency
- this needed to be updated to switch back to the official sqlite3
  library
2022-09-20 14:24:14 +01:00
Daniel Lockyer
b596eff418
Switched to official sqlite3 library
- this wasn't switched back when we switched from the vscode fork to our
  own maintained version
2022-09-20 14:21:31 +01:00
Daniel Lockyer
d73200799d
Updated lockfile
- also unversions `@tryghost/stats-service` so it isn't included in the
  lockfile
2022-09-20 14:18:51 +01:00
Kevin Ansfield
e9f3d90147 Fixed "Cannot find module '@lexical/clipboard'" when rendering lexical
no issue

- bumped `@tryghost/kg-lexical-html-renderer` so it no longer has an implicit dependency on `@lexical/clipboard`
2022-09-19 19:06:35 +01:00
Kevin Ansfield
125a98192c Fixed "Cannot find module 'react'" when rendering lexical in production
no issue

- bumped `@tryghost/kg-lexical-html-renderer` so it no longer has an implicit dependency on `react`
2022-09-19 18:03:23 +01:00
Simon Backx
4c5ba4ed7d
Added database storage for link redirects and click events (#15423)
closes https://github.com/TryGhost/Team/issues/1916 
closes https://github.com/TryGhost/Team/issues/1917

- Added database storage for link redirects and click events via repositories (hides away database layer) defined in the wrapper services
    - Added LinkClickRepository to store click events to database
    - Added LinkRedirectRepository to store link redirects to database
    - Added PostLinkRepository to link LinkRedirects with posts
- Renamed link-replacement package to link-replacer, and made it dependency less (it only replaces links now, doesn't do anything else)
- The link-tracking service has a new `addTrackingToUrl` which returns a new URL that includes tracking. The new `addRedirectToUrl` method does the same but without tracking for now.
- MEGA service now uses the link-replacer to replace links in the emails using a combination of different services (member attribution + link-tracking service)
2022-09-19 17:12:54 +02:00
renovate[bot]
225765241c
Updated @tryghost dependencies (#15404)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 12:09:33 +01:00
Kevin Ansfield
180bb72115 Added link and heading id attribute support when rendering lexical
no issue

- bumped `@tryghost/kg-lexical-html-renderer`
2022-09-19 11:42:15 +01:00
Kevin Ansfield
3bdfb68ff6
Added __GHOST_URL__ transform support to posts.lexical field (#15433)
no issue

- bumped `@tryghost/url-utils` to get access to the new lexical transform utilities
- updated the Post model's `parse()` and `formatOnWrite()` methods to transform the `lexical` field contents when reading/writing to ensure any links in content point at the correct place with `site.url` config changes
2022-09-19 11:30:38 +01:00
Daniel Lockyer
66f11d5e45
Updated lockfile 2022-09-19 08:45:46 +01:00
Naz
1b6a24f0d8
🐛 Fixed incorrect API error response message
closes https://github.com/TryGhost/Ghost/issues/15424
refs b9ab1002b3
refs 9210ac7dc7

- When errors were throw from the model layer the HTTP API responses contained misleading information about the error - e.g.:

"message": "Unknown error - TypeError, cannot save post."

- This was due to the error handling code throwing it's own internal error resulting in compete loss of the original Ghost's error context.
2022-09-19 14:52:28 +08:00
renovate[bot]
40df6c3252 Update dependency html-validate to v7.5.0 2022-09-19 07:52:04 +01:00
renovate[bot]
10f285d22e
Update dependency nodemon to v2.0.20 2022-09-16 18:19:50 +00:00
Fabien 'egg' O'Carroll
bddb0ba754
Wired up link redirects & tracking (#15418)
refs https://github.com/TryGhost/Team/issues/1910
refs https://github.com/TryGhost/Team/issues/1888

- Uses an in-memory repository for now whilst in development
- Updates the LinkReplacementService to choose the slug
- Exposes a `getSlug` method so we can ensure uniqueness
- Emits the RedirectEvent for use by LinkTracking
2022-09-16 10:42:21 +02:00
renovate[bot]
72a08f4901
Update dependency sanitize-html to v2.7.2 2022-09-15 20:21:58 +00:00
Kevin Ansfield
c240f7afa4
Added rendering of posts.lexical to posts.html when saving (#15416)
no issue

- added `@tryghost/kg-lexical-html-renderer` dependency
- added `lexical` lib following the same pattern as our `mobiledoc` lib
- updated the Post model's `onSaving` hook to generate the `html` value from `lexical` when present
2022-09-15 16:49:14 +01:00
Daniel Lockyer
08ba5065f2
Added ARM64 prebuilt binaries for SQLite
refs https://github.com/TryGhost/node-sqlite3/releases/tag/v5.1.1

- this bumps the version of `sqlite3` to one with prebuilt ARM64
  binaries so we need less dev tooling to run Ghost
2022-09-15 15:22:19 +01:00