From 42c5017a8e941bd6b9658df072219c0dde01293a Mon Sep 17 00:00:00 2001 From: Rayan Tighiouart <88558727+tig-github@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:57:11 -0800 Subject: [PATCH 1/4] feat: Add warning text to save modal (#846) --- .../src/components/Header/LoadSaveFunctionality.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/antalmanac/src/components/Header/LoadSaveFunctionality.tsx b/apps/antalmanac/src/components/Header/LoadSaveFunctionality.tsx index 28941297b..d479f800c 100644 --- a/apps/antalmanac/src/components/Header/LoadSaveFunctionality.tsx +++ b/apps/antalmanac/src/components/Header/LoadSaveFunctionality.tsx @@ -99,13 +99,16 @@ class LoadSaveButtonBase extends PureComponent{this.props.actionName} - Enter your username here to {this.props.actionName.toLowerCase()} your schedule. + Enter your unique user ID here to {this.props.actionName.toLowerCase()} your schedule. + + + Make sure the user ID is unique and secret, or someone else can overwrite your schedule. Date: Thu, 28 Dec 2023 23:22:55 -0800 Subject: [PATCH 2/4] chore: update meta tags (#850) --- apps/antalmanac/index.html | 10 +++++----- apps/antalmanac/public/index.html | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/antalmanac/index.html b/apps/antalmanac/index.html index 9ff7d5e70..716ad4193 100644 --- a/apps/antalmanac/index.html +++ b/apps/antalmanac/index.html @@ -23,15 +23,15 @@ - + - + @@ -40,7 +40,7 @@ @@ -68,7 +68,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - AntAlmanac — UCI Schedule Planner + AntAlmanac - UCI Schedule Planner diff --git a/apps/antalmanac/public/index.html b/apps/antalmanac/public/index.html index a8690f7bf..8ba783009 100644 --- a/apps/antalmanac/public/index.html +++ b/apps/antalmanac/public/index.html @@ -23,15 +23,15 @@ - + - + @@ -40,7 +40,7 @@ From b08e18e4763ecc40b32fadc81c0255f1737ecf2b Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Sun, 7 Jan 2024 16:52:17 -0800 Subject: [PATCH 3/4] fix: colorpicker no longer closes on click (#851) --- apps/antalmanac/src/components/Calendar/CalendarRoot.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/antalmanac/src/components/Calendar/CalendarRoot.tsx b/apps/antalmanac/src/components/Calendar/CalendarRoot.tsx index 47ce75da7..5a97c28e9 100644 --- a/apps/antalmanac/src/components/Calendar/CalendarRoot.tsx +++ b/apps/antalmanac/src/components/Calendar/CalendarRoot.tsx @@ -52,8 +52,8 @@ const AntAlmanacEvent = ({ event }: { event: CalendarEvent }) => { {event.showLocationInfo ? event.locations.map((location) => `${location.building} ${location.room}`).join(', ') : event.locations.length > 1 - ? `${event.locations.length} Locations` - : `${event.locations[0].building} ${event.locations[0].room}`} + ? `${event.locations.length} Locations` + : `${event.locations[0].building} ${event.locations[0].room}`} {event.sectionCode} @@ -164,8 +164,6 @@ export default function ScheduleCalendar(props: ScheduleCalendarProps) { setCurrentScheduleIndex(AppStore.getCurrentScheduleIndex()); setEventsInCalendar(AppStore.getEventsInCalendar()); setFinalEventsInCalendar(AppStore.getFinalEventsInCalendar()); - - handleClosePopover(); }; const updateScheduleNames = () => { From 53d364f9e778740cb5ef879efdea673970f8bccb Mon Sep 17 00:00:00 2001 From: Junping Luo <53324036+JacE070@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:25:21 -0800 Subject: [PATCH 4/4] Add custom event to the route (#853) --- apps/antalmanac/src/components/Map/Map.tsx | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/antalmanac/src/components/Map/Map.tsx b/apps/antalmanac/src/components/Map/Map.tsx index 569a740ec..4516c7ef3 100644 --- a/apps/antalmanac/src/components/Map/Map.tsx +++ b/apps/antalmanac/src/components/Map/Map.tsx @@ -148,7 +148,7 @@ export default function CourseMap() { const [searchParams] = useSearchParams(); const [selectedDayIndex, setSelectedDay] = useState(0); const [markers, setMarkers] = useState(getCoursesPerBuilding()); - const [customEventMarkers] = useState(getCustomEventPerBuilding()); + const [customEventMarkers, setCustomEventMarkers] = useState(getCustomEventPerBuilding()); const [calendarEvents, setCalendarEvents] = useState(AppStore.getCourseEventsInCalendar()); useEffect(() => { @@ -181,6 +181,20 @@ export default function CourseMap() { }; }, []); + useEffect(() => { + const updateCustomEventMarkers = () => { + setCustomEventMarkers(getCustomEventPerBuilding()); + }; + + AppStore.on('customEventsChange', updateCustomEventMarkers); + AppStore.on('currentScheduleIndexChange', updateCustomEventMarkers); + + return () => { + AppStore.removeListener('customEventsChange', updateCustomEventMarkers); + AppStore.removeListener('currentScheduleIndexChange', updateCustomEventMarkers); + }; + }, []); + useEffect(() => { const locationID = Number(searchParams.get('location') ?? 0); const building = locationID in buildingCatalogue ? buildingCatalogue[locationID] : undefined; @@ -274,14 +288,15 @@ export default function CourseMap() { * Every two markers grouped as [start, destination] tuples for the routes. */ const startDestPairs = useMemo(() => { - return markersToDisplay.reduce((acc, cur, index) => { + const allEvents = [...markersToDisplay, ...customEventMarkersToDisplay]; + return allEvents.reduce((acc, cur, index) => { acc.push([cur]); if (index > 0) { acc[index - 1].push(cur); } return acc; - }, [] as (typeof markersToDisplay)[]); - }, [markersToDisplay]); + }, [] as (typeof allEvents)[]); + }, [markersToDisplay, customEventMarkersToDisplay]); return (