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

  1. You can come back to an article and start where you left off
  2. 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

Command icon 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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

This 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.

wim leers’s picture

Issue tags: +Needs screenshots

@longwave Can you add a GIF for #3? 🤓

longwave’s picture

Issue tags: -Needs screenshots
StatusFileSize
new4.49 MB

Demo GIF:

If you need to reset your local site for any reason you can empty out the tempstore:

delete from key_value_expire where collection='tempstore.shared.xb';

tedbow made their first commit to this issue’s fork.

tedbow’s picture

Title: Autosave PoC » Implement basic auto-save
Issue summary: View changes
tedbow’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

Looking 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.

tedbow’s picture

Assigned: tedbow » wim leers
Status: Needs work » Needs review

@wim leers thanks for the review, back to you

wim leers’s picture

Assigned: wim leers » tedbow
Status: Needs review » Needs work
Issue tags: -Needs followup
  • Thanks for the follow-up!
  • Love the name you picked 🤣

Needs work because:

  1. Tests are failing now 😅
  2. Last concern: let's please make the trait link to an issue where this will be fleshed out more — even if it's just a meta issue.

Pre-emptively approved already — I trust you to address those last bits 👍

tedbow’s picture

Status: Needs work » Reviewed & tested by the community

@wim leers ok!

Addressed the last bits. If tests pass I will merge

wim leers’s picture

🚢 Ship it!

  • tedbow committed fac7acb0 on 0.x authored by longwave
    Issue #3478299 by tedbow, longwave, wim leers: Implement basic auto-save
    
tedbow’s picture

Assigned: tedbow » Unassigned
Status: Reviewed & tested by the community » Fixed

🎉

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.