Language Food offers the option to choose a different language, which only affects the food menu.
π€ Generated by Copilot at 53ded4c
Summary
ππ½οΈπ
This pull request adds support for using the legacy API as an alternative or fallback option for various features of the app, such as the timetable, exams, grades, rooms, etc. It also adds a feature to select a language for the food names in the mensa plan. It introduces new files, such as anonymous-legacy-api.js, authenticated-legacy-api.js, and *-legacy-utils.js, to handle the legacy API requests and responses. It also modifies some existing files, such as thi-session-handler.js, calendar-utils.js, FoodCard.jsx, and FilterFoodModal.jsx, to add conditional logic and props to switch between the legacy and the new API or the language preference. It also adds a new dependency, postgres-array, to parse the postgres array syntax used by the legacy API.
To work with the old and the newWe added some code to review
_With LEGACY_MODE we can switch_
Between APIs without a glitchAnd display the data we need to
Language Food offers the option to choose a different language, which only affects the food menu.
π€ Generated by Copilot at 53ded4c
Summary
ππ½οΈπ
This pull request adds support for using the legacy API as an alternative or fallback option for various features of the app, such as the timetable, exams, grades, rooms, etc. It also adds a feature to select a language for the food names in the mensa plan. It introduces new files, such as
anonymous-legacy-api.js
,authenticated-legacy-api.js
, and*-legacy-utils.js
, to handle the legacy API requests and responses. It also modifies some existing files, such asthi-session-handler.js
,calendar-utils.js
,FoodCard.jsx
, andFilterFoodModal.jsx
, to add conditional logic and props to switch between the legacy and the new API or the language preference. It also adds a new dependency,postgres-array
, to parse the postgres array syntax used by the legacy API.Walkthrough
selectedLanguageFood
andtoggleSelectedLanguageFood
props toFoodCard
andFilterFoodModal
components (link,link,link)FilterFoodModal
component and handleonChange
event (link)languageFood
variable based on props or default language inFood
andFoodCard
components (link,link)languageFood
variable to fetch and display food names from API inFood
andFoodCard
components (link,link,link,link,link,link,link)useFoodFilter
hook to store and update language selection in state andlocalStorage
(link,link,link,link,link,link,link)useFoodFilter
hook to child components (link)LEGACY_MODE
environment variable (link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link,link)postgres-array
dependency to parse postgres array syntax from legacy API (link,link,link)loadLegacyExamList
function to fetch and parse exam list from legacy API (link,link,link)getLegacyGradeList
function to fetch and parse grade list from legacy API (link,link,link,link)rooms-legacy-utils.js
file to fetch and parse free rooms data from legacy API (link,link,link)getFriendlyLegacyTimetable
function to fetch and parse timetable data from legacy API (link,link,link)anonymous-legacy-api.js
file to access legacy API without authentication (link,link,link,link,link,link,link,link)authenticated-legacy-api.js
file to access legacy API as a particular user (link,link,link,link,link,link,link,link,link)LEGACY_MODE
value in various functions and components (link,link,link,link,link,link,link,link,link,link,link,link,link)anonymous-api.js
andauthenticated-api.js
files to be used by legacy API files (link,link,link)rooms-utils.js
file to be used byrooms-legacy-utils.js
file (link,link,link)