B1-5..B1-20: distill remaining code behaviors into specs (rendering.allium, post/media/task/generation/editor specs)
This commit is contained in:
@@ -18,6 +18,7 @@ value TemplateEditorView {
|
||||
kind: String -- select: post | list | not_found | partial
|
||||
enabled: Boolean -- checkbox
|
||||
content: String -- code editor content
|
||||
can_publish: Boolean -- true while status = draft
|
||||
created_at: String -- locale-formatted date
|
||||
updated_at: String -- locale-formatted date
|
||||
}
|
||||
@@ -35,12 +36,15 @@ surface TemplateEditorSurface {
|
||||
|
||||
provides:
|
||||
TemplateSaveRequested(editor.template_id)
|
||||
TemplatePublishRequested(editor.template_id)
|
||||
when editor.can_publish
|
||||
TemplateValidateRequested(editor.template_id)
|
||||
TemplateDeleteRequested(editor.template_id)
|
||||
|
||||
@guarantee HeaderLayout
|
||||
-- Header bar with template title tab.
|
||||
-- Actions (right side): Save button, Validate button,
|
||||
-- Actions (right side): Save button, Publish button (shown only when
|
||||
-- can_publish, i.e. status = draft), Validate button,
|
||||
-- Delete button (danger style).
|
||||
|
||||
@guarantee MetadataRow
|
||||
@@ -67,6 +71,15 @@ rule TemplateSave {
|
||||
-- See engine_side_effects.allium UpdateTemplateSideEffects
|
||||
}
|
||||
|
||||
rule TemplatePublish {
|
||||
when: TemplatePublishRequested(template_id)
|
||||
-- Only offered while the template is a draft (can_publish gate on the button)
|
||||
-- Validates Liquid first (publish gate); invalid source blocks publish
|
||||
-- Saves current draft fields, then publishes (status -> published)
|
||||
-- Writes the published .liquid file to disk
|
||||
-- See template.allium PublishTemplate
|
||||
}
|
||||
|
||||
rule TemplateValidate {
|
||||
when: TemplateValidateRequested(template_id)
|
||||
-- Validates Liquid syntax without saving
|
||||
|
||||
Reference in New Issue
Block a user