Commit Graph

29558 Commits

Author SHA1 Message Date
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
Daniel Lockyer
4d63034bd2 Altered CI to upload coverage in one step
fixes https://github.com/TryGhost/Toolbox/issues/395

- we seem to be encountering issues with codecov where it randomly
  reports huge jumps in test coverage %
- I'm still not sure of the reason why, but the general trend in CI with
  codecov is to store test coverage files as artifacts and then submit
  them to codecov in one go
- this commit implements that in our CI
- let's see if this improves anything
2022-09-15 11:30:13 +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
Sanne de Vries
b5904d9956 Updated post list item hover state
Refs https://github.com/TryGhost/Team/issues/1895
2022-09-14 11:50:28 +01:00
Djordje Vlaisavljevic
1c6c737a22 Updated locked integrations state styles
no issue
2022-09-14 11:19:39 +02:00
Kevin Ansfield
a2f0ccc981 Added audio/x-m4a to allowed mime types in audio card
refs b12400577a

- additional mime type was added to the API's allowed list but was missed in Admin's allowed list
2022-09-14 09:04:58 +01:00
Naz
b12400577a Added support for .m4a format in audio cards
https://github.com/TryGhost/Team/issues/1894

- The .m4a is an apple lossless format which comes up every so often. Adding support for this format seems easy enough than coming back to the topic of it's support once every 6 months ^_^
2022-09-14 09:28:37 +08:00
Naz
09df67b1b3
Updated use of "blog" in comments to "site"
refs fa13ff2798

- The "site" is a preferred way to refer to Ghost instance instead of a "blog"
2022-09-14 08:00:18 +08:00
Kevin Ansfield
a7c4991af5 Wired up lexical editor saving
no issue

- fixed API returning "Invalid mobiledoc structure" errors when `mobiledoc:null` is sent in the payload alongside `lexical: '{...}'`
- updated Admin's `posts` and `pages` adapters to always add `?formats=mobiledoc,lexical` because the API doesn't return `lexical` by default
- added `lexical` attribute to Admin's Post model
- updated `lexical-editor` controller and related components to work with `lexical` always being a JSON string rather than a parsed object
- updated `<KoenigLexicalEditor>` to pass through the lexical state string as initial state and wired up the `onChange` prop
2022-09-13 21:01:53 +01:00
Kevin Ansfield
2d9dd4639d Added redirect between mobiledoc/lexical editors
no issue

- mobiledoc and lexical editors will co-exist for some time so we want to make using both as straight forward as possible
- posts can only have one of `lexical` or `mobiledoc` properties set so in the `edit` route for each editor we detect the opposite property being present and redirect so the right editor is loaded for each post
2022-09-13 18:55:39 +01:00
renovate[bot]
a435b2c54c Update dependency date-fns to v2.29.3 2022-09-13 18:24:39 +01:00
renovate[bot]
236addf67f Update dependency @babel/plugin-proposal-decorators to v7.19.0 2022-09-13 18:24:27 +01:00