-
Notifications
You must be signed in to change notification settings - Fork 49
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: add watchers field to the Course Edit Form #890
Conversation
aef2a67
to
4a66f31
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #890 +/- ##
==========================================
+ Coverage 66.86% 66.95% +0.09%
==========================================
Files 128 128
Lines 3190 3199 +9
Branches 925 930 +5
==========================================
+ Hits 2133 2142 +9
Misses 1008 1008
Partials 49 49
☔ View full report in Codecov by Sentry. |
4a66f31
to
7c909ba
Compare
d26d5e8
to
d87fe8f
Compare
// emailValue should only contain alphabets, numbers, hyphen, underscore, dot and @ | ||
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/i.test(emailValue)) { return false; } | ||
// disallow emails that have already been selected or are present in options(dropdown) | ||
return ![...selectValue, ...options].some(x => x.label.toLowerCase() === emailValue.toLowerCase()); |
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 particular validation should be on component level. This util method should only focus on email text validation.
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 followed here the same convention which is currently followed for the tags validation
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.
Right. Tags have a specific use-case. Email is generic, in my opinion.
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 don't find any benefit in moving it to the component level. Because we can reuse this function anywhere after importing it to that file
/> | ||
)} | ||
isMulti | ||
disabled={!(courseInfo?.data?.course_run_statuses?.includes(REVIEW_BY_INTERNAL) && administrator)} |
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.
- If I remember the spec, the watchers can be added at any point (but not once scheduled/published). Double-check this.
- We should make this field prominent, either moving to the side pane or moving higher in the course form. If the side pane does not take much effort, that would be preferrable. This particular field does not impact the course content behavior.
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.
Also, the form remains in an uncleaned state due to the ordering of watcher fields coming from backend. The form field needs to be refreshed. It is already happening for many of the fields in Publisher.
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.
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.
Also, the form remains in an uncleaned state due to the ordering of watcher fields coming from backend. The form field needs to be refreshed. It is already happening for many of the fields in Publisher.
Done
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 have added some followup comments.
9214b7a
to
e5b3ace
Compare
e5b3ace
to
55cfba0
Compare
PROD-3500
This PR adds the watchers field to the course edit form. Its a list of email addresses that will receive notifications when the course run of the course is published or reviewed