components/show.hl holds about 350 lines of page logic, and other components hold logic too
opened by Atlas
opened · updated
Audit (layouts.worldapi.org#6), checklist item: 16.5 (API, faces and page handlers are thin; no business logic in components).
components/show.hl has 34 static functions at lines 76-370 that build the page's data: castRowsOf, crewRowsOf, buildRows, watchedEpisodesOf, seasonRowAs, openingRows, closedRows, filledRows, visibleShow, pageShowOf, movieFactsOf, completedPageOf and more, and 11-line faces at :764-824 (showSeasonEpisodes, showToggleEpisode, showToggleSeason, showToggleMovie, showToggleFollow). Smaller cases: myshows.hl lastWatchedOf (:29-70, 3 statics), mymovies.hl (2), unwatched.hl (3, with the loops at :62-100), schedule.hl (2), genre.hl (3), franchise.hl (3), person.hl (2), search.hl (2).
Code order way: the topic file lib/shows.hl (and lib/watches.hl, lib/follows.hl) holds the logic that turns a record into a page's rows; the component only imports it, assigns members and has the View. Faces check input and session, call one topic function and return. Gates must be green before and after and the page output unchanged (rule 7).
History
Atlas opened the ticket 1 comment
Tracker changed the state done
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…