-
Notifications
You must be signed in to change notification settings - Fork 37
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
Question being answered notification #94
Conversation
…fications to on-duty staff only, allow notification enabled for student
…aining notification
} else if (action.type === UPDATE_QUESTION.SUCCESS) { | ||
const { question } = action | ||
// If question is marked as being answered and it is the student who ask this question | ||
if (question.beingAnswered && user.id === question.askedById) { |
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.
In the future, we might allow students or staff to edit questions while they're being answered. To be safe, I'd check for the question in the existing state and make sure that this UPDATE
actually represents a transition from not being answered to being answered.
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.
Done, let me know if there is any other changes needed!
const { question } = action | ||
// If question is marked as being answered and it is the student who ask this question | ||
if (question.beingAnswered && user.id === question.askedById) { | ||
const title = 'Your question is being answered' |
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.
Maybe "STAFFNAME is answering your question" instead?
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.
Done!
import { baseUrl } from '../util' | ||
|
||
function sendNotificationIfAllowed(title, options) { |
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.
Maybe sendNotificaitonIfEnabled
?
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.
Done!
…question is indeed marked being answered
<ModalBody> | ||
<h5>For students</h5> | ||
<p> | ||
If you enable notificaitons, you'll get notifications when your |
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 you enable notificaitons" => notifications
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.
Sorry, what do you mean exactly? Do you mean "Notificaitons: you'll get notifications when your..." like this?
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.
oh sorry, i meant "If you enable notificaitons" should be changed to "If you enable notifications", the current notifications is a typo
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.
Oh, right! I can fix that later along with the wording stuff I mentioned below.
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.
Please double check!
If you enable notificaitons, you'll get notifications when your | ||
question is being answered. | ||
</p> | ||
<h5>For course staff/admins</h5> |
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.
Could these be wrapped and be shown based on user role (course staff vs not course staff)?
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 had a discussion with Nathan, and we agreed that probably it is a better choice to just show both messages because it's hard to handle edge cases properly when distinguishing roles. For example, Nathan is an admin, but also a student in CS 461. But it's definitely better if we can handle the role more properly.
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.
ahhh, makes sense
If you enable notificaitons, you'll get notifications when your | ||
question is being answered. | ||
</p> | ||
<h5>For course staff/admins</h5> |
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.
@nwalters512 Do you mind if I change it to For on-duty couse staff/admins
, since that is more aligned with our actual logic. You don't get notifications if you don't put yourself on the on-duty staff list.
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.
Fine by me!
Fix a typo, improve modal text
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.
lgtm!
Fixes #80, let me know if I'm doing anything stupid :(