-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Bulk email recipient options #171
fix: Bulk email recipient options #171
Conversation
Thanks for the pull request, @Inferato! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
9cb6fa8
to
02d17ae
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #171 +/- ##
==========================================
+ Coverage 83.01% 83.18% +0.17%
==========================================
Files 46 47 +1
Lines 683 690 +7
Branches 132 135 +3
==========================================
+ Hits 567 574 +7
Misses 116 116 ☔ View full report in Codecov by Sentry. |
courseModes | ||
&& courseModes.length > 1 | ||
&& courseModes.map((courseMode) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to move logical operations into a separate variable, this will simplify the readability of the code.
courseModes | |
&& courseModes.length > 1 | |
&& courseModes.map((courseMode) => ( | |
const isCourseModes = courseModes && courseModes.length > 1; | |
... | |
isCourseModes && courseModes.map((courseMode) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I already moved it. Thx!
@@ -0,0 +1,18 @@ | |||
import { Factory } from 'rosie'; // eslint-disable-line import/no-extraneous-dependencies | |||
|
|||
const courseModeFactory = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a good idea to add some jsDocs documentation for this code. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. It has already been added. Check please and add any suggestions if needed.
|
||
function renderBulkEmailForm() { | ||
const { cohorts } = cohortFactory.build(); | ||
return ( | ||
<BulkEmailProvider> | ||
<BulkEmailForm courseId="test" cohorts={cohorts} /> | ||
<BulkEmailForm | ||
courseId="test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion: let's come up with a more meaningful name for this identifier 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any examples? I used the same name as in the backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mockCourseId
or exampleCourseId
Please, If it's possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if it is necessary. This ID was here before I made the changes to the tests so I didn't check this part for correctness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to not change courseId
value to save the common style of test values.
* | ||
* @returns {Object[]} An array of course mode objects generated by different factories. | ||
*/ | ||
import { Factory } from 'rosie'; // eslint-disable-line import/no-extraneous-dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that there is no need to write jsDocs for import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a doc for the module, not for import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove it, but I leave the decision up to you 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved in principle, though I have a nit with a variable name. Thanks!
Let's wait to merge this until after the backend PR merges, though.
additionalCohorts, | ||
courseModes, | ||
} = props; | ||
const isCourseModes = courseModes && courseModes.length > 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const isCourseModes = courseModes && courseModes.length > 1; | |
const hasCourseModes = courseModes && courseModes.length > 1; |
</Form.Checkbox> | ||
{ | ||
// additional modes | ||
isCourseModes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isCourseModes | |
hasCourseModes |
Sorry for the delays, Taras is no longer a member of RG. I will leave the status update comments on each PR's comments ASAP |
Hello @arbrandes Could you close this PR? I can't add edits to the source branch so I opened a new one where I took the source branch from here as it is and just applied your suggestions. |
closing per the comment above. |
@Inferato Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
According to the chapter Sending Email Messages to Learners in Different Enrollment Tracks course can may more than one mode and instructor must have the ability to send the email for users in this modes.
Communication MFE had a hardcoded 2 modes for every course. Sometimes it lead to the error.
courseModes
was added tocourseMetadata
to display real course email recipient options.Related MR: