-
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
Add download queue data button #290
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/illinois/queue/fmpfyvbdci |
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.
Sweet! It'll be great to have these data exports be self-service instead of requiring manual queries from an admin. I left a few inline comments. A few broader questions:
- Is there a reason the download is associated with the course as a whole and not with a specific queue? Now that queues are being used "persistently", I would imagine it would be most useful to have this data be per-queue. That's not to say an endpoint to get data for a course as a whole wouldn't be useful too!
- To my point of potentially wanting more downloads in the future, it might be nice to design for that from the start and put downloads in a location other than the course header. Perhaps a separate "downloads" section at the bottom of the course page?
Adding onto Nathan's comments, we should also add some tests for this new endpoint |
src/api/courses.js
Outdated
attributes: { | ||
include: [ | ||
['netid', 'AskedBy_netid'], | ||
['universityName', 'AskedBy_RealName'], |
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.
Calling something a "real" name has certain unwanted connotations. For instance, I have trans friends whose university name is not their real name; there are also students who use a different name day-to-day from what's in Enterprise. I think there are a couple potential changes here:
- calling this
UniversityName
- the above, but also exporting the
PreferredName
field - doing what the UI/API already do: taking the preferred name if it's specified and falling back to the name provided by Shib if they aren't
- omitting the name entirely
I think my personal preference would be the third option: it's most consistent with how names are treated everywhere else in the queue. There is the potential for abuse (I can set my preferred name to an arbitrary string), but the nedid can always be cross-referenced with a roster or the university directory if there are doubts about a user's identity.
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'll play around with the options you listed here - maybe one of them can solve the weird issue mentioned above.
@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. |
Now ready for review again.
Here is an updated version of an example csv. |
… into download-queue-data
Tested on staging. Everything appears to be working properly and correctly (times are verified to be in CST as well). |
Going to give this a final look over! |
const formattedTime = | ||
time !== null | ||
? moment | ||
.tz(time, 'YYYY-MM-DD HH:mm:ss.SSS Z', 'US/Central') |
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.
Thought: this may be undesirable if/when we roll out to schools like UBC that aren't in the central timezone. When that happens, we should either a) report times in UTC and allow consumers of this data to transform it as needed, or b) associate some concept of timezone with either courses or institutions (one institutions are an entity that we have). I think I'd prefer the latter; at any rate, that's outside the scope of this PR.
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 is looking really good! Merging is blocked on fixing the href
on the download button; the other few comments are just questions.
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.
Woot, looks great! 🚀
This PR:
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: