-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
E2006. Refactor tree_display_controller.rb #1698
Conversation
Rename children_node_ng to get_folder_contents. Change HTML method from POST to GET. Remove Tab System getter. Moved to folder contents getter Refactor children_node_ng Rename children_node_ng to get_folder_contents. Change HTML method from POST to GET. Remove Tab System getter. Moved to folder contents getter
Remove duplicate functions created by the merge.
…ildren_node_2_ng. Note: This object is not a FolderNode, but has the necessary information to populate a FolderNode object. Comments more clear Condense functions and make names more clear (cherry picked from commit ba6c360)
This removes course_node_for_current_ta? and assignment_node_for_current_ta?
Follows the pattern of serialize_folder_to_json
It doesn't seem to be called anywhere.
This new method will replace update_is_available() and update_is_available_2(). This optimization reduces redundant checks on the TA. It should not matter how the TA relates to the instructor. We should only check if the TA has privileges to view this course. If they do then all other checks are not needed.
assignment_or_course_is_available?() takes the place of these 2 methods.
Generated by expertiza-bot |
1 similar comment
Hey @pjloheide, |
PR bot doesn't not like these.
Instructors and TA's have access to courses, not individual assignments. It doesn't matter which node is passed in, we only about course access.
Required based off rubric.
Its true it should not redirect to '/tree_display/list', but its probably better to check that it directly renders #list by checking the http status code.
We will check the http status code like the instructor test since no redirect should occur.
This test doesn't use any methods from this class. It is not our job to test 'ta?()'.
Adding end to remove error
Remove unnecessary methods - Search the 45 methods defined in the controller to see where and why they are called. Remove outdated and unused methods, and see where it is fit to merge or replace methods.
Save code and avoid DRY issues - In addition to removing unnecessary methods, code should be reduced wherever possible to make the controller smaller and easier to read.
Improve understanding - For all necessary, complex methods in the controller, comments should be added to improve understanding of what methods do. This way, future reviewers won't have to search for implementations to understand the functionality when working on other issues.