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 draft posts not autosaving without title #20774

Merged
merged 5 commits into from
Aug 19, 2024

Conversation

ronaldlangeveld
Copy link
Member

@ronaldlangeveld ronaldlangeveld commented Aug 19, 2024

ref ENG-661 ONC-253

  • Reverts the revert of 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

refs ENG-661

Fixes a long-standing issue where an outdated Lexical schema in the
database triggered the unsaved changes confirmation dialog incorrectly.
Implemented a secondary hidden Lexical instance that loads the state
from the database, renders it, and uses this updated state to compare
with the live editor's scratch.
This ensures the unsaved changes prompt appears only when there are real
changes from the user.
ref ENG-661 ONC-253

- Reverts the revert of
  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
@ronaldlangeveld ronaldlangeveld changed the title Editor fix unsaved draft rev Fixed draft posts not autosaving without title Aug 19, 2024
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 53.12500% with 15 lines in your changes missing coverage. Please review.

Project coverage is 73.67%. Comparing base (170fba0) to head (e3f358b).
Report is 134 commits behind head on main.

Files Patch % Lines
ghost/admin/app/controllers/lexical-editor.js 60.00% 6 Missing and 2 partials ⚠️
...t/admin/app/components/gh-koenig-editor-lexical.js 0.00% 3 Missing ⚠️
...host/admin/app/components/koenig-lexical-editor.js 60.00% 2 Missing ⚠️
ghost/admin/app/components/modal-post-history.js 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20774      +/-   ##
==========================================
- Coverage   73.87%   73.67%   -0.20%     
==========================================
  Files        1266     1267       +1     
  Lines       74806    74980     +174     
  Branches     9978     9999      +21     
==========================================
- Hits        55261    55244      -17     
- Misses      18681    18881     +200     
+ Partials      864      855       -9     
Flag Coverage Δ
admin-tests 44.29% <53.12%> (-0.68%) ⬇️
e2e-tests 81.87% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ronaldlangeveld ronaldlangeveld marked this pull request as ready for review August 19, 2024 03:09
@ronaldlangeveld ronaldlangeveld merged commit aad438b into main Aug 19, 2024
22 checks passed
@ronaldlangeveld ronaldlangeveld deleted the editor-fix-unsaved-draft-rev branch August 19, 2024 05:21
ronaldlangeveld added a commit that referenced this pull request Aug 19, 2024
ronaldlangeveld added a commit that referenced this pull request Aug 19, 2024
)

This reverts commit aad438b.

- reverts the commit so that we can merge it together with PLG-174
kevinansfield pushed a commit to kevinansfield/Ghost that referenced this pull request Aug 19, 2024
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
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 browser-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant