@@ -157,6 +157,26 @@ export default function CoursePage({
157157 setFilteredCourses ( tempFilteredCourses )
158158
159159 } , [ courses , searchTerm , tableSettings ] )
160+
161+ const getCombinedCourse = ( ) => {
162+ let combinedCourse = { }
163+ combinedCourse . allReports = [ ]
164+ combinedCourse . issues = [ ]
165+ combinedCourse . instructors = [ ]
166+ Object . values ( courses ) . forEach ( course => {
167+ course ?. allReports ?. forEach ( ( report ) => {
168+ combinedCourse . allReports . push ( report )
169+ } )
170+ course ?. instructors ?. forEach ( ( instructor ) => {
171+ combinedCourse . instructors . push ( instructor )
172+ } )
173+ course ?. issues ?. forEach ( ( issue ) => {
174+ combinedCourse . issues . push ( issue )
175+ } )
176+ } )
177+ combinedCourse . title = "All Courses"
178+ return combinedCourse
179+ }
160180
161181 const handleTableSettings = ( newSettings ) => {
162182 setTableSettings ( Object . assign ( { } , tableSettings , newSettings ) )
@@ -349,7 +369,7 @@ export default function CoursePage({
349369 < div className = "flex-row justify-content-end mt-3 mb-2" >
350370 < button
351371 className = "btn btn-primary flex-row justify-content-center"
352- onClick = { ( ) => handleReportClick ( null ) }
372+ onClick = { ( ) => handleReportClick ( getCombinedCourse ( ) ) }
353373 >
354374 < ReportIcon className = "icon-md me-2" />
355375 < div className = "flex-column justify-content-center" > { t ( 'report.button.view_all_report' ) } </ div >
0 commit comments