Simplify field saving before draft publishing.
Review Request #13043 — Created May 11, 2023 and submitted
In order to make the "save before publish" operation a little more
streamlined, I'm rearranging things so that it can be somewhat less
event driven. This previously involved:
finishSavefor each open field.
- The field calls
InlineEditorView.savetriggers the "complete" event.
- "complete" is handled by the field view, which calls
with the new data.
- As each of the fields are saved,
track via a
pendingSaveCountattribute, which will trigger a new
publishDraftonce the count is zero.
After this change, it involves:
finishSavefor each open field,
using the returned promise to wait for the save completion.
IMPORTANT NOTE: this only affects the legacy draft review banner, which
is disabled and will be removed soon (perhaps before RB6, perhaps
after). A similar implementation for the unified banner is coming next.
This change also fixes up several unit tests which had been broken by
refactoring but were marked as "pending" when the unified banner is
- Ran js-tests.
- Disabled the unified banner feature and ran js-tests.
- Disabled the unified banner feature and published a draft while
several field editors were open. Saw them all save and the draft