Commit Graph

617 Commits

Author SHA1 Message Date
Sag
98b51b666d
Fixed ember concurrency cancellation errors (#20324)
fixes https://linear.app/tryghost/issue/SLO-121
fixes https://linear.app/tryghost/issue/SLO-138
fixes https://linear.app/tryghost/issue/SLO-139
fixes https://linear.app/tryghost/issue/SLO-140
fixes https://linear.app/tryghost/issue/SLO-141
fixes https://linear.app/tryghost/issue/SLO-142

- ember-concurrency prevents two executions of the same task from
running at the same time
- when a task is cancelled, the library raises an error by default
- however, we don't need to surface that error as the cancellation of
the second execution is intentional
2024-06-04 16:20:49 +02:00
Sag
7617759ae6
Added Sentry Session Replay in Ghost Admin (2/2) (#20263)
ref https://linear.app/tryghost/issue/SLO-128

- Sentry will record session replays when errors happen in Admin (Settings, Editor) to facilitate debugging
- The recorded sessions mask sensitive information (input fields, media items, content in the editor, metrics in the dashboard)
2024-05-28 17:25:38 +02:00
Sag
ed0a76e985
Added Sentry Session Replay for in Ghost Admin (#20255)
refs
https://linear.app/tryghost/issue/SLO-128/enable-sentry-replay-in-admin-adminx-editor

- this option lets us replay a session in Sentry when an error happens
2024-05-27 12:59:43 +00:00
Kevin Ansfield
40ee2043e0
Reduced Admin search re-indexes (#20154)
closes https://linear.app/tryghost/issue/MOM-97

The 30s search content expiry didn't really make sense and caused unnecessary delays and server load now that search will be more widely used within the editor.

- replaced concept of time-based expiry with explicit expiry
  - content still fetched on query if not already loaded or marked as stale
  - added `.expireContent()` method on search service to allow explicit expiry
- updated editor to pre-fetch search content when not already loaded or marked as stale
  - removes delay when first using internal linking search inside the editor
- updated post model to expire search content on save
  - expires on published post save or delete
  - expires on publish and unpublish
- updated tag model to expire content on create/save/delete
  - only expires when name or url is changed
- updated user model to expire on save/delete
  - only expires when name or url is changed
  - does not handle creation because that's done server-side via invites
2024-05-07 15:24:20 +01:00
Djordje Vlaisavljevic
7a3bbfde10
Added ActivityPub playground (#20081)
ref MOM61

- Adds admin-x react app we’ll use as ActivityPub playground to the
sidebar nav behind the feature flag.
- Wired up routing to Ember
- Setup the project as `admin-x-activitypub`

---------

Co-authored-by: Ronald Langeveld <hi@ronaldlangeveld.com>
2024-04-25 16:44:29 +08:00
Kevin Ansfield
2332f339dc
Fixed setup/done screen showing 500 when not authenticated (#19973)
closes https://linear.app/tryghost/issue/IPC-136/setupdone-route-500s-if-you-hit-it-from-a-logged-out-state-instead-of

- the setup/done route was not set up as an authenticated route so no redirect occurred when accessing it directly before logging in which in turn caused an error because the route tries to read from the session user
2024-04-02 16:43:44 +00:00
Kevin Ansfield
5cb85ff58f
Replaced setup/done screen with onboarding checklist (#19952)
part of https://linear.app/tryghost/issue/IPC-81/remove-setupdone-screen-from-signup-flow

- when the `onboardingChecklist` flag is enabled the `setup/done` screen shown after install or signup will initiate the onboarding checklist and redirect straight to the dashboard effectively replacing the previous onboarding flow
2024-03-28 16:10:59 +00:00
Chris Raible
59076d1bca
Reverted "Fixed PostHog toolbar in admin (#19675)" (#19680)
This reverts commit c32ee3ca40.

- I found another way to fix this, making this change unnecessary
2024-02-08 16:58:46 -08:00
Chris Raible
c32ee3ca40
Fixed PostHog toolbar in admin (#19675)
refs PA-32

- The PostHog toolbar relies on a value that is passed via a hash in the
URL to launch successfully
- Admin overwrites the hash (since it uses hash based routing) before
the toolbar has a chance to read the value
- This change checks for the hash and if it exists, it launches the
toolbar using the hash value
2024-02-08 13:40:03 -08:00
Ronald Langeveld
0c95111f8e
🎨 Admin X - Offers (#19520)
no issue

- Offers rebuilt in React and now located in Settings.
2024-01-25 12:41:54 +00:00
Daniel Lockyer
57c5f92770 Reverted "🎨 Added Offers to the new Settings (#19493)"
This reverts commit c7d7b883cc.
2024-01-18 15:04:59 +01:00
Ronald Langeveld
c7d7b883cc
🎨 Added Offers to the new Settings (#19493)
no issue

- Removes flags for the new Offers in Admin X (Settings)
- Removes old Offers from the sidebar.
- See a new version of Offers in Settings. 🎨
2024-01-18 12:56:08 +00:00
Kevin Ansfield
46d6c56763
Added ResizeObserver loop error to Sentry ignore list (#19440)
closes https://github.com/TryGhost/Product/issues/4238

- the error often comes from extensions that we can't control and doesn't correspond to anything being broken so it's just noise
2024-01-04 10:50:15 +00:00
Chris Raible
a97e2b823e
Added error handling to Sentry's beforeSend (#19109)
refs TryGhost/Product#4175

- Added error handling to Sentry's beforeSend function in both Admin and
Core, so if there is any error in beforeSend, we will still send the
unmodified event to Sentry
- This is in response to an incident yesterday wherein the beforeSend
function threw an error due to an unexpected missing value in the
exception. The event sent to Sentry was the error in the beforeSend
function, and the original error never reached Sentry.
- If the original event had reached Sentry, even if unmodified by the
logic in beforeSend, we could have been alerted to the issue sooner and
more easily identified all affected sites.
- Also added defensive logic to protect for certain values in the
exception passed to beforeSend not existing and added unit tests for the
beforeSend function in admin and core
2023-11-23 02:46:50 +00:00
Jono M
a93c665d20
Created a skeleton AdminX demo app (#19005)
refs https://github.com/TryGhost/Product/issues/4152

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset)
Generated by Copilot at a28462f</samp>

This pull request adds a new admin-x app called `admin-x-demo`, which
demonstrates how to use the shared packages `admin-x-framework` and
`admin-x-design-system` to create a simple app that renders a button and
a modal. It also improves the development workflow, the vite
integration, the dependency management, and the type checking for the
admin-x apps and packages. It modifies some files in the
`admin-x-framework` and `admin-x-design-system` packages to make the
modals prop optional, to introduce a new type for the props from the
Ember app, to fix the z-index of the modal backdrop, and to use
consistent file extensions and module syntax.
2023-11-20 13:30:15 +00:00
Chris Raible
c0e39affd0
Masked post and page IDs in Ember Data errors (#19035)
no issue

- The standard error message from Ember Data includes post/page ids in
the error message
- This causes Sentry to treat each instance as a unique issue and
results in many duplicate issues for the same error
- This change should mask the ids and allow Sentry to group the errors
correctly
2023-11-16 14:34:23 -08:00
Chris Raible
d6c5ce3d02
Fixed Sentry ajax error tags (#19034)
no issue

- Fixed an issue where the ajax_url tag was exceeding the allowed length
of tags in Sentry
- Fixed the mechanism for deleting the ajax tags when the error is not
an ajax error
- Removed the isAjaxError tag, since we can use the other ajax tags to
filter for ajax errors now
2023-11-16 12:27:07 -08:00
Chris Raible
2d8abb70ec
Removed RewriteFrames Sentry integration from admin (#19007)
refs
5f7c7a82dc

- The goal of the RewriteFrames plugin was to remove version identifiers
from the stack traces sent to Sentry, to improve the stack trace
grouping. That sort of worked, but it ended up breaking the sourcemaps
so the stack traces were ugly and hard to read within Sentry.
- This change removes the RewriteFrames plugin to fix the stack traces
again. Instead, planning to use Sentry's stack trace rules built into
the UI to fix the grouping.
2023-11-15 18:37:13 -08:00
Chris Raible
5f7c7a82dc
Added RewriteFrames integration to Admin Sentry (#18969)
no issue

- Currently our stack traces in Production include the admin build
version in the paths, e.g. `/admin/1633/assets` instead of
`admin/assets`
- This confuses the error grouping logic in Sentry, resulting in many
duplicate issues being created every time we release a new version of
admin
- Ultimately, this makes it really difficult to determine if a 'New'
issue in Sentry is actually new, or if it's just the first time we've
seen it in this release.
- This commit adds the `RewriteFrames` integration to the Admin Sentry
client, which will strip the build version from the paths in the stack
traces, and allow Sentry to group issues correctly.
- With this, hopefully we will have far fewer 'New' issues created, so
we can again start alerting on the 'New' condition in Sentry.
2023-11-14 18:16:29 -08:00
Simon Backx
14927ee24b
Added quotes to NQL filters with ids (#18958)
refs https://github.com/TryGhost/Product/issues/4120

Updated some places where we don't add quotes around ids in NQL filters,
which can be an issue when the id is a number
2023-11-13 12:00:20 +01:00
Jono M
e8e0d84d50
Deleted old Ember settings pages (#18740)
refs https://github.com/TryGhost/Product/issues/4055

---

<!-- Leave the line below if you'd like GitHub Copilot to generate a
summary from your commit -->
<!--
copilot:summary
-->
### <samp>🤖 Generated by Copilot at 3b24693</samp>

Removed unused components related to announcement settings, custom theme
settings, and file upload. These components were part of a deprecated
feature or a legacy UI.
2023-11-06 06:46:31 +00:00
Chris Raible
2db24c9282
Removed path tags from Sentry (#18853)
no issues

- The `path` tags added to Sentry events from admin aren't super useful, since they often include e.g. a
post id in the path, which isn't super useful for filtering/grouping
- We already have a `route` tag which can be used to filter to a
particular route, which renders the `path` tags unnecessary
2023-11-02 14:13:38 -07:00
Chris Raible
4ae8fc91fa
Updated AJAX error context sent to Sentry from admin (#18831)
no issues

- Added isAjaxError tag to all errors sent from admin with a true/false
value
- Removed all Ajax context and tags if the error is not an Ajax error
- Updated names of Ajax tags to use camelcase instead of dot notation
2023-11-01 14:48:23 -07:00
Chris Raible
c91527efc8
Improved Sentry logging for AJAX errors in admin (#18829)
no issue

- Currently AJAX errors that surface in Admin get logged to Sentry with
super generic messages like "Error"
- This commit adds more context to the information that's sent to sentry
and should make it easier to identify the error at a glance
2023-11-01 14:03:32 -07:00
Michael Barrett
766374a44a
Prevented handled errors from being sent to Sentry (#18790)
no refs

As part of the reduce Sentry noise work we decided to temporarily
prevent the submission of "handled" errors to Sentry. This is a
temporary measure to reduce noise while we work on improving the quality
of the error reporting / alerting
2023-10-30 16:42:06 +00:00
Chris Raible
32d1cd525d
Added route and path tags to Sentry admin events (#18781)
no issue

- All events sent from Admin should now be tagged with the current route
(e.g. `lexical-editor.edit`) and the path (e.g.
`editor/post/65388d98734d6ecc7bbafb87?test`)
- This will allow us to filter events by route and path in Sentry and
improve our alerting logic
2023-10-26 23:38:11 -07:00
Chris Raible
d2ca5daf9d
Enabled Sentry Debug integration for Admin when in development mode (#18780)
no issue

- This change enables the Debug integration in Sentry when the app is
running in development mode (and Sentry is configured with a valid DSN).
- Whenever an event is sent to Sentry, the event & hint are passed to
the beforeSend() function will be logged to the browser console so you
can quickly see a) when events are sent to Sentry and b) exactly what
data & tags are sent with integration
2023-10-26 20:44:39 -07:00
Chris Raible
3a88027611
Removed RewriteFrames integration from Sentry (#18779)
no issue

- Unfortunately the RewriteFrames plugin was not successful in fixing
the duplicated `/assets/assets` in the Sentry stacktraces for admin
- This commit removes the RewriteFrames plugin and reverts the changes
so there will at least be some kind of source code reaching Sentry
2023-10-26 22:04:48 +00:00
Chris Raible
42ac31a270
Fixed duplicate /assets in Sentry stacktrace filenames (#18777)
no issue

- For whatever reason, our Sentry stack traces are adding an extra
`/assets` to the filenames in stacktraces from admin
- Attempted to fix this
[here](3e9ee16ffb)
but it didn't work because at this point the duplication hasn't occurred
yet
- This change strips the `/assets` segment from the filenames, so when
Sentry adds it back in, it doesn't duplicate anything. Would be good to
get to the bottom of why this is happening, but this should hopefully
improve our stacktraces in Sentry in the meantime.
2023-10-26 13:45:11 -07:00
Chris Raible
f82a3e0245
Added console logs to debug Sentry stack traces in Admin (#18776)
no issue

- Our stack traces in Sentry are pointing to the wrong location for source code files. We attempted to fix this [here](https://github.com/TryGhost/Ghost/pull/18773) but this didn't work as expected in staging for some reason
- This commit just adds a few console logs to help with debugging in staging so we can figure out what's going wrong
2023-10-26 12:11:45 -07:00
Daniel Lockyer
3e9ee16ffb Fixed duplicate assets/ in Sentry stacktrace filenames
fixes https://github.com/TryGhost/DevOps/issues/94

- we've seen in production that some filepaths contain a duplicate
  assets folder, but we're not sure why
- instead of spending too much time trying to figure that out, we can
  just fix that in preprocessing by using the RewriteFrames integration
  in Sentry
- this should remove the duplicate folder from the stacktrace frame, if it exists
2023-10-26 11:55:22 +02:00
Kevin Ansfield
b00388eb34
Cleaned up old re-auth code in editor route/template (#18605)
no issue

- brings the lexical editor in line with the previous editor
2023-10-13 09:13:52 +00:00
Kevin Ansfield
daa36a91b1
Fixed infinite save loop due to missing post_revisions include on saves (#18597)
refs edcd6caf2b
refs 56f2832754

- although we added an include for `post_revisions` when fetching a post for editing we didn't have the same `include` param added to saves meaning our revisions list was wiped from the store on each update
- on leaving the editor we check the last post revision to see if anything has changed and we need to save again, but with it being wiped and not being re-populated on save it meant the check always failed leading to an infinite loop of saves
- updated the posts and pages adapters to use the full includes param on create/update requests so we don't lose what we're trying to compare against
2023-10-12 19:16:45 +00:00
Kevin Ansfield
fa0b1c607b
Deleted all Admin code relating to the old editor (#18580)
no issue

- removed labs flag
- removed main editor component and all associated components
- switched usage of `<KoenigBasicHtmlInput>` and `<KoenigBasicHtmlTextarea>` over to use plain `textarea`, the only uses were in settings modals that have been replaced in AdminX
- cleaned up unused editor CSS
2023-10-12 13:17:39 +01:00
Fabien "egg" O'Carroll
56f2832754 Explicitly set include for posts/pages in editor
We want to remove the post_revisions default include from the API but it's
required for the post history feature in the editor. Because the default include
is only applied when no include is sent, we have to set the entire string,
rather than just the missing post_revision related fields
2023-10-12 13:10:05 +02:00
Peter Zimon
e68db848dc
AdminX: reroute settings-x to settings (#18360)
refs. https://github.com/TryGhost/Product/issues/3949

---------

Co-authored-by: Jono Mingard <reason.koan@gmail.com>
Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2023-10-09 08:12:46 +01:00
Kevin Ansfield
c56bfd51de Fixed posts list hrefs showing "mobiledoc-editor" and added "editor-beta" redirects
no issue

- switched posts list over to using the `lexical-editor.edit` route so it uses the `/editor/` href rather than `/mobiledoc-editor/`
- added redirect handling for the `/editor-beta/*` urls to our generic 404 route so anyone upgrading with the beta URLs still open in tabs or saved won't hit a 404
2023-10-04 14:37:12 +01:00
Daniel Lockyer
639be25f1d Updated Koenig-Lexical bundling
refs https://github.com/TryGhost/DevOps/issues/83

- this will now continue use the dev server assets if we tell it to,
  or copy the dependency package files to the built folder otherwise
- removes `editor` from config API because it's no longer needed
- removes dependency on `editor.url` in tests, as this no longer exists
- edits dev script to pass dev server URL as env var
- adds `@tryghost/koenig-lexical` dependency to Admin
2023-10-04 12:50:21 +02:00
Daniel Lockyer
f705dda314 Updated Admin-X bundling process
refs https://github.com/TryGhost/DevOps/issues/80

- as part of moving Admin-X-Setting towards GA, we want to change it from
  loading the settings externally via a CDN, to bundling it in with
  Admin
- the bulk of the changes here are removing the config in Ghost, setting
  up the copy to the Admin assets dir, and loading the new path in Admin
- several other changes have come along the way as I've cleaned up
  unneeded code
2023-09-19 11:31:55 +02:00
Jono M
cb6a8ff6df
Removed redirect for editors accessing AdminX (#18111)
refs https://github.com/TryGhost/Product/issues/3832

Removed redundant code from `settings-x.js` since we now display the
settings page correctly for editors.
2023-09-13 14:04:58 +01:00
Jono M
acae53d9ed
Updated AdminX to be preloaded to improve perceived speed (#18059)
refs https://github.com/TryGhost/Product/issues/3832
2023-09-11 10:55:12 +01:00
Kevin Ansfield
a4f6a33fee
Fixed "new post" button showing 500 error when editor beta is enabled (#17926)
refs https://github.com/TryGhost/Ghost/pull/17876

- the redirect added for the beta editor was always redirecting to `lexical-editor.edit` even when accessing `editor.new` which resulted in an incorrect route params error and a 500 screen
- switched to redirecting to the correct new/edit route based on the route we're trying to access
2023-09-01 13:31:40 +00:00
Kevin Ansfield
5f5ad4d5dd
Added automatic conversion of old content when opening in beta editor (#17876)
no issue

Previously the beta editor only worked for newly created posts/pages, any older content would open with the original editor. This change enables automatic conversion of old content to the new content format when a post/page is opened in the admin interface allowing new features like signup and advanced header cards to be used on existing content.

- removed `convertToLexical` feature flag
  - where necessary switched to using just the `lexicalEditor` feature flag in its place
- moved the "L"/"M" indicators on the posts list to a new `lexicalIndicators` feature flag to make debugging/development easier
- added a redirect to the original editor route so that any route to opening the editor (such as the `/edit` front-end shortcut, or other areas of Admin) will open in the beta editor
  - avoids confusing/inconsistent behavior
2023-08-30 16:54:03 +01:00
Aileen Nowak
ec14f78ba3 Removed usage of did-insert hook and simplified openExploreWindow method
- We don't actually utilise the history handling for Explore, as it's not a full screen modal and therefore don't need passing in previous routes before opening the iframe
- Removed usage of `did-insert` livecycle hook and reverted to usage of `contructor` and `willDestroy` instead to add and remove message event listener
2023-08-11 10:47:47 +01:00
Aileen Nowak
a72dfdddb7 Prevented Explore iframe to be loading before needed
no issue

- We were loading the Explore iframe together with all assets in Admin
- This change will avoid that and only start loading and rendering Explore, once it's clicked
2023-08-11 10:47:47 +01:00
Chris Raible
9ea4fbd7a7
Added feature to convert and open mobiledoc posts in the lexical editor (#17453)
refs TryGhost/Product#3638

- Added `convert_to_lexical` flag to the posts/pages edit endpoint
- Added 'convertToLexical' feature flag so we can enable/disable this
feature independently from the main lexical beta flag
- Modified admin posts/pages list to point to the lexical editor for
_all_ posts, regardless of mobiledoc vs lexical (if the flag is on)
- Added call to edit endpoint with `convert_to_lexical` in the lexical
editor admin route if the page/post is currently in mobiledoc and the
flag is enabled
2023-08-08 15:44:54 -07:00
Naz
baf0f4b692 Added /collections/slug/:slug Admin API endpoint
closes https://github.com/TryGhost/Arch/issues/45

- This endpoint is here to keep the convention of being able to fetch the resource by it's slug through a `GET /{resource_name}/slug/:slug`. It has identical output as the `GET /collections/:id` endpoint
- The alternative would be having an alias and try fetching by :id and then by slug if the result for id was null, but that would be a completely new pattern we have not used anywhere else yet.
2023-07-24 14:27:17 +08:00
Daniel Lockyer
46422d7bae Reverted "Enabled Sentry Replay within Admin"
refs https://ghost.slack.com/archives/C02G9E68C/p1689599266267649

- this reverts commit bb6deda10e
- we're seeing some weird errors when Admin boots otherwise
2023-07-17 15:31:25 +02:00
Jono M
9dd2489000
Fixed bugs with AdminX navigation settings (#17340)
refs https://github.com/TryGhost/Product/issues/3433

- Removed Ember dirty state from AdminX to prevent extra popups
- Fixed incorrect navigation popup new item errors
2023-07-13 01:12:31 +00:00
Daniel Lockyer
bb6deda10e Enabled Sentry Replay within Admin
fixes https://github.com/TryGhost/DevOps/issues/44

- this enables Sentry Replay within Admin, so we're able to debug errors
  and bugs easier
2023-07-11 10:32:08 +02:00