dp ← Move Promote/Publish button to header, wire for all contexts#27031
Conversation
…editing and non-editable states based on versioning visibility
…ests and components accordingly.
…e conditions, enhancing form behavior for published items.
…tem.vue template.
Co-authored-by: Florian C. Wachmann <dev@formfcw.com>
There was a problem hiding this comment.
@formfcw The old publish item in version-menu.vue had:
v-if="primaryKey === '+' ? createAllowed : updateAllowed"The new header Publish button only disables on isCurrentVersionNew, so users without updateAllowed/createAllowed should we use the same permission guard or do we need policies specific to publishing?
…t-published-non-editable' into alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts
…sions and remove outdated publish tests.
…publish-button-to-header-wire-for-all-contexts # Conflicts: # app/src/modules/content/routes/item.vue
…ish-button-to-header-wire-for-all-contexts' into alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts
…publish-button-to-header-wire-for-all-contexts
…ish-button-to-header-wire-for-all-contexts' into alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts
Good question. Same permission guard please. |
…in item component
There was a problem hiding this comment.
Thank you @alvarosabu ❤️ Great work!
A few things I've found.
- version-menu.vue — Let's remove the
updateAllowedandcreateAllowedprops from thePropsinterface — they're no longer used since the publish action was moved out of the version menu. - item.vue — A few related simplifications for
saveVersionActionsince the only action we need for version saves isstay:- Flatten the conditional in the function body of
saveVersionAction— remove theif (action === 'stay')wrapper and theelse if (action === 'quit')branch, keeping just the refresh logic directly - Remove the
'stay'argument from themeta+sshortcut:saveVersionAction('stay')→saveVersionAction() - Simplify the
meta+shift+sshortcut — since versions don't have a 'quit' save action anymore, just early-return when a version is active
- Flatten the conditional in the function body of
…nu component and related tests to streamline functionality.
…onsistently after publishing actions.
formfcw
left a comment
There was a problem hiding this comment.
Thank you @alvarosabu ❤️
LGTM 🎉
Scope
What's changed:
public) to the header as primary CTA, visible when viewing any version (not on published view or non-versioned items)meta+shift+pto Publish (shown in tooltip)publishemit fromversion-menu.vueand corresponding@publishlistener initem.vueisPublishAllowedcomputed property for permission checking — Publish button now respectscreateAllowed/updateAllowedpermissionsPotential Risks / Drawbacks
PATCH /versions/:idwith{ delta: null }to reset the version's content. This cannot be wired yet because the API does not currently support settingdeltatonullvia PATCH. A separate API-side change is needed before this can work end-to-end.Tested Scenarios
meta+shift+ptriggers publishReview Notes / Questions
Checklist
Closes CMS-1863