Skip to content

Commit e74e80c

Browse files
author
Yushin Jo
committed
Merge branch 's24-remove-redundancy-transcript' of https://github.com/gordon-cs/gordon-360-ui into s24-remove-redundancy-transcript
2 parents 8b4083c + 4ea5b62 commit e74e80c

File tree

34 files changed

+384
-196
lines changed

34 files changed

+384
-196
lines changed

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"react-imask": "^7.4.0",
3737
"react-router": "^6.22.1",
3838
"react-router-dom": "^6.22.1",
39+
"react-router-hash-link": "^2.4.3",
3940
"react-to-print": "^2.15.1",
4041
"react-visibility-sensor": "^5.1.1",
4142
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz"
-11.6 KB
Loading

src/app.jsx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1+
import { useMsal } from '@azure/msal-react';
12
import AppRedirect from 'components/AppRedirect';
23
import BirthdayMessage from 'components/BirthdayMessage';
3-
import { createBrowserHistory } from 'history';
4-
import { useEffect, useRef, useState } from 'react';
5-
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
4+
import { useWatchSystemColorScheme } from 'hooks';
5+
import { useEffect, useState } from 'react';
6+
import { useLocation } from 'react-router';
7+
import { Route, Routes, useNavigate } from 'react-router-dom';
8+
import { CustomNavigationClient } from 'services/NavigationClient';
9+
import analytics from 'services/analytics';
610
import './app.global.css';
711
import styles from './app.module.css';
812
import ErrorBoundary from './components/ErrorBoundary';
913
import GordonHeader from './components/Header';
1014
import GordonNav from './components/Nav';
1115
import routes from './routes';
12-
import analytics from './services/analytics';
13-
import { useWatchSystemColorScheme } from 'hooks';
1416

1517
const App = () => {
1618
useWatchSystemColorScheme();
19+
const location = useLocation();
1720

18-
const [drawerOpen, setDrawerOpen] = useState();
21+
useEffect(() => {
22+
analytics.onPageView();
23+
}, [location]);
1924

20-
const historyRef = useRef(createBrowserHistory());
25+
// Setup custom navigation so that MSAL uses react-router for navigation
26+
const { instance } = useMsal();
27+
const navigate = useNavigate();
28+
const navigaitonClient = new CustomNavigationClient(navigate);
29+
instance.setNavigationClient(navigaitonClient);
30+
31+
const [drawerOpen, setDrawerOpen] = useState();
2132

2233
const onDrawerToggle = () => {
2334
setDrawerOpen((o) => !o);
2435
};
2536

26-
useEffect(() => {
27-
// Only use analytics in production
28-
if (import.meta.env.NODE_ENV === 'production') {
29-
analytics.initialize();
30-
}
31-
32-
historyRef.current.listen(() => analytics.onPageView());
33-
}, []);
34-
3537
return (
3638
<ErrorBoundary>
37-
<Router historyRef={historyRef.current}>
38-
<GordonHeader onDrawerToggle={onDrawerToggle} />
39-
<GordonNav onDrawerToggle={onDrawerToggle} drawerOpen={drawerOpen} />
40-
<main className={styles.app_main}>
41-
<BirthdayMessage />
42-
<AppRedirect />
43-
<Routes>
44-
{routes.map((route) => (
45-
<Route key={route.path} path={route.path} element={route.element} />
46-
))}
47-
</Routes>
48-
</main>
49-
</Router>
39+
<GordonHeader onDrawerToggle={onDrawerToggle} />
40+
<GordonNav onDrawerToggle={onDrawerToggle} drawerOpen={drawerOpen} />
41+
<main className={styles.app_main}>
42+
<BirthdayMessage />
43+
<AppRedirect />
44+
<Routes>
45+
{routes.map((route) => (
46+
<Route key={route.path} path={route.path} element={route.element} />
47+
))}
48+
</Routes>
49+
</main>
5050
</ErrorBoundary>
5151
);
5252
};

