uoft-tapp / tapp-cp

TA assignment and matching application (TAPP) & Contract Presentment helper (CP) at the Department of Computer Science, University of Toronto
8 stars 6 forks source link

Applicant model freezes when it is clicked [Development Branch] #149

Closed edward0414 closed 5 years ago

edward0414 commented 6 years ago

Nige: "the modal doesn't come up and my browser window freezes when clicking the last name. I haven't been able to spot the reason in the code, yet."

jsyoon01 commented 6 years ago

I think I figured out the problem. Let's say we are logged in as an instructor with Karen and Karen will be teaching csc209. By the changes made in the merge pull request #148, our application only asks to fetch relevant course data from the database (i.e., the courses that Karen will be teaching, csc209). However, let's say there's an applicant who has several course preferences, (csc148, csc209) for example. Upon selecting this applicant's last name, it will try to access csc148 data but then csc148 data was not fetched from the database, which is causing the problem.

I guess there are two ways of solving this.

  1. We can try to load necessary course info every time we click some applicant's last name.
  2. We can fetch all the course data from the database at the beginning and filter which courses to show on the instructor's panel.

I would like to ask you guys on which option sounds better. Both approaches seem OK to me.

nigef commented 6 years ago

Thanks for looking into that @jsyoon01

Probably try to avoid option 2. Fetching all that data seems unnecessary for just a couple sections in a modal. And that may get more complicated for different rounds, and sessions.

Upon selecting this applicant's last name, it will try to access csc148 data

If I understand option 1 correctly @jsyoon01, to fix the bug, it should be uncomplicated to set up a fetch for csc148 data when opening a modal, even if its not one of the instructor's courses. It is not unreasonable to do a new API fetch at opening each modal.

But that being said, I don't fully understand for example, why do we want to fetch csc148 data in a modal if a prof does not have that class in their instructor view?