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:
ReviewRequestEditorView
calls finishSave
for each open field.
- The field calls
InlineEditorView.submit
.
InlineEditorView.save
triggers the "complete" event.
- "complete" is handled by the field view, which calls
ReviewRequestEditor.setDraftField
ReviewRequestEditor.setDraftField
calls ReviewRequestDraft.save
with the new data.
- As each of the fields are saved,
ReviewRequestEditor
is keeping
track via a pendingSaveCount
attribute, which will trigger a new
call to publishDraft
once the count is zero.
After this change, it involves:
ReviewRequestEditorView
calls finishSave
for each open field,
using the returned promise to wait for the save completion.
ReviewRequestEditorView
calls ReviewRequestEditor.publishDraft
.
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
enabled.