E1868 remove reports from review mapping controller: Difference between revisions
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
== Separation of Concerns == | == Separation of Concerns == | ||
As part of refactoring, we | As part of this refactoring, we will separate the 2 controller functions of review_mapping_controller: | ||
:- Manage various reviewers | |||
:- Display and manage different reports | |||
== generalize code to display reports == | == generalize code to display reports == | ||
The reports loop through either participants or teams. This loop can be generalized so that the headers, footers, etc. are all the same for all the reports. | |||
== modify the UI to list the types of reports == | == modify the UI to list the types of reports == | ||
In the current implementation, the reports are accessed by clicking on the “view review report” button in the buttons tray of an assignment, which leads into the review report page. This page contains a drop-down menu near the top which has the list of reports to navigate to. | |||
The drop-down menu can be replaced by a new ‘...’ icon in the buttons tray, which on hovering on it, would show the menu of various reports. | |||
== write tests for the new controller == | |||
Since the logic for report generation has been abstracted into a new controller, existing tests for report generation must be modified and new tests must be written for the new controller. | |||
= Implementation specifics = | |||
= Test Plan = | |||
The majority of our changes were refactors, and thusly required a few new tests, but we did need to adjust existing tests to expect proper mocked/seamed methods. | |||
= Results = | |||
= Conclusion = | |||
Revision as of 03:13, 10 November 2018
Background
As part of the project E1837[1], the review_mapping_controller.rb file has been significantly modified to improve maintainability, code quality and code readability. To summarize, the review_mapping_controller was modified by separating the report generation functionality into a new helper named - report_formatter_helper. This helper contains the logic of rendering different reports as per the user's request thus simplifying the code inside the controller.
This refactoring has a good impact on the overall design but can be further modified to made the code more Object-Oriented. The aim of our project is to extrapolate the report_formatter_helper code into a reports_controller.
Goals
- - separation of concerns
- - generalize code to display reports
- - modify the UI to list the types of reports
- - write tests for the new controller
Separation of Concerns
As part of this refactoring, we will separate the 2 controller functions of review_mapping_controller:
- - Manage various reviewers
- - Display and manage different reports
generalize code to display reports
The reports loop through either participants or teams. This loop can be generalized so that the headers, footers, etc. are all the same for all the reports.
modify the UI to list the types of reports
In the current implementation, the reports are accessed by clicking on the “view review report” button in the buttons tray of an assignment, which leads into the review report page. This page contains a drop-down menu near the top which has the list of reports to navigate to.
The drop-down menu can be replaced by a new ‘...’ icon in the buttons tray, which on hovering on it, would show the menu of various reports.
write tests for the new controller
Since the logic for report generation has been abstracted into a new controller, existing tests for report generation must be modified and new tests must be written for the new controller.
Implementation specifics
Test Plan
The majority of our changes were refactors, and thusly required a few new tests, but we did need to adjust existing tests to expect proper mocked/seamed methods.