Skip to content

Commit

Permalink
feat: Add connectionPoints and missedStops to the “Review Detour” pan…
Browse files Browse the repository at this point in the history
…el (#2878)
  • Loading branch information
hannahpurcell authored Oct 25, 2024
1 parent 9f486ae commit 611f99c
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@ import React, { PropsWithChildren } from "react"
import { Button, Form } from "react-bootstrap"
import * as BsIcons from "../../../helpers/bsIcons"
import { Panel } from "../diversionPage"
import { CopyButton } from "../detourPanelComponents"
import {
ConnectionPoints,
CopyButton,
MissedStops,
} from "../detourPanelComponents"
import { Stop } from "../../../schedule"

interface DetourFinishedPanelProps extends PropsWithChildren {
onNavigateBack: () => void
detourText: string
connectionPoints?: [string, string]
missedStops?: Stop[]
onChangeDetourText: (value: string) => void
onActivateDetour?: () => void
}

export const DetourFinishedPanel = ({
onNavigateBack,
detourText,
connectionPoints,
missedStops,
onChangeDetourText,
onActivateDetour,
children,
Expand Down Expand Up @@ -45,6 +54,11 @@ export const DetourFinishedPanel = ({
}}
data-fs-element="Detour Text"
/>

{connectionPoints && (
<ConnectionPoints connectionPoints={connectionPoints} />
)}
{missedStops && <MissedStops missedStops={missedStops} />}
</Panel.Body.ScrollArea>

<Panel.Body.Footer className="d-flex flex-column">
Expand Down
5 changes: 5 additions & 0 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ export const DiversionPage = ({
<DetourFinishedPanel
onNavigateBack={editDetour}
detourText={textArea}
connectionPoints={[
connectionPoints?.start?.name ?? "N/A",
connectionPoints?.end?.name ?? "N/A",
]}
missedStops={missedStops}
onChangeDetourText={setTextArea}
onActivateDetour={
inTestGroup(TestGroups.DetoursList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,29 @@ exports[`Detours Page: Open a Detour renders detour details in an open drawer on
data-fs-element="Detour Text"
style="resize: none;"
/>
<section
class="pb-3"
>
<h2
class="c-diversion-panel__h2"
>
Connection Points
</h2>
<ul
class="list-group"
>
<div
class="list-group-item"
>
N/A
</div>
<div
class="list-group-item"
>
N/A
</div>
</ul>
</section>
</div>
<div
class="border-top d-flex mt-auto d-flex flex-column"
Expand Down Expand Up @@ -1239,6 +1262,29 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke
data-fs-element="Detour Text"
style="resize: none;"
/>
<section
class="pb-3"
>
<h2
class="c-diversion-panel__h2"
>
Connection Points
</h2>
<ul
class="list-group"
>
<div
class="list-group-item"
>
N/A
</div>
<div
class="list-group-item"
>
N/A
</div>
</ul>
</section>
</div>
<div
class="border-top d-flex mt-auto d-flex flex-column"
Expand Down

0 comments on commit 611f99c

Please sign in to comment.