Development: Frontend: Containers - zhaw-timetable/zhawo GitHub Wiki

Content

AppBarContainer ⇐ Component

Kind: global class
Extends: Component

AppBar Component. Styled in Material design. Can be passed children that will desplayed in bar.

appBarContainer.toggleDrawer

State of Drawer

Kind: instance property of AppBarContainer

BottomNavContainer ⇐ Component

Kind: global class
Extends: Component

new BottomNavContainer()

Bottom App Drawer/ Navigation Component. Uses React router to switch between Components, by pushing Components to history. Styled in material design. Contains Material Icons that can be found in the assets folder.

BottomNavContainer.updateViewState

Function that pushes view to history so Components can be changed using react router

Kind: static property of BottomNavContainer

Param Type Description
event event
value number (name of new Component)

DrawerContainer ⇐ Component

Kind: global class
Extends: Component

new DrawerContainer()

Drawer Component.

Floats to the right. Is hidden on Mobile and fixed on lager Screens.

DrawerContainer.toggleDrawer

Function that calls action to open/close drawer state

Kind: static property of DrawerContainer

DrawerContainer.handleDrawer

Function that is called when store changes. Sets local drawerOpen state to match store drawerOpen state.

Kind: static property of DrawerContainer

DrawerNav ⇐ Component

Kind: global class
Extends: Component

new DrawerNav()

DrawerNav Component

Navigation bar in Drawer. Contains all the links to the links to the different Views. Replaces BottomNav on Desktop.

DrawerOptions ⇐ Component

Kind: global class
Extends: Component

new DrawerOptions()

Drawer Option Component

Contains to option switches. Day/Week view. Dark/Light Mode. Contains Logout Button.

DrawerOptions.logout

Function that call Action logout user.

Kind: static property of DrawerOptions

DrawerOptions.handleThemeSwitchChange

Function that is called on when Theme Switch changes. Calls action to set state in Global Store.

Kind: static property of DrawerOptions

DrawerOptions.handleThemeChanged

Function that is called when store changes. Sets local themeSwitch state to match store theme state.

Kind: static property of DrawerOptions

DrawerOptions.handleViewChanged

Function that is called when store changes. Sets local viewSwitch state to match store isDayView state.

Kind: static property of DrawerOptions

DrawerOptions.handleViewSwitchChange

Function that is called on when Day/Week view Switch changes. Calls action to set state in global Store.

Kind: static property of DrawerOptions

LoginContainer ⇐ Component

Kind: global class
Extends: Component

new LoginContainer()

Login Component. Login page shown to users that are not loggin.

LoginContainer.login

Function called when store changes Set local state redirectToPreviousRoute to true. This allows user to be redirected to next Component.

Kind: static property of LoginContainer

LoginContainer.getCurrentViewPath

Function that pushes view to history so Components can be changed using react router.

Kind: static property of LoginContainer

LoginSearch ⇐ Component

Kind: global class
Extends: Component

new LoginSearch()

Login Search Component.

Maintains a list of all the possible User names. Filters list when user types. Login User and forwards to next Component. Chooses top name in list on enter press.

loginSearch.componentDidMount()

componentDidMount Function is called when the component is finished rendering. loadPossibleNames Function is called form this function, so that the possible username list is ready for the users when they start typing.

Kind: instance method of LoginSearch

LoginSearch.loadPossibleNames

Function calls for possible usernames to be called, if store does not contain names yet.

If store does contain names it set loadingPossibleNames state to false, so that the Autosuggest component is shown and not the 3 dots.

Kind: static property of LoginSearch

LoginSearch.refreshPossibleLoginNames

Function that is called when store changes. Sets local possibleLoginNames state to match store possibleLoginNames state.

Set loadingPossibleNames state to false, so that the Autosuggest component is shown and no longer the 3 dots.

Kind: static property of LoginSearch

LoginSearch.handleSuggestionsFetchRequested

Function that is called when store changes. Set local suggestions state by calling getSuggestions function.

Kind: static property of LoginSearch

LoginSearch.handleSuggestionsClearRequested

Function that clears local suggestions state. Called on Autosuggest onSuggestionsClearRequested.

