Commit Graph

13027 Commits

Author SHA1 Message Date
Simon Backx
bba6a4dc84 Fixed cleaned URLs in link table on analytics page
fixes https://github.com/TryGhost/Team/issues/1963
2022-09-23 17:42:51 +02:00
James Morris
87a242bada Removed the full width for posts with the member attribution flag
- Full width was  part of the member attribution flag
- It's messing with email clicks flag
- Removing for both to make things easier

refs https://github.com/TryGhost/Team/issues/1960
2022-09-23 16:19:35 +01:00
Ghost CI
c6865ffe6c v5.16.0 2022-09-23 16:00:34 +01:00
James Morris
6c527cfe78 Made the margins event between elements in the new post rows
refs https://github.com/TryGhost/Team/issues/1957
2022-09-23 15:55:20 +01:00
James Morris
80eaa567b5 Added target blank to links in the link table on post analytics
refs https://github.com/TryGhost/Team/issues/1955
2022-09-23 15:23:59 +01:00
Simon Backx
e658f7622a
Added LinkClickTrackingService unit tests and renamed wrapper (#15462)
refs https://github.com/TryGhost/Team/issues/1958

- Renamed wrapper service link-click-tracking to link-tracking to be consistent with the package name
- Added unit tests for LinkClickTrackingService
- Added DomainEvents dependency to LinkClickTrackingService
- Fixes dependencies in link-tracking package
2022-09-23 16:19:16 +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
Simon Backx
3056e3cb51 Fixed subdirectories saved in the link_redirects table
refs https://github.com/TryGhost/Team/issues/1954

- Subdir should be removed before storing it as the 'from' URL
- Should be removed before checking a URL
2022-09-23 14:41:26 +02:00
Simon Backx
239d93a725 Cleaned up LinkRedirectsService
no issue
2022-09-23 13:32:44 +02:00
Simon Backx
1290477d71
Added member last seen update on link click (#15459)
fixes https://github.com/TryGhost/Team/issues/1952

Adds a new MemberLinkClickEvent event that is fired when a member clicks a link. This code has been added to the `linkClickRepository` because that is the only place that has access to the member model (and the event requires the id and current last seen at value). The LastSeenAtUpdater listens for this event and updates the timestamp if required.
2022-09-23 10:34:33 +02:00
Naz
225a046bb8
Made Admin assets aggressively cacheable
closes https://github.com/TryGhost/Toolbox/issues/372

- The admin assets are served with a unique hash depending on the build with a year-long "max-age" value in the response cache-control header. The client browsers still do send 'If-None-Match' requests when there is a hard-refresh on the client side. There's no need for 'If-None-Match' requests though!
- With 'immutable' value in the cache-control header, the browser caches are treating responses as "hard-fresh" without sending redundant requests.
- For more about 'immutable' value read https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#immutable
2022-09-23 13:46:49 +08:00
Rishabh
fe90dde0e1 Updated referrer attribution for empty history
- empty history means attribution script is not loaded, which should be only when its behind the flag
2022-09-22 23:47:24 +05:30
James Morris
eb7547ea3c Added a new click icon for the member attribution flag
- Adds a new SVG icon when the members attribution flag is on only
- Fixes up some dark mode issues for the URL scrollable in events

refs https://github.com/TryGhost/Team/issues/1951
2022-09-22 18:00:48 +01:00
James Morris
729935eca7 Tidied up the page a bit more with the source attribution included
- Has the source attribution chart and table with some basic styles
- Added in a edit button to the analytics page

refs https://github.com/TryGhost/Team/issues/1920
2022-09-22 17:20:15 +01:00
James Morris
0541dbc79b Moved the empty links into it's own box in the post analytics page
- Not ideal, yet, but this is better than what it was before
- Now links empty state is inside it's box rather than just plain text

refs https://github.com/TryGhost/Team/issues/1920
2022-09-22 17:18:51 +01:00
Djordje Vlaisavljevic
a0c6fafba1
Refined source attribution dashboard design (#15457)
refs https://github.com/TryGhost/Team/issues/1932
refs https://github.com/TryGhost/Team/issues/1941
refs https://github.com/TryGhost/Team/issues/1904
refs https://github.com/TryGhost/Team/issues/1932

- updates attribution sources table design
- updates member profile page design
2022-09-22 21:46:42 +05:30
Rishabh
e93f6071cd Handled null sources for attribution chart and table
refs https://github.com/TryGhost/Team/issues/1932

- removes null sources from attribution chart
- moves null sources count to bottom of attribution table
2022-09-22 21:04:46 +05:30
Rishabh Garg
45a301277d
Updated empty referrer source to null (#15456)
refs https://github.com/TryGhost/Team/issues/1939

- changes empty referrer source to null instead of explicit `Unavailable` in API
- makes it easier for clients/frontend to ignore empty referrers
2022-09-22 20:58:45 +05:30
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
Simon Backx
7581b8726e Added basic post table and analytics page conditionals
refs https://github.com/TryGhost/Team/issues/1947
2022-09-22 15:40:37 +02:00
James Morris
99332dae21 Added the new URL design for events over in the members activity page too
- Brought over the new URL events design
- Tested to make sure it worked as expected
- Had to add a new JS component file

refs https://github.com/TryGhost/Team/issues/1922
2022-09-22 13:44:45 +01:00
Simon Backx
e18ba2bb4d Removed hardcoded subscribers count from list-item-clicks
fixes https://github.com/TryGhost/Team/issues/1948
2022-09-22 14:23:06 +02:00
Rishabh
6dbc42bf55 Updated api endpoint for referrer stats in admin
refs https://github.com/TryGhost/Team/issues/1939
2022-09-22 17:48:46 +05:30
Simon Backx
2d583cef43 Removed free from analytics page count header 2022-09-22 13:44:51 +02:00
Simon Backx
1ab6ff8ada Renamed free signups to signups on analytics page and source chart 2022-09-22 13:43:46 +02:00
Fabien 'egg' O'Carroll
5fcf5098a8
Added links API (#15446)
closes https://github.com/TryGhost/Team/issues/1927

This expose the /links endpoint on the Admin API, which is filterable by Post ID.

Co-authored-by: Simon Backx <simon@ghost.org>
2022-09-22 13:39:52 +02:00
James Morris
433842b2f2 Fixed up the post analytics page so it didn't break at narrower viewports
- Some layout problems at narrower viewports
- Followed dashboard convention with stacking metrics when narrow
- Stacking resources too

refs https://github.com/TryGhost/Team/issues/1937
2022-09-22 12:24:28 +01:00
Rishabh Garg
98fc808e6e
Wired referrers API data to admin dashboard (#15454)
closes https://github.com/TryGhost/Team/issues/1939

- adds real source data counts to attribution table and chart on dashboard
2022-09-22 16:51:41 +05:30
Rishabh Garg
b048b02f67
Added new referrer source stats API (#15449)
closes https://github.com/TryGhost/Team/issues/1939

- adds new endpoint that returns count of referrer sources by date for admin dashboard
2022-09-22 16:34:26 +05:30
Daniel Lockyer
c4c39fe3c4
Added pipe into History log date formatting
- this should help with readability when scanning the list
2022-09-21 19:57:39 +01:00
Simon Backx
7cadaa6378 Implemented referrers stats API on posts' analytics page
refs https://github.com/TryGhost/Team/issues/1921
2022-09-21 18:20:03 +02:00
Simon Backx
7437d92d50
Added post referrers stats API (#15448)
closes https://github.com/TryGhost/Team/issues/1942

- Added data fixtures for referrers
- Added new endpoint to fetch referrer stats for a given post: `/stats/referrers/posts/:id`
- Added new ReferrersStatsService, responsible for calculating referrer stats
2022-09-21 18:16:56 +02:00
James Morris
16acdad985 Improved the post table at narrower viewports
- Fixed up the broken table for Email Clicks flag
- Double checked other flags and when flag is off and fixed those
- Tested to smallest width

refs https://github.com/TryGhost/Team/issues/1937
2022-09-21 15:20:11 +01:00
Rishabh
bb0d900937 Handled storing referrer information in DB
refs https://github.com/TryGhost/Team/issues/1931

- stores `referrer_source`, `referrer_medium` and `referrer_url` in event tables for new members and paid subscriptions
2022-09-21 19:32:18 +05:30
Rishabh
3b9998cdd6 Updated referrer attribution calculation logic
refs https://github.com/TryGhost/Team/issues/1907

- assigns top-level domain as source for external referrers that don't have known mapping
- returns `Direct` as source for new members when no referrer information is found
2022-09-21 19:32:18 +05:30
Rishabh Garg
b99c5428d0
Added referrer attribution columns to events table (#15436)
refs TryGhost/Team#1931

- referrer source, medium and url will be stored in the events table along with rest of attribution data
- stores referrer information on two tables
  - `members_created_events` for signups
  - `members_subscription_created_events` for paid conversions
2022-09-21 19:01:36 +05:30
James Morris
fe46bd05fb Added in email clicks icon and better handling of URLs
- Now has a new email click icon
- Handles long URLs better in the events list
- Fixed narrow viewports bug with events

refs https://github.com/TryGhost/Team/issues/1936
2022-09-21 14:05:37 +01:00
Simon Backx
ad79d45926 Added source attribution table to posts' analytics page
refs https://github.com/TryGhost/Team/issues/1921
2022-09-21 15:01:31 +02:00
Simon Backx
cd4e4d7003 Added format option to gh-format-post-time helper
fixes https://github.com/TryGhost/Team/issues/1940

The passed format was not used by the helper. This is fixed now.
2022-09-21 12:15:53 +02:00
Simon Backx
14f91093eb Fixed post counts cleared when member attribution flag was disabled 2022-09-21 11:32:00 +02:00
Simon Backx
719e5321d6 Fixed wrong usage of frontend labs in server
no issue
2022-09-21 11:25:29 +02:00
Simon Backx
383edc293f Added protection for missing count in clickRate
refs https://ghost.slack.com/archives/C02G9E68C/p1663751415397159?thread_ts=1663748981.221509&cid=C02G9E68C
2022-09-21 11:11:06 +02:00
James Morris
9f41dde506 Added a new icon for clicking in emails
refs https://github.com/TryGhost/Team/issues/1930
2022-09-21 09:34:51 +01:00
Simon Backx
b8041f0a60
Added clicks to activity feed (#15439)
closes https://github.com/TryGhost/Team/issues/1933

- Added click_events to activity feed
- Added support for parsing click_events in the frontend
- Moved url parsing (transform ready) to model layer of LinkRedirect
- Moved `getEventTimeline` method to the top of the event repository
- Added description field to parsed events in the frontend (because we need a second line)
- Fixed: member email not returned in comment_event
2022-09-21 10:25:51 +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
Ludovic Toinel
79ffdd9b7e
Improved handling of mailgun errors on bulk send (#15445)
- show both the status code and original error from mailgun
- clarify that the error is from mailgun
- swap from error to err as we're rolling out that pattern everywhere

Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-09-20 22:46:55 +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
Hannah Wolfe
f31a50270d Removed search labs flag
- the search helper was promoted to GA and we no longer need the feature flag
2022-09-20 15:22:06 +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
Daniel Lockyer
ab12a978b1
Fixed missing yarn test:unit command
- this is needed so CI can just run unit tests independently
2022-09-20 14:32:39 +01:00
Rishabh
e422ab48c2 Updated source grouping to use known referrers data
refs TryGhost/Team#1923

- updates referrer translator logic to use grouping for known domains/urls to calculate source and medium
- returns first external ref url if nothing matches in history in first pass
2022-09-20 19:02:06 +05:30
Rishabh
4ebe94f721 Added new package with known referrers list
refs TryGhost/Team#1923

- leverages well organized list from Plausible to create known referrers list package for grouping incoming referrers - 5d4918b66b/priv/ref_inspector/referers.yml
- original list has been modified from yaml to json
2022-09-20 19:02:06 +05:30
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
b1878e5a06
Cleanup Stats-Service package files
- LICENSE is no longer needed as this is an unpublished package in the
  monorepo
- the README has been cut down to reflect the fact that it's unpublished
- added `private: true` to package.json config
2022-09-20 14:28:11 +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
Daniel Lockyer
651252714a
Migrated packages and history from Analytics repo
- the Analytics repo was missed during the monorepo conversion and its packages
  belong in the Ghost repo
2022-09-20 14:17:05 +01:00
Simon Backx
ae6761c08b Updated filledSubscriptionCountStats implementation in dashboard stats
refs https://ghost.slack.com/archives/C02G9E68C/p1663674928386639
2022-09-20 15:06:09 +02:00
Simon Backx
1a0f366cf8 Fixed linting errors
refs fe0071496c
2022-09-20 15:05:54 +02:00
Simon Backx
fe0071496c Added real count data to analytics page
closes https://github.com/TryGhost/Team/issues/1934
2022-09-20 14:53:50 +02:00
Rishabh Garg
41bf5f1530
Fixed empty paid subscriptions chart for fake data (#15440)
- the paid subscribers chart was empty when using with fake data due to missing values of `signups` and `cancellations`
2022-09-20 17:36:31 +05:30
Simon Backx
63103c2251
Added click counts to posts admin API (#15435)
closes https://github.com/TryGhost/Team/issues/1928
2022-09-20 10:05:41 +02: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
Kevin Ansfield
b2b6be9cb5 Fixed content-length matcher in posts API test snapshot
refs d5f03ec0b1

- underlying error message varies across node versions so the content-length can't be fixed
- applied any-content-length matcher to the right test this time
2022-09-19 16:37:54 +01:00
Kevin Ansfield
1cc8176d4f Allowed any error message length in posts API error test snapshot
refs d5f03ec0b1

- underlying error message varies across node versions so the content-length can't be fixed
2022-09-19 16:22:22 +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
Kevin Ansfield
201d4ef228 Loosened error message snapshot matching for posts API test error output
refs d5f03ec0b1

- underlying error message varies across node versions
- adjusted to match only the part we explicitly set
2022-09-19 16:06:34 +01:00
Kevin Ansfield
744534fde6 Updated snapshot for posts API test error output
refs d5f03ec0b1
2022-09-19 15:56:30 +01:00
Kevin Ansfield
d5f03ec0b1 Added original error message to context in "Invalid lexical structure" error
no issue

- setting the original error message to the `context` property means it's not completely lost and gives us a clue for debugging
- updated the lexical and mobiledoc validation errors to use the messages+tpl pattern
2022-09-19 15:51:55 +01:00
Sanne de Vries
b2d449fecf Added Lexical indicator to post list
Closes https://github.com/TryGhost/Team/issues/1926
2022-09-19 15:40:19 +01:00
Sanne de Vries
242850b7da Added external link to lexical indicator pointing to koenig-lexical repo
Refs https://github.com/TryGhost/Team/issues/1926
2022-09-19 14:55:00 +01:00
Daniel Lockyer
74f1f1bba6
Fixed CDN URLs in tests
refs de416629e6

- I forgot to update them when making the referenced commit
2022-09-19 14:51:31 +01:00
Sanne de Vries
e2dbf2c748 Added indicator to the Lexical editor screen
Refs https://github.com/TryGhost/Team/issues/1926
2022-09-19 14:48:44 +01:00
Daniel Lockyer
1ba6d2e5a7
Updated test snapshot
refs de416629e6

- this was forgotten after I'd changed the endpoint in the referenced
  commit
2022-09-19 14:43:07 +01:00
Daniel Lockyer
de416629e6
ℹ️ Switched to jsDelivr CDN endpoint with shorter browser cache
fixes https://github.com/TryGhost/Toolbox/issues/416

- this commit switches the default endpoint for our CDN-loaded assets to
  a Ghost-specific jsDelivr one, with a shorter 10 min browser cache config, so
  assets are refreshed quicker upon publishing
2022-09-19 14:22:34 +01: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
226f45fd83 Fixed "cannot save both mobiledoc and lexical" error when tabbing from title field to lexical editor
closes https://github.com/TryGhost/Team/issues/1924

- updated the Post model so the relevant `mobiledoc`/`lexical` field always has a blank document by default depending on which editor is selected via the feature flag
- ensures we don't send `{mobiledoc: null, lexical: null}` inadvertently creating a mobiledoc post (API sets the default blank document in that scenario) when the lexical editor flag is enabled
2022-09-19 12:06:05 +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
Sanne de Vries
a6c76dadc3 Fixed missing shadow on hovering edit button in post list 2022-09-19 10:47:27 +01:00
Simon Backx
901a28f3c6
Added link_redirects and members_link_click_events tables (#15421)
closes https://github.com/TryGhost/Team/issues/1912
closes https://github.com/TryGhost/Team/issues/1913
2022-09-19 11:20:36 +02:00
Sanne de Vries
8a5b401795 Removed dash separator between scheduled status and time in post list 2022-09-19 10:04:04 +01:00
Djordje Vlaisavljevic
99f119a1f4
Source attribution design (#15431)
- Updated subscription box design
- Added Source attribution widget to the dashboard

Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
2022-09-19 10:48:24 +02:00
Rishabh
54f848415a Updated stripe checkout session metadata for referrer data
- adds referrer source, medium and url to stripe checkout metadata for later storage
2022-09-19 12:29:22 +05:30
Rishabh
c765c3230e Updated attribution service to handle referrer information
refs TryGhost/Team#1907

- calculates final attribution source and medium using captured referrer information in history
- adds new referrer-translator that goes through available history and based to determine most valid referrer info
- includes referrer url, source and medium in the attribution data for storage
2022-09-19 12:29:22 +05:30
Rishabh
2807a35cb0 Updated attribution script to capture referrer information
refs TryGhost/Team#1906

- captures referrer url and any source/medium param for referrer
- maintains history with latest referrer information when moving around pages
2022-09-19 12:29:22 +05:30
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
Sanne de Vries
9cca07ff70 Replaced all classnames referencing stats with analytics
Refs https://github.com/TryGhost/Team/issues/1893
2022-09-17 12:26:39 +01:00
Sanne de Vries
8a5bbad8e3 Updated resources section on post analytics page
Refs https://github.com/TryGhost/Team/issues/1918
2022-09-17 12:21:03 +01:00
Peter Zimon
7e3e4bd36b Fixed number formatting in Publish menu
no refs.

- number formatting (ie. thousands indicators) were missing in a couple of places in the Publish menu
2022-09-16 19:36:39 +02:00
Sanne de Vries
a4ff3e1900 Added resource section to post analytics page
Refs https://github.com/TryGhost/Team/issues/1918
2022-09-16 16:09:54 +01:00
Ghost CI
29e5a91323 v5.15.0 2022-09-16 16:00:36 +01:00
Kevin Ansfield
8b5bd09341 Added Sentry logging of any errors that occur internally in Lexical
no issue

- adds custom `onError` handler that both logs to console (as per default behaviour) and also logs to Sentry with the `lexical` tag added for easier filtering
- does not re-throw so Lexical will attempt to gracefully recover without losing data
2022-09-16 15:13:58 +01:00
Sanne de Vries
a077d4393f Updated post list for newsletters and/or memberships disabled
Refs https://github.com/TryGhost/Team/issues/1915
2022-09-16 14:59:29 +01:00
Aileen Nowak
be45d4ebcf Added post stats service to return total posts in Explore endpoint
no issue

- The explore endpoint needs to expose the total amount of published posts
- To be more consistent, this PR creates a PostStats class which is exposed as `stats` method within the PostService; just like it's done with the MemberService
- Moved existing method to return the date of the most recently published post into the stats service
- Updated the explore service test to reflect the new return property
2022-09-16 13:56:14 +01:00
Kevin Ansfield
79d8e64e9a 🐛 Fixed tag slug not auto-matching tag title when creating new tag
refs 08b099e527

- when the use of scratch values was removed a bug was introduced where only the first character of the tag title was used to set the slug when typing
- bug was caused because previously we were checking against the original `tag.slug` value which wouldn't have been set yet because we were setting scratch values instead
- updated the code to explicitly mark the slug value as being set manually if it's edited directly so the auto-update logic can use that to skip updates instead of comparing against old/unset values
2022-09-16 13:34:48 +01:00
Peter Zimon
04dfa0a9e5 Updated loading animation 2022-09-16 14:22:01 +02:00
Sanne de Vries
e87f468042 Updated email newsletter tracking settings
Refs https://github.com/TryGhost/Team/issues/1914
2022-09-16 13:14:48 +01:00
Kevin Ansfield
ce461aef34 Fixed post/page API requests having incorrect ?include= params
refs 58b0a1b90d

- `buildQuery` in the post/page adapters was recently removed which meant it was falling back to the `EmbeddedRelationAdapter.buildQuery` method which uses the defined Ember Data relationships to build up an `?include=` param
- the Ember Data relationships are not fully in sync with the API because we don't have models for all of the members/tiers related relationships meaning we were adding a more restrictive `?include` parameter than what the API would use internally by default, breaking parts of the app that expected the default embedded relationships
2022-09-16 12:54:50 +01:00
Peter Zimon
9972892259 Updated loading animation 2022-09-16 13:44:58 +02:00
Kevin Ansfield
3b21d26be7
Wired up creation of post_revisions entries when saving posts with lexical (#15422)
no issue

- added `PostRevsion` model
- duplicated `mobiledoc_revision` creation routine in Post model's onSaving hook to create `post_revision` when model's `lexical` field has changed
- updated `mobiledoc_revision` creation to skip when `lexical` field is populated
2022-09-16 11:59:35 +01:00
Kevin Ansfield
48aaa53770 Added lexical editor feature flag
no issue

- adds `lexicalEditor` alpha labs flag and associated toggle in Admin
- when feature flag is enabled the new post/page routes will load the lexical editor instead of the mobiledoc editor
2022-09-16 11:59:03 +01:00
Peter Zimon
e957c6d3a1 Updated Members importer preview table min. height
no refs.

- removed `min-height` of members importer preview table because it caused a weird spacing issue when there were only 1 or 2 columns in the CSV
2022-09-16 11:30:34 +02:00
Kevin Ansfield
1581f439e9
Added post_revisions table (#15420)
no issue

- initially this will perform the same function as `mobiledoc_revisions` but storing `lexical` instead of `mobiledoc`
- naming is intentionally generic ready for later expansions
2022-09-16 10:19:05 +01:00
Simon Backx
f9e5d57f0d 🎨 Added number formatting to members import email
refs https://ghost.slack.com/archives/C02G9E68C/p1663318892246929?thread_ts=1663317382.429489&cid=C02G9E68C
2022-09-16 11:13:12 +02:00
Simon Backx
7a565d4892 🐛 Fixed duplicate error columns in members import error CSV
fixes https://github.com/TryGhost/Team/issues/1911

Kept on creating a new error column when unparsing the error list. So for every error we would create a new column when it was already added.
2022-09-16 11:02:22 +02:00
Peter Zimon
2769578dbd Various Members importer UX improvements
no refs.

- CSV overview table headings were selectable
- spinner on the last screen was confusing: users might think they had to wait for something to finish, but that's not true
- spacings in import confirmation emails were off
2022-09-16 10:50:54 +02: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
Rishabh
87cbcc8f14 Updated copy for newsletter email verification popup
- updates heading copy dynamically based on verification status
- removes quotes around newsletter name
2022-09-16 13:40:44 +05:30
Simon Backx
a7b583050c
Added link tracking to paywall (#15414)
closes https://github.com/TryGhost/Team/issues/1908

### Problem:
- We need tracking on the paywall links in each email. (we cannot ignore them because those buttons are probably gonna have a higher paid conversion attribution than others).
- Currently we only add the paywall HTML to an email when processing each batch. So if we batch an email to 1.000 recipients per 100, we'll generate the paywall HTML 10 times. 
- We cannot replace links in `renderEmailForSegment` because that methods will get called multiple times. We don't want to have multiple redirect instances created for the same link in the same email.

###  Solution:
- Move the generation of the paywall to the `serialize` method of the post email serializer.
- Surround the generated paywall with HTML-comments so we can remove it if required in `renderEmailForSegment` depending on the member segment we are sending the email to.

---

### Before:

**Serialize output:**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
            <!--members-only-->
                <p>Content visible for paid members only</p>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```

To be modified later by  `renderEmailForSegment`:

**Paid members (nothing changed):**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
            <!--members-only-->
                <p>Content visible for paid members only</p>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```

**Free members (paywall _added_):**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
                <h2>Generated paywall here</h2>
                <a href="https://subscribe.com">Subscribe to read the full post</a>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```

### After this change:

**Serialize output:**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
            <!--members-only-->
                <p>Content visible for paid members only</p>
             <!-- PAYWALL -->
                <h2>Generated paywall here</h2>
                <a href="https://subscribe.com/?tracked">Subscribe to read the full post</a>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```

To be modified later by  `renderEmailForSegment`:

**Paid members (paywall removed):**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
            <!--members-only-->
                <p>Content visible for paid members only</p>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```

**Free members (members-only content removed):**
```html
<html>
    <body>
        <h1>Generated email header</h1>
        <p>Generated text</p>

        <div>
            <!-- POST CONTENT START -->
                <h1>Post title</h1>
                <p>Content visible for all members</p>
            <!-- PAYWALL -->
                <h2>Generated paywall here</h2>
                <a href="https://subscribe.com/?tracked">Subscribe to read the full post</a>
            <!-- POST CONTENT END -->
        </div>
    </body>
</html>
```
2022-09-16 10:08:12 +02:00
Peter Zimon
18a251976e Updated Explore section category link
no refs.

- category link wasn't opening in a new window which took users away from the Admin
2022-09-16 07:35:52 +02:00
renovate[bot]
72a08f4901
Update dependency sanitize-html to v2.7.2 2022-09-15 20:21:58 +00:00
Kevin Ansfield
58b0a1b90d Fixed post/page requests in Admin not including correct ?formats param
no issue

- `buildQuery` method in adapters is only used for store `.query()` calls so when saving the formats param wasn't being added meaning we were losing the `lexical` field in the API response
- switched to `buildURL` which is always used
2022-09-15 17:40:45 +01:00
Daniel Lockyer
6f3c18b6f4
Merged v5.14.2 into main
v5.14.2
2022-09-15 17:16:24 +01:00
Ghost CI
7a6375c840 v5.14.2 2022-09-15 17:13:56 +01: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
Peter Zimon
d330c91555 Added category to Dashboard Explore section title
no refs.

- category name with a link to a prefiltered Ghost Explore page on the Dashboard's Explore section helps users get a direct link to more sites from with the same topic
2022-09-15 17:28:49 +02:00
Sanne de Vries
2deb8f4595 Updated post list stats and CTA
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-15 16:21:57 +01:00
Simon Backx
6127037986 🐛 Fixed feature image caption escaped twice in newsletters (#15417)
fixes https://github.com/TryGhost/Team/issues/1909

- The feature image caption is already escaped on the frontend
- Doing it again in the backend breaks the possibility to add links to the caption
- I checked and the `feature_image_alt` is not escaped in the frontend.
2022-09-15 17:11:03 +02:00
Simon Backx
e9974d8cc0
🐛 Fixed feature image caption escaped twice in newsletters (#15417)
fixes https://github.com/TryGhost/Team/issues/1909

- The feature image caption is already escaped on the frontend
- Doing it again in the backend breaks the possibility to add links to the caption
- I checked and the `feature_image_alt` is not escaped in the frontend.
2022-09-15 17:07:10 +02: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
Sanne de Vries
5a2e1ddab6 Updated post-analytics page breadcrumb structure
Refs https://github.com/TryGhost/Team/issues/1893

- New structure allows for multiple level navigation when we apply this to all pages.
2022-09-15 15:15:25 +01:00
renovate[bot]
3d328d24e6 Update sentry-javascript monorepo to v7.13.0 2022-09-15 15:13:23 +01:00
Simon Backx
699e67f4e4
Added email_track_clicks setting (#15409)
fixes https://github.com/TryGhost/Team/issues/1900
refs https://github.com/TryGhost/Team/issues/1901

- Defaults to the same value as the current email_track_opens setting for existing installations, otherwise defaults to true
- Had to use a custom migration because the `addSetting` helper doesn't support using an existing setting as current value
- Added a minimal UI to change the setting, but this still needs some design magic 🪄
- Link replacement is disabled if `email_track_clicks` is disabled. In the future we might consider to still do parial additions, such as source attribution and maybe redirects (to discuss).
2022-09-15 15:48:22 +02:00
Sanne de Vries
de9d63bb9f Fixed Opens and Clicks position jumping on hovering post list
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-15 13:50:59 +01:00
Sanne de Vries
e008e8c9fd Added animated transition to post list hover states
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-15 13:23:22 +01:00
Sanne de Vries
47903962cc Updated post list layouts
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-15 12:50:53 +01:00
Sanne de Vries
8d607b9490 Updated draft and scheduled status in post list
Refs https://github.com/TryGhost/Team/issues/1895

- Added a dot for emphasis
- Added extra info on hovering scheduled posts
2022-09-15 09:08:51 +01:00
Naz
81e34e02c9
Added one week in seconds value to constants
refs https://github.com/TryGhost/Toolbox/issues/411

- There's one week in MS, and just to have a full set of values in S added a week in seconds
2022-09-15 10:56:34 +08:00
Naz
d06194a0d6
Made members/.well-known config more readable
refs https://github.com/TryGhost/Toolbox/issues/411

- Before moving the cache control values to a configurable ones, making them readable first.
2022-09-15 10:56:34 +08:00
renovate[bot]
edb8afe106
Update dependency sqlite3 to v5.1.0 2022-09-14 19:53:21 +00:00
Simon Backx
972c25edc7
Wired up member attribution from email clicks (#15407)
refs https://github.com/TryGhost/Team/issues/1899

- Added `addEmailAttributionToUrl` method to MemberAttributionService. This adds both the source attribution (`rel=newsletter`) and member attribution (`?attribution_id=123&attribution_type=post`) to a URL.
- The URLHistory can now contain a new sort of items: `{type: 'post', id: 'post-id', time: 123}`.
- Updated frontend script to read `?attribution_id=123&attribution_type=post` from the URL and add it to the URLHistory + clear it from the URL.
- Wired up some external dependencies to LinkReplacementService and added some dummy code.
- Increased test coverage of attribution service
- Moved all logic that removes the subdirectory from a URL to the UrlTranslator instead of the AttributionBuilder
- The UrlTranslator now parses a URLHistoryItem to an object that can be used to build an Attribution instance
- Excluded sites with different domain from member id and attribution tracking
2022-09-14 15:50:54 -04:00
renovate[bot]
5714dec524 Update babel monorepo to v7.19.1 2022-09-14 18:54:53 +01:00
renovate[bot]
8c172d506d Pin dependencies 2022-09-14 18:53:15 +01:00
Fabien "egg" O'Carroll
c2102ea42b Updated link replacement service to use deps
refs https://github.com/TryGhost/Team/issues/1886
2022-09-14 13:24:17 -04:00
Fabien "egg" O'Carroll
b564e2bd66 Wired up link-tracking to Ghost services
refs https://github.com/TryGhost/Team/issues/1888
2022-09-14 13:24:17 -04:00
Fabien "egg" O'Carroll
ae281eb226 Wired up link-redirects to Ghost services & web server
refs https://github.com/TryGhost/Team/issues/1887
2022-09-14 13:24:17 -04:00
Fabien "egg" O'Carroll
160a0f881e Added initial link-tracking package
refs https://github.com/TryGhost/Team/issues/1888
2022-09-14 13:24:17 -04:00
Fabien "egg" O'Carroll
8fe200ff45 Added initial link-redirects package
refs https://github.com/TryGhost/Team/issues/1887
2022-09-14 13:24:17 -04:00
Fabien "egg" O'Carroll
4726742673 Renamed redirects to custom-redirects
We're going to be adding more redirection logic into Ghost and it's
going to get confusing if we have names this generic. This makes it
clear which feature this service is related to.

Ideally in the future we can combine all of these into one redirects
service, but for now we will be running a specific service per feature
2022-09-14 13:24:17 -04:00
renovate[bot]
57f2b64bf2
Update dependency knex-migrator to v5.0.5 2022-09-14 16:49:38 +00:00
Simon Backx
d5b332ab02 Added temporary fix for random test failures in comments
refs https://ghost.slack.com/archives/C02G9E68C/p1663162175224299

This requires a better fix in the future that properly awaits the emails (not really possible at the moment) or disables sending new member emails when using loginAs
2022-09-14 17:02:13 +02:00
Sanne de Vries
50e00a3b4c Updated post stats page
Refs https://github.com/TryGhost/Team/issues/1893
2022-09-14 14:22:25 +01:00
Sanne de Vries
8b24022e5f Updated post list with email clicks
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-14 12:21:22 +01:00