Ghost/ghost/admin/app/components/gh-publishmenu-draft.hbs

73 lines
3.8 KiB
Handlebars
Raw Normal View History

<div ...attributes>
<header class="gh-publishmenu-heading">Ready to
🐛 Fixed inconsistent publish/send messaging in publish menu 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
2021-10-21 15:07:56 +03:00
{{#if @canSendEmail}}
<GhDistributionActionSelect
🐛 Fixed inconsistent publish/send messaging in publish menu 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
2021-10-21 15:07:56 +03:00
@distributionAction={{@distributionAction}}
@setDistributionAction={{@setDistributionAction}}
/>
{{else}}
🐛 Fixed inconsistent publish/send messaging in publish menu 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
2021-10-21 15:07:56 +03:00
publish
{{/if}}
this {{@post.displayName}}?
</header>
2022-02-11 16:56:42 +03:00
<section class="gh-publishmenu-content {{if this.disableEmailOption "no-border"}}">
<div class="gh-publishmenu-section">
<div class="gh-publishmenu-radio {{if (eq @saveType "publish") "active"}}" {{on "click" (fn this.setSaveType "publish")}}>
<div class="gh-publishmenu-radio-button" data-test-publishmenu-published-option></div>
<div class="gh-publishmenu-radio-content">
🐛 Fixed inconsistent publish/send messaging in publish menu 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
2021-10-21 15:07:56 +03:00
<div class="gh-publishmenu-radio-label">{{#if @emailOnly}}Send email now{{else}}Set it live now{{/if}}</div>
<div class="gh-publishmenu-radio-desc">{{#if @emailOnly}}Deliver this immediately{{else}}Publish this {{@post.displayName}} immediately{{/if}}</div>
</div>
2019-11-08 07:46:38 +03:00
</div>
<div class="gh-publishmenu-radio {{if (eq @saveType "schedule") "active"}}" {{on "click" (fn this.setSaveType "schedule")}}>
<div class="gh-publishmenu-radio-button" data-test-publishmenu-scheduled-option></div>
<div class="gh-publishmenu-radio-content">
<div class="gh-publishmenu-radio-label">Schedule it for later</div>
<GhDateTimePicker
@date={{@post.publishedAtBlogDate}}
@time={{@post.publishedAtBlogTime}}
@setDate={{this.setDate}}
@setTime={{this.setTime}}
@setTypedDateError={{@setTypedDateError}}
@errors={{@post.errors}}
@dateErrorProperty="publishedAtBlogDate"
@timeErrorProperty="publishedAtBlogTime"
@minDate={{this._minDate}}
@isActive={{eq @saveType "schedule"}}
/>
🐛 Fixed inconsistent publish/send messaging in publish menu 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
2021-10-21 15:07:56 +03:00
<div class="gh-publishmenu-radio-desc">{{#if @emailOnly}}Send email at a specific time{{else}}Set automatic future publish date{{/if}}</div>
</div>
2019-11-08 07:46:38 +03:00
</div>
</div>
{{#if this.showEmailSection}}
<div class="gh-publishmenu-section {{if @isSendingEmailLimited "no-border"}}" {{did-insert (perform this.countTotalMembersTask)}}>
<div class="gh-publishmenu-email">
{{#if @isSendingEmailLimited}}
<p class="gh-box gh-box-alert">{{html-safe @sendingEmailLimitError}}</p>
{{else}}
<div class="gh-publishmenu-email-label">
<label class="gh-publishmenu-radio-label mb3">Send by email to</label>
{{#if this.disableEmailOption}}
<p class="gh-box gh-content-box">
<LinkTo @route="members">
Add members
</LinkTo>
to start sending newsletters!
</p>
{{else}}
<div class="form-group">
<GhMembersRecipientSelect
@filter={{@recipientsFilter}}
@onChange={{@setSendEmailWhenPublished}}
/>
</div>
{{/if}}
</div>
{{/if}}
</div>
</div>
{{/if}}
</section>
</div>