diff --git a/assets/css/_diversion_page.scss b/assets/css/_diversion_page.scss index 846b25ef3..464e3629a 100644 --- a/assets/css/_diversion_page.scss +++ b/assets/css/_diversion_page.scss @@ -44,10 +44,14 @@ .l-diversion-page__header { border-bottom: none; } + + .l-diversion-page-panel__header { + align-items: center; + } + .c-diversion-panel__header_text, .c-detour-panel__subheader, - .c-diversion-panel__back-button-container, - .c-active-detour__alert-icon { + .c-diversion-panel__desktop-buttons { display: none !important; } } diff --git a/assets/src/components/detours/detourPanelComponents.tsx b/assets/src/components/detours/detourPanelComponents.tsx index 8f98dede9..b7a7de9f4 100644 --- a/assets/src/components/detours/detourPanelComponents.tsx +++ b/assets/src/components/detours/detourPanelComponents.tsx @@ -1,8 +1,15 @@ import React from "react" import { Stop } from "../../schedule" -import { Badge, ListGroup } from "react-bootstrap" +import { + Badge, + Button, + ListGroup, + OverlayTrigger, + Popover, +} from "react-bootstrap" import { uniqBy } from "../../helpers/array" import { RoutePill } from "../routePill" +import { Files } from "../../helpers/bsIcons" interface MissedStopsProps { missedStops?: Stop[] @@ -64,3 +71,27 @@ export const AffectedRoute = ({ ) + +export const CopyButton = ({ detourText }: { detourText: string }) => ( + + Copied to clipboard! + + } + > + + +) diff --git a/assets/src/components/detours/detourPanels/activeDetourPanel.tsx b/assets/src/components/detours/detourPanels/activeDetourPanel.tsx index 24ee0983a..fdc150ca2 100644 --- a/assets/src/components/detours/detourPanels/activeDetourPanel.tsx +++ b/assets/src/components/detours/detourPanels/activeDetourPanel.tsx @@ -8,9 +8,15 @@ import { ExclamationTriangleFill, StopCircle, } from "../../../helpers/bsIcons" -import { AffectedRoute, MissedStops } from "../detourPanelComponents" +import { + AffectedRoute, + CopyButton, + MissedStops, +} from "../detourPanelComponents" +import inTestGroup, { TestGroups } from "../../../userInTestGroup" export interface ActiveDetourPanelProps extends PropsWithChildren { + detourText: string directions?: DetourDirection[] connectionPoints?: string[] missedStops?: Stop[] @@ -23,6 +29,7 @@ export interface ActiveDetourPanelProps extends PropsWithChildren { } export const ActiveDetourPanel = ({ + detourText, directions, connectionPoints, missedStops, @@ -38,6 +45,7 @@ export const ActiveDetourPanel = ({ - {onActivateDetour && (

View Draft Detour

+
- -
+ />
@@ -1161,16 +1173,35 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke class="l-diversion-page__panel text-bg-light" >

View Draft Detour

+
- -
+ />
diff --git a/assets/tests/components/detours/diversionPage.test.tsx b/assets/tests/components/detours/diversionPage.test.tsx index 63bc288e3..f18f82465 100644 --- a/assets/tests/components/detours/diversionPage.test.tsx +++ b/assets/tests/components/detours/diversionPage.test.tsx @@ -1217,7 +1217,7 @@ describe("DiversionPage", () => { await userEvent.click(reviewDetourButton.get()) - expect(screen.getByRole("button", { name: "Copy Details" })).toBeVisible() + expect(screen.getByRole("button", { name: "Copy details" })).toBeVisible() }) test("'View Draft Detour' screen copies text content to clipboard when clicked copy details button", async () => { @@ -1283,7 +1283,7 @@ describe("DiversionPage", () => { await userEvent.click(reviewDetourButton.get()) - await userEvent.click(screen.getByRole("button", { name: "Copy Details" })) + await userEvent.click(screen.getByRole("button", { name: "Copy details" })) await waitFor(() => expect(window.navigator.clipboard.readText()).resolves.toBe(