Kind: static property of LoginSearch

LoginSearch.handleChange

Function called on Autosuggest component cahnge.

sets local value state to match Autosuggest value.

Kind: static property of LoginSearch

LoginSearch.handleKeyDown

Function called on every key press in Autosuggest. Checks if key press was enter. If enter was pressed it sets the user using loginUser function.

Kind: static property of LoginSearch

Param Type
event event

LoginSearch.loginUser

Function called to to login user. Sets current user by calling setCurrentUser action. Gets user schedule using getSchedule action.

Kind: static property of LoginSearch

Param Type
user User

LoginSearch.getSuggestions

Function filters possibleLoginNames with input. Returns list of names.

Kind: static property of LoginSearch

Param Type
value string

LoginSearch.getSuggestionValue

Function called by Autosuggest. return suggestion.

Kind: static property of LoginSearch

LoginSearch.onSuggestionSelected

Function called by Autosuggest on list element selection. Login user using loginUser.

Kind: static property of LoginSearch

MensaContainer ⇐ Component

Kind: global class
Extends: Component

new MensaContainer()

Mensa Container Component. Mensa Page. Displays Mensa Info.

MensaContainer.onSwipeStart

Function that sets local swipeInX state to. Used to swipe.

Kind: static property of MensaContainer

MensaContainer.onSwipeMove

Function that sets local swipeInX state. Used to swipe.

Kind: static property of MensaContainer

MensaContainer.onSwipeEnd

Function that swipes by calling swipeRight or swipeLeft action. Uses local swipeInX state to decided if the user is swiping left or right.

Kind: static property of MensaContainer

MensaContextMenu ⇐ Component

Kind: global class
Extends: Component

new MensaContextMenu()

Mensa Context Menu Component Contains the Mensa Elements that need to be passed to AppBar Go to today button Select Mensa button

MensaContextMenu.handleMensasLoaded

Function called when store changes. List of Mensas is readay and list can be stored in local state. Local selectedMensaName state is set.

Kind: static property of MensaContextMenu

MensaContextMenu.handleClick

Function that sets local anchorEl state to selected value

Kind: static property of MensaContextMenu

MensaContextMenu.handleClose

Function that sets local anchorEl state back to null

Kind: static property of MensaContextMenu

MensaContextMenu.getMenuPlan

Function that prevents the default behavior of an element, gets Menu plan for the selected Mensa using getMenuPlan action and sets local selectedMensaName state to the selected mensa and the anchorEl state to null.

Kind: static property of MensaContextMenu

Param Type
params Params

MensaContextMenu.handleGoToTodayClick

Function that prevents the default behavior of an element and uses the gotoDay action to go to current day.

Kind: static property of MensaContextMenu

MensaNavigationWeek ⇐ Component

Kind: global class
Extends: Component

new MensaNavigationWeek()

Mensa Navigation Week Component. Navigation bar with the days of the week. Used to switch between days.

MensaNavigationWeek.refreshNavigation

Function called when store changes. Sets local displayDay and displayWeek state to match store states.

Kind: static property of MensaNavigationWeek

MensaNavigationWeek.handleDateClick

Function that changes day by calling gotoDay action.

Kind: static property of MensaNavigationWeek

MensaNavigationWeek.handleWeekBackClick

Function that changes day by calling gotoDay action. Before calling gotoDay it subtracts a week from the current date.

Kind: static property of MensaNavigationWeek

MensaNavigationWeek.handleWeekForwardClick

Function that changes day by calling gotoDay action. Before calling gotoDay it adds a week from the current date.

Kind: static property of MensaNavigationWeek

MenuPlan ⇐ Component

Kind: global class
Extends: Component

new MenuPlan()

Menu Plan Component. List of the Meals for Selected Mensa on selected day.

MenuPlan.handleMenuPlanChanged

Function called when store changes. Sets local currentMenuDay, emptyMenuMessage and selectedMensaName state to match store.

Kind: static property of MenuPlan

NotFoundContainer ⇐ Component

Kind: global class
Extends: Component

new NotFoundContainer()

Not Found Container Component 404 page

RoomSearchContainer ⇐ Component

Kind: global class
Extends: Component

