Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding commuter rail ridership to dashboard #1001

Merged
merged 5 commits into from
Jul 25, 2024
Merged

Conversation

devinmatte
Copy link
Member

@devinmatte devinmatte commented Jul 19, 2024

Motivation

Subset of #898 that adds ridership to the dashboard

Changes

Screenshot 2024-07-18 at 10 19 52 PM
  • Adds Ridership data for commuter rail to data dashboard

Testing Instructions

Test in beta today

@github-actions github-actions bot added the frontend Change to frontend code label Jul 19, 2024
Copy link
Contributor

@skaplan-dev skaplan-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits

Comment on lines +41 to +50
const href = React.useMemo(() => {
switch (line) {
case 'line-bus':
return `/bus/trips/single?busRoute=1&date=${BUS_DEFAULTS.singleTripConfig.date}`;
case 'line-commuter-rail':
return `/commuter-rail/ridership?crRoute=CR-Lowell&startDate=${COMMUTER_RAIL_DEFAULTS.lineConfig.startDate}&endDate=${COMMUTER_RAIL_DEFAULTS.lineConfig.endDate}`;
default:
return getLineSelectionItemHref(line, route);
}
}, [line, route]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we util this?

@@ -20,7 +20,7 @@ export const BetaDataNotice: React.FC = () => {
const isEndDateAfterBusMaxDay = endDate !== undefined && dayjs(endDate).isAfter(BUS_MAX_DAY);

if (
(line === 'line-bus' || linePath === 'bus') &&
(line === 'line-commuter-rail' || linePath === 'commuter-rail') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have these as consts somewhere?

@@ -21,8 +21,10 @@ export const GobbleDataNotice: React.FC = () => {
const isEndDateAfterBusMaxDay = endDate !== undefined && dayjs(endDate).isAfter(BUS_MAX_DAY);

if (
(line === 'line-bus' || linePath === 'bus') &&
(isStartDateAfterBusMaxDay || isEndDateAfterBusMaxDay)
((line === 'line-bus' || linePath === 'bus') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more const

@devinmatte devinmatte merged commit a6ea682 into main Jul 25, 2024
4 checks passed
@devinmatte devinmatte deleted the commuter-rail-ridership branch July 25, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Change to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants