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

Allow a course to open/close their queues #128

Merged
merged 21 commits into from
May 9, 2018

Conversation

genevievehelsel
Copy link
Collaborator

@genevievehelsel genevievehelsel commented Apr 26, 2018

as title says.

here are some pictures:

screen shot 2018-04-26 at 3 18 39 pm

screen shot 2018-04-26 at 3 18 47 pm

screen shot 2018-04-26 at 3 18 56 pm

EDIT fixed spacing and color :

screen shot 2018-04-26 at 5 16 41 pm

fixes #62

@genevievehelsel
Copy link
Collaborator Author

genevievehelsel commented Apr 26, 2018

very open to style changes, please give input on that. The color on the closed queue is the color used by bootstrap alerts. that can be changed.

Also, there is no hover animation on closed queues cards. I can add that back if wanted.

edit: since i made a new template for closed queues (the way styling was working, it had to happen to get a different color and loose the hover), I can remove some information from the closed queue cards.

I think its important to keep the delete and edit buttons, and to keep it clickable (in order to get to the queue page to reopen the queue)

edit2: maybe the "Closed Queues" text could be the same size and the "Or, select a course" ?

too many design decisions

@wadefagen
Copy link
Member

There's two high-level design bits that I notice from the screenshots:

  • There are two different grays (one in the "there aren't any open queues" and a different one for the closed queue). It feels like once should be chosen and used for both cases.
  • There seems to be a different spacing under "Open queues" as "Closed queues".

Otherwise, this looks amazing!! I'm going to leave this unreviewed for @nwalters512 to dive into the code.

Copy link
Member

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

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

Overall, looks great! I think the biggest thing this is missing is real-time updates of open/closed status to clients. Students shouldn't have to reload the page to see that a queue is now closed. This shouldn't be too bad to implement - you can take a look at the files in src/socket/ to see how that's done for questions, and it should be pretty similar for queues as a whole.

res.status(201).send(updatedQueue)
})
)

router.patch(
Copy link
Member

Choose a reason for hiding this comment

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

If we want to stick to proper HTTP semantics (we already violate them in some places, but) we should really just have a single PATCH endpoint that can handle updating name, location, open/closed status, etc; it just updates any fields that are present in the request.


import ShowForCourseStaff from './ShowForCourseStaff'

const ClosedQueueCard = ({
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a lot of code duplication - might be better to just have QueueCard take an open prop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was trying this way earlier, I can do it like this, but if I did, then closed cards would have the hover animation. If thats okay, then I can switch it so they use the same component

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

earlier an issue was with the color of the card too, but now that would be an easy fix, so hover is the only issue

Copy link
Member

Choose a reason for hiding this comment

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

You should be able to fix that by just applying a different set of styles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

v true, i was trying something overly complicated last night lol

import { updateQueueStatus } from '../actions/queue'
import QueueStatusToggle from '../components/QueueStatusToggle'

function mapStateToProps() {
Copy link
Member

Choose a reason for hiding this comment

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

You can just pass null to connect instead of defining an empty function.

Copy link
Member

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

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

This is looking beautiful Genna! Live updating looks and feels awesome <3

Just a few more minor things, and then I'll go ahead and merge!

@@ -113,43 +115,29 @@ router.patch(
[
requireCourseStaffForQueue,
requireQueue,
check('name').isLength({ min: 1 }),
check('name')
.optional({ nullable: true })

This comment was marked as resolved.

{!this.props.queue.open && (
<Card className="bg-light mb-3">
<CardBody className="text-center">
This queue is closed.
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 spirit of friendly copy, maybe add "Check back later!"

@nwalters512 nwalters512 merged commit 9f0fa9e into master May 9, 2018
@nwalters512 nwalters512 deleted the queue-open-close-button branch May 9, 2018 21:05
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.

Have a course close/open button
3 participants