Feature: Visual builder undo button
Related to Feature #61 (closed) -- Convo checkpoints saved with each user click of [Save & Next] or [Save & Previous] button, also separate [Save] button.
User can Undo most recent changes with Undo button in visual editor.
-
add [Undo] button to html template -
create quizbot.models.Checkpoint record with each [Save] -
State.objects.filter
shouldsort_values('checkpoint', ascending=True).last()
taking the most recent state definition (including triggers) when retrieving a Convo States and Triggers for editing in visual editor -
copy the Convo State and Trigger records associated with the save button (that have changed since the last Checkpoint), incrementing the Checkpoint ID ( ForeignKey
) to the changed DB records -
With each undo click, delete the latest Checkpoint (and "cascade" the delete to all of the latest states and triggers associated with that checkpoint)
Edited by Hobson Lane