Skip to content

Commit d587f89

Browse files
committed
Allow sending notifications also for draft info articles
1 parent ea8dc67 commit d587f89

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

plugins/bcc-login/src/components/send-notifications.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ const SendNotifications = ({ label, postId, postType, status, targetGroupsCount,
136136
>
137137
<p>{__('Status', 'bcc-login')}: {status === 'publish' ? <Tag icon="dashicons dashicons-yes" severity="success" value={__('Published', 'bcc-login')} /> : <Tag icon="dashicons dashicons-warning" severity="warning" value={__('NOT published', 'bcc-login')} />}</p>
138138

139+
{status === 'draft' && (
140+
<p className='bcc-send-notifications__info'>* {__('Draft info articles are only accessible to WP Admins & Sentral redaksjon.', 'bcc-login')}</p>
141+
)}
142+
139143
{isOriginalPost === false && (
140144
<p>
141145
<Tag icon="dashicons dashicons-no" severity="danger" value={__('This is a translation. Notifications should be sent from the original post.', 'bcc-login')}></Tag>
@@ -198,7 +202,7 @@ const SendNotifications = ({ label, postId, postType, status, targetGroupsCount,
198202

199203
<p>{__('Changes', 'bcc-login')}: {isDirty ? <Tag icon="dashicons dashicons-warning" severity="warning" value={__('Unsaved changes', 'bcc-login')}></Tag> : <Tag icon="dashicons dashicons-yes" severity="success" value={__('Saved', 'bcc-login')}></Tag>}</p>
200204

201-
<Button type="button" label={__('Send', 'bcc-login')} onClick={() => sendNotifications()} disabled={status !== 'publish' || (targetGroupsCount === 0 && visibilityGroupsCount === 0) || isNotificationDryRun || isDirty || isAutoSaving || !isOriginalPost} />
205+
<Button type="button" label={__('Send', 'bcc-login')} onClick={() => sendNotifications()} disabled={!['publish', 'draft'].includes(status) || (targetGroupsCount === 0 && visibilityGroupsCount === 0) || isNotificationDryRun || isDirty || isAutoSaving || !isOriginalPost} />
202206
</Dialog>
203207

204208
<Toast ref={toast} position="bottom-right" />

0 commit comments

Comments
 (0)