fix(revisions): connect safe restore UI and readable change history
Build and publish container images / images (push) Successful in 9m28s
Release container images / release (push) Successful in 19s

This commit is contained in:
Anya Tokugawa committed 2026-11-10 11:34:28 +09:00
1 parent 2cbaa9342d
commit 96065d1e89
11 files changed
+166 -96

No files matched your search

+6 -1
View File
@@ -252,6 +252,10 @@ window.PagesEditor = {
if (this.saving) return false
if (!this.dirty) return !this.paused
if (!manual && this.paused) return false
const messageField=document.getElementById('revision-message')
const changeMessage=messageField?.value.trim()||''
// A supplied message belongs to the next explicit save, not autosave.
if (!manual && changeMessage) return false
if (manual) this.mergeAttempts=0
this.persist()
this.saving = true
@@ -261,11 +265,12 @@ window.PagesEditor = {
try {
body = await this.canonical(text,format)
const data = await this.post('/_/api/v1/revisions/save',{
object_uuid:this.value('object-uuid'),body,message:manual?'manual-save':'autosave',
object_uuid:this.value('object-uuid'),body,message:manual?(changeMessage||'manual-save'):'autosave',
lang:this.value('page-language')||'und',content_type:this.value('page-content-type'),filename:this.value('page-filename'),
base_revision_uuid:this.baseRevision,editor_principal_uuid:this.owner,
})
if (!data.revision_uuid) throw {kind:'failed'}
if (manual && messageField?.value.trim()===changeMessage) messageField.value=''
this.baseRevision = data.revision_uuid
this.baseBody = typeof data.body==='string' ? data.body : body
this.initialText = text; this.initialFormat = format