src/components/EventList/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ const smallHeader = (
1515
const headings = [
1616
{
1717
name: 'Event',
18-
size: '4',
18+
size: 4,
1919
},
2020
{
2121
name: 'Date',
22-
size: '2',
22+
size: 2,
2323
},
2424
{
2525
name: 'Time',
26-
size: '2',
26+
size: 2,
2727
},
2828
{
2929
name: 'Location',
30-
size: '4',
30+
size: 4,
3131
},
3232
];
3333

src/components/Header/index.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ const GordonHeader = ({ onDrawerToggle }) => {
145145
<Link to="/" component={ForwardNavLink} value={tabIndex}>
146146
<picture>
147147
{/* pick a different image as the screen gets smaller.*/}
148-
<source srcset={headerLogo72dpi} media="(min-width: 900px)" />
149-
<source srcset={headerLogo64dpi} media="(min-width: 600px)" />
148+
<source srcSet={headerLogo72dpi} media="(min-width: 900px)" />
149+
<source srcSet={headerLogo64dpi} media="(min-width: 600px)" />
150150
<source srcSet={headerLogo56dpiNoText} media="(max-width: 375px)" />
151151
<img src={headerLogo56dpi} alt="Gordon 360 Logo"></img>
152152
</picture>
@@ -165,6 +165,7 @@ const GordonHeader = ({ onDrawerToggle }) => {
165165
label="Involvements"
166166
component={ForwardNavLink}
167167
to="/involvements"
168+
tabIndex={0}
168169
/>
169170
<Tab
170171
className={styles.tab}

src/components/Profile/components/PersonalInfoList/components/UpdatePlannedGraduationYear/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FormControl, IconButton } from '@mui/material';
1+
import { FormControl, IconButton, Link } from '@mui/material';
22
import EditIcon from '@mui/icons-material/Edit';
33
import GordonDialogBox from 'components/GordonDialogBox';
44
import GordonSnackbar from 'components/Snackbar';
@@ -46,6 +46,7 @@ const UpdatePlannedGraduationYear = (props) => {
4646
<SearchField
4747
name="Planned Graduation Year"
4848
value={plannedGraduationYear}
49+
defaultLabel="None"
4950
updateValue={(event) => setPlannedGraduationYear(event.target.value)}
5051
options={Array.from({ length: 6 }, (_, i) => ({
5152
value: (currentYear + i).toString(),
@@ -59,7 +60,10 @@ const UpdatePlannedGraduationYear = (props) => {
5960
<p className={styles.note}>
6061
NOTE: <br /> This does not replace the Application to Graduate, which must be filled out
6162
8-12 months before you plan to graduate. The application can be found in{' '}
62-
<a href="https://my.gordon.edu"> my.gordon.edu</a>, in the Academics tab, on the left.
63+
<Link href="https://my.gordon.edu" underline="hover" className={'gc360_text_link'}>
64+
my.gordon.edu
65+
</Link>
66+
, in the Academics tab, on the left.
6367
</p>
6468
</GordonDialogBox>
6569
<GordonSnackbar

src/components/Profile/components/PersonalInfoList/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,15 @@ const PersonalInfoList = ({ myProf, profile, isOnline, createSnackbar }) => {
343343
<Typography>
344344
{' '}
345345
No strengths to show.{' '}
346-
<a
346+
<Link
347347
href="https://gordon.gallup.com/signin/default.aspx"
348+
underline="hover"
348349
target="_blank"
350+
className={'gc360_text_link'}
349351
rel="noopener noreferrer"
350352
>
351353
Take the test
352-
</a>{' '}
354+
</Link>{' '}
353355
</Typography>
354356
)
355357
}

src/components/Profile/components/SchedulePanel/components/ScheduleCalendar/ScheduleCalendar.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,19 @@ button.rbc-input::-moz-focus-inner {
7272
background-color: var(--mui-palette-primary-main);
7373
color: var(--mui-palette-primary-contrastText);
7474
font-size: 90%;
75-
width: 60%;
75+
width: 75%;
7676
flex: 1 1 0;
77-
word-wrap: break-word;
77+
word-wrap: normal;
7878
line-height: 1;
7979
height: 100%;
8080
min-height: 1em;
8181
}
82-
82+
@media (max-width: 1152px) {
83+
.rbc-row-segment .rbc-event-content,
84+
.rbc-day-slot .rbc-event-content {
85+
font-size: 70%;
86+
}
87+
}
8388
.rbc-day-slot .rbc-event,
8489
.rbc-day-slot .rbc-background-event {
8590
border: 1px solid var(--mui-palette-primary-main);

src/components/Profile/components/SchedulePanel/components/ScheduleCalendar/index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Calendar, luxonLocalizer } from 'react-big-calendar';
22
import { CourseEvent, Schedule, scheduleCalendarResources } from 'services/schedule';
33
import './ScheduleCalendar.css';
44
import { DateTime } from 'luxon';
5-
import { useWindowSize } from 'hooks';
65

76
const localizer = luxonLocalizer(DateTime, { firstDayOfWeek: 1 });
87

@@ -12,26 +11,26 @@ type Props = {
1211
};
1312

1413
const GordonScheduleCalendar = ({ schedule, onSelectEvent }: Props) => {
15-
const [width] = useWindowSize();
1614
const dayStart = new Date();
1715
dayStart.setHours(8, 0, 0, 0);
1816

1917
const dayEnd = new Date();
2018
dayEnd.setHours(22, 0, 0, 0);
2119

2220
const courseFormat = schedule.courses.map((course) => {
21+
let tempTitle = `${course.title.replaceAll(' ', '')}`;
2322
let title;
24-
if (course.location.includes('ASY')) {
25-
title = `${course.title}${width >= 1500 ? ' | ' : ' '} ${course.location}`;
26-
} else {
27-
title = `${course.title}${width >= 2212 ? ' | ' : ' '} ${course.location}`;
28-
}
29-
23+
course.location.includes('ASY')
24+
? (title = tempTitle + ' | ASYNC')
25+
: course.location.includes('null')
26+
? (title = tempTitle)
27+
: (title = tempTitle + `\n${course.location}`);
3028
return { ...course, title };
3129
});
3230

3331
return (
3432
<Calendar
33+
style={{ whiteSpace: 'pre-wrap' }}
3534
events={courseFormat}
3635
localizer={localizer}
3736
min={dayStart}
@@ -44,6 +43,15 @@ const GordonScheduleCalendar = ({ schedule, onSelectEvent }: Props) => {
4443
dayHeaderFormat: () => schedule.session.SessionDescription,
4544
}}
4645
onSelectEvent={onSelectEvent}
46+
onKeyPressEvent={(selectedEvent, keyPressEvent) => {
47+
if (
48+
'key' in keyPressEvent &&
49+
typeof keyPressEvent.key === 'string' &&
50+
keyPressEvent.key === 'Enter'
51+
) {
52+
onSelectEvent(selectedEvent);
53+
}
54+
}}
4755
/>
4856
);
4957
};

0 commit comments

Comments
 (0)