Commit Graph

20949 Commits

Author SHA1 Message Date
Ghost CI
5f32c8e89d v5.96.0 2024-10-04 15:05:25 +00:00
Steve Larson
2157cbfc20
🌐 Updated packages for improved i18n support (#21218)
no ref

We've shipped quite a few updates to our i18n package these past couple
weeks and are due for an update to the consuming packages. Special
thanks to our community contributors for the translations, and in
particular to @cathysarisky for their continued effort!
2024-10-03 22:27:16 +00:00
Cathy Sarisky
cf63094e13
🌐 Updated Hindi translations (#21208)
no ref

Hindi translations - original PR from meSingh, thank you! #20631
2024-10-03 21:01:39 +00:00
Cathy Sarisky
69a283b229
🌐 Added Urdu translations (#21209)
no issue

A re-submission of @siddiqss 's work on translating Urdu.  
#18508

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-03 20:43:32 +00:00
renovate[bot]
83e9eb1345
Pin dependency parse-prometheus-text-format to 1.1.1 (#21211)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[parse-prometheus-text-format](https://redirect.github.com/yunyu/parse-prometheus-text-format)
| devDependencies | pin | [`^1.1.1` ->
`1.1.1`](https://renovatebot.com/diffs/npm/parse-prometheus-text-format/1.1.1/1.1.1)
|

Add the preset `:preserveSemverRanges` to your config if you don't want
to pin your dependencies.

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-03 19:16:42 +00:00
Chris Raible
768336efad
Added a prometheus metrics exporter to Ghost (#21193)
ref
https://linear.app/tryghost/issue/ENG-1505/add-prometheus-metrics-server-to-allow-monitoring-ghost-metrics

# Summary
This commit includes two main components: a prometheus client class to
collect metrics from Ghost, and a standalone metrics server that exposes
a /metrics endpoint at a separate port (9416 by default) from the main
Ghost app.

The prometheus client is a very thin wrapper around
[prom-client](https://github.com/siimon/prom-client). We could use
prom-client directly, but this approach should make it easier to switch
to a different prometheus client package (or make our own) if we ever
need to down the line.

The list of default metrics this enables is specified in an e2e test
[here](https://github.com/TryGhost/Ghost/pull/21192/files#diff-ebc52236be2cd14b40be89220ae961f48d3f837693f7d1da76db292348915941R66-R92).
This also gives us the ability to create and collect custom metrics,
although none are included in this commit yet.

# Configuration
The prometheus client and the metrics server are both disabled by
default, but can be enabled by setting the metrics_server:enabled flag
to true.

You can also define a custom host and port using `metrics_server:host`
and `metrics_server:port`.

## Why not expose the /metrics endpoint in one of the existing express
apps?
The standalone express app exists for two main reasons:

1. We don't want these metrics to be public, and the easiest way to
accomplish that is to expose the /metrics endpoint at a different port
that won't be exposed to the internet.

2. Creating a standalone express instance decouples the metrics endpoint
from the Ghost server, so if Ghost is not responding for whatever
reason, we should still be able to scrape metrics to understand what's
going on internally.


## Impact on Boot & Shut down time
The prometheus client is initialized early in the boot process so we can
collect metrics during the boot sequence. Testing locally has shown that
this increases boot time by ~20ms. The metrics server which exposes the
/metrics endpoint is not initialized until after the background
services, and it is not awaited, to avoid impacting boot time. None of
this code, including the requires, will run if the
metrics_server:enabled flag is set to false (or not set).

Shutting down the metrics server is added as a cleanup task for the main
Ghost server instance, and is setup to shut down with 0 grace period to
avoid impacting shut down time.
2024-10-03 11:34:25 -07:00
Steve Larson
135772620d
Updated Norwegian i18n string order (#21210)
no ref

This was causing i18n test failures because the string was being reordered (updated) to be fully alphabetical.
2024-10-03 17:48:16 +00:00
Chris Raible
52ac218867
Fixed flaky publishing browser tests (#20935)
no issue

- These two tests were relying on the ordering of the posts in the posts
list, which can vary when running the test suite all together (as we do
in CI), since multiple tests can be running and creating/deleting posts
in parallel.
- This commit navigates directly to the post's URL to avoid this
problem.
2024-10-03 10:06:28 -07:00
matsbst
b125a25dfc
🌐 Updated Norwegian translations (#20917)
no ref

Fixed typos and improved some translations with correct wording
2024-10-03 15:27:21 +00:00
ayangizzat
b9063c9e82
🌐 Added Kazakh locale for Portal (#20698)
no ref
2024-10-03 15:22:07 +00:00
renovate[bot]
0bbb29fbf8 Update dependency sanitize-html to v2.13.1 2024-10-03 14:42:44 +00:00
Cathy Sarisky
1196688b0e
🌐 Improved i18n support for Portal error messages (#21190)
no ref

Expose (some) Portal error strings for translations

💩This is a somewhat hacky (but test-passing and individual inspection
passing) solution to the way Portal handles errors. Or rather, the
half-dozen ways Portal handles errors.

Passing 't' around with context and state, and occasionally recreating
it from the site object. Yes, I am also somewhat horrified, but a better
implementation will need a major rewrite of Portal.

Addresses errors in both the popover React app and in the
data-attributes.

There are probably more. Since Portal exposes raw API responses in some
places, it's hard to enumerate everything that /might/ end up being
client-facing, but at least I've gotten the ones that I've commonly
seen.

Improvements very welcome.
2024-10-03 13:35:23 +00:00
Kevin Ansfield
d65f07e4fd Extracted basic request/response tests in e2e comments test file
no issue

- removes some repetition making tests more compact and easier to read
2024-10-03 11:04:40 +01:00
Kevin Ansfield
a2d44c8778 Refactored members-comments e2e test
no issue

Initial pass at refactoring the tests and making each independent so they aren't relying on data from previous tests.

- DRYed up some repeated API requests by extracting `testPostComment()`, `testGetComments()`, and `assertAuthorEmailSent()`
- removed data inter-dependency across tests
  - truncated the tables under test before each test is run
  - added suite of db fns to populate the database without having to do so via API requests
  - updated all tests to include their own data setup calls rather than relying on fixtures and modifications from earlier tests
2024-10-03 10:07:46 +01:00
Steve Larson
c26aacacf5
Fixed Date.now() use in email analytics unit tests (#21188)
no ref

We had an instance where this was a ms off and I should've used mock
timers when I first wrote this. This should prevent any rare clock
mishaps.
2024-10-02 17:54:48 +00:00
Raka Afp
851ec7eb0b
🌐 Added Bahasa Indonesia translation for search & portal (#21179)
no ref

Translated/updated all relevant strings in the search & portal feature
to Bahasa Indonesia.

---------

Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2024-10-02 12:36:34 -05:00
Hannah Wolfe
4b1ce62ca9
Fix origin attribution in Tinybird analytics hits (#21187)
closes 
https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- Atttribute the referral of the first hits to the whole session in `analytics_sources_mv`, while keeping the raw hits in `analytics_hits`
- Updated tests accordingly
- This is a rebased / reordered version of https://github.com/TryGhost/Ghost/pull/21166

Co-authored-by: alejandromav <hi@alejandromav.com>
Co-authored-by: Alejandro Martin <alejandromav@tinybird.co>
2024-10-02 17:27:43 +01:00
Hannah Wolfe
f082ba68e0 Added tinybird tests for filtering
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- This adds a set of tests to describe what the data should look like when we filter on various values
- We have tests for source and browser which are pulled from different MVs
- The result files are generated using ./scripts/gen_test_results.sh, and then manually verified
- We know they are not yet fully correct
2024-10-02 17:04:24 +01:00
Hannah Wolfe
60443726c9 Fixed tinybird test fixture data
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- This fixes the test data so that the session first hit and subsequent hits are in chronological order
- It also makes sure there isn't more than 30 minutes between hits, as our tracking script is only designed to keep sessions alive for 30 minutes so the data wasn't realistic
- NOTE: This data was generated by a script https://gist.github.com/ErisDS/25bb36f38d4c5a3f01d86f34ea5be707 - which didn't take these things into account

Co-authored-by: alejandromav <hi@alejandromav.com>
2024-10-02 17:04:24 +01:00
Hannah Wolfe
bce5d9d588
Updated tinybird tooling with usability improvements (#21185)
- Added yarn command to update TB CLI, as that needs doing frequently and I can never remember the command
- Improved safety & usability of tinybird test script by ensuring branches are correctly created before running & adding optional delete
- Updated tinybird test to warn only for sanity check as that's not always a valid check (Will prob remove soon)
- Improved output of tinybird test script on failure, so that the diff is readable and closer to what git shows you
- Added tool to convert tinybird ndjson to csv to make it easier to bring the data into google sheets for verifying numbers
2024-10-02 15:28:39 +01:00
Kevin Ansfield
bb48d3623a Increased feature image alt text length to 191 chars
no issue

- removed the 125 char soft limit so the full 191 char db field length can be used
2024-10-02 10:22:17 +01:00
renovate[bot]
9a93a5cfc6 Pin dependency i18n-iso-countries to 7.12.0 2024-10-02 07:28:28 +00:00
Peter Zimon
7cb8cbdf7a
Showing country names instead of codes in Stats (#21172)
[ANAL-53](https://linear.app/tryghost/issue/ANAL-53/10-stats-page-engineering-stuff)

- So far only country codes were displayed instead of human readable country names in the Stats page
2024-10-02 09:17:06 +02:00
Chris Raible
bf7320cfb7
Fixed test that left an instance of ghost running (#21178)
no issue

- This test file starts a Ghost server, but doesn't close it, which can
cause other tests to fail when they try to start an instance of Ghost,
with an `EADDRINUSE` error.
- This change closes the server in the `after` hook
2024-10-01 17:22:48 -07:00
Leif Singer
6965254b3f
🌐 Added German translations for search (#21163)
no ref

This PR adds the translations for `search.js`. It's a bit opinionated in
that ...
- it uses the Anglicism "Posts" to ... "translate" ... "Posts" 😆;
- it uses an asterisk to make sure we address all genders when
translating "authors".

Happy to discuss. ☺️
2024-10-01 21:55:42 +00:00
Cathy Sarisky
6501f1d41b
🌐 Added Kazakh locale and translations (#21174)
no ref

This is a merge & tidy up of [[ayangizzat](https://github.com/ayangizzat)] 's original (https://github.com/TryGhost/Ghost/pull/20698), which was missing the changes to locale, causing folders & files not to generate correctly. All credit goes to @ayangizzat , and thank you for your work!

Kazakh-speaking help still needed for search.json, which is untranslated, and the addition of a few other new strings, and refinements anywhere needed. Please add comments if not yet merged, or open a new PR if already merged.

---------

Co-authored-by: ayangizzt
2024-10-01 21:45:03 +00:00
Cathy Sarisky
b9547cc120
Improved i18n tests to include commits with missing i18n.js entries (#21175)
no ref

We've had several PRs for new locales that forgot to update i18n.js,
which causes them not to get regenerated by yarn translate. This PR
checks for that error, and also the reverse one where they update i18n
but we're missing folders. (Never expected to error, because 'yarn test'
is defined to include 'yarn translate', which generates the folders.)
2024-10-01 15:04:21 -05:00
Kevin Ansfield
3bbe8c8c7a
Fixed bugs in post's change-access context menu flow (#21173)
ref 86d61304b1
ref https://linear.app/tryghost/issue/ONC-323

- added `tracked()` to our proxy model object properties
  - fixes default data always showing when opening the modal
- fixed data push after completing modal
- `post.tiers` is set up as an attribute in Admin rather than a relationship
- fixes incorrect tiers list showing when the change access modal is opened again after changing access before the post is re-fetched from the API
- fixed flash of failure button state when saving modal changes
- expanded tests to cover tiers selection
2024-10-01 17:16:23 +00:00
Peter Zimon
8aaac5abe1
Stats page design fixes (#21171)
[ANAL-95](https://linear.app/tryghost/issue/ANAL-95/internal-beta-qa)

Various design refinements and fixes for the Stats page:
- Updated scroll area in detail modals so that the Close button and the footer is never outside the viewport
- The detail modal didn't close after clicking on the filter values
- "Show all" button was displayed also when there were no new items in the detail modal
- Dropdown styles needed a visual update: the toggles were way too huge and inconsistent with other dropdowns
- If no audience was selected we still showed stats. Now it's displaying the default empty screen in this case
- Click through filter indicators had low discoverability
- Technical data styles needed some love: changed the alignment and color scheme
- Mobile size viewports were not handled
- The google favicon API returned 404 many times for sources. Swapped the service for another one that returns favicons more reliably
- Default favicon was not handled. Now it comes from static.ghost.org
2024-10-01 17:51:55 +02:00
Cathy Sarisky
d8c4dfef99
Added content_api_key helper (#21151)
no ref

This very small helper adds {{content_api_key}} to the collection of handlebars helpers available to theme creators. This will make it easier for themes to access the content API key, without either requiring the user to get it from the integrations page and input it on the theme setting page or resorting to JavaScript to read it from one of the built-in script tag attributes -- both ugly workarounds.
2024-10-01 09:13:57 -05:00
Kevin Ansfield
86d61304b1 🐛 Fixed errors creating new posts after a post access change via context menu
ref https://linear.app/tryghost/issue/ONC-323

After changing a post's access via the posts list context menu, creating new posts or members would not work correctly.

- the issue stemmed from `this.post.set('currentState.parentState.isNew', false);` that was called when changing a post's access level, after that all Ember Data models created from the store would have `isNew: false` causing Ember Data to attempt a PUT request to update the not-yet-created model rather than a POST request to create it
- we were only using a real post model instance in order to run validations against the post access level settings but we can do that just as easily by creating a new object and injecting our validation mixin
2024-10-01 15:10:59 +01:00
Leif Singer
4679bbb10b
🌐 Added and adjusted various German translations in portal.json (#21165)
no ref

This PR adds and adjusts various German translations in `portal.json`.
I'm a native speaker and have made adjustments to the best of my
knowledge. As in #21163, the gender variations are a bit opinionated and
I'm happy to discuss.
2024-10-01 08:48:05 -05:00
Leif Singer
44bfb8a17a
🌐🐛 Fixed German translation for "Sign up" in comments (#21162)
fixes #21104 

This PR corrects a single translation. The German translations for "sign
up" and "sign in" _can_ both be "anmelden", but are confusing when used
together. So here we're switch to "register now" and "sign in" to make
the distinction clearer. IMHO even in English "register now" and "sign
in" might be a better (more distinguishable) combination, but it's much
harsher in German.
2024-10-01 00:24:55 +00:00
Volodymyr Lavrynovych
80794486a9
🌐 Added Ukrainian translations (#20709)
no ref

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-09-30 11:36:00 -05:00
ココロ
647e675ff5
🌐 Updated Chinese translations (#21154)
-translation for zh portal and search

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-09-30 11:35:05 -05:00
Alexandre "Lekler" Rodrigues
5381530b21
🌐 Updated Portal pt-BR translations (#21076)
no ref

Filled in 6 missing translations and made style corrections to existing translations to improve clarity and consistency.
2024-09-30 11:19:02 -05:00
Fernando Ochoa Olivares
0756000766
🐛🌐 Fixed capitalization in Spanish sign-up string (#20711)
no ref

When beginning a sentence with exclamation in Spanish first letter needs
to be uppercase.
2024-09-30 11:15:05 -05:00
Cathy Sarisky
27d4f643b5
🐛🌐 Fixed missing Greek strings (#21137)
no ref 

This PR restores a few strings that were renamed during the time the
Greek strings were not being correctly processed.

---------

Co-authored-by: Vikas Potluri <vikaspotluri123.github@gmail.com>
2024-09-30 11:13:25 -05:00
Cuong Thach
e9cff37283
🌐 Added Vietnamese translation for search (#21149)
no ref
- also added a few missing Portal strings
2024-09-30 11:12:27 -05:00
Kevin Ansfield
c0bc17fb72 Added beforeunload debug log to editor
ref https://linear.app/tryghost/issue/ONC-323

- we're sometimes seeing our force-refresh failing when Ember Data gets into a bad state but we're not sure why so this log should tell us if it's the browser's native "leave site" modal that is preventing the refresh
- updated the `onbeforeunload` event handler to match modern JS approach
  - modern browsers use `event.preventDefault()` to show their dialog
  - older browsers use `event.returnValue = true` (this is what our old string return was triggering)
  - no browser supports a custom message in the native dialog
2024-09-30 16:58:54 +01:00
renovate[bot]
06c54f2472 Update dependency terser to v5.34.1 2024-09-30 08:54:20 +00:00
renovate[bot]
d9a18a77a9 Update dependency webpack to v5.95.0 2024-09-30 08:52:06 +00:00
Ghost CI
de82b6be61 v5.95.0 2024-09-27 15:05:25 +00:00
Ghost CI
b572c565b2 🎨 Updated Casper to v5.7.5 2024-09-27 15:05:25 +00:00
Hannah Wolfe
7ebb208549 Fixed browser/device missing data in tinybird
ref https://linear.app/tryghost/issue/ANAL-96/data-discrepancy-between-charts-when-filtering

- The top browser and device endpoints were pulling from the sources MV, that is filtered to not have same-source traffic
2024-09-27 14:30:42 +01:00
Hannah Wolfe
606fcbabe7 Added a set of tests for our tinybird setup
- TODO: make these run in CI
- Right now you run them by running `yarn tb` and then `./script/branch_and_test.sh`
- These are snapshot tests that check we get the desired result

Co-authored-by: alejandromav <hi@alejandromav.com>
2024-09-27 14:30:42 +01:00
Hannah Wolfe
e3268c8c59 Renamed hits to pageviews in tinybird
closes https://linear.app/tryghost/issue/ANAL-111/rename-hits-to-pageviews-inside-of-tinybird

- We currently have two concepts: visits (unique visits) and pageviews (also called hits)
- We want to standardise on this terminology, so inside tinybird, we're going to call hit "pageviews" to make it super clear what's happening
2024-09-27 14:30:42 +01:00
Cathy Sarisky
43b57aa53c
🐛🌐 Added missing locales to i18n.js (#21144)
- Apparently several PRs for new languages were merged without the
corresponding additions to i18n.js, which has caused new strings not to
be generated for those languages, and missing translations in the
frontend, even though we had them in the .json file.

- I've added language codes for all languages that had at least some
strings translated in i18n/locales, and have run yarn translate to
create missing strings and files for these languages.

New language codes for:
* Arabic
* Swiss German
* Greek
* Estonian
* Macedonian
* Serbian (Cyrillic)
* Thai
2024-09-27 14:07:51 +01:00
Chris Raible
a9ace11d9d
Removed OpenTelemetry (#21145)
no issue

- This commit removes all OpenTelemetry related code and dependencies
from Ghost.
- The initial implementation was done as a POC but it raised some
performance concerns with boot time, so we never actually enabled it
widely.
- We can revisit this in the future, but in the meantime it's just
adding unnecessary dependencies and bloating the codebase.
2024-09-26 16:18:49 -07:00
Chris Raible
046b06fe72
Refactored local revisions to avoid QuotaExceededErrors (#21128)
ref https://ghost-foundation.sentry.io/issues/5908152800/

- In the current state, we are maintaining an 'index' key for all
revisions in localStorage. This gives us quick and easy access to all
the revisions in localStorage, but it requires additional "bookkeeping"
to update the index each time we add/remove a key.
- In some obscure edge cases, this results in the `remove()` method
throwing a `QuotaExceededError` (since removing a revision also requires
updating the index with `localStorage.setItem()`). If the `remove()`
call fails, we are sort of stuck — the only way to reduce our storage
usage is to remove items, but if the `remove()` method throws errors, we
can't do that.
- This change removes the whole index concept, and instead loops over
all the keys in localStorage, filtering by the prefix to find all our
revisions. This makes the `keys()` method slightly more complex, as it
has to filter out keys in localStorage that aren't related to revisions,
but it simplifies saving and removing revisions.
- Critically, this also means that `remove()` should never throw a
`QuotaExceededError`, since it no longer needs to call
`localStorage.setItem()` — it now simply calls
`localStorage.removeItem()` for the revision, which should never fail.
2024-09-26 12:50:31 -07:00
Fabien O'Carroll
9bb1696329 Loaded AdminX activitypub app from jsdelivr in production
ref https://linear.app/tryghost/issue/AP-438

We want to keep development and test mode using the local build so we can have
feedback on our local changes.
2024-09-26 23:24:26 +07:00
Fabien O'Carroll
9884e2bb2c Allowed to load AdminX apps from custom url
ref https://linear.app/tryghost/issue/AP-438

This is going to allow us to load the activitypub package from the jsdelivr
cdn, which means we can release new versions without releasing the admin.
2024-09-26 23:24:26 +07:00
Hannah Wolfe
908ff731d6
Updated tinybird unsafe deploy script (#21135)
ref https://github.com/TryGhost/Ghost/pull/21092

- This updates the unsafe deploy script to be safer and more useful
2024-09-26 15:54:08 +01:00
Kevin Ansfield
21ecd9c2af Fixed tests failing with native stack traces due to blob.slice() calls
no issue

Either a node or macOS update resulted in our broken image upload tests causing native stack traces:

```
  #  /Users/kevin/.nvm/versions/node/v20.16.0/bin/node[8841]: static void node::Blob::ToSlice(const FunctionCallbackInfo<v8::Value> &) at ../src/node_blob.cc:248
  #  Assertion failed: args[1]->IsUint32()
```

- updated our `blob.slice()` calls to ensure the second argument is always an integer rather than possibly a float
2024-09-26 15:40:46 +01:00
Hannah Wolfe
68be1f95b1
Updated stats page to show visits instead of hits (#21133)
closes:
https://linear.app/tryghost/issue/ANAL-102/visits-on-tables-is-actually-displaying-pageviews

- The expectation is that the UI shows unique visits, not pageviews for
the breakdown charts
2024-09-26 14:50:30 +01:00
WindTheWhisperer
5579f03fd5
🌐 Added Estonian translations (#21129)
This pull request adds Estonian (et) language translations to Ghost.

Translated files:
- comments.json
- ghost.json
- portal.json
- search.json
- signup-form.json

Changes:
- Created new 'et' folder in the locales directory
- Translated all strings from English to Estonian in the above files

I'm a native Estonian speaker, but if there are any questions about
specific translations, please let me know.

Thank you for considering this contribution to make Ghost more
accessible to Estonian-speaking users!

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-09-26 07:47:16 +00:00
Sérgio Spagnuolo
4bc353bab8
🌐 Added new Brazilian Portuguese new i18n strings (#21101)
Add pt-br (Brazilian Portuguese) translations for Portal and native
search strings.

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-09-26 05:35:00 +00:00
Mertcan GÖKGÖZ
4c5d1940db
🌐 Updated Turkish translation (#21110)
Türkçe(Turkish) language support has been updated.

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-09-26 14:23:28 +09:00
Stanislav Traykov
7454bb1bdc
🌐 Added Bulgarian translation for search (#21102)
Add initial translation for Bulgarian for the search interface.
2024-09-26 13:48:07 +09:00
Yovko Lambrev
076300a5eb
🌐 Bulgarian translation updates (Sep 2024) (#21062)
A needed update of the Bulgarian version. Fixing some errors. Made some
improvements. And some new strings were translated.

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-09-26 02:29:40 +00:00
Cathy Sarisky
c23dc8a973
🌐 German translations (#21050)
ref: https://forum.ghost.org/t/help-translate-ghost-beta/37461/113

thanks to thewolfofallstreetz on the Ghost forum
2024-09-26 11:25:12 +09:00
Chris Mitchell
706c7eda3c
🌐 Updated Gaelic portal / search translations (#21093)
Updated the Gaelic translation with the new portal and search strings.
2024-09-26 11:24:36 +09:00
Alexandre "Lekler" Rodrigues
186f87eecc
🌐 Update pt-BR translation of search.json (#21100)
Following commit #21055, the following updates were made:

Added translations for terms related to authors, posts, search, and
tags.
2024-09-26 11:23:59 +09:00
renovate[bot]
3f0e4b4584 Update dependency mysql2 to v3.11.3 [SECURITY] 2024-09-25 15:02:44 +00:00
renovate[bot]
7f6517fbe8 Update dependency mysql2 to v3.11.2 [SECURITY] 2024-09-25 14:38:19 +00:00
renovate[bot]
1616acc20d Update dependency mysql2 to v3.11.1 [SECURITY] 2024-09-25 12:50:53 +00:00
Ronald Langeveld
052ef6971f
🐛 Fixed infinite loops in setFeatureImageCaption for deleted posts (#21081)
ref ONC-364

- Adds a condition to check whether the record is deleted or if deleting
is in progress before firing the `setFeatureImageCaption`.
- Adds tests. Managed to reproduce the issue using tests.
2024-09-25 08:02:38 +00:00
renovate[bot]
662d10077f Update dependency html-validate to v8.24.0 2024-09-25 08:23:04 +02:00
Chris Raible
0125f52dc4
Added sentry logging to local revisions service for localStorage errors (#21078)
no issue

- Added Sentry logs to capture how often we are running into
`QuotaExceededErrors` when saving local revisions to localStorage, to
help in deciding if localStorage is sufficient, or if we need to expand
to e.g. IndexedDB.
- Also adds some handling to ignore errors when calling
`localStorage.setItem()` elsewhere in the admin app to avoid crashing if
localStorage isn't supported or the quota is exceeded.
2024-09-24 19:39:36 -07:00
Steve Larson
c121149ca3
Added posts restore UI (#21096)
ref https://app.incident.io/ghost/incidents/107
ref cc88757e2a
- added new path in admin `/restore`
- added basic ui for restoring posts from local storage
- added limits for # of revisions for posts with an `id` (5 revisions)

This commit adds a simple UI for restoring posts in case of data loss.
This is a backstop for very rare situations in which it seems Ember gets
into a conflicted state. See ref'd commit for more info. Clicking
'Restore' will create a new post with the saved off content.
2024-09-24 15:01:17 +00:00
Hannah Wolfe
45211b2f4c
Fixed bounce rate on stats page (#21097)
closes
https://linear.app/tryghost/issue/ANAL-81/investigate-bounce-rate-looks-incorrect

- Think I've figured out what was wrong
- TODO: Figure out TinyBird's test pipeline, so we can verify this
2024-09-24 15:52:57 +01:00
Hannah Wolfe
7e27b1cb36
Clickthrough filtering for stats page (#21095)
closes
https://linear.app/tryghost/issue/ANAL-58/click-through-filtering-for-content
closes
https://linear.app/tryghost/issue/ANAL-60/click-through-filtering-for-sources
closes
https://linear.app/tryghost/issue/ANAL-61/click-through-filtering-for-locations

- This implements filtering and click-throughs for device, browser,
source, location and pathname.
- It requires significant updates to our tinybird setup, to pass through
all the right data and have them as parameters on the API endpoints
- We update the UI to add query parameters when clicking around and then
pass those through to every chart/request.
- We've added a interface to display the filters and remove them

---------

Co-authored-by: Peter Zimon <peter.zimon@gmail.com>
2024-09-24 15:26:08 +01:00
Hannah Wolfe
5ebdbe4e25
Renamed referrer without www to source in tinybird (#21094)
ref
https://linear.app/tryghost/issue/ANAL-60/click-through-filtering-for-sources

- In our stats page we use the referrer without a protocol or www, that
is the pure domain as our source that we output
- Meanwhile all the data pipelines had the full url as the referrer
passed through
- When we come to add clickthroughs/filtering, we'll need to use this
value to filter the data. If we have a different value locally in the UI
to what is in the DB, we won't be able to make the filters match
- Also, we pay for everything we store, and this removes all the
https:// and www. data
2024-09-24 14:16:50 +01:00
Hannah Wolfe
26e09dd6cc
Added script for unsafe redeploys to tinybird (#21092)
- Whilst we are in development, we can safely make changes to all
aspects of our pipeline without worrying
- This is because currently, it's safe to delete all data and start over
- This script removes everything excepts the analytics_events
datasource, and then recreates everything fresh, repopulating from the
datasource where possible
- This shouldn't be used after tinybird is in production, we need a
better change process
2024-09-24 13:53:19 +01:00
Hannah Wolfe
554920d20b
Shipped sodo-search@1.2.0 (#21090)
- This adds i18n support to search
2024-09-24 13:13:27 +01:00
Hannah Wolfe
2c1d57dcef
Updated stats UI to hide unfinished features (#21089)
ref
https://linear.app/tryghost/issue/ANAL-53/10-stats-page-engineering-stuff

- There are several features that we are yet to implement, the UI is
ready for them
- Hiding the UI in the short term so that it's less confusing what
is/isn't working as we test things
2024-09-24 12:44:38 +01:00
Cathy Sarisky
2a2d7bb9ad
Added i18n support to search - ready for translator work! (#21055)
ref https://github.com/TryGhost/Ghost/issues/16628

This adds translation support to search, which should be the last missing piece of i18n support for Ghost's frontend  🎉
- Translation (t) helper added to sodo-search.
- Ghost head tweaked to include data-locale.
- All (I hope) strings in sodo-search wrapped in the t helper.
- Possibly poor-quality French translation strings added.

---------

Co-authored-by: Vikas Potluri <vikaspotluri123.github@gmail.com>
2024-09-24 12:39:32 +01:00
Hannah Wolfe
e397046fb5
Improved the implementation of the stats page (#21088)
ref
https://linear.app/tryghost/issue/ANAL-53/10-stats-page-engineering-stuff

- All of these changes are intended to improve developer experience
going forward, to make it easier to implement further changes to the
stats page.
- Moved the modal into the stats components, as it has a lot of shared
code, and it makes it easier to update them all
- Removed various comment blocks that were outdated or didn't really add
value
  - Fixed all imports to use the same pattern starting `ghost-admin/`
  - Ensured all the components had the correct name
- Dried up the generation of params for Tinybird charts into a utility
function as we'll need to add several more in the near future
- Tried to use a consistent pattern everywhere for the order of
operations
- Dried up the implementation of technical.js which handles the
device/browser charts
2024-09-24 12:23:27 +01:00
renovate[bot]
31f1d7b464
Update dependency @tinybirdco/charts to v0.2.1 (#20937)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| @&#8203;tinybirdco/charts | [`0.2.0-beta.2` ->
`0.2.1`](https://renovatebot.com/diffs/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@tinybirdco%2fcharts/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@tinybirdco%2fcharts/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@tinybirdco%2fcharts/0.2.0-beta.2/0.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Configuration

📅 **Schedule**: Branch creation - "every weekday" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41OS4yIiwidXBkYXRlZEluVmVyIjoiMzguNTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-24 11:08:32 +01:00
Kevin Ansfield
eb3824383b Shipped comments-ui@0.18.0
no issue

- general styling and design updates
2024-09-24 10:46:23 +01:00
Sanne de Vries
d789b7efbf
Updated comment report modal (#21084)
REF PLG-226
- Changed title copy from "You want to report this comment?" to "Report
this comment?"
- Changed button copy from "Report this comment" to "Report"
- Updated styles to be more responsive
2024-09-24 11:13:22 +02:00
Sodbileg Gansukh
2f02ec5566
Added unschedule bulk action to posts (#20945)
ref DES-675
2024-09-24 15:32:45 +08:00
Peter Zimon
8d54e4bf7a
Updated button styles (#21080)
DES-774

- The buttons in the Admin got very diverse over the last couple of
years. This PR updates the styles to use outline buttons, white
background for better contrast and slightly more rounded corners.
Additionally the right click and dropdown menu typography and spacing
has also been updated.
2024-09-24 07:20:20 +00:00
Kevin Ansfield
459a2c553e Added full-page refresh when new post route is in a bad state
ref https://linear.app/tryghost/issue/ONC-323

When the store gets into a bad state for new posts that causes saves to fail we can detect that by looking at the `model.isNew` property. Currently our best approach to fix this state is to restart the app.

- added a `didTransition()` hook to our `lexical-edit.new` route
  - detects the bad state, logs the error, and triggers a browser refresh
  - logs with a `recreatedPostIsGood` property that will let us know if we could instead just try recreating the post and avoiding a full refresh (so far we have no reproduction case so we need to learn what we can)
- added `sinon-chai` dependency for better assertions on spies/stubs
- added `sentry-testkit` dependency so we can test our Sentry integration calls
  - we can't use sinon for these calls because of the way Sentry's es6 imports work
- extracted our full Sentry config object generation to a util function so it can be re-used in unit tests
  - updated our integrations list to disable the default `dedupe` integration because it can cause very unexpected/difficult to debug test failures when you're asserting using `sentry-testkit`
2024-09-23 22:38:34 +01:00
Sanne de Vries
0656bd4de8
Added more specificity to newsletter title line-height (#21070)
REF DES-770
- In certain email clients such as Protonmail, the newsletter title
line-height was inherited from the `body` rather than the parent `td`.
This commit adds line-height to the title link explicitly.
2024-09-23 16:29:07 +02:00
renovate[bot]
7d441f24be Update dependency ember-auto-import to v2.8.1 2024-09-23 09:34:16 +02:00
renovate[bot]
a1dcd9168d Update dependency ember-auto-import to v2.8.0 2024-09-23 09:08:50 +02:00
renovate[bot]
56af0e0095 Update dependency html-validate to v8.23.0 2024-09-23 08:59:09 +02:00
renovate[bot]
ed04bd4a8b Pin dependency microdiff to 1.4.0 2024-09-23 08:56:08 +02:00
Ghost CI
887fdbd430 v5.94.2 2024-09-23 06:43:10 +00:00
Kevin Ansfield
c41c44b02d Fixed "Editor crashed" error showing for a valid 404
ref https://linear.app/tryghost/issue/ONC-323

- sometimes posts can be deleted by another user or in a different tab but then edited in an old tab that had the post loaded in the editor
- in this situation we were displaying our "Editor crashed" error put in place for the  rarer situation where the editor is genuinely in a bad state
- added an extra conditional for the bad state and a custom error message for the deleted post state
2024-09-20 09:40:44 +01:00
Kevin Ansfield
64118c139e Added extra post model state properties to debug logs
ref https://linear.app/tryghost/issue/ONC-323

- include post model state properties as well as the state name
2024-09-20 09:14:39 +01:00
Chris Raible
cc88757e2a
Added local revisions to the editor as backstop against data loss (#21044)
ref https://app.incident.io/ghost/incidents/107

- We have a rare bug that causes the initial `POST` request to create a
new post from the editor to be skipped or fail. Subsequent `PUT`
requests then fail because there is no post ID, potentially resulting in
data loss. The aim of this commit is to start saving revisions of posts
in the editor to the browser's localStorage, as a last-ditch option to
restore lost work.
- Since we don't know where the bug is yet, and to protect against
future bugs, we've deliberately avoided depending too heavily on the
`lexical-editor` controller or the ember store. We've aimed to create a
direct route to the state in the editor, by hooking into the
`updateScratch` method (effectively the `onChange` handler for the
editor).
- The `scheduleSave` function on the new `local-revisions` service is
called immediately upon any changes to the state of the lexical editor,
which is effectively every keystroke. The service has some logic and
timeouts, so it doesn't actually save a revision on every change to the
editor.
- The "schema" of the datastore is a simple key-value store, where the
key is of the format: `post-revision-${postId}-${timestamp}` if the post
has an ID, or `post-revision-draft-${timestamp}` for an unsaved draft.
There is also an array of all the revisions' keys, which allows us to
clear all the revisions without having to loop over every key in
localStorage (along with some other conveniences, like filtering).
- There is currently no UI for viewing/restoring revisions. In the event
that you need to restore a revision, you can access the service in the
browser console. You can access all the saved revisions using the
`list()` method, which logs all the revisions to the console by title &
timestamp. You can then choose a revision to restore, and call
`restore(revision_key)`, which will `POST` the revision's data to the
server to create a new post.
- Since localStorage data is limited to a 5mb quota in most browsers,
the service has a mechanism for evicting the oldest revisions once it
meets the quota. If a save fails because it would exceed the quota, the
`performSave` method will evict the oldest revision, then recursively
try to save again.

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-09-20 00:08:28 -07:00
Kevin Ansfield
8ab7182bfe Added logging of post state changes
ref https://linear.app/tryghost/issue/ONC-323

- added debug logs to print to console each time the post state changes and include a full list of post state changes within the editor session in the error reports when we hit the 404 error caused by a bad editor state
2024-09-19 17:31:20 +01:00
Kevin Ansfield
bd6ca272dd 🐛 Fixed wrong breadcrumb and missing post status when starting new post from analytics
closes https://linear.app/tryghost/issue/ENG-1533

- the code to switch to "from analytics" state for the editor was applying when clicking the create post button in the nav menu whilst on the analytics screen which was confusing because you not only lost the `< Posts` link in the editor but you couldn't see the post's saving status
2024-09-19 16:27:40 +01:00
renovate[bot]
46aa2a7ce7
Update Koenig packages (#21048)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons

When a bookmark is added(pasting a URL) into the editor we’re immediately hitting the oembed endpoint twice.
The editor shouldn’t be firing a second bookmark oembed request when it’s already been given all the bookmark data from the first request.
Details: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons#comment-852d53dc
2024-09-19 18:19:36 +05:30
Cathy Sarisky
6b84d9a900
🎨 wrapped missing i18n strings in portal (#21042)
ref https://forum.ghost.org/t/how-to-translate-the-date-intervals-year-and-month-in-portal-js/25599

- Added sneaky missing translation wrapping, notably the elusive year and month strings. Also "Change Plan" and "Choose Plan" for upgrade situations.
- Finding and adding these missing wrappings is critical to making Ghost's i18n usable for customers using other languages
2024-09-19 13:30:45 +01:00
Hannah Wolfe
f828ddefee Updated missed references to unique visitors
ref https://github.com/TryGhost/Ghost/pull/21035

- We decided to rename unique visitors to unique visits, but I missed a few places. Updated test case names for good measure
2024-09-19 12:09:46 +01:00
Hannah Wolfe
1c8513d94b Updated KPI pipe to fill missing data
closes https://linear.app/tryghost/issue/ANAL-77/na-data-should-be-zero
ref https://www.tinybird.co/blog-posts/tips-9-filling-gaps-in-time-series-on-clickhouse

- Sometimes we have no matching data for a particular date/date range, which makes our charts look super janky
- Clickhouse has a feature to fill these in called WITH FILL, which makes it really easy to fix this!
- WITH FILL works except for on bounce rate. That seems to be due to the column being marked as nullable and so WITH FILL fills missing data with NULL instead of 0
- To fix that, I've updated the code that generates the bounce rate so that it doesn't generate nulls, and that seems to result in a not-nullable column, which then works with WITH FILL
2024-09-19 11:32:49 +01:00
Hannah Wolfe
7c465a5fb5 Updated token handling to be in code
- When I went off, I quickly recreated all our endpoints with some new functionality
- However, I forgot that I was manually managing tokens, this meant the UI for stats broke with a token error
- Adding the tokens to the endpoint definitions should prevent this happening again, by automating the management of the token scopes
2024-09-19 11:32:49 +01:00
Princi Vershwal
871d21acaf
🐛 Fixed fetching and storing bookmark card icons and thumbnails (#21036)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-09-19 15:52:08 +05:30
Kevin Ansfield
412b850538 Filtered Sentry network breadcrumbs to reduce noise
no issue

- Sentry error reports were full of network breadcrumbs that weren't useful, added filtering to remove ones that aren't helpful in error logs
2024-09-19 11:18:20 +01:00
Kevin Ansfield
f9bb2d0ba7 Fixed missing extra context for Sentry report for editor 404
no issue

- Sentry requires additional data to be passed in under the `extra` property
2024-09-18 17:49:19 +01:00
Kevin Ansfield
48b1b7d504 Fixed [Object] appearing in Sentry log for unsaved-changes reason diff
ref https://linear.app/tryghost/issue/ENG-661
2024-09-18 17:31:09 +01:00
Kevin Ansfield
618d0b130a Added debug logging for 404 errors on new posts
ref https://linear.app/tryghost/issue/ONC-323

- the post model state appears to be in an odd situation when this issue occurs, the extra log context should help us determine if the bad state is occurring at the route level or inside the editor controller
2024-09-18 17:20:23 +01:00
Steve Larson
5923588818
Fixed date storage for analytics job using sqlite (#21038)
no ref

With sqlite the dates were being stored as unix timestamps, which led to
occasional ingestion issues as we assume the date is a date.
2024-09-18 14:56:37 +00:00
Sanne de Vries
7d97c4659d
Improved comments UI styles (#20957)
REF https://linear.app/tryghost/issue/PLG-225

- Reduced overall spacing and font-sizes for it to be more compact
- Optimised mobile spacing and typography
2024-09-18 12:52:13 +00:00
Hannah Wolfe
01c75bb3be
Removed visits and renamed unique visitors (#21035)
closes
https://linear.app/tryghost/issue/ANAL-82/unique-visitors-vs-visits-question

- In our current implementation we don't have a difference between
unique visitos and visits, instead we have unique visits
- Updated the UI to represent this for now, we may change it later
2024-09-18 13:17:47 +01:00
Princi Vershwal
773f514ddb
🎨 Added a maximum limit of 100 for GET members admin endpoint (#20643)
Ref: https://linear.app/tryghost/issue/SLO-188/set-a-maximum-limit-for-get-members-api

Endpoint: ghost/api/admin/members/?limit=all

Change Overview: We are updating the GET ghost/api/admin/members/ endpoint to remove support for the limit=all parameter. Previously, a request like GET ghost/api/admin/members/?limit=all would return a list of all members. Going forward, any request with limit=all or a limit greater than 100 will only return up to 100 members per request.
This change aims to improve the performance and scalability of the API.

What changes for users? - They will have to implement pagination to retrieve the list of all members.
2024-09-18 11:17:56 +00:00
Hannah Wolfe
036c175a5d
Updated top metrics to refetch on change (#21033)
closes
https://linear.app/tryghost/issue/ANAL-67/audience-filtering-doesnt-update-the-top-metrics-just-the-charts

- We want the data to be refetched whenever the chart range or audience
args change
- I don't think this is the right pattern, but we're going to move to a
react project in a few weeks, and I think this will be ok for that long
2024-09-18 11:43:16 +01:00
Hannah Wolfe
cb3a116cf8
Updated kpi-overview top bar fetch to use params (#21032)
ref
https://linear.app/tryghost/issue/ANAL-67/audience-filtering-doesnt-update-the-top-metrics-just-the-charts

- At the moment we are manually fetching the top bar data for KPIs via
Ember.
- This was done quickly, and didn't make use of the params for audience
or chartRange
- We need these params to fetch filtered data results
2024-09-18 11:17:55 +01:00
renovate[bot]
8d957c3ec1 Update dependency @slack/webhook to v7.0.3 2024-09-18 06:49:39 +00:00
Daniel Lockyer
5832ab5138 Added workaround for internal adapter dependencies
refs https://linear.app/tryghost/issue/DEV-23/workaround-for-yarn-caching-issues

- in our build pipeline, we add some more dependencies for our internal
  adapters
- recently we've been seeing caching issues with these dependencies, not
  sure why
- to workaround that, we'll just include them here and eventually bring
  the adapters into the OSS repo
2024-09-18 08:34:51 +02:00
chicodurden21
be8c3ec100
Updated Portuguese translations (#21023)
no issue
2024-09-17 22:11:52 +02:00
Sag
99d8a5777f
Fixed "Unsaved post" modal shown after publishing (#21028)
ref https://linear.app/tryghost/issue/ENG-661
ref INC-109

- this PR reverts two commits: 5903dd7 and 426b1d4
2024-09-17 18:55:03 +00:00
Tomáš Baránek
7838e5cd59
Added new Czech translations (#20941)
no issue
2024-09-17 19:15:40 +02:00
Kevin Ansfield
03df113d5c Improved logging of unsaved changes modal
ref https://linear.app/tryghost/issue/ENG-661

Logging the full lexical objects to Sentry for the "showing leave editor modal" event isn't very useful because they almost always truncated due to size or stripped due to potentially sensitive data which makes the reports difficult to debug and action.

- added `code` to the context for each report to make identification easier
- updated `reason` for the lexical diverged reason to better match what's happened
- stripped `lexical`, `scratch`, and `secondaryLexical` from the context that is logged to Sentry because they aren't actionable there and just add noise
- added a diff to the logged context for the lexical change reason to more easily identify the changes that triggered an unexpected modal display
  - previously we didn't get full objects in Sentry so couldn't do a comparison and the local workflow was to grab the logged scratch and secondaryLexical values and run a manual diff - this should help in both cases
2024-09-17 17:22:02 +01:00
Princi Vershwal
1c08fd2b9d
Update dependency gscan to v4.43.5
Ref:
https://linear.app/tryghost/issue/ONC-318/support-escalation-re-500-error,
https://linear.app/tryghost/issue/ENG-1444/gscan-slow-checking-for-themes-with-many-files
2024-09-17 13:40:36 +00:00
renovate[bot]
c5dd77e551 Update dependency terser to v5.33.0 2024-09-17 12:27:26 +00:00
renovate[bot]
3d65690987 Update dependency jwk-to-pem to v2.0.6 2024-09-17 14:13:00 +02:00
Princi Vershwal
5903dd7fb4
Checking unique names for icon and thumbnails before saving locally (#21012)
Ref: https://linear.app/tryghost/issue/ENG-1554/wrong-youtube-thumbnail
2024-09-16 19:19:35 +05:30
Sag
430fbdb987
🐛 Fixed member filtering for "Unsubscribed from newsletter" filters (#20926)
ref https://linear.app/tryghost/issue/ENG-1466
ref https://linear.app/tryghost/issue/ENG-1484

- Previously, filtering members with multiple "Unsubscribed from
newsletter x" led to no filtering at all, all members were returned
- This was caused by a bug in NQL, that is fixed in version 0.12.5, cf.
[commit](dd18d1d6ca)
- We're also removing the safeguard in the product around bulk deletion
when multiple newsletter filters are in use, as the root problem has
been fixed
2024-09-16 11:16:49 +02:00
Ghost CI
1f3e72eac8 v5.94.1 2024-09-13 15:05:36 +00:00
Kevin Ansfield
a9bf6c66ed Improved displayed error message when editor reaches bad saving state
ref https://linear.app/tryghost/issue/ONC-323

- added explicit 404 handling to the editor's save task so we can display a more direct/useful error message
2024-09-13 11:35:53 +01:00
Kevin Ansfield
f054205e58 Fixed errors from 404 error handler for non-transition 404s
ref https://linear.app/tryghost/issue/ONC-323

- our fallback 404 error handler assumed we always had a transition along with the error
  - this wasn't a bad assumption, it should be very unlikely that we see a 404 outside of navigating to a non-existent/deleted resource
  - unfortunately we weren't handling the error thrown by our error handler which meant the error was silent as far as the user was concerned
  - having a silent error meant that in very rare circumstances the editor could get into a state where saving was failing but there was no indication of that
- updated the fallback 404 error handler to only do something when navigation was occurring in which case it transitions to the 404 screen, otherwise let the error continue to our generic API error handling which will stay on the current screen but show an error alert
- adjusted the editor saving to actually trigger autosave-after-change when testing (albeit with 100ms wait compared to 3s) so the tests better reflect actual behaviour
2024-09-13 11:02:55 +01:00
Chris Raible
971d497c1e
Added caching to LastSeenAtUpdater (#20964)
ref
https://linear.app/tryghost/issue/ENG-1543/debounce-the-members-lastseenatupdater

- The `LastSeenAtUpdater.updateLastSeenAt` function is called in
response to a `MemberClickEvent` — when a member clicks a link in an
email with tracking enabled. This function can be called many times for
the same member in a short period of time if e.g. a link checker is
clicking all the links in an email they received.
- This function should only update a member's `last_seen_at` timestamp
once per day. To accomplish this, `updateLastSeenAt` runs a
`select...for update` query to find the member's current `last_seen_at`
timestamp, and only updates the timestamp if the current `last_seen_at`
is before the start of the current day. The `for update` is required to
avoid a race condition, which previously caused this function to update
the `last_seen_at` timestamp more frequently than needed, which results
in many unnecessary database queries. However, we still run the initial
`select...for update` query for each event, which seems to be resulting
in contention for locks on the member's row in the `members` table.
- This commit introduces a simple in-memory cache so that we avoid
calling `updateLastSeenAt` if the member's `last_seen_at` timestamp has
already been updated in the current day, which should avoid running so
many `select...for update` queries and locking the `members` table up.
2024-09-13 00:54:43 -07:00
Kevin Ansfield
a5b1f2e9fa Added logging for editor saveTask errors
ref https://linear.app/tryghost/issue/ONC-323

- we're seeing a rare situation where the editor can get into a bad state when creating a new post that means saves silently fail
- added logging to help debug
2024-09-13 00:07:08 +01:00
Kevin Ansfield
24e9436155
Removed unused react-editor template file (#20996)
no issue

- unused remnant of early editor testing
2024-09-12 22:20:19 +00:00
Djordje Vlaisavljevic
a087e329ed
Updated ActivityPub Feed and Replies design (#20992)
- Added activity icon for Replies
- Updated Replies design
- Updated hard-coded Profile values to more realistic ones
- Renamed ActivityPub nav item and moved it to the top of the navbar
- Added a check for post attachments
2024-09-12 16:03:49 +01:00
renovate[bot]
2e43017757 Update dependency webpack to v5.94.0 2024-09-12 13:24:07 +00:00
Daniël van der Winden
96cfa97c84
Updated buttons for share modal and post analytics (publish flow) in dark mode (#20989)
Buttons in the share modal as well as on the Analytics page weren't
getting the right colours and hover states. That's fixed now.
2024-09-12 11:39:50 +00:00
Daniël van der Winden
7fa8faefc7
Improved optical (vertical) alignment for onboarding (#20988)
The optical (vertical) alignment of the onboarding was a tad off. This
improves that.
2024-09-12 10:44:06 +00:00
Ronald Langeveld
7d86c2ce9c
Added labs props to Content Settings API (#20965)
ref PLG-229

- Added Labs properties to the Content Settings API endpoint to be
reachable in Portal and Comments UI app.
2024-09-12 18:18:57 +09:00
Ronald Langeveld
ba74785250
Added comment improvements feature flag (#20986)
ref PLG-229

- Added `commentImprovements` feature flag toggle
2024-09-12 14:49:22 +09:00
renovate[bot]
43a392d734 Update dependency express to v4.21.0 2024-09-12 07:37:27 +02:00
Sirichai Chulee
58ca6f3d95
Updated uuid to crypto.randomUUID() (#20821)
The uuid package README suggests using the node builtin `crypto` library if
we're only using uuid.v4, which we are.
2024-09-12 09:09:30 +07:00
Peter Zimon
028c1a6929
Fix formatting error on Stats page (#20978)
[ANAL-79](https://linear.app/tryghost/issue/ANAL-79/stats-page-v10-design-refinements)

- There was a formatting error on the Stats page that was causing the
KPIs to be displayed incorrectly. This commit fixes that error.
2024-09-11 15:02:31 +00:00
Peter Zimon
8d29479981
Refined ui details for Stats page (#20977)
[ANAL-79](https://linear.app/tryghost/issue/ANAL-79/stats-page-v10-design-refinements)

Further UI refinements for Stats page
2024-09-11 14:14:05 +00:00
Daniel Lockyer
6744bb9457 Tidied up monobundle output
- just some minor readability improvements
2024-09-11 15:09:27 +02:00
Daniel Lockyer
2a39053962 Configured outputs for Admin build step
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- by doing this, we can tell Nx which files should be restored when the
  cache is restored
2024-09-11 14:12:30 +02:00
Peter Zimon
7c64a7ac09
Stats page UI updates (#20970)
[ANAL-79](https://linear.app/tryghost/issue/ANAL-79/stats-page-v10-design-refinements)

- typography is inconsistent in table headings
- chart section headings are not unified
- spacings are off between section and data headings
- inactive KPI tab colors are too light
- tech data numbers are not formatted
2024-09-11 10:56:14 +00:00
renovate[bot]
7fc092447d Update dependency pump to v3.0.2 2024-09-11 10:16:42 +00:00
renovate[bot]
d63c4d13ec Update dependency html-validate to v8.22.0 2024-09-11 12:03:53 +02:00
renovate[bot]
979e704410 Update dependency express to v4.20.0 2024-09-11 08:21:15 +02:00
Chris Raible
a5dfd6016e
Reorganized test cases for lastSeenAtUpdater (#20963)
no issue

- These tests were all in a single `describe` block, making it difficult
to navigate and add more tests.
- This commit adds a nested `describe` block for each method on the
`lastSeenAtUpdater`, making it easier to understand the test cases, and
to add more. None of the tests themselves have changed, just the
organization of them.
2024-09-10 15:40:57 -07:00
renovate[bot]
482cf08ee7 Update dependency pump to v3.0.1 2024-09-10 20:20:08 +00:00
renovate[bot]
137a0b6aba Update dependency yjs to v13.6.19 2024-09-10 14:43:10 +00:00
Princi Vershwal
b14b44faa4
ENG-1526 Added logs and sentry messages in Router Controller (#20955)
Ref:
https://linear.app/tryghost/issue/ENG-1526/errors-from-members-api-routercontroller-are-being-lost

The try/catch/re-throw pattern, that hides errors, is used throughout
the RouterController.js file.
I have not changed the try/catch/re-throw pattern because it helps in
sending clean messages to the users. We may not want to return internal
errors as API responses.
I have added logs and Sentry messages that will help us debug without
losing error messages.
2024-09-10 16:47:12 +05:30
renovate[bot]
9860371df7 Update dependency i18next to v23.15.1 2024-09-10 10:04:37 +00:00
renovate[bot]
d3cf1045f5 Update dependency body-parser to v1.20.3 2024-09-10 00:22:39 +00:00
renovate[bot]
3677f83d1c Update dependency i18next to v23.15.0 2024-09-09 18:15:47 +00:00
renovate[bot]
1dc2a3bcfd Update dependency terser to v5.32.0 2024-09-09 11:38:16 +00:00
chicodurden21
e2e2d94ac0
Added Portuguese translations for Comments app (#20927)
no issue

- Just added the portuguese translation for the comments file
2024-09-09 12:34:06 +01:00
Peter Zimon
b16c80259e
Stats UI updates (#20946)
[ANAL-43](https://linear.app/tryghost/issue/ANAL-43/implement-all-possible-ui-for-10)

- The BarList component wasn't using the parameters provided in its
latest release
- Number formatting was missing on all numbers
- "See all" links were missing in Content/Sources/Locations
- Empty/default values was showing [blank]
- Flags were missing for country values
2024-09-09 13:32:28 +02:00
zivko-koraci
681deb18fc
Added Serbian Cyrillic translations (#20940)
no issue

- translations from the ChatGPT-4o
2024-09-09 12:22:35 +01:00
Paul
abf2bfe634
Complete and accurate translation into Russian (#20886)
Got some translated strings, and hope it's awesome 🎊!

A short description of my changes:

- [x] All lines have been translated
- [x] For lines that already had a translation into Russian - I
double-checked the accuracy of that translation and corrected the
translation if necessary
- [x] I tried to ensure uniformity in the translation of terms and even
compiled a small glossary (local on my computer)
- [x] Frequently referred to and checked the hints from the
`context.json` file

I hope, you will appreciate your contribution!

---------

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-09-09 09:42:46 +01:00
Duy
f51d7bb27a
Update newest Vietnamese strings for Portal translation (#20902)
My translation is 100% accurate and helps to perfect Vietnamese
2024-09-09 09:12:51 +01:00
Ronald Langeveld
499c80673b
Cleaned up comments after Stripe Controller refactor (#20943)
no issue
2024-09-09 05:31:52 +00:00
Ronald Langeveld
a64eaeccf2
Refactored Stripe webhook controller (#20918)
no issue

- Moved business logic from `WebhookController` to dedicated service
classes (`SubscriptionEventService`, `InvoiceEventService`,
`CheckoutSessionEventService`).
- Reduced controller complexity.
- Added unit tests for individual services, increasing overall test
coverage.
- Improved maintainability and scalability by isolating responsibilities
in specific services, making future updates easier and safer.
2024-09-09 12:54:22 +09:00
renovate[bot]
c96744156e
Update dependency @playwright/test to v1.46.1 (#20866) 2024-09-06 10:35:50 -07:00
Ghost CI
18cc8dc7fb v5.94.0 2024-09-06 15:05:07 +00:00
Chris Raible
ee514a397c
Added configurable target delivery window for batch sending (#20719)
ref
https://linear.app/tryghost/issue/ONC-217/implement-the-deliverytime-option-in-mailgun-api-calls

Ghost experiences its highest peak load immediately after sending out a
newsletter, as it recieves an influx of traffic from users clicking on
the links in the email, a burst of email analytics events to process
from mailgun, and an increase in organic traffic to the site's frontend
as well as the admin analytics pages. The `BatchSendingService`
currently sends all the batches to Mailgun as quickly as possible, which
may contribute to higher peak loads.

This commit adds a `deliverytime` parameter to our API calls to Mailgun,
which allows us to specify a time in the future when we want the email
to be delivered. This will allow us to moderate the rate at which emails
are delivered, and in turn that should moderate the peak traffic volume
that Ghost receives in the first 2-3 minutes after sending an email.

The `deliverytime` is calculated based on a configurable parameter:
`bulkEmail.targetDeliveryWindow`, which specifies the maximum allowable
time (in milliseconds) after the email is first sent for Ghost to
instruct Mailgun to deliver the emails. Ghost will attempt to space out
all the batches as evenly as possible throughout the specified window.
For example, if the targetDeliveryWindow is set to `300000` (5 minutes)
and there are 100 batches, Ghost will set the `deliveryTime` for each
batch ~3 seconds apart.
2024-09-05 22:28:40 -07:00
Chris Raible
55e6166618
Removed retries from batch sending tests (#20934)
no issue

- These retries were added a while ago when these tests were flaking in
CI, but this only serves to cover up any potential problems with these
tests or the code they are testing
- Ran these tests in CI three times in a row without them failing, so I
don't think the retries are necessary
2024-09-05 16:29:16 -07:00
Chris Raible
289b18c01f
Fixed dependency between tests in batch sending integration tests (#20932)
no issue

- One of the tests in this suite added a member and didn't clean it up
when it was finished.
- Because of this, the tests after this one depended on this test
running first, so running an individual test in isolation might fail,
despite passing when run in the whole test suite
- This commit removes the added member, so all the tests in this suite
should pass whether run independently or all together
2024-09-05 13:37:06 -07:00
Kevin Ansfield
0b5f26ab97 🐛 Fixed "Unsaved changes" modal showing for some published posts with images
closes https://linear.app/tryghost/issue/ENG-1532

- bumps Koenig to version that doesn't re-populate image node dimensions when they already exist
2024-09-05 17:19:10 +01:00
Sam Lord
46a4f7bc36
Added middleware to prevent other sites' content from being served (#20922)
ref ONC-294

---------

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2024-09-05 17:15:09 +01:00
Peter Zimon
dd183cf25e
Stats page refinements (#20924)
[ANAL-43](https://linear.app/tryghost/issue/ANAL-50/update-colors-of-barlist)

- Copy is too technical, doesn't follow conventions on Stats page
- Range filter dropdown has to be updated with more meaningful values
- KPI charts need a granularity dropdown to display meaninful charts
depending on the context
- Typography details should be updated
- "Posts/pages" dropdown needs to be added to Content section. This is a
Ghost specific filter that brings high value to customers
- "Campaigns" dropdown needs to be added to Sources section to support
ad tracking and filtering in the future
- BarList colors should be updated to be less purple all over the place
2024-09-05 17:49:20 +02:00
matsbst
e3ae2a22b1
Fixed typos in Norwegian (NO) strings for Portal translation (#20916)
Fixed small typos in Norwegian (NO) translation
2024-09-05 15:12:34 +01:00
Steve Larson
a47298a75c
Reimplemented email analytics prioritizing email opens (#20914)
ref https://github.com/TryGhost/Ghost/pull/20835
- reimplemented email analytics changes that prioritized opened events
over other events in order to speed up open analytics
- added db persistence to fetch missing job to ensure we re-fetch every
window of events, especially important if we restart following a large
email batch

We learned a few things with the previous trial run of this. Namely,
that event throughput is not as high as we initially saw in the data for
particularly large databases. This set of changes is more conservative,
while a touch more complicated, in ensuring we capture edge cases for
really large newsletter sends (100k+ members).

In general, we want to make sure we're fetching new open events at least
every 5 mins, and often much faster than that, unless it's a quiet
period (suggesting we haven't had a newsletter send or much outstanding
event data).
2024-09-05 08:10:07 -05:00
Cuong Thach
af4aba9664
Update missing Vietnamese strings for Portal translation (#20884)
The missing Portal translation string has been added in Vietnamese.
2024-09-05 13:40:14 +01:00
Alexandre "Lekler" Rodrigues
4d39f8fc7a
Update pt-BR translation of portal.json (#20880)
Following commit #20858, the following updates were made:

- Inserted the Brazilian standard phone number format for `+1 (123)
456-7890`.
- Translated missing static strings, such as "Enter your email address"
and "Invalid email address."
- Updated some translations to maintain consistency and proper context.
2024-09-05 13:35:21 +01:00
Princi Vershwal
426b1d4d93
🐛 Fixed bookmark card hot linking icons and thumbnails (#20923)
Ref:
https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-09-05 16:09:17 +05:30
renovate[bot]
2faa051c9b
Update Koenig packages (#20925) 2024-09-05 13:29:53 +05:30
Peter Zimon
00b23789a0
Stats filters update (#20921)
[ANAL-39](https://linear.app/tryghost/issue/ANAL-39/update-audience-and-days-filter-ui)

- Filters on the Stats page used a very basic power dropdown and needed
to update to use a similar component as in Members Activity. Also the
button style didn't match the rest of the Admin
2024-09-04 14:23:50 +02:00
Princi Vershwal
77cfa39eec
Revert Fetch and store icons and thumbnails ENG-904 (#20920)
Reverting this as there is an issue with the urls stored in db. Details
in the
[thread](https://ghost.slack.com/archives/C02G9E68C/p1725445854035799)
2024-09-04 11:10:23 +00:00
Daniël van der Winden
678a0c2b9a
Updated date notation (#20915)
refs
https://linear.app/tryghost/issue/DES-771/publish-flow-modal-shows-the-wrong-published-time-for-scheduled-posts

Scheduled post's date and time was shown as the date of creation, not
the date it was going to be scheduled. This fixes that.
2024-09-04 07:20:14 +00:00
Princi Vershwal
b6407f2d45
🐛 Fixed bookmark card hot linking icons and thumbnails ENG-904 (#20906)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons

Bookmark cards' icons and thumbnails are not fetched and stored in our storage.
2024-09-04 12:33:14 +05:30
Ghost CI
fb0f7d284a v5.93.0 2024-09-03 20:25:25 +00:00
Kevin Ansfield
013041304e 🐛 Fixed Tips & Donations checkout error for sites with long titles
ref https://linear.app/tryghost/issue/ONC-296

Our `stripe_prices.nickname` field had a length of 50 chars which meant we could error out trying to save a donation Stripe price with a generated product nickname containing a long site title.

- updated db schema and added a migration to change column length to 255
- added truncation to nickname generation to enforce a limit of 250 chars to match Stripe's limit
2024-09-03 21:08:24 +01:00
renovate[bot]
b2d7922f30 Update dependency nodemailer to v6.9.15 2024-09-03 16:26:49 +00:00
renovate[bot]
67291056b0
Update Koenig packages (#20911)
Ref: https://linear.app/tryghost/issue/ENG-1435/threads-embeds-contain-broken-images

Fixed broken Thumbnails and Icons
2024-09-03 16:13:13 +00:00
Ghost CI
4ce116d5fb v5.92.0 2024-09-03 15:21:50 +00:00
Kevin Ansfield
1bc34f7227 Added Tips & Donations one-off payments
no issue

Give your audience a simple way to support your work with one-time payments, no membership required.

- cleaned up `tipsAndDonations` labs flag
2024-09-03 16:00:48 +01:00
Kevin Ansfield
3744caa950 Fixed lint warnings from Admin feature-test
no issue

- converted use of promises to async/await
- removed return from async test functions to clear lint warnings
2024-09-03 10:59:08 +01:00
Kevin Ansfield
fd926193ce 🐛 Fixed unsaved changes modal showing when title has leading/trailing whitespace
closes https://linear.app/tryghost/issue/PLG-205

The server trims whitespace from the title when saving but our unsaved changes detection was comparing the raw title input field value meaning there would be a mismatch after publishing if the title field contained leading/trailing whitespace.

- updated title comparison to compare trimmed values
- moved and improved unsaved changes modal tests from publish-flow to unsaved-changes acceptance test file
  - added util for pasting content into the editor to test for content changes
2024-09-03 10:53:53 +01:00
Sodbileg Gansukh
1cee402339 Fixed publish flow related admin tests 2024-09-03 10:46:25 +01:00
Kevin Ansfield
cc72d368de Fixed Admin tests
no issue

- fixed eslint config so tests are correctly linted
- removed `.only` on stats tests preventing other tests from running
- removed unneccessary `return` from async setup functions
2024-09-03 10:46:25 +01:00
Peter Zimon
397342a910
Added technical details to stats (#20898)
[ANAL-1](https://linear.app/tryghost/issue/ANAL-32/add-stats-kpis-charts)

The technical details section in Stats contains only the browser breakdown ATM. This PR adds the rest (devices, operating systems) and fixes a couple of minor UI details on the rest of the charts
2024-09-02 16:05:09 +02:00
Daniel Lockyer
47d1a3c451 Switched build and build:ts scripts
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- `build` should be the overall script to build the package
- `build:ts` should only build TypeScript
- by having them switched around, `build:ts` would call `yarn build`,
  and `yarn` adds several hundreds of milliseconds of time to each build
2024-09-02 15:20:03 +02:00
Daniël van der Winden
e369ca6489
Updated date notation (#20899)
fixes https://linear.app/tryghost/issue/DES-762/improve-date-notation-when-scheduling-posts

If a post goes out *today*, it will no longer show the full date. Also
formatted the subtitle in the modal to be a bit more legible.
2024-09-02 15:08:42 +02:00
Hannah Wolfe
4c5704bfa6 Added audience handling to stats
closes https://linear.app/tryghost/issue/ANAL-23/filtering-by-logged-out-logged-in-traffic

- Updated all of our tinybird datasources and pipes to handle member status
- Added member_status as an array query param to the API endpoints
- Added a really dodgy power select multiple to the stats page to demonstrate it works (needs styling)
- Added all of the wiring so each chart updates
- This was done pretty fast, and may not be 100% right yet
2024-09-02 12:56:37 +01:00
Kevin Ansfield
73d75413a0
🎨 Convert portal links to relative to avoid homepage flash on click (#20896)
closes https://linear.app/tryghost/issue/PLG-190

- often when adding portal links to your own site pages the URLs are added as absolute on the site's homepage due to copy+paste from displayed URLs in Admin
- when clicking absolute portal URLs the homepage is first loaded before the Portal popup is shown resulting in a slower and flashier experience
- added a transform for all local portal URLs on the page when Portal is initialized so links open the Portal popup immediately on the current page
2024-09-02 11:23:12 +00:00
Peter Zimon
ad9312451d
Stats tab charts (#20895)
[ANAL-1](https://linear.app/tryghost/issue/ANAL-1/v1-chart-list)

Creating first version of charts on Stats tab which includes KPIs, Content, Sources, Locations and technical data.
2024-09-02 13:22:39 +02:00
Kevin Ansfield
9467ffadb5 Removed sqlite skip in recommendation email test
no issue

- test runs OK locally in SQLite
- enabling it to run eliminates a potential tripping point when generating updated snapshots locally
2024-09-02 11:16:02 +01:00
Daniël van der Winden
16d2987c0c
Updated URL encoding (#20891)
Fixes
https://linear.app/tryghost/issue/DES-760/make-a-line-break-between-the-post-title-and-url-when-sharing-to

When a post is shared to Twitter from the 'Share' modal (or in the
publishing flow), the URL now sits on the second line.

<img width="653" alt="Screenshot 2024-09-02 at 11 20 53"
src="https://github.com/user-attachments/assets/178066cc-01da-41b6-bf1d-d00943881209">
2024-09-02 09:27:32 +00:00
Daniel Lockyer
0f8fd441c7 Renamed ghost:build to ghost:build:assets
ref https://linear.app/tryghost/issue/DEV-20/faster-builds

- this was previously causing duplicate builds of the TS projects
  because Nx was building all projects with `build` targets, and we were
  also calling `build:ts`
- this cuts 12 compilation jobs from the archive process, which should
  help with container build times
2024-09-02 09:08:47 +02:00
Hannah Wolfe
c1798620bb
Added basic date-handling to stats page (#20887)
ref https://linear.app/tryghost/issue/ANAL-21/filtering-the-dashboard

- Added the very basic date filter back from the dashboard
- Without this, it's very hard to see that the basic concept is working
- This method can be reused for creating any filter
2024-09-01 16:33:31 +01:00
Ghost CI
bf4e6600a9 v5.91.0 2024-08-30 15:05:40 +00:00
Hannah Wolfe
0720bc2bdb
Updated multi-tenant param name for stats charts
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd

- We've settled on a name for the param of site_uuid
- Need to update the chart code that was added prior to this final decision
2024-08-30 11:23:27 +01:00
Hannah Wolfe
08bf49eaec
Added full suite of tinybird datasources and pipes (#20882)
ref
https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd
ref
https://github.com/tinybirdco/web-analytics-starter-kit/blob/main/tinybird/pipes/analytics_sessions.pipe

- These datasources and pipes work together to define the main endpoints
we need for our stats dashboard
- They are based on the web analytics starter kit from tinybird
- We've updated them to handle site_uuid
- There's more to do to pipe the member-related and post-related data
through the system yet
2024-08-29 22:03:31 +01:00
Hannah Wolfe
f79f5471b4
Added stats tracker script to ghost head (#20881)
closes
https://linear.app/tryghost/issue/ANAL-9/initial-tracker-in-ghost-head

- Given that all of the correct config is in place, output a tracking
script
- This allows us to send pageview events into tinybird
- All of the details (location of the script, destination etc) are kept
in config so that it's easy to change for different environments
2024-08-29 21:40:41 +01:00
Sodbileg Gansukh
d30164df97
Improved publishing flow (#20878)
ref DES-706

* After a user publishes or schedules a post, they are directed to the post list
* If a post is sent as an email, they are directed to the Analytics page
* In both cases, a confirmation modal is shown
* If a post is published, they can share it directly from the confirmation modal
* Added a "Share" button and some additional functions (view, edit, and delete post) to
published posts in post analytics
* Added a manual "Refresh" button to post analytics so that there is
no need to reload the whole app to update the data

---------

Co-authored-by: Sag <guptazy@gmail.com>
2024-08-29 21:17:16 +02:00
Steve Larson
c2ae91e4db
Added config flag to disable recommendations service (#20879)
no ref

This service can get rather noisy when doing local development with our
data generator, as we do not use real urls, and therefore generate a lot
of not found errors in the console.
2024-08-29 17:51:23 +00:00
Hannah Wolfe
79f4b523ac
Added analytics_events tinybird datasource
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd
ref https://www.tinybird.co/docs/concepts/data-sources

- This is our main datasource, where we'll store events that come in as people browse around Ghost
- It's defined using tinybird's format, and then deployed out to tinybird using `tb deploy`
2024-08-29 17:20:16 +01:00
Sanne de Vries
b79534387d Updated notification email mobile styles
ref https://linear.app/tryghost/issue/PLG-200
2024-08-29 17:15:45 +01:00
Kevin Ansfield
0647172ca8 Added style inlining to staff service emails
no issue

- uses same `juice` version that we use in our newsletter emails
2024-08-29 17:15:45 +01:00
Hannah Wolfe
e41984d0a5
Initial tinybird setup
ref https://linear.app/tryghost/issue/ANAL-27/setup-tinybird-project-and-cicd

- Tinybird has a system for managing it's configuration as code, with full ci/cd support
- The tinybird CLI tool uses python, so we'll run that using docker, via `yarn tb`
- Some of the files tinybird adds should not be in source control, so we've added those to git ignore
- Everything in /ghost/tinybird is tinybird's init config
2024-08-29 16:56:51 +01:00
Hannah Wolfe
9d121d8e9a
Added initial Stats page to Ghost Admin (#20877)
closes
https://linear.app/tryghost/issue/ANAL-10/stats-page-in-ghost-admin

- Adds all the structure, logic and permissions tests for the Stats page
to check we're loading the right thing at the right time
- Adds @tinybirdco/charts as a dependency, and has a single example of a
chart setup using the right config
2024-08-29 12:56:39 +01:00
Daniël van der Winden
42009eb9ed
Updated subtitle logic (#20876)
It was previously not displaying the correct text for when a post is
published + emailed. That's solved now.
2024-08-29 10:41:02 +00:00
Hannah Wolfe
3e25370ebe
Added initial stats config to API (#20875)
closes https://linear.app/tryghost/issue/ANAL-8/flag-and-config

- This checks if tinybird:stats is set, and if so passes through the
config that is set via the config API
- This is used by Ghost admin to configure where to pull charts from
2024-08-29 11:37:28 +01:00
Daniel Lockyer
0a6cd75993 Gated NestJS framework behind environment variable
- we added NestJS to Ghost as a way forwards for a new framework within
  Ghost but we haven't added much to it
- requiring all the NestJS code adds about 6-9% to our boot time, so if
  we're not using it, it's just time we're burning for no benefit
- for now, I've gated this behind an env var to prevent it from loading
- we can't use labs flags in the boot process, so I've gone for an env
  var
2024-08-29 12:18:42 +02:00
Daniël van der Winden
d92f8bcf0a
Updated button colours and hover states (#20873) 2024-08-29 10:05:52 +00:00
Sanne de Vries
2b90ca9082
Updated member link styling in donation email (#20872)
REF PLG-202
- Removed underline from member link
- Changed &rarr; to &bull;
2024-08-29 09:58:40 +00:00
Fabien O'Carroll
2d00d5ca0e Fixed welcome email being sent for Admin API creates
ref https://linear.app/tryghost/issue/ONC-274

This fix is done at the endpoint layer, which isn't ideal, but has the smallest
surface area for the change. I think we may want to move it up a layer though,
despite the extra complications. If we move the check _into_ the MembersAPI
class however, we start to run into issues with circular dependncies due to the
mess that is our dependency injection approach with the Members service
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
3adc0c0441 Added breaking test for sending welcome emails
ref https://linear.app/tryghost/issue/ONC-274

This test checks that a welcome email is not sent when adding a member via the
Admin API if the site is in need of email verification, regardless of whether
or not the flag to send an email is set.

It is currently failing to demonstrate the whole in our logic.
2024-08-29 16:05:27 +07:00
Fabien O'Carroll
b012da023d Cleaned up settings cache after test
All tests after this one were in a non-sending email state, which luckily
doesn't affect these tests, but it will affect future ones! This just cleans up
the settings so that they're back to a standard default.
2024-08-29 16:05:27 +07:00
Ronald Langeveld
8e1a730731
Fixed hanging dash when no attribution is present (#20869)
ref PLG-198

- Fixed trailing dash when no attribution is present
2024-08-29 15:22:31 +09:00
Sodbileg Gansukh
7be7112e68
Fixed non-email analytics error when refreshed (#20868)
ref DES-756, DES-757

- made the email property to make the refresh work properly for published-only posts
- included sentiment in the query to update the feedback percentage when refreshed
2024-08-29 04:49:06 +00:00
Sanne de Vries
0532e4063f
Fixed potential orphaned words in notification email titles (#20860)
REF PLG-150
2024-08-28 16:03:37 +00:00
Kevin Ansfield
c689414497
Added missing translation entries for Portal field placeholders, labels, and errors (#20858)
no issue

- added `t()` around static strings to allow them to be translated
- updated translation files, with context provided in `context.json`
2024-08-28 15:43:03 +00:00
Sanne de Vries
76f9b7982b
Updated donation email CTA's (#20857)
REF PLG-160
- Added link to member profile next to name in donation email
- Added "Say thanks" CTA to donation email without message
2024-08-28 16:37:25 +02:00
Hannah Wolfe
0a7093b7dd
Updated Config API testing to use snapshot + unit tests (#20854)
- Swap the e2e config API test to use our newer framework, and match against a
snapshot for the default case
- Move the individual test cases to unit tests (new file) - there are more to add
here, but this is parity with what we had before
- We use unit tests for checking through various cases for how config
changes modify the output as this is faster and more explicit
2024-08-28 14:29:17 +01:00
Hannah Wolfe
ac345aa84d Removed unused billing url from config API
ref 40cedb84ff (diff-dba52cb217f89ed45931ded5618ce83294fc32cf4a8dec73aa605c65441331b3R43)
ref 639be25f1d/ghost/core/core/server/api/endpoints/utils/serializers/output/config.js

- This was moved under hostSettings very early on in development and should have been cleaned up
- As this property wasn't listed in the output serializer, we know it's not being used anywhere
- We can see from the limit code that it looks for hostSettings.billing.url
2024-08-28 13:49:13 +01:00
Hannah Wolfe
9e45822dbb
Removed unused items from config API (#20851)
ref 
639be25f1d
ref
f705dda314

- These items are never returned from the API as they've been removed
from the serializer
- The tests also check that they are not present
- They were removed by the referenced commits, which changed how these
things were built
2024-08-28 13:25:05 +01:00
Ronald Langeveld
e8e1b8ea2f
Added donation message to Stripe and Email (#20828)
ref PLG-160

- Refactored donation handling logic to be processed within the
`checkout.session.completed` webhook event.
- Added support for capturing and storing donation messages from Stripe
sessions.
- Integrated donation messages into the email notifications sent to
staff.
- Added database integration.
- Removed redundant donation logic from the invoice.payment_succeeded
webhook, since custom fields isn't supported.
- Updated and added new tests

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
2024-08-28 21:08:42 +09:00
Kevin Ansfield
32edc12cc2 Fixed error closing donation success modal
no issue

- when redirecting from Stripe back to Ghost after making a donation the URL contained a double slash (`//#/portal/...`) which triggered browser security errors when Portal modified the browser history stack when navigating
- the above could prevent the donation success modal from closing
2024-08-28 12:38:14 +01:00
renovate[bot]
1871269e8f
Update Koenig packages (#20849)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-28 13:10:57 +02:00
Sodbileg Gansukh
3b38ba3a29
Make split number helper handle empty value (#20848)
no issues
2024-08-28 10:47:03 +00:00
Daniël van der Winden
5cc3d943f2
Made the post preview card a link (#20846)
The modal in the new publish flow has a post preview card, which did not
link to the post itself. It does now (except when it's an email).
2024-08-28 10:08:25 +00:00
Sodbileg Gansukh
1afe96ae34
Added animation to the analytics numbers when refreshed (#20842)
ref DES-709

- when refresh button is clicked, the numbers in the analytics will be animated if changed
- for the animation to be performant, added a new dependency "animejs"
- to minimize the flash and layout shift, the analytics data is kept as it is while loading
- once finished loading, it will be replaced with the new data
2024-08-28 17:25:37 +08:00
Daniël van der Winden
1d17600f5d
Publishing flow: Social buttons update (#20841)
Updated the hover colour of the social buttons in the new publishing
flow's modal.
2024-08-28 08:42:56 +00:00
renovate[bot]
cfda52ead2 Update dependency gscan to v4.43.3 2024-08-28 10:10:54 +02:00
Ronald Langeveld
41e696f00f
Added migration to include donation_message in donation_payment_events (#20839)
ref PLG-197

- DB migration to add `donation_message` to `donation_payment_events`
table
2024-08-28 15:58:11 +09:00
Steve Larson
962194b595
Bumped Portal (#20837)
no ref
2024-08-27 21:29:40 +00:00
Ghost CI
291d48ecb7 Merged v5.90.2 into main 2024-08-27 21:29:17 +00:00
Ghost CI
eaf414a2de v5.90.2 2024-08-27 21:29:15 +00:00
Steve Larson
ae15e12ffc Reverted email analytics jobs commits (#20835)
ref https://linear.app/tryghost/issue/ENG-1518

After releasing the analytics job improvements, it appears for large
sites we're awfully close to missing some Mailgun events because of an
unexpected behavior of the aggregateStats call for just the opened
events job. This is taking 2-5x(+) the amount of time that the aggregate
queries take for the other jobs, despite not being dependent on the
events.

To err on the side of caution, we're going to roll this back and look to
optimize the aggregation queries before re-implementing. And we may be a
bit more cautious in giving _some_ but not _all_ priority to the
`opened` events.
2024-08-27 16:16:07 -05:00
Steve Larson
8f3985bc66
Reverted email analytics jobs commits (#20835)
ref https://linear.app/tryghost/issue/ENG-1518

After releasing the analytics job improvements, it appears for large
sites we're awfully close to missing some Mailgun events because of an
unexpected behavior of the aggregateStats call for just the opened
events job. This is taking 2-5x(+) the amount of time that the aggregate
queries take for the other jobs, despite not being dependent on the
events.

To err on the side of caution, we're going to roll this back and look to
optimize the aggregation queries before re-implementing. And we may be a
bit more cautious in giving _some_ but not _all_ priority to the
`opened` events.
2024-08-27 16:15:34 -05:00
Kevin Ansfield
709ee163e3 Bumped Portal
ref https://linear.app/tryghost/issue/PLG-152

- updates tips and donations success states
2024-08-27 19:30:27 +01:00
Kevin Ansfield
f613f42bec Updated donation success states
closes https://linear.app/tryghost/issue/PLG-152

- switched member success to a notification
- updated non-member success modal to include signup and signin links
2024-08-27 19:30:27 +01:00
Daniel Lockyer
2757ef70fa Revert "🐛 Fixed frontend routing prioritizing collections over built in routes (#20765)"
refs https://app.incident.io/ghost/incidents/102

- this reverts commit c0471f0c28
2024-08-27 18:04:27 +02:00
Daniel Lockyer
d5bac91feb
Revert "🐛 Fixed frontend routing prioritizing collections over built in routes (#20765)"
This reverts commit c0471f0c28.
2024-08-27 17:31:08 +02:00
Daniël van der Winden
af0338b504
Rewrote the publish modal logic and layout (#20832)
Removed unnecessary code, rewrote it in places where we were repeating
ourselves, and followed the new layout for posts + emails.
2024-08-27 15:22:11 +00:00
Daniël van der Winden
344f440de9
Updated the buttons in the publish flow modals (#20831)
Buttons were previously part of the bookmark card, but that's no longer
the case. This makes it easier to scale between different types of
posts/emails.
2024-08-27 13:06:19 +00:00
Ronald Langeveld
9449e0a048
Added donations checkout session unit tests (#20827)
ref PLG-196

- Added comprehensive unit tests to cover various scenarios for the
createDonationCheckoutSession function.
- Verified correct handling of customer object, customerEmail and
metadata.
- Ensured accurate parameter passing to Stripe API, including
success_url and cancel_url.
2024-08-27 12:36:43 +09:00
Ghost CI
8fc8dc72e6 Merged v5.90.1 into main 2024-08-26 23:37:15 +00:00
Ghost CI
46e9b20479 v5.90.1 2024-08-26 23:37:13 +00:00
Steve Larson
2df2c7f120 Bumped Portal (#20826)
ref https://github.com/TryGhost/Ghost/issues/20767
2024-08-26 18:20:43 -05:00
Steve Larson
d24af3bd50
Bumped Portal (#20826)
ref https://github.com/TryGhost/Ghost/issues/20767
2024-08-26 23:06:27 +00:00
renovate[bot]
cfc4c08200 Pin dependency @opentelemetry/instrumentation-runtime-node to 0.6.0 2024-08-26 18:34:34 +02:00
renovate[bot]
400ccfafef Update dependency @sinonjs/fake-timers to v11.3.1 2024-08-26 14:08:32 +02:00
Sodbileg Gansukh
2a212bfff4
Publish flow improvements and bug fixes (#20824)
ref DES-731

- improved mobile styles for the social buttons in the modal
- fixed the flow for publishing/scheduling pages
- redirect to post list only when a post doesn't involve any email
2024-08-26 17:02:00 +08:00
Amel Sućeska
0673ca9627
Improved Bosnian translations (#20667)
Comprehensive, context aware, Bosnian translations for all available
strings.

Informal addressing of users (as is widely accepted in Bosnia and
Herzegovina).

Minor text fixes.
2024-08-26 14:59:09 +07:00
Ghost CI
ef031728cc v5.90.0 2024-08-23 15:05:10 +00:00
Chris Raible
5f9c0d21c5
Added eventLoopUtilization instrumentation behind config (#20819)
ref
https://linear.app/tryghost/issue/ENG-1505/start-monitoring-event-loop-utilization-in-production-with

- The two main constraints we've observed in Ghost are the database connection pool and the CPU usage. However, there is a third constraint that we may be hitting, but can't currently observe: the event loop.
- This commit re-enabled OpenTelemetry (behind a config flag), removes the problematic tracing instrumentation which was breaking the frontend, and adds a Prometheus endpoint to export the eventLoopUtilization metric.
- This should give us visibility into whether we are hitting constraints in the event loop and address the root cause if we are.
2024-08-22 19:16:53 -07:00
Sam Lord
9ca513bfdd Added logging when honeypot field is hit
ref KTLO-1
2024-08-22 22:32:04 +01:00
Sam Lord
56a9fa34af Fixed names of tests for Portal honeypot field
ref KTLO-1
2024-08-22 22:32:04 +01:00
Sam Lord
0a9d2fadba Added honeypot field to prevent bot signup/signin
ref KTLO-1
Should prevent untargeted attacks using headless browser bots.
2024-08-22 22:32:04 +01:00
Sam Lord
244e612f53 Use config flag to change whether token integrity is checked
ref KTLO-1
Allows us to get this out to self-hosters much faster
2024-08-22 22:23:16 +01:00
Sam Lord
23c0882019 Added tests for request integrity token validation 2024-08-22 22:23:16 +01:00
Sam Lord
ef4f79370f Added support in Portal for integrity tokens on magic link API
ref KTLO-1
These tokens should prevent untargeted attacks, as the magic link
endpoint needs a token that was generated by the server, similar to a
CSRF token, but without needing any server-side state, or a cookie to
be set for unauthenticated users.
2024-08-22 22:23:16 +01:00
Sam Lord
a48b4e5cbf Added integrity token API & middleware for magic link requests
ref KTLO-1
Back-end implementation of request integrity tokens. The purpose here
is to prevent simple web bots from spamming the signup form.
2024-08-22 22:23:16 +01:00
Steve Larson
0053939185
Improved email analytics jobs system (#20809)
ref https://linear.app/tryghost/issue/ENG-952
- added persistence to the job timestamps

This set of changes reduces the potential for gaps in our email event
processing by adding persistence to the job timestamps. This avoids
expensive queries on the `email_recipients` table after every boot, and
reduces reliance on fallbacks in periods of heavy processing or reboot.

This is our first use of the jobs table to create a persistent line,
instead of its initial use case of single-run jobs. We may expand this
capability and move to use of the jobs model over knex.raw in order to
make this a bit friendlier.

Note: this works with sqlite but datetimes are stored as ints. It still
works fine. https://github.com/knex/knex/pull/5272
2024-08-22 15:20:42 -05:00
Steve Larson
827518c98b
🐛 Fixed shift selection in the posts list (#20818)
ref https://linear.app/tryghost/issue/ENG-1489/

The changes to improve posts loading in admin broke the shift selection
functionality. This restores that, as we need to be able to crawl across
the (now) three models when present.
2024-08-22 13:15:06 -05:00
Daniël van der Winden
7c992825ed
Publish modal updates (#20817)
The new modal for the updated publishing flow has an entirely new
layout, based on feedback previously received. In addition, this PR
includes a few tweaks to the underlying logic.
2024-08-22 14:49:29 +00:00
Steve Larson
cd7c27d3ad
🐛 Fixed fetching labels and offers in the editor (#20815)
ref https://linear.app/tryghost/issue/ONC-263/
- labels dropdown in sign up card was not successfully fetching labels
- offers dropdown suffered the same fate

When introducing the second editor instance, it appears we ran into some
race conditions with the Ember tasks used to fetch the resources. The
init instance was beating the other to the punch, and so the state was
never successfully updated, as it is only fetched once on mounting the
card.
2024-08-22 08:55:33 -05:00
Princi Vershwal
f984fbd47e
🎨 Improved the performance of the /members/events/ aggregated_click_event endpoint (#20790)
Ref https://linear.app/tryghost/issue/ONC-216/improve-the-performance-of-the-membersevents-aggregated-click-event
2024-08-22 18:26:10 +05:30
Ronald Langeveld
f2206fb232
Added one-time payments under "payments" for filtering (#20807)
ref PLG-153

- Scoped one-time payments (`donation_event`) under the "payments"
category in the member activity feed filter.
- Updated `toggleEventType` logic to ensure that toggling "payments"
also toggles one-time payments when the `tipsAndDonations` feature is
enabled.
- Refactored event type handling into utility functions for easier
testing.
- Added unit tests for the new utility functions to ensure correct
behaviour.
- Added acceptance testing.
2024-08-22 10:26:46 +00:00
Ronald Langeveld
ad3751bfa6
Added i18n support to tips and donations on portal (#20812)
ref PLG-159

- wrapped strings inside the translate function in Portal
- added new strings to i18n files
2024-08-22 15:28:08 +07:00
Princi Vershwal
309cb37cc6
Updated nql package (#20811)
Ref [ONC-216](https://linear.app/tryghost/issue/ONC-216/improve-the-performance-of-the-membersevents-aggregated-click-event)

Needed changes in nql package for this task.
2024-08-22 07:55:14 +00:00
Chris Raible
6d46dc26c7
🔒 Fixed admin forms defaulting to GET method (#20810)
ref
https://linear.app/tryghost/issue/ENG-1497/admin-signin-signup-and-setup-forms-default-to-get

- If method is not specified, the form will default to GET, which is
incorrect
- This commit sets the method to POST and action to javascript:void(0)
to prevent the form from submitting via GET if JavaScript is disabled or
not fully loaded yet
2024-08-21 15:49:52 -07:00
Chris Raible
c0471f0c28
🐛 Fixed frontend routing prioritizing collections over built in routes (#20765)
ref
https://linear.app/tryghost/issue/ONC-242/frontend-routing-prioritizes-collections-over-taxonomies

- Under a fairly specific edge case with a collection route that conflicts with a default, built-in route ("taxonomy" — like tags, authors, etc), the frontend routing would prioritize the collection over the taxonomy.

- For example, with the following in a custom `routes.yaml`:
```
collections:
  /:
    permalink: /{primary_tag}/{slug}/
    template: index
```

If a post exists with the same slug as its primary tag's slug, the frontend routing would redirect the `/tag/{slug}/` route to the post in the collection, rather than serving the tag itself.

- This commit changes that, so if a collection's route conflicts with e.g. a `/tag/{slug}/` default route, Ghost will still return the built in route, rather than the collection.
2024-08-21 13:45:59 -07:00
Kevin Ansfield
b01d4287ad Fixed Admin test failures when running in Safari
no issue

- Safari's `innerText` sometimes includes a trailing `\n` depending on the markup used so we need to use `.to.have.rendered.trimmed.text()`
- reproducible when running tests via http://localhost:4200/tests (we don't yet run in Safari via our testem config)
2024-08-21 12:58:11 +01:00
Kevin Ansfield
fc501add94 Fixed editor not loading in Admin acceptance tests
closes https://linear.app/tryghost/issue/PLG-176

The editor files were previously stubbed for testing because we didn't have a way to load the externally-hosted files. This made testing slow and difficult because the only way to test the Admin integration was via Ghost's e2e browser tests.

- unstubbed the editor globals so `fetchKoenigLexical()` actually tries to import the external assets
- updated `ember-cli-build` to copy the Koenig UMD file over to the assets directory in development/test builds
- updated `environment.js` to set the required filename for the default asset import to successfully hit the test environment hosted files
- updated lexical editor acceptance tests to demonstrate the editor loads successfully for new and existing posts
2024-08-21 11:49:05 +01:00
Ghost CI
2627dd6aa0 Merged v5.89.6 into main 2024-08-21 09:58:53 +00:00
Ghost CI
1456fc2b03 v5.89.6 2024-08-21 09:58:51 +00:00
Ronald Langeveld
27ff27ce76 🐛 Fixed editor performance issues in Safari for posts with HTML or Markdown cards (#20806)
ref https://linear.app/tryghost/issue/ONC-261

- Previous method of hiding the second Lexical instance using `width:
0`, `height: 0`, and `overflow: hidden` caused CPU usage to spike,
likely due to CodeMirror continuously processing the element.
2024-08-21 16:48:37 +07:00
Ronald Langeveld
3645fd8a5c
🐛 Fixed editor performance issues in Safari for posts with HTML or Markdown cards (#20806)
ref https://linear.app/tryghost/issue/ONC-261

- Previous method of hiding the second Lexical instance using `width:
0`, `height: 0`, and `overflow: hidden` caused CPU usage to spike,
likely due to CodeMirror continuously processing the element.
2024-08-21 09:42:22 +00:00
Steve Larson
54b0b87633
Added additional tests for email analytics (#20805)
ref 4267ff9
- unit tests didn't cover what events were passed along to be fetched,
important now that it's split out
2024-08-20 23:30:54 +00:00
Steve Larson
3c9b8d682d
Fixed handling of await (#20804)
ref 8e1f552
2024-08-20 19:23:27 +00:00
Steve Larson
8e1f5529c7
Fixed value destructuring for null values (#20803)
ref 4267ff9

Found while testing other code. Appears to fail destructuring which
prevents the job from running.
2024-08-20 14:04:35 -05:00
Steve Larson
4267ff9be6
Updated email analytics job to prioritize open events (#20800)
ref https://linear.app/tryghost/issue/ENG-1477
- updated email analytics job to prioritize open events
- put limits on non-open event fetching
- updated job to now restart itself until processing is at a
sufficiently low volume

Previously the EmailAnalytics job would process all event data equally.
When there's sufficient recipients (>20k), we could see delays in the
open rate data in Admin because of all the delivered events being
processed. Open events are far more important to users, so we've now
prioritized processing those events before any others.

Processing of events shouldn't be any faster or slower with this as this
doesn't change throughput, just order.

NOTE: Use the mailgun-mock-server in TryGhost/Toolbox for testing.
2024-08-20 17:25:01 +00:00
Steve Larson
2f36d6a4de
Fixed email integration tests (#20799)
ref dac2561

Among the mess of GH forks, it seems a few commits got lost patching up
these tests.
2024-08-20 15:12:53 +00:00
Ghost CI
5effca4c5e Merged v5.89.5 into main 2024-08-20 14:33:31 +00:00
Ghost CI
eecd79a875 v5.89.5 2024-08-20 14:33:30 +00:00
Steve Larson
dac2561252
🔒 Added uuid verification to member endpoints not requiring a session
ref https://linear.app/tryghost/issue/ENG-1364
ref https://linear.app/tryghost/issue/ENG-1464

- credits to https://github.com/1337Nerd
- added a hashed value to endpoints that do not require a member sign in in order to verify the source of the link and resulting request
- added redirect to sign in page when trying to access newsletter
management
2024-08-20 16:24:02 +02:00
Sodbileg Gansukh
6413a30c35
Fixed missing stats on the analytics screen (#20797)
ref DES-716
2024-08-20 12:58:36 +00:00
Sodbileg Gansukh
9b41307a76
Replaced refresh button with a GhTaskButton (#20796)
ref DES-705
2024-08-20 20:06:12 +08:00
Sodbileg Gansukh
a8dc689823
Improved publish flow transition (#20794)
ref DES-697

- used client side navigation on the flow instead of hard refresh
- reduced layout shift on the analytics screen
- made the modal transition a bit smoother
2024-08-20 20:04:44 +08:00
Kevin Ansfield
d3c2c7b369 Updated donations browser tests for new default suggested value
ref https://github.com/TryGhost/Ghost/pull/20793

- now that there's a non-zero suggested value amount Stripe's UI shows a button to change the amount rather than showing the amount input field immediately
- added extra click to the tests and an expectation that the default value is set correctly
2024-08-20 12:43:02 +01:00
Kevin Ansfield
0b3f7d7705 Updated tips & donations default suggested value
closes https://linear.app/tryghost/issue/PLG-156

- updated all default fixtures to use `500` ($5) as the default suggested donation value
- added migration to update existing settings using the old default of `0` to `500`
  - this is fine to apply because the feature hasn't been released so there's no explicit `0` values in the wild
- added an acceptance test for the adminx-settings tips & donations section
2024-08-20 12:07:51 +01:00
Sodbileg Gansukh
5cce46e851
Share button improvements on publish flow modal (#20791)
ref DES-684

- switched social links from buttons to regular links 
- added post title to share links
2024-08-20 17:33:40 +08:00
Sodbileg Gansukh
cc545b55b0
Added default background and font styles to cards (#20676)
ref DES-609

- On top of bookmark card, this update adds default background color and font to file, audio, and product cards
- The main purpose of this is keeping embedded look across these cards consistencly regardless of the theme background color and default font
- Themes can still override the styles
2024-08-20 16:46:47 +08:00
Ghost CI
0a2f2adefd Merged v5.89.4 into main 2024-08-20 07:55:48 +00:00
Ghost CI
beb70e9c11 v5.89.4 2024-08-20 07:55:46 +00:00
Steve Larson
ad9aa47400
Added Sentry message logging for generating magic links (#20789)
ref https://linear.app/tryghost/issue/ONC-258
2024-08-20 08:38:12 +01:00
Kevin Ansfield
19b8674c3a
Fixed excerpt blur saving non-draft posts
ref https://linear.app/tryghost/issue/PLG-174

- forcing autosave on excerpt blur caused posts to revert to `draft` and save immediately even when they were published/scheduled
- updated the save-on-excerpt-blur to only autosave drafts
- added acceptance tests for title and excerpt change+blur on published posts
2024-08-20 08:38:06 +01:00
Kevin Ansfield
d6df261446
🐛 Fixed editor unsaved changes modal showing too often (#20787)
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) 
ref [ONC-253](https://linear.app/tryghost/issue/ONC-253/)
ref [PLG-174](https://linear.app/tryghost/issue/PLG-174/)

- restored the original but reverted fix for unsaved changes modal from https://github.com/TryGhost/Ghost/pull/20687
- updated code to remove some incorrect early-falsy-return logic in `editorController.hasDirtyAttributes` that prevented save of unsaved changes on the underlying model (e.g. excerpt)
- updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
- added acceptance tests to ensure autosave is working for title and excerpt fields

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-08-20 08:37:57 +01:00
Kevin Ansfield
b6582e6623
Updated Admin editor unit tests to use real model instances
ref https://linear.app/tryghost/issue/PLG-176

- we recently had to revert code because it caused unexpected problems despite the unit tests passing
- the setup for the editor unit tests was very basic and did not represent the real world because it tested a simple EmberObject instance rather than an Ember Model instance meaning the tests weren't covering the real code paths
- updated the unit test with a more realistic environment ready for re-working the reverted code+tests
2024-08-20 08:37:49 +01:00
Kevin Ansfield
25c31c31c9
🐛 Fixed autosave not triggering when in-editor excerpt is changed (#20785)
ref https://linear.app/tryghost/issue/PLG-174

- added `blur` handler to excerpt field so it acts the same as the title field and triggers a save when it loses focus
2024-08-20 08:37:41 +01:00