@@ -29,6 +29,7 @@ import {
2929 selectAnonymousPostingConfig ,
3030 selectDivisionSettings ,
3131 selectEnableInContext ,
32+ selectIsNotifyAllLearnersEnabled ,
3233 selectModerationSettings ,
3334 selectUserHasModerationPrivileges ,
3435 selectUserIsGroupTa ,
@@ -79,6 +80,7 @@ const PostEditor = ({
7980 const userIsStaff = useSelector ( selectUserIsStaff ) ;
8081 const archivedTopics = useSelector ( selectArchivedTopics ) ;
8182 const postEditorId = `post-editor-${ editExisting ? postId : 'new' } ` ;
83+ const isNotifyAllLearnersEnabled = useSelector ( selectIsNotifyAllLearnersEnabled ) ;
8284
8385 const canDisplayEditReason = ( editExisting
8486 && ( userHasModerationPrivileges || userIsGroupTa || userIsStaff )
@@ -108,6 +110,7 @@ const PostEditor = ({
108110 title : post ?. title || '' ,
109111 comment : post ?. rawBody || '' ,
110112 follow : isEmpty ( post ?. following ) ? true : post ?. following ,
113+ notifyAllLearners : false ,
111114 anonymous : allowAnonymous ? false : undefined ,
112115 anonymousToPeers : allowAnonymousToPeers ? false : undefined ,
113116 cohort : post ?. cohort || 'default' ,
@@ -161,6 +164,7 @@ const PostEditor = ({
161164 anonymousToPeers : allowAnonymousToPeers ? values . anonymousToPeers : undefined ,
162165 cohort,
163166 enableInContextSidebar,
167+ notifyAllLearners : values . notifyAllLearners ,
164168 } ) ) ;
165169 }
166170 /* istanbul ignore if: TinyMCE is mocked so this cannot be easily tested */
@@ -216,6 +220,8 @@ const PostEditor = ({
216220 anonymousToPeers : Yup . bool ( )
217221 . default ( false )
218222 . nullable ( ) ,
223+ notifyAllLearners : Yup . bool ( )
224+ . default ( false ) ,
219225 cohort : Yup . string ( )
220226 . nullable ( )
221227 . default ( null ) ,
@@ -417,6 +423,21 @@ const PostEditor = ({
417423 < div className = "d-flex flex-row mt-n4 w-75 text-primary font-style" >
418424 { ! editExisting && (
419425 < >
426+ { isNotifyAllLearnersEnabled && (
427+ < Form . Group >
428+ < Form . Checkbox
429+ name = "notifyAllLearners"
430+ checked = { values . notifyAllLearners }
431+ onChange = { handleChange }
432+ onBlur = { handleBlur }
433+ className = "mr-4.5"
434+ >
435+ < span >
436+ { intl . formatMessage ( messages . notifyAllLearners ) }
437+ </ span >
438+ </ Form . Checkbox >
439+ </ Form . Group >
440+ ) }
420441 < Form . Group >
421442 < Form . Checkbox
422443 name = "follow"
0 commit comments