You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current structure of TTS makes development harder due to the big amount of redundant states. This issue intends to simplify the entire structure of states and code in general.
This issue intends to minimize the data stored in local storage and, therefore make the development process easier.
New Structure
State
Explanation
major
Stores every major infomation
selected_major
Index of the currently selected major - the course unit picker modal will suffer a refactor as well, in the new update this state will only be relevant during the edition of the selected course_units instead of being global (i.e. existing a main major). Learn more about this refactor
course_info[]
Stores information of every course unit of the currently selected major
picked_courses : course[]
Stores the information of each picked course_unit
option[]
{ id, icon, name, course_option[] } - this is the new multipleOptions
Classes now have a set of slots. This will fix the problem having multiple options for the same class on the ScheduleListbox.
A note on the most important structure multiple options
Before the MultipleOptions structure looked like this:
The meaning of the old structure is the following:
The selected field is the array of the currently selected option (which square with the emojis we pressed)
The options field is where each entry represents the options of each emoji.
Now, the MultipleOptions is just an array of Option
exporttypeMultipleOptions=Array<Option>exporttypeOption={id: number,// The id goes from 1 to 10, since we have 10 optionsicon: string,// This is the image link for the emojiname: string,// This is the name (the default names are Horário <id>course_options: Array<CourseOption>// This is an array with the courses selected on the course picker}
The CourseOption has a field course_options that is an array where every entry represents each course.
In each course, in order to assign an option, we just change the value of picked_class_id from null to the correct one.
For example, if we chose the course with the course_id = 10 and a class with the id 50, the CourseOption would look like this:
{
course_id: 10,
picked_class_id: 50,
locked: /*either true or false*/,
filteredTeachers: [/* either empty or with the selected filtered teachers*/],
hide: [/* either empty or with the lesson types */],
}
And this object would be an entry in the array course_options of the MultipleOptions structure.
Problem
The current structure of TTS makes development harder due to the big amount of redundant states. This issue intends to simplify the entire structure of states and code in general.
This issue intends to minimize the data stored in local storage and, therefore make the development process easier.
New Structure
id
,icon
,name
,course_option[]
} - this is the new multipleOptionsclass_id
(references acourse
element),locked
,filtered_teachers
,hide
: Array<lesson_type> }id
,class[]
, ... }class_name
,slot[]
}day
,start_time
,duration
,room
}Obs:
lesson_type
= { T, TP, P, PL, etc. }A note on the most important structure multiple options
Before the
MultipleOptions
structure looked like this:The meaning of the old structure is the following:
The
selected
field is the array of the currently selected option (which square with the emojis we pressed)The
options
field is where each entry represents the options of each emoji.Now, the
MultipleOptions
is just an array ofOption
The
CourseOption
has a fieldcourse_options
that is an array where every entry represents each course.In each course, in order to assign an option, we just change the value of
picked_class_id
from null to the correct one.For example, if we chose the course with the
course_id = 10
and a class with the id 50, theCourseOption
would look like this:And this object would be an entry in the array
course_options
of theMultipleOptions
structure.Current subtasks
The text was updated successfully, but these errors were encountered: