Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fixed editor unsaved changes modal showing too often #20787

Merged

Conversation

kevinansfield
Copy link
Member

@kevinansfield kevinansfield commented Aug 19, 2024

ref ENG-661
ref ONC-253
ref PLG-174

  • restored the original but reverted fix for unsaved changes modal from 🐛 Fixed unsaved changes confirmation on Lexical schema change #20687
  • updated code to remove some incorrect early-falsy-return logic in editorController.hasDirtyAttributes that prevented save of unsaved changes on the underlying model (e.g. excerpt)
  • updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
  • added acceptance tests to ensure autosave is working for title and excerpt fields

ronaldlangeveld and others added 3 commits August 19, 2024 16:17
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) ONC-253

- Reverts the revert of
TryGhost@93cbb94
of the intial bug fix.
- Updated hasDirtyAttributes logic to ensure the dirty state changes
when typing a draft, despite not title.
- Updated tests and added tests missing from the hasDirtyAttributes
logic
@github-actions github-actions bot added the affects:admin Anything relating to Ghost Admin label Aug 19, 2024
@kevinansfield kevinansfield changed the title fix excerpt not triggering dirty 🐛 Fixed editor unsaved changes modal showing too often Aug 19, 2024
@kevinansfield kevinansfield enabled auto-merge (squash) August 19, 2024 18:03
@kevinansfield kevinansfield merged commit 887f4d3 into TryGhost:main Aug 19, 2024
22 checks passed
kevinansfield added a commit that referenced this pull request Aug 20, 2024
ref [ENG-661](https://linear.app/tryghost/issue/ENG-661/) 
ref [ONC-253](https://linear.app/tryghost/issue/ONC-253/)
ref [PLG-174](https://linear.app/tryghost/issue/PLG-174/)

- restored the original but reverted fix for unsaved changes modal from #20687
- updated code to remove some incorrect early-falsy-return logic in `editorController.hasDirtyAttributes` that prevented save of unsaved changes on the underlying model (e.g. excerpt)
- updated unit tests so they are testing real post model instances and therefore are testing what we expect them to test
- added acceptance tests to ensure autosave is working for title and excerpt fields

---------

Co-authored-by: Ronald Langeveld <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants