refactor: Phase 1 PR3/7 — Extract DataCollection IIFE module (#129) - #147
Conversation
✅ VERIFIEDReviewer: cb-team-reviewer Files Reviewed
SummaryPhase 1 PR3/7: Extracts 14 data collection/transformation methods from JavaScript.html into
|
Extract 14 methods (11 public + 3 private helpers) from JavaScript.html
to DataCollection.js.html using IIFE pattern (function(App) { ... })(App).
Methods extracted:
- _forEachCourse, _collectFromScheduleData, _collectFromAllCourses
- getAllTags, getGlobalAllTags, getGlobalAllCourseNames, getGlobalAllTeachers
- ensureDataIds, buildCourseColorMap, sortClassrooms
- checkTimeConflict, countOccurrences, updateAllOccurrences
- findNextUpcomingClasses
All this.xxx references converted to App.xxx.
buildCourseColorMap default param changed from = this.scheduleData
to explicit undefined check (IIFE cannot reference this).
Load order: JavaScript.html → UtilityFunctions.js → DataCollection.js → init()
Follows spec. npm test: 1147/1147 pass. eslint: 0 errors.
Part of #129 Phase 1 (PR3/7)
Agend-Agent: cb-team-impl2
Agend-Branch: refactor/phase1-pr3-data-collection
Agend-Issued-At: 2026-06-24T05:47:33.654268+00:00
f6708ba to
ee85b37
Compare
Summary
Extract 14 methods (11 public + 3 private helpers) from JavaScript.html to a new
DataCollection.js.htmlIIFE module as part of #129 Phase 1.Part of #129 Phase 1 (PR3/7)
Methods Extracted
_forEachCourse_collectFromScheduleData_forEachCourse_collectFromAllCoursesgetAllTags_collectFromScheduleDatagetGlobalAllTags_collectFromAllCoursesgetGlobalAllCourseNames_collectFromAllCoursesgetGlobalAllTeachers_collectFromAllCoursesensureDataIdsApp.generateUniqueId(UtilityFunctions)buildCourseColorMapApp.stringToHashCode,AppConfig.COURSE_COLORSsortClassroomscheckTimeConflictApp.timeToMinutes(UtilityFunctions)countOccurrences_forEachCourseupdateAllOccurrences_forEachCoursefindNextUpcomingClassesApp.timeToMinutes,AppConfig.MODESChanges
this.xxx→App.xxxDataCollection.jsinclude afterUtilityFunctions.js, beforeApp.init()IIFE_EXTRACTEDset, updated count 41→30Verification
npm test: 1147/1147 pass (36 files)npx eslint --ext .html .: 0 errors (8 pre-existing warnings)Notable
buildCourseColorMapdefault parameterdataSource = this.scheduleDatachanged to explicitundefinedcheck since IIFE cannot referencethis