new RoomSearchContainer()

Room Search Container Component Shows all free rooms for current day.

Time slot can be selected and then rooms that are free for duration of full time are shown. Free rooms have a colored background.

RoomSearchContainer.setFreeRooms

Function called when store changes. Sets local currentFreeRooms state to match store currentFreeRooms state. Sets background of free rooms using setRoomBackground

Kind: static property of RoomSearchContainer

RoomSearchContainer.setFloor

Function called when store changes. Sets local currentFreeRooms, currentFloor and currentBuildingFloors state to match store. Sets background of free rooms using setRoomBackground

Kind: static property of RoomSearchContainer

RoomSearchContainer.setRoomBackground

Function that sets the state for rooms/floors that should have a colored background.

Kind: static property of RoomSearchContainer

RoomSearchContainer.handleSearchClick

Function that gets free rooms for a given time slot using getFreeRoomsByTime action. Uses local startTime and endTime state as time slot

Kind: static property of RoomSearchContainer

RoomSearchContainer.handleTimeChange

Functions that sets times on change. Set local startTime, startTimeIndex, endTime and endTimeIndex state. Makes sure end time is after start time.

Kind: static property of RoomSearchContainer

RoomSearchContainer.handleFloorClick

Function changes floor on changeFloor action.

Kind: static property of RoomSearchContainer

Schedule ⇐ Component

Kind: global class
Extends: Component

new Schedule()

Schedule Component Displays the schedule for the current user. User can swipe between days/weeks.

Schedule.toggleMonthView

Function that toggles local isOpen state.

Kind: static property of Schedule

Schedule.handleView

Function that is called when store changes. Sets local isDayView to match store.

Kind: static property of Schedule

Schedule.onSwipeStart

Function that sets local swipeInX state to 0. Used to swipe.

Kind: static property of Schedule

Schedule.onSwipeMove

Function that sets local swipeInX state. Used to swipe.

Kind: static property of Schedule

Schedule.onSwipeEnd

Function that sets local swipeInX state. Used to swipe.

Kind: static property of Schedule

EventDetailDialog ⇐ Component

Kind: global class
Extends: Component

new EventDetailDialog()

Event Detail Dialog Component Dialog Windows for Events.

LessonDay ⇐ Component

Kind: global class
Extends: Component

new LessonDay()

Lesson Day Component Lesson information container for one day.

lessonDay.startTimer()

Function that start a timer that updates activeSlot state every 60000 milliseconds. Local activeSlot state is set to current time slot using getTimeSlot.

Kind: instance method of LessonDay

lessonDay.stopTimer()

Ends interval started using startTimer.

Kind: instance method of LessonDay

LessonDay.setEvents

Function called on store change. Sets local vszhawEvents state to match store events state

Kind: static property of LessonDay

LessonDay.refreshSchedule

Function called when store changes. Sets local slots, displayDay and schedule states to match store.

Kind: static property of LessonDay

LessonDay.getTimeSlot

Function that returns current time slot in a given list of time slots.

Kind: static property of LessonDay

Param Type
slots Array.<slot>

LessonDay.handleEventClick

Function that sets local eventDetailsOpen state to true and eventForDetails to the given param, after checking if the clicked event contains actual information (not. f.ex. holiday). Doing so will cause model to open.

Kind: static property of LessonDay

LessonDay.handleCloseEventDetails

Function that sets local eventDetailsOpen state to false and eventForDetails to null. Doing so will cause model to close.

Kind: static property of LessonDay

LessonDay.getWeekKey

Function will return the first day of the week for the given date formatted as YYYY-MM-DD

Kind: static property of LessonDay

Param Type
displayDay Date

LessonDay.getDayKey

Function will return the given date formatted as YYYY-MM-DD

Kind: static property of LessonDay

Param Type
displayDay Date

LessonDay.checkForVszhawEvent

Function returns the next vszhawEvents, if one exists during current week.

Kind: static property of LessonDay

LessonWeek ⇐ Component

Kind: global class
Extends: Component

new LessonWeek()

Lesson Week Component Used to display Week Schedule.

lessonWeek.startTimer()

