diff --git a/assets/css/_route_ladder.scss b/assets/css/_route_ladder.scss index 2b5d97ca1..e763ebe58 100644 --- a/assets/css/_route_ladder.scss +++ b/assets/css/_route_ladder.scss @@ -49,16 +49,14 @@ .card-body { display: inline-grid; - padding: 0; + grid-template-columns: 1fr 1fr auto 1fr 1fr; + padding: 6px 8px; align-items: center; } - .c-new-route-ladder__fake-dropdown { - height: 36px; - width: 36px; - border-radius: 4px; - background-color: $color-eggplant-500; - margin: 6px 8px; + .c-route-ladder__dropdown-button { + height: 2.25rem; + width: 2.25rem; } .c-route-ladder__alert-icon { @@ -82,8 +80,7 @@ .c-route-ladder__close-button-container { grid-column: 5/6; - margin-right: 8px; - margin-left: auto; + margin: 2px 0 2px auto; } } diff --git a/assets/src/components/routeLadder.tsx b/assets/src/components/routeLadder.tsx index 9d9ca7de6..abd105f53 100644 --- a/assets/src/components/routeLadder.tsx +++ b/assets/src/components/routeLadder.tsx @@ -29,9 +29,9 @@ import { CloseButton as OldCloseButton } from "./closeButton" import Tippy from "@tippyjs/react" import { tagManagerEvent } from "../helpers/googleTagManager" import inTestGroup, { TestGroups } from "../userInTestGroup" -import { ExclamationTriangleFill } from "../helpers/bsIcons" +import { ExclamationTriangleFill, PlusSquare } from "../helpers/bsIcons" import { RoutePill } from "./routePill" -import { Card, CloseButton } from "react-bootstrap" +import { Card, CloseButton, Dropdown } from "react-bootstrap" interface Props { route: Route @@ -91,7 +91,17 @@ export const NewHeader = ({ return ( -
+ {inTestGroup(TestGroups.DetoursPilot) && ( + + + + + + Add detour + + + + )} {hasAlert && ( `; -exports[`routeLadder renders a route ladder with the new header format 1`] = ` +exports[`routeLadder renders a route ladder with the new header and detour dropdown 1`] = `
+
+
+ 28 +
+
+
+
+
+
+ +
+
+ + + + + + + MATPN + + + + + WELLH + + + + + MORTN + + +
+
+
+`; + +exports[`routeLadder renders a route ladder with the new header format 1`] = ` +
+
+
diff --git a/assets/tests/components/routeLadder.test.tsx b/assets/tests/components/routeLadder.test.tsx index cee7c55d2..7a14f763e 100644 --- a/assets/tests/components/routeLadder.test.tsx +++ b/assets/tests/components/routeLadder.test.tsx @@ -228,6 +228,42 @@ describe("routeLadder", () => { expect(tree).toMatchSnapshot() }) + test("renders a route ladder with the new header and detour dropdown", () => { + jest + .mocked(getTestGroups) + .mockReturnValue([ + TestGroups.RouteLadderHeaderUpdate, + TestGroups.DetoursPilot, + ]) + + const route: Route = routeFactory.build({ + id: "28", + name: "28", + }) + const timepoints = [ + { id: "MATPN", name: "MATPN Name" }, + { id: "WELLH", name: "WELLH Name" }, + { id: "MORTN", name: "MORTN Name" }, + ] + + const { container: tree } = render( + {}} + reverseLadder={() => {}} + toggleCrowding={() => {}} + ladderDirections={{}} + ladderCrowdingToggles={{}} + hasAlert={false} + /> + ) + + expect(tree).toMatchSnapshot() + }) + test("renders a route ladder with vehicles", () => { const route: Route = routeFactory.build({ id: "28",