Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/ntgl 404 persisting prev data (#792)
* Changed the default storage object to include a timetable array and added a useState for selected Timetable index * Create handlers for changing and deleting timetables * fix: updateTimetableEvents now fetches current timetable properly * Fixed main idea for deleting timetables. Created timetables component to automatically rerender * Fixed multiple timetables functionality Fixed multiple timetables functionality + fixed issue with not allowing user to select classes * refactor(client): NTGL-384 Move logic of timetable tabs to separate file * feat(client): NTGL-384 Initial creation of styled-components for timetable tabs bar * fix(client): NTGL-384 Change add timetable click handler to work on entire tab instead of just the icon * style(client): NTGL-384 Add shadow and border styling for tabs * Added timetable renaming functionality * feat(client): NTGL-384 Add delete modal to menu * fix(client): NTGL-384 Fix bug where displayTimetables[selectedTimetable].name would throw an error * Fixed deleting timetables functionality * Fixed issue with timetable data being passed to other timetables * Fixed bugs with deleting and adding new timetables * Added error checking to timetable rename and changed style * Added brief documentation * Changed timetable rename dialog style * Added tab duplication, themes, and improved speed of switching between tabs * feat(client): NTGL-384 Add alert for adding or copying a timetable when at timetable limit * feat(client): NTGL-384 Add right click tab handler to switch tabs and bring up menu * Added hotkeys to quick delete timetables * Fixed bugs with enter keybind * Added hotkey shortcut for creating new timetables * Fixed duplicate timetables moving both events * Fixed deep clone issue with duplicate timetables * Added drag and drop to sort timetable tabs + fixed some styling with tabs * Added hotkey to allow pressing enter to confirm timetable rename * Forgot to push the timetabledata interface * Added tool tips for adding and deleting timetable tabs * fixed scrolling on timetable tabs, add timetable button sticks to scroll bar for ease of access * fixed animation issue with custom events and switching between duplicate timetables * feat(client): NTGL-384 Add core history functionality to support multiple timetables (WIP) * feat(client): NTGL-384 Add modal supporting clearing current and all timetables, improvements to history logic * style(client): NTGL-384 connect tab nav bar to timetable * made timetable tabs similar to google tabs interface (changed border radius) * Minor changes to tab UI and tab clearing feature * Attempt at fixing history.ts for multiple timetables * feat(client): NTGL-384 Add undo alert after deleting timetable * feat(client): NTGL-384 Change history.ts to use hashmap/object instead of 2D array * NTGL-384 Generate timetableId function checks for collisions with displayTimetables, duplicated timetables now given ids * NTGL 384 Undo/redo works with timetable renaming * fix(client): NTGL-384 Rearranging timetable will successfully trigger save to local storage * Changed new tab button look * fix(client): NTGL-384 resetAll resets timetables to default * feat(client): NTGL-384 Re-wrote defaultReset logic to disable buttons on modal, and handle clearOne/clearAll seperately * style/refactor(client): Cleaned up code, move tab styling to a separate file * style(client): Minor style changes to history.ts * Moved timetable tab popups to separate file + tidied up some of the logic for timetable tabs * Fixed styling of rename timetable popup modal * Updated the delete timetable popup modal * Updated the style of clear timetables modal * Ran prettier on files * Context menu for rename, duplicate, delete is consistent with events. Got rid of inline styling for timetableTabs. Still yet to get rid of inline styling in the EditTabPopups. Fixed bug from context menu, now changes color when changing from light to dark mode * Changed EditTabPopups component to TimetableTabContextMenu for consistency with events * Tidied up rename timetable dialog * Refactored the repeated code for timetable states * made dialog for delete timetable consistent with discard changes for events * Made dialog for clear timetable(s) consistent with discard changes to event info * Cleaned up code and fixed tooltips and keyboard shortcuts for context menu * Added snackbar alert message for restoring deleted timetable - need to fix up the colour scheme for this * Fixed colour styling for restore timetable snackbar alert * Minor changes to restoreTimetable action component to be consistent with dialog messages * NTGL-384 refactor(client): Move/create helper functions related to creating timetables/history, simplify logic in history.ts * NTGL-384 refactor(client): minor changes to TimetableTab (move event duplicate function to utils) and History (fix logic) * NTGL-384 bugfix(client): fixed bug when history.ts creates a new timetableActions array for timetable, and added back disabling reset button functionality * Added styling to delete timetable button, fixed behaviour and bugs with undo/redo buttons * Edited padding of ExpandedClassView, ExpandedEventView and Rename timetable dialog * fix(client): NTGL-384 timetable time bounds properly reset upon timetable switching * fix(client): NTGL-384 timetable tab and course select wrapper aligned with timetable layout * fix(client): NTGL-384 close the edit timetable menu when they click out of edit timetable name * fix(client): NTGL-384 Location no longer a necessary field for CustomEvent creation/editing * Created CourseData object in defaults.ts * changed courseData object structure * feat: NTGL-402 Added color picker menu to ExpandedClassView, users can select colors for courses * added subtype property * disabled dragging of tutorial and laboratory classes * disabled edit on tutoring class cards * disabled edit icon on tutoring class card * changed context menu of tutoring card to only have a delete option * increasing timeout value for recieving course info * Added basic layout for switching between terms * Added basic implementation for storage of term data for switching terms * feat: colors for courses are independent for each timetable. Color choices are stored locally. * feat: duplicating timetables does not break custom colors * feat: History stores the assigned colors when reversing deletion of a course * resolved conflicts * disabled event link in tutoring and lab events * testing: add debugging code to App.tsx * fixed usage of createEventObj in timetableHelpers.ts * removed edit icon tutoring event * fixed styling * fixed syntax errors from merge * Added todos for jeremy, brainstormed/drafted mock behaviour for switching terms * fix: bug where initially loaded timetable resets to default assigned colors FIXED! * fix: minor changes to history to fix unwanted behaviour * feat: add save button to expanded class view * minor fix: disable save button functionality fix * able to change colors on tutorial card * bugfix: History branching bug fixed - reference to newly branched timetable is properly made * fix: older stored timetables will not break upon updating to assignedColors * created a new TutorialColorPicker file, that is the exact same as ColorPicker except with a Save button * Fixed errors with handling terms n history.ts * changed props of ColorPick to accept Save function and display save button only for tutorial events * fix: increased timeout value for fetching course info + refactored fetchTermData to fix issue with restoring previously saved data * styled colour picker in class cards to be consistent with tutoring classes * changed prop name of Color Picker from handleSaveNewTutorialColor to handleSaveNewColor * Fixed behaviour of preserving prev calendar data * Border outline of select term stays white and aligned, padded component * forcing tabs to only be dragged horizontally * chore: remove CTF artifacts * style: move inline styling of divider and list item into styled components * fix: add subtype to createLinkEvent to silence errors * refactoring and cleaning up code for termSelect * re-ordered terms in term select * removed comment and fixing linting errors * fixed undefined errors with rendering data on first load * testing fix to populate timetable data when moving to multiple terms version * debugged issues with migration to multiple terms version * removed unused imports and variables * NTGL-402 Fix minor styling issues * Fix other issues * style(event share, period): added new line and removed unused styled component * bugfix - colors retained on delete. Also removed code to prevent timetables on assigned color migration * Remove code that supported migration to assignedcolors * resolving comments, improved typing and removed unnecessary data * bugfix: loading timetable colours when switching terms * updated calls to scraper with generic path for fetching previous term data * fix: FIXED OUTLINE DISAPPEARING WHEN FOCUSED * removed redundant styles * updated changelog --------- Co-authored-by: eklavya-joshi <[email protected]> Co-authored-by: Michael Siu <[email protected]> Co-authored-by: manhualu <[email protected]> Co-authored-by: Jasmine Tran <[email protected]> Co-authored-by: Jeremy Le <[email protected]>
- Loading branch information