Skip to content

dp ← Move Promote/Publish button to header, wire for all contexts#27031

Merged
formfcw merged 26 commits intofeat/draft-publishedfrom
alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts
Apr 21, 2026
Merged

dp ← Move Promote/Publish button to header, wire for all contexts#27031
formfcw merged 26 commits intofeat/draft-publishedfrom
alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts

Conversation

@alvarosabu
Copy link
Copy Markdown
Contributor

@alvarosabu alvarosabu commented Apr 2, 2026

Scope

What's changed:

  • Add Publish button (icon: public) to the header as primary CTA, visible when viewing any version (not on published view or non-versioned items)
  • Remove promote/publish action from the version menu — only rename and delete/discard remain
  • Save Version button is now secondary; Publish button is primary
  • Keyboard shortcut: meta+shift+p to Publish (shown in tooltip)
  • 3-dots menu on Publish button shows "Publish and Quit" option
  • Existing items show comparison modal before publishing (behavior relocated from version menu)
  • New item-less drafts skip the comparison modal and publish directly
  • Remove unused publish emit from version-menu.vue and corresponding @publish listener in item.vue
  • Add isPublishAllowed computed property for permission checking — Publish button now respects createAllowed/updateAllowed permissions
  • Exclude singleton collections from the publish keyboard shortcut
  • Updated translation keys for publish action tooltips

Potential Risks / Drawbacks

  • Discard changes (reset delta to null) not implemented — The version menu's "Discard Changes" action for global versions (draft) requires a PATCH /versions/:id with { delta: null } to reset the version's content. This cannot be wired yet because the API does not currently support setting delta to null via PATCH. A separate API-side change is needed before this can work end-to-end.

Tested Scenarios

  • Viewing a draft/local version shows Publish button as primary CTA in the header
  • Viewing the published item shows Edit button instead (no Publish button)
  • Non-versioned collections show the regular Save button
  • Clicking Publish on an existing item opens the comparison modal
  • Confirming the comparison modal promotes the version and navigates back to published view
  • "Publish and Quit" navigates to the collection list after publishing
  • meta+shift+p triggers publish
  • Version menu no longer contains any promote/publish action
  • Users without create/update permissions see disabled Publish button
  • Singleton collections do not trigger publish on keyboard shortcut

Review Notes / Questions

  • N/A

Checklist

  • Added or updated tests
  • Documentation PR created here or not required
  • OpenAPI package PR created here or not required

Closes CMS-1863

@alvarosabu alvarosabu requested a review from AlexGaillard as a code owner April 2, 2026 15:27
@linear
Copy link
Copy Markdown

linear Bot commented Apr 2, 2026

@alvarosabu alvarosabu marked this pull request as draft April 2, 2026 15:28
alvarosabu and others added 2 commits April 7, 2026 09:36
Copy link
Copy Markdown
Contributor Author

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

formfcw and others added 2 commits April 7, 2026 11:04
…t-published-non-editable' into alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts
@alvarosabu alvarosabu requested a review from formfcw April 7, 2026 09:06
Base automatically changed from chore/alvaro/cms-1862-header-actions-per-version-context-published-non-editable to feat/draft-published April 7, 2026 09:07
formfcw and others added 6 commits April 7, 2026 11:08
…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
@formfcw
Copy link
Copy Markdown
Contributor

formfcw commented Apr 7, 2026

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?

Good question. Same permission guard please.

formfcw

This comment was marked as resolved.

Copy link
Copy Markdown
Member

@HZooly HZooly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, nice!

@alvarosabu alvarosabu requested review from formfcw April 8, 2026 07:38
Copy link
Copy Markdown
Contributor

@formfcw formfcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alvarosabu ❤️ Great work!

A few things I've found.

  • version-menu.vue — Let's remove the updateAllowed and createAllowed props from the Props interface — they're no longer used since the publish action was moved out of the version menu.
  • item.vue — A few related simplifications for saveVersionAction since the only action we need for version saves is stay:
    • Flatten the conditional in the function body of saveVersionAction — remove the if (action === 'stay') wrapper and the else if (action === 'quit') branch, keeping just the refresh logic directly
    • Remove the 'stay' argument from the meta+s shortcut: saveVersionAction('stay')saveVersionAction()
    • Simplify the meta+shift+s shortcut — since versions don't have a 'quit' save action anymore, just early-return when a version is active

Comment thread .changeset/pretty-views-stick.md Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue Outdated
Comment thread app/src/modules/content/routes/item.vue
Comment thread app/src/modules/content/routes/item.vue Outdated
@alvarosabu alvarosabu requested a review from formfcw April 17, 2026 18:29
Copy link
Copy Markdown
Contributor

@formfcw formfcw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @alvarosabu ❤️

LGTM 🎉

@formfcw formfcw merged commit 126da49 into feat/draft-published Apr 21, 2026
6 checks passed
@formfcw formfcw deleted the alvaro/cms-1863-move-promotepublish-button-to-header-wire-for-all-contexts branch April 21, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants