mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
Allowed editors to send email on publish (#1504)
no issue So far, only owners or Admins were allowed to control the send email setting while publishing/scheduling a post. This change allows Editors to see the setting as well and toggle as needed. No changes on the API side were needed.
This commit is contained in:
parent
d664cf45b5
commit
491c5abdc9
@ -1,7 +1,7 @@
|
||||
import Component from '@ember/component';
|
||||
import moment from 'moment';
|
||||
import {computed} from '@ember/object';
|
||||
import {equal} from '@ember/object/computed';
|
||||
import {equal, or} from '@ember/object/computed';
|
||||
import {isEmpty} from '@ember/utils';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
@ -19,6 +19,7 @@ export default Component.extend({
|
||||
'data-test-publishmenu-draft': true,
|
||||
|
||||
disableEmailOption: equal('memberCount', 0),
|
||||
showSendEmail: or('session.user.isOwner', 'session.user.isAdmin', 'session.user.isEditor'),
|
||||
|
||||
canSendEmail: computed('feature.labs.members', 'post.{displayName,email}', function () {
|
||||
let membersEnabled = this.feature.get('labs.members');
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Component from '@ember/component';
|
||||
import moment from 'moment';
|
||||
import {computed} from '@ember/object';
|
||||
import {equal} from '@ember/object/computed';
|
||||
import {equal, or} from '@ember/object/computed';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
@ -18,6 +18,7 @@ export default Component.extend({
|
||||
'data-test-publishmenu-scheduled': true,
|
||||
|
||||
disableEmailOption: equal('memberCount', 0),
|
||||
showSendEmail: or('session.user.isOwner', 'session.user.isAdmin', 'session.user.isEditor'),
|
||||
|
||||
timeToPublished: computed('post.publishedAtUTC', 'clock.second', function () {
|
||||
let publishedAtUTC = this.get('post.publishedAtUTC');
|
||||
|
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if (and this.canSendEmail this.session.user.isOwnerOrAdmin)}}
|
||||
{{#if (and this.canSendEmail showSendEmail)}}
|
||||
<div class="gh-publishmenu-section">
|
||||
<div class="gh-publishmenu-radio gh-publishmenu-email">
|
||||
{{#if this.backgroundLoader.isRunning}}
|
||||
|
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{#if this.session.user.isOwnerOrAdmin}}
|
||||
{{#if showSendEmail}}
|
||||
{{#unless this.post.email}}
|
||||
<section class="gh-publishmenu-section">
|
||||
<div class="gh-publishmenu-radio gh-publishmenu-email">
|
||||
|
Loading…
Reference in New Issue
Block a user