payload icon indicating copy to clipboard operation
payload copied to clipboard

feat: allow publish and publish specific locale buttons to be swapped

Open jessrynkar opened this issue 1 year ago • 1 comments

What?

Adds new feature to change the default behavior of the Publish button.

When localization is enabled, you can now choose whether to publish all locales (default) or publish the active locale only.

Screenshot 2024-11-22 at 12 03 20 PM

Why?

Since implementing the ability to publish a specific locale, users have reported that having this option as the default button would be preferred in some cases.

How?

Add defaultLocalePublishOption to your localization config and set it to 'active':

  localization: {
    defaultLocalePublishOption: 'active',
    // the rest of your localization config
  },

jessrynkar avatar Nov 22 '24 15:11 jessrynkar

This is great! Thanks @JessChowdhury

rilrom avatar Nov 27 '24 08:11 rilrom

Hmm I'm not sure we should add a new property for this. I think the less configuration the better. Imo whatever the default behavior is currently should continue to be the default, and we should just add the drop-down for everyone with the secondary behavior. What do you think?

jacobsfletch avatar Jan 14 '25 13:01 jacobsfletch

@jacobsfletch I think the Sanity Actions API is very nice for expressing those things and in case you want to make it configurable I'd love to see this (or something like it) instead of a a new property too.

This could also be used elsewhere in the admin ui and allow plugins to customize the UI even further.

gu-stav avatar Jan 23 '25 07:01 gu-stav

🚀 This is included in version v3.20.0

github-actions[bot] avatar Jan 29 '25 15:01 github-actions[bot]