Skip to content
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

Merged
merged 10 commits into from
Apr 17, 2018

Conversation

zwang180
Copy link
Collaborator

@zwang180 zwang180 commented Apr 3, 2018

Fixes #80, let me know if I'm doing anything stupid :(

} 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) {
Copy link
Member

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.

Copy link
Collaborator Author

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'
Copy link
Member

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?

Copy link
Collaborator Author

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe sendNotificaitonIfEnabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

<ModalBody>
<h5>For students</h5>
<p>
If you enable notificaitons, you&apos;ll get notifications when your
Copy link
Collaborator

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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&apos;ll get notifications when your
question is being answered.
</p>
<h5>For course staff/admins</h5>
Copy link
Collaborator

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)?

Copy link
Collaborator Author

@zwang180 zwang180 Apr 10, 2018

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.

Copy link
Collaborator

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&apos;ll get notifications when your
question is being answered.
</p>
<h5>For course staff/admins</h5>
Copy link
Collaborator Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me!

Copy link
Collaborator

@genevievehelsel genevievehelsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@nwalters512 nwalters512 merged commit 7b769bf into master Apr 17, 2018
@nwalters512 nwalters512 deleted the question_being_answered_notification branch April 17, 2018 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants