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

Hotfixes #803

Merged
merged 6 commits into from
Feb 25, 2022
Merged

Hotfixes #803

merged 6 commits into from
Feb 25, 2022

Conversation

srisainachuri
Copy link
Contributor

fixing graded file link issues to delegate and advisor views + fixing null pointers for resubmitted graded papers

Copy link
Member

@erwang01 erwang01 left a comment

Choose a reason for hiding this comment

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

LGTM. Not tested on stage.

Lots of reused code segments makes me think we can shove some parts of this into a react component on its own and pass the paper object and graded_files[paper.id] into the component.

Also I wonder what JS code convention is between the repeated gradedHrefData ? and a giant if {} block.

@@ -133,7 +133,7 @@ class AdvisorProfileView extends React.Component {
if (
registration &&
registration.registration_fee_paid &&
registration.delegate_fees_paid == registration.delegate_fees_owed
registration.delegate_fees_paid >= registration.delegate_fees_owed
Copy link
Member

Choose a reason for hiding this comment

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

Do we provide refunds or what not? This is the advisor checklist so probably not the right view but curious if somewhere we have a flag for a yes we are refunding you in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do provide refunds but until they are processed, it's for the treasurer's records that the fees paid might be greater than fees owed.

var fileNames = paper.file.split("/");
var fileName = fileNames[fileNames.length - 1];
var gradedFileNames = gradedHrefData ? paper.graded_file.split("/") : null;
var gradedFileName = gradedFileNames ? gradedFileNames[gradedFileNames.length - 1] : null;
Copy link
Member

Choose a reason for hiding this comment

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

Over here, what if gradedFileNames is empty list, so gradedFileName is null then the next line we try to add "graded_" to null?

I don't think it will happen unless paper.graded_file is empty string or something similarly odd but the code just looks a bit funky.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gradeFileName shouldn't be null if gradedHrefData isn't null so in this case it should be ok

Copy link
Contributor

@mathildepm mathildepm left a comment

Choose a reason for hiding this comment

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

LGTM! Should consider Eric's suggested for later bug fixes since Paper grading is a nightmare.

@srisainachuri
Copy link
Contributor Author

srisainachuri commented Feb 25, 2022

LGTM. Not tested on stage.

Lots of reused code segments makes me think we can shove some parts of this into a react component on its own and pass the paper object and graded_files[paper.id] into the component.

Also I wonder what JS code convention is between the repeated gradedHrefData ? and a giant if {} block.

This is a good point. A lot of the reused code could be condense into a separate component since it probably reflects being written at different times. Will make an issue to work on this in the future.

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.

3 participants