illinois / queue

A microservice queue for holding open office hours
University of Illinois/NCSA Open Source License
82 stars 36 forks source link

Add download queue data button #290

Closed jackieo5023 closed 4 years ago

jackieo5023 commented 4 years ago

This PR:

image

Here is an example of what the download would look like given fake data. Unfortunately, I couldn't upload to GitHub as a csv. Here is the SQL query that this was based off of:

SELECT
  questions.id AS id,
  courses.name AS CourseName,
  queues.name AS QueueName,
  u_asked.netid AS AskedBy_netid, u_asked.universityName AS AskedBy_RealName,
  u_answered.netid AS AnsweredBy_netid, u_answered.universityName AS AnsweredBy_RealName,
  topic,
  CONVERT_TZ(enqueueTime, '+0:00', 'US/Central') AS enqueueTime,
  CONVERT_TZ(dequeueTime, '+0:00', 'US/Central') AS dequeueTime,
  CONVERT_TZ(answerStartTime, '+0:00', 'US/Central') AS answerStartTime,
  CONVERT_TZ(answerFinishTime, '+0:00', 'US/Central') AS answerFinishTime,
  comments, preparedness,
  questions.location AS UserLocation,
  queues.location AS QueueLocation,
  CONVERT_TZ(queues.createdAt, '+0:00', 'US/Central') AS Queue_CreatedAt,
  queueId, courseId
FROM questions
  INNER JOIN queues ON questions.queueId = queues.id
  INNER JOIN courses ON queues.courseId = courses.id
  INNER JOIN users u_asked ON questions.askedById = u_asked.id
  LEFT JOIN users u_answered ON questions.answeredById = u_answered.id
WHERE courseId=6
ORDER BY enqueueTime DESC
vercel[bot] commented 4 years ago

This pull request is being automatically deployed with ZEIT Now (learn more). To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/illinois/queue/fmpfyvbdci 🌍 Preview: In Progress

james9909 commented 4 years ago

Adding onto Nathan's comments, we should also add some tests for this new endpoint

jackieo5023 commented 4 years ago

@nwalters512 as for your point about downloads being in another section, I think at this point @wadefagen just wants downloads to be pushed out as quick as possible - so I guess think of this as a temporary solution, and later I can make it nicer to be able to download per queue as well.

jackieo5023 commented 4 years ago

Now ready for review again.

Here is an updated version of an example csv.

jackieo5023 commented 4 years ago

Tested on staging. Everything appears to be working properly and correctly (times are verified to be in CST as well).

nwalters512 commented 4 years ago

Going to give this a final look over!