UCSD / webreg-mobile

MIT License
1 stars 6 forks source link

Profile-Calendar and SOC-Search Implementation #29

Open p8gonzal opened 2 years ago

p8gonzal commented 2 years ago

Summary

Relevant Files and Changes:

Profile + Calendar main.dart Checking if token is being passed in (will be true when Campus Mobile opens Webreg-Mobile). If not, will redirect to authentication_sso.dart

authentication_sso.dart Will redirect user to SSO login page. Once logged in, will capture token from URL and redirect to bottom.dart (Main page)

bottom.dart Main page calls two objects of Calendar( calendarType: ). Type for classes + discussion: 'LECT_DISC’. Type for finals: ‘FINALS’.

calendar.dart Initializes an instance of the profile provider from providers/profile.dart. Begins by creating a future builder of profileProvider.fetchProfile(). Once call is complete, creates section cards of type CalendarCard from calendar_card.dart from a Profile Model from models/profile.dart. Main method to create cards is buildCalendarCard(String sectionType, SectionData sectionObject). ‘ providers/profile.dart Change Notifier containing profile service from services/profile.dart and profile model models/profile.dart.

service/profile.dart Employs Network Helper to call the user’s profile service. Will be replaced later with live APIs. Currently using mock lamda + api gateway: ‘https://i4ghbvwuo9.execute-api.us-west-2.amazonaws.com/qa/profile'

models/profile.dart Top level of ‘enrolled classes’ but is composed of smaller data models in models/schedule_of_classes.dart. Particularly SectionData.

Schedule Of Classes + Search search_view.dart Initializes an instance of the schedule of classes provider from providers/schedule_of_classes.dart. Upon first run of this search, we get current term and previous terms in order to fill in term selector. Done with a future builder calling from classesProvider.scheduleOfClassesService.fetchTerms() from services/schedule_of_classes.dart. Once complete and query is entered, query will be parsed and generate a search input. Then a future builder will call classesProvider.fetchClasses(searchBuilder). Once complete, results list will be generated. Upon selecting an item in results list, redirected to an instance of SearchDetail(data: course) where course model is passed in (models/schedule_of_classes.dart). Search Detail implemented in search_detail.dart.

search_detail.dart Unpacks CourseData model and displays different section options. UI heavy file.

providers/schedule_of_classes.dart Change notifier holding references to the corresponding service and model.

models/schedule_of_classes.dart Contains different models to parse data from live API: ScheduleOfClasses. Models include: CourseData: Top layer containing list of sections available for a course, Section Data: Second Layer holding information about professor, room, etc and MeetingData: Times for labs, discussions, lectures, etc.

services/schedule_of_classes.dart Handles calls to academic term lambda: https://o17lydfach.execute-api.us-west-2.amazonaws.com/qa-peter/v1/term/current and schedule of classes api.

Changelog

[General] [Add] - Created new services and providers to implement some webreg functionality.

Test Plan

Notes: Calendar will still scroll incorrectly as described in #26 . Fixed could not be applied due to change in widget structure. Relevant files listed above. Other changed files are result of changed styling or previous developers. Client_ID in authentication_sso.dart is missing to avoid exposing key.