E1868 remove reports from review mapping controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 29: Line 29:


= Test Plan =
= 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 =
= Results =


= Conclusion =
= Conclusion =

Revision as of 23:40, 13 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

Results

Conclusion