Overview
#3475672: Research: Possible backend implementations of auto-save, drafts, and publishing in we are discussing exactly how auto-save should work.
For now make using the demo easier this issue will be implement a very basic auto-save functionality
For demo purposes this will be mean
- You can come back to an article and start where you left off
- You can easily create multiple articles with different XB data
Proposed resolution
Save the front-end Layout and Model to a shared tempstore.
This means that for each node that uses XB the state of experience builder will be save when you reload browser. It will be shared among all users of XB for the node.
There will not be a way to clear the auto-save but this MR also updates toolbar XB item to link the current node if it uses the XB demo field. That way to start with an empty canvas you can just create another article
To delete all auto-save states you can drush sql:query "delete from key_value_expire where collection='tempstore.shared.experience_builder.auto_save"
After #3475672: Research: Possible backend implementations of auto-save, drafts, and publishing is finished we can do the actual auto-save functionality
User interface changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screencast from 2024-10-02 17-51-21.gif | 4.49 MB | longwave |
Issue fork experience_builder-3478299
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
longwaveThis is very rough indeed but works as a proof of concept.
In the UI you can now click the Publish button and it posts the current layout and model to the server. This is saved in the shared tempstore keyed by entity type and ID. When you navigate away from the XB UI and come back to the same node, the saved layout and model are reloaded, instead of always getting the default dummy layout.
Comment #4
wim leers@longwave Can you add a GIF for #3? 🤓
Comment #5
longwaveDemo GIF:
If you need to reset your local site for any reason you can empty out the tempstore:
Comment #7
tedbowComment #8
tedbowComment #9
wim leersLooking good! 🏓 Basically only nitpicky concerns that all relate to setting the right expectations: this is temporary, it will change, and the first follow-up step is to update the end-to-end tests that must be linked.
Comment #10
tedbow@wim leers thanks for the review, back to you
Comment #11
wim leersNeeds work because:
Pre-emptively approved already — I trust you to address those last bits 👍
Comment #12
tedbow@wim leers ok!
Addressed the last bits. If tests pass I will merge
Comment #13
wim leers🚢 Ship it!
Comment #15
tedbow🎉