Ghost/ghost/admin/app/components/modals
Steve Larson 59b304dfca
🐛 Fixed editor 'are you sure?' modal displaying when no user changes occurred (#20370)
ref https://linear.app/tryghost/issue/ENG-661
- added a dirty check to ignore the `direction` field from the lexical
object; this is set dynamically and shouldn't be serialized, see
facebook/lexical/issues/4998
- fixed a bug where the modal wouldn't display on leaving the editor if
the post had no revisions (e.g. import); this could result in content
being saved over published content with no user action
- added Sentry logging for the modal

We would sometimes see the "Are you sure?" modal pop up when opening a
post in the editor and attempting to navigate away immediately, without
any changes to the post. This appears to be an issue with the serialized
Lexical data, which would change after loading into the editor,
resulting in the scratch and model's lexical values to differ, making
Admin think the user changed the content.

Ideally we'll see a fix upstream (or fix it ourselves). We may need to
revisit this if we experience other such situations. It's awfully
difficult to be able to set a flag saying 'the editor is done loading',
so this seems to be the best path for the moment.

Testing is difficult because we don't actually load the new Lexical editor into e2e/acceptance tests. I've added a unit test that can at least simulate the editor state changing on editor load.
2024-06-13 11:07:56 -05:00
..
design Deleted old Ember settings pages (#18740) 2023-11-06 06:46:31 +00:00
editor 🐛 Fixed editor 'are you sure?' modal displaying when no user changes occurred (#20370) 2024-06-13 11:07:56 -05:00
limits Deleted old Ember settings pages (#18740) 2023-11-06 06:46:31 +00:00
offers Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
settings Deleted old Ember settings pages (#18740) 2023-11-06 06:46:31 +00:00
confirm-unsaved-changes.hbs Added a preview link in Admin for Tips & Donations (#17711) 2023-08-14 13:33:38 +00:00
custom-view-form.hbs Fixed disappeared button text on custom view modal 2022-09-13 14:56:04 +01:00
custom-view-form.js Resolved deprecation warnings for dynamic modal component binding (#2303) 2022-03-14 10:52:04 +00:00
delete-post.hbs 🐛 Fixed admin error when deleting an unsaved or imported post (#20053) 2024-04-18 10:02:02 -07:00
delete-post.js Resolved deprecation warnings for dynamic modal component binding (#2303) 2022-03-14 10:52:04 +00:00
email-preview.hbs Fixed sender email in the post preview for email (#19211) 2023-11-30 18:22:38 +00:00
email-preview.js 🐛 Fixed blank email previews when opening from member activity feeds (#16207) 2023-02-01 09:52:45 +00:00
new-custom-integration.hbs [chore] adds ember-template-lint and fixes all fixable issues (#2238) 2022-02-02 16:09:43 +00:00
new-custom-integration.js Resolved deprecation warnings for dynamic modal component binding (#2303) 2022-03-14 10:52:04 +00:00
restore-revision.hbs Added Admin acceptance test for post revision restoration 2024-06-04 20:16:19 +01:00
restore-revision.js Renamed subtitle to excerpt (#20334) 2024-06-05 17:59:30 +01:00
search.hbs Generalised Admin search for use in editor (#20011) 2024-04-11 14:01:39 +00:00
search.js Resolved deprecation warnings for dynamic modal component binding (#2303) 2022-03-14 10:52:04 +00:00
whats-new.hbs What's new popup (#20112) 2024-05-21 12:36:28 +02:00
whats-new.js What's new popup (#20112) 2024-05-21 12:36:28 +02:00