no issue
- fixes the "publish/send" dropdown showing when mail is not allowed by tying it to the `canSendEmail` property rather than always showing when editing a draft post
- was previously showing when mailgun is not configured and when default email recipients is set to "disabled", in both cases the recipient selection was never available so the dropdown was confusing and lead to invalid states
- removed the unnecessary property`showEmailOnlyInput` - replaced with `@canSendEmail`
- removed the unnecessary property `nextActionName` - it always resulted in "publish" because it was only being shown for pages and pages can't be sent by email
- removed the logic for setting the initial selected option in `<GhDistributionActionSelect>` because it meant the select was not directly tied to the real distribution action value leading to mixed states across components. Switched to using the passed in `@distributionAction` value directly.
- fixed the publish button incorrectly showing "Publish & send" when no send would be occurring for a post
- if "Publish & Send" is selected, the button will now show "Publish" when no recipients are selected
- fixed the publish button incorrectly showing "Publish & send" for pages
- fixed the now/schedule radio texts not changing when publish type was set to "Send" - the conditionals were incorrectly looking at `this.args.post.emailOnly` which is incorrect syntax would only update _after_ saving, switched to the menu's internal `@emailOnly` argument instead
closes https://github.com/TryGhost/Team/issues/1151
The publish-type state was being set directly on the model in the publish menu rather than being internal to the menu until publishing. A previous attempt had been made to fix that but it wasn't complete and resulted in the menu showing that it would "Publish" after setting it and closing/re-opening when in fact it would "Publish and send".
- moved all state for the distribution type and email settings to be stored in the `<PublishMenu>` component rather than split across the the component and model
- when saving a post from the publish menu, we now pass `emailOnly` as an option to the editor's save task the same as `sendEmailWhenPublished` (corresponding to the `email_recipient_filter` query param) so that we're back to one place controlling email behaviour for a post
- when `emailOnly` is passed as an option to the editor save task it will set the property on the model before saving and reset it back if the save fails. That way the email-only flag behaves as close to the "send when published" flag as possible without it also being sent as a query param.
refs https://github.com/TryGhost/Team/issues/947
- With email-only posts there's a new "send" status that deserved it's own publishing action in the post publish menu. With with addition the post ended up having few more publishing states: publish, send, and publish&send. In addition to all this there's a "schedule" option. An addition of the "send" only select option there became a need to persist the "email_only" flag when the option was changed in the publish menu. Such persistance was not done before from the publishing menu and led a whole chain of additional methods being passed down from publishmenu component all the way down to distribution-action-select component
- At this moment only a happy path work properly when selecting one of the publishing options and publishing. More states will need to be handled for scheduled, unblished, etc. states of the post
refs https://github.com/TryGhost/Team/issues/947
- Added a "distribution" dropdown component to the post publish menu allowing to select from one of three available types of distribution: publish, poblush&send, and send