Function that start a timer that updates activeSlot state every 60000 milliseconds. Local activeSlot state is set to current time slot using getTimeSlot.

Kind: instance method of LessonWeek

lessonWeek.stopTimer()

Ends interval started using startTimer.

Kind: instance method of LessonWeek

LessonWeek.setEvents

Function called on store change. Sets local vszhawEvents state to match store events state

Kind: static property of LessonWeek

LessonWeek.refreshSchedule

Function called when store changes. Sets local slots, displayDay and schedule states to match store.

Kind: static property of LessonWeek

LessonWeek.getTimeSlot

Function that returns current time slot in a given list of time slots.

Kind: static property of LessonWeek

Param Type
slots Array.<slot>

LessonWeek.handleEventClick

Function that sets local eventDetailsOpen state to true and eventForDetails to the given param, after checking if the clicked event contains actual information (not. f.ex. holiday). Doing so will cause model to open.

Kind: static property of LessonWeek

LessonWeek.handleCloseEventDetails

Function that sets local eventDetailsOpen state to false and eventForDetails to null. Doing so will cause model to close.

Kind: static property of LessonWeek

LessonWeek.getWeekKey

Function will return the first day of the week for the given date.

Kind: static property of LessonWeek

Param Type
displayDay Date

LessonWeek.checkForVszhawEvent

Function returns the next vszhawEvents, if one exists during current week.

Kind: static property of LessonWeek

NavigationWeek ⇐ Component

Kind: global class
Extends: Component

new NavigationWeek()

Navigation Week Component Week days Mon-Sat used for navigation.

NavigationWeek.refreshNavigation

Function called when store changes. Sets local displayDay and displayWeek state to match store.

Kind: static property of NavigationWeek

NavigationWeek.handleDateClick

Function set current date to given date using gotoDay action

Kind: static property of NavigationWeek

Param Type
newDate date

NavigationWeek.handleWeekBackClick

Function that changes day by calling gotoDay action. Before calling gotoDay it subtracts a week from the current date.

Kind: static property of NavigationWeek

NavigationWeek.handleWeekForwardClick

Function that changes day by calling gotoDay action. Before calling gotoDay it adds a week from the current date.

Kind: static property of NavigationWeek

ScheduleContextMenu ⇐ Component

Kind: global class
Extends: Component

new ScheduleContextMenu()

Schedule Context Menu Component

ScheduleContextMenu.refreshState

Function called on store change. Set local currentSearch state to match store.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleGoToTodayClick

Function that prevents the default behavior of an element and uses the gotoDay action to go to current day.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleOpen

Function used to open Schedule Search by setting isScheduleSearchOpen state to true.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleClose

Function used to close Schedule Search by setting isScheduleSearchOpen state to false. Resets value state.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleClearSearch

Function clears search by calling clearSearch action

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.refreshPossibleNames

Function called on store change. Sets local possibleNames to match store.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleSuggestionsFetchRequested

Function used to set local suggestions state by calling getSuggestions. Used by Autosuggest.

Kind: static property of ScheduleContextMenu

Param Type
value string

ScheduleContextMenu.handleSuggestionsClearRequested

Function used to clear local suggestions state. Used by Autosuggest.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleChange

Function used to set local value state. Used by Autosuggest.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleKeyDown

Function called on every key press and prevents the default. Selects suggestion on enter press using handleSearch.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.handleSearch

Function that get schedule for search by calling getSchedule action and closes modular using handleClose.

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.getSuggestions

Function that filters possibleNames by value.

Kind: static property of ScheduleContextMenu

Param Type
value string

ScheduleContextMenu.getSuggestionValue

Function that get suggestion value from given suggestion

Kind: static property of ScheduleContextMenu

ScheduleContextMenu.onSuggestionSelected

Function that selects suggestion using handleSearch. Prevents Default.

Kind: static property of ScheduleContextMenu

VszhawEvent ⇐ Component

Kind: global class
Extends: Component

new VszhawEvent()

Vszhaw Event Component Container for Event, to place event in schedule

VszhawEvent.gotoLink

Function that forwards to given link

Kind: static property of VszhawEvent

Param Type
link string
⚠️ **GitHub.com Fallback** ⚠️