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

Course details #41

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Course details #41

wants to merge 9 commits into from

Conversation

beetosu
Copy link
Contributor

@beetosu beetosu commented Aug 21, 2021

Proposed changes


Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes


What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist


Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

  • My changeset covers only what is described above (no extraneous changes)
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged downstream

Further comments


I'm not entirely sure if I implemented the filter described in the issue correctly (I made it a "group by" dropdown, with the elements being the category described).

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

This page shows the general info of the course, alongside some buttons which direct to specific actions a user can take (view the roster/gradebook if a user-course object exists for the user, and edit course if the user is an instructor). The page also shows all of the assignments associated with the course.

Screenshot 2021-08-21 at 16-58-36 AutoFour
Screenshot 2021-08-21 at 17-00-26 AutoFour
Screenshot 2021-08-21 at 17-00-40 AutoFour
Screenshot 2021-08-21 at 17-00-49 AutoFour

@beetosu beetosu self-assigned this Aug 21, 2021
</header>
{userCourse &&
<div>
<Link className={styles.button} to={`${courseId}/assignments`}><Button>Gradebook</Button></Link>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure this is the correct link, but I was having issues finding a grade book page

@beetosu beetosu linked an issue Aug 21, 2021 that may be closed by this pull request
@MikeDrewitt
Copy link
Member

Run npm run format please

<ListItemWrapper
to={`/courses/${courseId}/assignments/${assignment.id}`}
tag={`${courseId}-${assignment.id}`}>
<h3 className={styles.name}>{assignment.name}</h3>
Copy link
Member

Choose a reason for hiding this comment

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

Under normal circumstances I don't think you'd want to use a header in a list item, even if the sizing is correct. It make screen readers go wonky when you're misusing "headers"

to={`/courses/${courseId}/assignments/${assignment.id}`}
tag={`${courseId}-${assignment.id}`}>
<h3 className={styles.name}>{assignment.name}</h3>
<p className={styles.dueDate}>Due At: {prettyPrintDate(assignment.dueDate)}</p>
Copy link
Member

Choose a reason for hiding this comment

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

Might we want to include an assignments description here? Maybe make it ellipse out after 1 line? At that point it might not even be useful

Maybe 3 or so lines?


// Find the users relationship to the course by calling all user-course objects, and seeing if any have the user/course id.
const userCourses = await RequestService.get<UserCourse[]>(`/api/user-courses`);
const uCourse = userCourses.filter(u => u.courseId === parseInt(courseId) && u.userId === userId).shift()
Copy link
Member

Choose a reason for hiding this comment

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

Firstly, you don't actually need the

u.userId === userId 

part since this endpoint only returns the current user's user-courses.

Secondly, I think this would be a good opportunity to add a query parameter to just look up the one we want rather than grabbing the whole list and shrunking it down

/api/user-courses?courseId=123

<header>
<h1>{course.name}</h1>
<div className={styles.subtitle}>
<h3>{course.number} | {course.semester} ({prettyPrintDate(course.startDate)}-{prettyPrintDate(course.endDate)})</h3>
Copy link
Member

Choose a reason for hiding this comment

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

This is a proper use of a header.

And with this you might be able to see why having a bunch of these would make using a screen reader a bit harder to use

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.

Course Details Page
2 participants