Commit Graph

12433 Commits

Author SHA1 Message Date
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]
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
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
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
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
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
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
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
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
ba74785250
Added comment improvements feature flag (#20986)
ref PLG-229

- Added `commentImprovements` feature flag toggle
2024-09-12 14:49:22 +09: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
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
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
Ghost CI
18cc8dc7fb v5.94.0 2024-09-06 15:05:07 +00: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
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
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
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
Ghost CI
fb0f7d284a v5.93.0 2024-09-03 20:25:25 +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