Skip to content

Commit

Permalink
cleanup: Remove detour-route-selection and route-ladder-header-update…
Browse files Browse the repository at this point in the history
… test groups (#2697)
  • Loading branch information
joshlarson authored Jul 24, 2024
1 parent cf7d0ed commit 656a63f
Show file tree
Hide file tree
Showing 12 changed files with 414 additions and 681 deletions.
7 changes: 1 addition & 6 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { DetourFinishedPanel } from "./detourFinishedPanel"
import { DetourRouteSelectionPanel } from "./detourRouteSelectionPanel"
import { Route, RoutePattern } from "../../schedule"
import RoutesContext from "../../contexts/routesContext"
import inTestGroup, { TestGroups } from "../../userInTestGroup"

const displayFieldsFromRouteAndPattern = (
route: Route,
Expand Down Expand Up @@ -203,11 +202,7 @@ export const DiversionPage = ({
routeDirection={routeDirection ?? "??"}
detourFinished={reviewDetour !== undefined}
onReviewDetour={reviewDetour}
onChangeRoute={
inTestGroup(TestGroups.DetourRouteSelection)
? () => send({ type: "detour.route-pattern.open" })
: undefined
}
onChangeRoute={() => send({ type: "detour.route-pattern.open" })}
/>
) : snapshot.matches({ "Detour Drawing": "Share Detour" }) &&
editDetour ? (
Expand Down
2 changes: 1 addition & 1 deletion assets/src/components/detours/diversionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface DiversionPanelProps {
routeDirection: string
detourFinished?: boolean
onReviewDetour?: () => void
onChangeRoute?: () => void
onChangeRoute: () => void
}

export const DiversionPanel = ({
Expand Down
83 changes: 17 additions & 66 deletions assets/src/components/routeLadder.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React, { useId } from "react"
import {
AlertIcon,
CrowdingIcon,
ReverseIcon,
ReverseIconReversed,
} from "../helpers/icon"
import { CrowdingIcon, ReverseIcon, ReverseIconReversed } from "../helpers/icon"
import {
getLadderCrowdingToggleForRoute,
LadderCrowdingToggle,
Expand All @@ -25,7 +20,6 @@ import { LoadableTimepoints, Route, RouteId } from "../schedule.d"
import IncomingBox from "./incomingBox"
import Ladder from "./ladder"
import Loading from "./loading"
import { CloseButton as OldCloseButton } from "./closeButton"
import Tippy from "@tippyjs/react"
import { tagManagerEvent } from "../helpers/googleTagManager"
import inTestGroup, { TestGroups } from "../userInTestGroup"
Expand All @@ -48,39 +42,6 @@ interface Props {
onAddDetour?: (route: Route) => void
}

export const Header = ({
routeName,
onClose,
hasAlert,
}: {
routeName: string
onClose: () => void
hasAlert: boolean
}) => {
return (
<div className="c-route-ladder__header">
{hasAlert && (
<Tippy
content="Active detour"
trigger="click"
onShow={() => tagManagerEvent("alert_tooltip_clicked")}
>
<AlertIcon
className="c-route-ladder__alert-icon"
aria-label="Route Alert"
/>
</Tippy>
)}
<div className="c-route-ladder__close-button-container">
<OldCloseButton closeButtonType="l_darker" onClick={onClose} />
</div>

<div className="c-route-ladder__route-name">{routeName}</div>
</div>
)
}

// TODO: delete old header after roll-out
export const NewHeader = ({
routeName,
onClose,
Expand Down Expand Up @@ -130,8 +91,11 @@ export const NewHeader = ({
trigger="click"
onShow={() => tagManagerEvent("alert_tooltip_clicked")}
>
<div className="c-route-ladder__alert-icon">
<ExclamationTriangleFill aria-label="Route Alert" />
<div
className="c-route-ladder__alert-icon"
aria-label="Route Alert"
>
<ExclamationTriangleFill />
</div>
</Tippy>
)}
Expand Down Expand Up @@ -251,30 +215,17 @@ const RouteLadder = ({

return (
<>
{inTestGroup(TestGroups.RouteLadderHeaderUpdate) ? (
<NewHeader
routeName={route.name}
hasAlert={hasAlert}
onClose={() => {
deselectRoute(route.id)
}}
showDropdown={
inTestGroup(TestGroups.DetoursPilot) &&
inTestGroup(TestGroups.DetourRouteSelection)
}
onClickAddDetour={() => {
onAddDetour?.(route)
}}
/>
) : (
<Header
routeName={route.name}
hasAlert={hasAlert}
onClose={() => {
deselectRoute(route.id)
}}
/>
)}
<NewHeader
routeName={route.name}
hasAlert={hasAlert}
onClose={() => {
deselectRoute(route.id)
}}
showDropdown={inTestGroup(TestGroups.DetoursPilot)}
onClickAddDetour={() => {
onAddDetour?.(route)
}}
/>
<Controls
displayCrowdingToggleIcon={displayCrowding}
ladderDirection={ladderDirection}
Expand Down
2 changes: 0 additions & 2 deletions assets/src/userInTestGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ import getTestGroups from "./userTestGroups"

export enum TestGroups {
DemoMode = "demo-mode",
DetourRouteSelection = "detour-route-selection",
DetoursPilot = "detours-pilot",
DummyDetourPage = "dummy-detour-page",
KeycloakSso = "keycloak-sso",
MinimalLadderPage = "minimal-ladder-page",
LateView = "late-view",
RouteLadderHeaderUpdate = "route-ladder-header-update",
}

const inTestGroup = (key: TestGroups): boolean => {
Expand Down
25 changes: 0 additions & 25 deletions assets/stories/skate-components/routeLadderHeader.stories.tsx

This file was deleted.

Loading

0 comments on commit 656a63f

Please sign in to comment.