Commit Graph

39875 Commits

Author SHA1 Message Date
Hannah Wolfe
fe2cff4e1d
Moved search i18n behind labs flag (#21488)
- When we added i18n for search we missed gating it behind the i18n flag. 
- There aren't that many translations for search yet, so it's likely not many have noticed yet
- We'll remove the flag soon, but until then, adding the flag for consistency :)
2024-10-31 16:36:44 +00:00
Michael Barrett
3ecfe08e1d
Added failure state for reply in admin-x-activitypub (#21487)
no refs

Added a failure state for when a reply fails to be sent
2024-10-31 16:34:53 +00:00
Cathy Sarisky
f601ab3fda
Added "exclude" option for customizing {{ghost_head}} (#21229)
no ref

{{ghost_head}} is huge, and some power-users and theme creators want the
ability to customize what it contains. This PR makes it easier for a
theme to write custom schema, or to load a custom version of
portal/comments/search/etc, or to minimize load times by not loading
scripts where they aren't needed, in a theme-specific way.

Because ghost_head is controlled at the theme level, this gives folks in
managed hosting the new ability to load a different version of the
included app scripts (by preventing ghost_head from writing them and
adding them in manually).

Usage example: ` {{ghost_head exclude="search,portal"}} `

(empty array)
	No changes to current behavior

search
	The built-in sodo-search script
Includes adding the click event listener on buttons, generating the
search index, and the UI.

portal
	The portal script
Handles sign-in and sign-up, payments, tips, memberships, etc, and all
the portal data-attributes.

announcement
	The announcement bar javascript
If you'd like to use the announcement bar admin settings but not have it
[mess up your CLS
metric](https://www.spectralwebservices.com/blog/announcement-bar-a-review/),
this is for you.

metadata
Skips HTML tags for meta description, favicon, canonical url, robots,
referrer
	Important for SEO

schema
	The LD+JSON schema
	Important for SEO

card_assets
	Loads cards.min.css and .js
Needed on any page with a post body, unless your theme replaces them
all. Assets can also be selectively loaded with the [card_assets
override](https://ghost.org/docs/themes/content/?ref=spectralwebservices.com#editor-cards)

comment_counts
	Loads the comment_counts helper
Needed if the page is using {{comments}} or data-ghost-comment-count
attribute

social_data
Produces the og: and twitter: attributes for social media sharing and
previews
	Required for good social media cards

cta_styles
	Removes the call to action (CTA) styles
Used for member signup and CTA cards - may be overwritten by your theme
already
2024-10-31 15:32:34 +00:00
Kevin Ansfield
7e50a4051f Improved error log when Twitter enhanced oembed fails
ref https://linear.app/ghost/issue/ONC-506

- adding `context` with the returned API response makes the logged error much more useful as without it we only log the status code which misses any details for why the failure occurred
2024-10-31 14:21:46 +00:00
Cathy Sarisky
1d429b8b09
🌐Added i18n for newsletter strings (#21433)
no issue

This PR adds the ability to translate the strings that appear in the
newsletter as boilerplate text, using i18next.

Variables are in single mustaches ( `{date}` ) in the translation
strings (rather than `{{date}}`), because these strings occur both the
email template.hbs and also .js files. That necessitated a separate
namespace.

This PR also includes changes to the newsletter button ("more like
this", "less like this", "comment") that were previously delivered on
desktop as images that included the text. @sanne-san provided a rework
that removed text-as-image from the desktop buttons, and allows more
shared code between the two layouts, along with making the buttons
translatable.

Example usage - handlebars
```
<h3 class="latest-posts-header">{{t 'Keep reading'}}</h3>

{{{t 'By {authors}' authors=post.authors }}} 
```
(NOTE: triple { required because of possible & )

Example usage - javascript
```
                getValue: (member) => {
                    if (member.status === 'comped') {
                        return t('complimentary');
                    }
                    if (this.isMemberTrialing(member)) {
                        return t('trialing');
                    }
                    // other possible statuses: t('free'), t('paid') //
                    return t(member.status);
                }
```

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-31 08:41:39 -05:00
Michael Barrett
dd2ed27d9d
Removed unused useAllActivitiesForUser hook and related code in admin-x-activitypub app (#21482)
no refs

Removed unused `useAllActivitiesForUser` hook and related code. This was
a left over from when we added paginated activities
2024-10-31 11:40:41 +00:00
renovate[bot]
085afdeb74 Pin dependency clsx to 2.1.1 2024-10-31 11:02:29 +00:00
Djordje Vlaisavljevic
45711e197c
AP design bugs (#21395)
- Fixed links in profile description
- Stripped post content
- Fixed grey bg in Avatars
- Installed `clsx`

---------

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-10-31 10:50:51 +00:00
renovate[bot]
4f4662490f
Update Koenig packages (#21480) 2024-10-31 10:11:27 +00:00
Djordje Vlaisavljevic
824efc7f10
Added UUID as data attribute to posts in all views (#21470)
ref
https://linear.app/ghost/issue/AP-404/add-uuid-as-a-data-attribute-in-the-dom-for-easier-db-lookup

- This will allow us to find posts in the DB

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-10-31 10:07:52 +00:00
Djordje Vlaisavljevic
becfd13141
Refactored handleViewContent so it can be reused (#21468)
ref
https://linear.app/ghost/issue/AP-540/clicking-comment-icon-on-posts-and-likes-tabs-of-your-profile-doesnt

- We want to open posts in the drawer from multiple views (Inbox,
Profile etc.) and this change allows us to do so by pulling
`handleViewContent` from `Inbox.tsx` into a utility function. At the
same time, we’ve simplified the function so it uses less props to
achieve the same functionality.
- Also added a simple fix for scrolling the reply-box into view when
opening a long `article` by clicking on the reply icon. We probably
still need to figure out a more robust solution, because the height of
the `iframe` and the fact it takes some time to load it sometimes gets
in the way.

Co-authored-by: Michael Barrett <mike@ghost.org>
2024-10-31 09:58:47 +00:00
Michael Barrett
5f59ddaacc
Updated replies implementation to use thread mechanism in admin-x-activitypub (#21465)
refs:

- https://linear.app/ghost/issue/AP-439/seeing-parent-post-for-replies
- https://linear.app/ghost/issue/AP-481/reply-ui
-
https://linear.app/ghost/issue/AP-482/replies-to-a-post-should-be-visible-when-opening-it

Updated the replies implementation to make use of the new thread
mechanism. This allows for a more sane approach to handling replies as
well as making it possible to show the parent of a reply in the UI

---------

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2024-10-31 09:38:52 +00:00
Daniel Lockyer
ea6d3a0f26 ️ Optimized fetching strings from the settings cache
fix https://linear.app/ghost/issue/ENG-1105/settingscacheget-is-slow

- through profiling and flamegraphs, we can see that `_doGet` is one of
  the bottlenecks during high traffic times, sometimes taking up to 20%
  of the CPU time when hammering Ghost with `wrk`
- this is because, for the majority of settings cache lookup, we're
  running `JSON.parse`, which blocks the main thread
- whilst we're only parsing small strings, we're doing it a LOT,
  sometimes hundreds of times per request, which adds up
- this code just throws most deserializing at `JSON.parse`, so if we can
  stop it from doing that, it'd be a huge win
- my initial attempts here were to convert the _doGet function to a
  smarter deserializing, by looking up `cacheEntry.type` and acting
  accordingly
- however, it became a bit of a logical nightmare, and difficult to
  reason about for now (i still think we should do it)
- therefore, I'm just doing to add a hotpath fix to catch 99% of
  usecases, which is checking the type of the cache entry and returning
  the value if it's a string
- on a trivial benchmark locally, this causes Ghost to return 30% more
  requests per second!!
2024-10-31 10:13:10 +01:00
Sodbileg Gansukh
fa31176621
Removed Prata font (#21478)
ref DES-926
2024-10-31 05:43:39 +00:00
Sodbileg Gansukh
e01b952ed2
Made the tabs sticky in design and newsletter settings (#21477)
ref DES-927, DES-928
2024-10-31 13:30:25 +08:00
Ronald Langeveld
87e24f6403
Revert "Enhanced Comments Ordering for Best Liked Sorting (#21473)" (#21475)
This reverts commit fd18a39238.
2024-10-31 03:28:44 +00:00
Ronald Langeveld
fd18a39238
Enhanced Comments Ordering for Best Liked Sorting (#21473)
ref PLG-220

- Improved `getBestComments` service to paginate correctly since we're
using a custom query to determine the top comments that goes beyond the
scope of what `findPage` is capable of.
- Updated CommentsController and CommentsService to support custom order
parameters.
- Added tests
2024-10-31 01:44:15 +00:00
Chris Raible
fe9b01910d
Cleaned up browser test output in CI (#21462)
no issue

- The browser test output in CI is really noisy, because the `NX_DAEMON`
doens't run in CI, but we're trying to use NX to watch and rebuild the
typescript modules. This is outputting a ton of "NX Daemon is not
running" type of errors, which make it difficult to sift through the
actual test results.
- We don't actually need to watch the typescript files, we just need to
build them once before starting. This is defined as an NX dependency for
the browser tests target, so we don't need to explicitly build the TS
packages at all. Removing the typescript watch & build command removes
the noisy errors, without impacting how the tests actually run.
2024-10-30 12:39:41 -07:00
Chris Raible
30fc2f3d50
Added ps dependency to Dockerfile (#21471)
no issue

- When stopping `yarn dev` with ctrl+c in the dev container, you'd get
an error because the container doens't have `ps` installed, which is
used by node under the hood. Adding this dependency fixed the error so
`yarn dev` (and other commands) exit cleanly
2024-10-30 11:56:10 -07:00
matsbst
fbad9f114a
🌐 Added new and improved Norwegian translation (#21452)
- New and improved Norwegian translation. All strings translated.
2024-10-30 15:38:46 +00:00
Steve Larson
97e756ec3b
Bumped Portal and search packages (#21467)
no ref

These had new minors shipped without a bump in Ghost core.
2024-10-30 14:18:06 +00:00
Kevin Ansfield
98c06f8126 Fixed removal of event tracker requests in Sentry
no issue

- filtering was previously added to breadcrumbs but that wasn't enough to clean up Sentry reports
- added filtering to the `beforeSend` hook too so reports don't get cluttered with unhelpful XHR noise
2024-10-30 11:52:50 +00:00
Ronald Langeveld
cca6a38e53
Patched Comments UI v0.20.1 (#21464)
no issue

---------

Co-authored-by: Sanne de Vries <65487235+sanne-san@users.noreply.github.com>
2024-10-30 10:06:11 +00:00
Sanne de Vries
119a913ce5
Fixed comment form being cut off at the top (#21463)
No ref
2024-10-30 08:56:42 +00:00
Chris Raible
d4d45de3de
Added github-cli and some zsh plugins to dev container (#21460)
no issue

- The Dev Container didn't have the Github CLI installed, so this adds
that using Dev Container
"[features](https://containers.dev/implementors/features/)"
- It also adds oh-my-zsh and a few plugins that are nice to have when
developing.
2024-10-29 19:22:58 -07:00
Chris Raible
eb9483abb6
Fixed git remote configuration in dev container (#21459)
no issue

- When creating a dev container, the onCreateCommand script will try to
setup the git remotes according to the environment variables defined for
e.g. `$GHOST_UPSTREAM`. There was a bug that caused the `origin` remote
to successfully be renamed to `$GHOST_UPSTREAM`, but the `origin` remote
was not being created successfully on the first try. This commit fixes
that bug.
2024-10-29 15:21:46 -07:00
Chris Raible
1d24b2c8c0
Added configuration of git remotes to dev container setup (#21458)
no issue

- Added function to Dev Container onCreateCommand to setup git remotes
when creating the Dev Container
- If `$GHOST_UPSTREAM` is set, it will rename the default `origin`
remote to its value
- It will also update the remotes for the submodules, otherwise `yarn
main` will fail
- If `$GHOST_FORK_REMOTE_URL` is set, it will add it as `origin`, or the
value of `$GHOST_FORK_REMOTE_NAME` if set.
- If `$GHOST_FORCE_SSH` is set to `true`, it will change all remotes
URL's to use ssh instead of https
2024-10-29 14:52:44 -07:00
Djordje Vlaisavljevic
c29905155f
Fixed incorrect actor passed from like notifications (#21451)
ref https://linear.app/ghost/issue/AP-541/incorrect-object-loaded-on-like-notifications

- We were passing the wrong `actor` info from `like` notifications. We should be using `activity.object.attributedTo` instead.
2024-10-29 20:55:30 +00:00
Chris Raible
71fb9f8b34
Converted dev container's onCreateCommand to JavaScript (#21457)
no issue

- The onCreateCommand was previously a bash script, which made it a bit
more challenging to read and make changes to it. This commit converts it
to JavaScript so it will be easier to make updates to it.
2024-10-29 13:03:49 -07:00
Kevin Ansfield
856dd1fc2b 🐛 Fixed "Access Denied" error when accepting staff invite
ref https://app.incident.io/ghost/incidents/117

- the authenticate call made as part of signup was missed as part of the update when we adjusted the params for `cookie` authenticator's `authenticate` method in Admin so it could switch behaviour for 2fa
- fixed the authenticate call params and updated our mocked `/session` endpoint to check for expected POST data which would have let tests catch this error
2024-10-29 17:57:13 +00:00
Michael Barrett
28a9a431db
Prevent replies from being shown on profile page in admin-x-activitypub (#21454)
refs
[AP-543](https://linear.app/ghost/issue/AP-543/posts-on-profile-should-not-include-replies)

Filtered the posts on the profile page to only show `Create` activities
that are not replies.
2024-10-29 17:07:01 +00:00
Daniël van der Winden
4a8da45895
Fixed searchbar's X button overlapping with Settings' X button (#21449)
fixes
https://linear.app/ghost/issue/DES-316/adminx-settings-search-overlaps-with-modal-close-x-when-in-mobile-view

Regression, solved by removing an overexcited media query.
2024-10-29 11:03:43 +00:00
Sanne de Vries
456af29607
Fixed avatar initials being broken in comment form (#21448)
REF PLG-248
2024-10-29 10:44:00 +00:00
Djordje Vlaisavljevic
cc8a36cc12
Fixed articles getting cut off in the drawer (#21447)
ref
https://linear.app/ghost/issue/AP-542/articles-are-cut-off-when-viewed-in-sidebar

- We now wait for the content of the iframe to load completely before
determining the height needed to display it
2024-10-29 10:26:27 +00:00
Michael Barrett
e6df621436
Updated ActivityPub collection retrieval to accommodate pagination (#21393)
refs
[AP-526](https://linear.app/ghost/issue/AP-526/implement-pagination-for-fedify-collections)

Updated followers, following, outbox and liked collection retrieval to
accommodate pagination
2024-10-29 09:46:43 +00:00
Sodbileg Gansukh
4b32a3d9c3
Fixed signup card button height (#21446)
ref DES-923
2024-10-29 07:31:29 +00:00
Fabien 'egg' O'Carroll
f8ef2a1cb6
Fixed layout state sync issues (#21443)
refs https://linear.app/ghost/issue/AP-544

useState was still called twice, we should have pulled that out - but
instead passing values down for now
2024-10-29 03:17:57 +00:00
Chris Raible
d0bf80b718
Added from address to Dev Container's auto configuration (#21442)
refs
https://linear.app/ghost/issue/ENG-1686/mail-auto-configuration-doesnt-work

- Previously the `mail` configuration that is auto-generated didn't work
because the `from` address wasn't being set, and requests were
consequently failing due to some Mailgun internal validation.
- This change requires the `MAILGUN_FROM_ADDRESS` environment variable
to be set for it to automatically configure the `mail` block, and if it
is, it adds it as `mail.from`. Now with all three of
`MAILGUN_SMTP_AUTH`, `MAILGUN_SMTP_PASS` and `MAILGUN_FROM_ADDRESS`
setup, transactional emails work out of the box in the Dev Container.
2024-10-28 16:14:04 -07:00
Ghost CI
75948c6d45 Merged v5.98.1 into main 2024-10-28 20:53:37 +00:00
Ghost CI
2c7de4e29a v5.98.1 2024-10-28 20:53:35 +00:00
Steve Larson
00bd31a718 🐛 Fixed malformed unsubscribe_url in members api response (#21437)
no ref
2024-10-28 15:36:05 -05:00
Sodbileg Gansukh
2b2981205e Fixed banner text color in dark mode (#21427)
ref DES-908
2024-10-28 15:35:09 -05:00
Daniël van der Winden
5581695b02
Fixes Members filter falling offscreen on mobile viewports (#21438)
fixes
https://linear.app/ghost/issue/DES-922/members-filter-ui-appears-offscreen-on-mobile

Updated the positioning for the member filter dropdown to work more
accurately on mobile viewports.
2024-10-28 15:24:54 +00:00
Krisztian Kecskes
84966747dd
🌐 Added Hungarian locale for Search (#21428)
no ref

The translation of this was somehow missed in the past, now I've
replaced it.
2024-10-28 15:07:22 +00:00
Steve Larson
f577aafa52
🐛 Fixed malformed unsubscribe_url in members api response (#21437)
no ref
2024-10-28 09:58:09 -05:00
Daniël van der Winden
91e10e2959
Adds a margin between buttons (#21436)
fixes
https://linear.app/ghost/issue/DES-919/missing-space-between-back-button-and-status-indicator-in-editor

The `editor-post-status` needed a margin on its left side.
2024-10-28 14:35:02 +00:00
Kevin Ansfield
bf714ac22f
Fixed some elements overlapping mobile nav (#21431)
closes https://github.com/TryGhost/Ghost/issues/21418

- adjusted z-index for the mobile nav expanded state so elements like
members filters no longer overlap
2024-10-28 13:23:19 +01:00
Fabien 'egg' O'Carroll
d4b1f692ab
Persisted activitypub layout to localstorage
closes https://linear.app/ghost/issue/AP-544

We're releasing this change immediately with v0.3.0
Also cleans up some props for the MainNavigation component.
2024-10-28 18:39:28 +07:00
renovate[bot]
7589b36944 Update dependency nodemailer to v6.9.16 2024-10-28 11:17:18 +00:00
Sodbileg Gansukh
ef4ac66bef
Fixed banner text color in dark mode (#21427)
ref DES-908
2024-10-28 18:36:38 +08:00