Skip to content

Commit

Permalink
fix: [RGOeX-26199] Course mode is used to show the correct bulk email…
Browse files Browse the repository at this point in the history
… options
  • Loading branch information
Inferato committed Nov 9, 2023
1 parent b2d39f2 commit ac9ac77
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/components/bulk-email-tool/BulkEmailTool.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function BulkEmailTool() {
</h1>
</div>
<div className="row">
<BulkEmailForm courseId={courseId} cohorts={courseMetadata.cohorts} />
<BulkEmailForm courseId={courseId} cohorts={courseMetadata.cohorts} courseModes={courseMetadata.courseModes} />
</div>
<div className="row py-5">
<BulkEmailTaskManager courseId={courseId} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FORM_ACTIONS = {
};

function BulkEmailForm(props) {
const { courseId, cohorts, intl } = props;
const { courseId, cohorts, courseModes, intl } = props;
const [{ editor }, dispatch] = useContext(BulkEmailContext);
const [emailFormStatus, setEmailFormStatus] = useState(FORM_SUBMIT_STATES.DEFAULT);
const [emailFormValidation, setEmailFormValidation] = useState({
Expand Down Expand Up @@ -272,6 +272,7 @@ function BulkEmailForm(props) {
handleCheckboxes={onRecipientChange}
additionalCohorts={cohorts}
isValid={emailFormValidation.recipients}
courseModes={courseModes}
/>
<Form.Group controlId="emailSubject">
<Form.Label className="h3 text-primary-500">{intl.formatMessage(messages.bulkEmailSubjectLabel)}</Form.Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DEFAULT_GROUPS = {
};

export default function BulkEmailRecipient(props) {
const { handleCheckboxes, selectedGroups, additionalCohorts } = props;
const { handleCheckboxes, selectedGroups, additionalCohorts, courseModes } = props;
return (
<Form.Group>
<Form.Label>
Expand Down Expand Up @@ -86,18 +86,6 @@ export default function BulkEmailRecipient(props) {
</Form.Checkbox>
))
}
<Form.Checkbox
key="track:audit"
value="track:audit"
disabled={selectedGroups.find((group) => group === DEFAULT_GROUPS.ALL_LEARNERS)}
className="col col-lg-4 col-sm-6 col-12"
>
<FormattedMessage
id="bulk.email.form.recipients.audit"
defaultMessage="Learners in the audit track"
description="A selectable choice from a list of potential email recipients"
/>
</Form.Checkbox>
<Form.Checkbox
key="learners"
value="learners"
Expand Down
3 changes: 2 additions & 1 deletion src/components/page-container/PageContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function PageContainer(props) {
}

const {
org, number, title, tabs, originalUserIsStaff,
org, number, title, tabs, originalUserIsStaff, courseModes
} = metadataResponse;
const { cohorts } = cohortsResponse;

Expand All @@ -48,6 +48,7 @@ export default function PageContainer(props) {
number,
title,
originalUserIsStaff,
courseModes: courseModes,
tabs: [...tabs],
cohorts: cohorts.map(({ name }) => name),
});
Expand Down

0 comments on commit ac9ac77

Please sign in to comment.