brownfield-team / anacapa-github-linker

A tool for managing students in computer science courses. Deployed at:
https://ucsb-cs-github-linker.herokuapp.com
MIT License
4 stars 6 forks source link

As an instructor I can add additional instructors to a course so that multiple users can have instructor access to a course #522

Open pconrad opened 2 years ago

pconrad commented 2 years ago

User Story (Epic)

Fine grained user stories

  1. As a developer, there is a react component I can use to list multiple instructors for a course so that I have an easy way to display multiple instructors for a course, seeing name and email address.
  2. As a user, on any course where I have access to the course page, I can see a list of the instructors for that course right under the name of the course, so that I know who the instructors are for the course.
  3. As a developer, there is a method

Acceptance Criteria

...

Implementation Todos

Back end:

Front end:

Testing:

pconrad commented 2 years ago

It appears that models/course.rb has a method called instructor.

We probably want to remove that method and replace it with one called instructors.

The .instructor method appears to be used in only one place, which is in this code inside models/user.rb... here's that code with a comment that suggests what the replacement code might look like. I'm not sure if include? is a legitimate method here, but it's at least correct as pseudocode...

image
pconrad commented 2 years ago

Another implementation suggestion:

The first step might be to go to app/views/courses/_show_admin.html.erb and add a React Component at the top of the page called CourseInfo. That component could at first just take a @course object, and perhaps also a list of the instructors, and it would render a table showing for each instructor, just their name and their email address.

Later on, all the other stuff that's in the header of the course page could be moved into the React component as well.

image
pconrad commented 2 years ago

As a remidner, when you create a new react component that you are going to insert into an .erb file with react_component, you have to register it inside this file:

app/javascript/packs/react-bundle.js