Commit Graph

39447 Commits

Author SHA1 Message Date
renovate[bot]
9834f0946c Update dependency nx to v19.8.3 2024-10-02 08:38:19 +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
Steve Larson
49debef3da
🌐 Updated Portal error handling to be i18n-friendly (#21176)
no ref
- Portal was not set up in a way to allow for easy use of the i18n
module for errors, as they weren't a React component
- moved away from the class model to a functional component that could
utilize React state (AppContext)

I'm working on a different refactor that would convert more of Portal to
hooks & functional components so that the codebase is more consistent
and easier to read. This will have to work for the moment while that is
being done, as that's no small task.
2024-10-01 21:19:09 +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
Cathy Sarisky
6e599ef541
🌐 Added ⬅️RTL to sodo-search & improved tests (#21152)
no ref

- added dir prop, calculated by i18next from language (using the dir
function)
- tweaked a few styles to use me/ms/pe/ps instead of mr/ml/pr/pl
- added updated test that checks that stemming works in English, and added tests for partial and full-word searching with RTL content.
2024-10-01 18:04:54 +00:00
ココロ
300eba49ca
🌐 Improved sodo-search for CJK (#21148)
no ref

According to the flexsearch documentation, https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#cjk-word-break-chinese-japanese-korean for searching CJK text, need to pass in a custom encode function for better search results.

This enhancement for CJK will only take effect when the ghost site locale is set to one of `zh`, `zh-Hans`, `zh-Hant`, `ja`, `ko`.

Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2024-10-01 18:01:54 +00: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
renovate[bot]
e2d20d5c49 Update tiptap monorepo to v2.8.0 2024-09-30 16:05:32 +00: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
Daniel Lockyer
c58cbe4fb9 Bumped CI fetch-depth to 1000
refs https://ghost.slack.com/archives/C02G9E68C/p1727704490753759

- if you open a PR and it becomes outdated enough such that the base
  commit was 100 commits ago, the workflow starts to fail
- to help prevent this, we can increase it by 1000, which should more
  than cover enough use-cases but still keep checkout quick
2024-09-30 16:11:47 +02:00
Michael Barrett
8fa9fb9c25
Updated search to be dynamic in admin-x-activitypub app (#21099)
refs
[AP-352](https://linear.app/tryghost/issue/AP-352/search-for-mastodon-usernames-in-ghost-admin)

Updated the search functionality in the admin-x-activitypub app to be
dynamic and utilise the search API endpoint provided by the activitypub
service

---------

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2024-09-30 11:32:05 +01:00
Daniel Lockyer
e2bf950b63 Removed unused @sentry/tracing dependency
- this isn't used anywhere so we can remove it and cleanup a dependency
2024-09-30 11:05:22 +02: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
Daniel Lockyer
607dee288b Cleaned up branch triggers
- we don't use `arch` anymore, and `2.x` and `3.x` are ollldddddd, so
  we're not going to run CI on them
2024-09-30 09:38:28 +02:00
Daniel Lockyer
d86f94db2d Fixed looking up users with special username characters
- users like `renovate[bot]` have brackets in the username
- this breaks the command and it exits with `exit code 3.`
- to fix this, we can encode the username before passing it in
2024-09-30 09:38:28 +02:00
renovate[bot]
b4f2e03ae2 Update dependency nx to v19.8.2 2024-09-30 09:10:20 +02: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
Daniel Lockyer
75afbb4f2a Added missing if-statement to CI workflow
- without this, we're constantly purging the cache, which exceeds the
  rate limit afforded to us from jsdelivr
2024-09-26 19:51:07 +02:00
Kevin Ansfield
26f429be78 Shipped comments-ui@0.18.3 2024-09-26 17:56:28 +01:00
Sanne de Vries
5a251b5cac
Fixed comment form visual issues (#21138)
REF PLG-225
- When editing a comment, the form was not aligned correctly.
- The form has more height by default now even when not focused, to
increase engagement.
2024-09-26 18:35:01 +02:00
Fabien O'Carroll
146e702d93 Updated @tryghost/admin-x-activitypub to 0.1.0
This will test the release when we merge to main
2024-09-26 23:24:26 +07:00
Fabien O'Carroll
5f637af3cf Added workflow for deploying @tryghost/admin-x-activitypub
ref https://linear.app/tryghost/issue/AP-438

This will build and release the Admin X activitypub app when we bumb the
package.json version and push to `main`
2024-09-26 23:24:26 +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
Fabien O'Carroll
d9a2b0e3a6 Removed private flag
This is necessary so that we can publish to npm
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
Daniel Lockyer
f19c01a11f Added workflow changes to support PR deploys to staging
ref https://linear.app/tryghost/issue/DEV-31/staging-deploys-of-feature-branchesprs

- we want the ability to ship a PR to staging, so we can test and QA
  without merging to `main`
- most of the infrastructure is already in place for this, so it's
  mostly a case of wiring it all up
- this commit will send a slightly different payload to the build
  process, to indicate it's coming from a PR
- I've also added a check that the user is a member of the org, so we
  don't get random builds from non-members
- to trigger this, we should be able to add the `deploy-to-staging`
  label and it Just Works :TM:
2024-09-26 15:38:35 +02:00