-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat send team emails #8
base: jv/feat-send-indivudial-email-pluggable
Are you sure you want to change the base?
feat send team emails #8
Conversation
0a0b15d
to
bcd7e63
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## jv/feat-send-indivudial-email-pluggable #8 +/- ##
========================================================================
Coverage 83.31% 83.31%
========================================================================
Files 53 53
Lines 773 773
Branches 147 147
========================================================================
Hits 644 644
Misses 129 129 ☔ View full report in Codecov by Sentry. |
bcd7e63
to
01f8c9f
Compare
import ListTeams from './ListTeams'; | ||
|
||
describe('ListTeams component', () => { | ||
// eslint-disable-next-line no-unused-vars, react/prop-types |
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.
Is this still necessary?
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.
'no-unused-vars' isn't necessary, I will remove it. Thanks!
|
||
const formStatusToast = ['error', 'complete', 'completeSchedule']; | ||
const formStatusToast = ['error', 'complete', 'completeSchedule', 'loadingTeams']; |
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've seen this status in many different places, I would suggest to move into a variables, in order to avoid typos in the future.
Ej:
const formStatusToast = ['error', 'complete', 'completeSchedule', 'loadingTeams']; | |
const ERROR = 'error' | |
const COMPLETE = 'complete' | |
const COMPLETE_SCHEDULE = 'completeSchedule' | |
const LOADING_TEAMS = 'loadingTeams' | |
const formStatusToast = [ERROR, COMPLETE, COMPLETE_SCHEDULE, LOADING_TEAMS]; |
}), [intl]); | ||
|
||
const statefulButtonDisableStates = useMemo(() => [ | ||
'pending', | ||
'complete', | ||
'completeSchedule', | ||
], []); | ||
isLoadingTeams ? 'loadingTeams' : '', |
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.
Same about this states:
isLoadingTeams ? 'loadingTeams' : '', | |
COMPLETE_SCHEDULE, | |
isLoadingTeams ? LOADING_TEAMS : '', |
data-testid="send-email-btn" | ||
variant="primary" | ||
onClick={handleClickStatefulButton} | ||
state={isLoadingTeams ? 'loadingTeams' : formStatus} |
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.
Same here:
state={isLoadingTeams ? 'loadingTeams' : formStatus} | |
state={isLoadingTeams ? LOADING_TEAMS : formStatus} |
Works as expected! 🚀 |
Description
This allows you to send emails to specific teams in a course. The teams will be displayed as checkboxes, and the user will be able to select the teams as they wish.
Demo
demo.mp4
When teams are being fetched
Plugin loaded
How to test it
Setting up
You will need to install these following plugins:
If you are using devstack
Go to http://localhost:1984/courses/course-v1:edX+DemoX+Demo_Course/bulk_email Or
http://localhost:1984/courses/{{id_course}}/bulk_email
Select any team or some teams in the field called "teams"
Fill out the fields Subject and Body