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

feat(ts/detours): add data-fs-element properties to detours flow #2881

Merged
merged 8 commits into from
Oct 25, 2024
6 changes: 5 additions & 1 deletion assets/src/components/detours/activateDetourModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ const SurroundingModal = ({
Cancel
</Button>
{onActivate ? (
<Button variant="primary" onClick={onActivate}>
<Button
variant="primary"
onClick={onActivate}
data-fs-element="Confirm Activate Detour"
>
Activate detour
</Button>
) : (
Expand Down
1 change: 1 addition & 0 deletions assets/src/components/detours/deactivateDetourModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const DeactivateDetourModal = ({
variant="ui-alert"
onClick={onDeactivate}
className="text-white"
data-fs-element="Confirm Return to Regular Route"
>
Return to regular route
</Button>
Expand Down
2 changes: 2 additions & 0 deletions assets/src/components/detours/detourMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export const DetourMap = ({
onClick={onUndo}
size="lg"
title="Undo"
data-fs-element="Undo"
>
<ArrowLeftSquare />
</MapButton>
Expand All @@ -189,6 +190,7 @@ export const DetourMap = ({
onClick={onClear}
size="lg"
title="Clear"
data-fs-element="Clear"
>
<XSquare />
</MapButton>
Expand Down
1 change: 1 addition & 0 deletions assets/src/components/detours/detourPanelComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const CopyButton = ({ detourText }: { detourText: string }) => (
variant="outline-primary"
size="sm"
onClick={() => window.navigator.clipboard?.writeText(detourText)}
data-fs-element="Copy Details"
>
<Files />
Copy details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const ActiveDetourPanel = ({
variant="ui-alert"
className="flex-grow-1 m-3 icon-link text-light justify-content-center"
onClick={onOpenDeactivateModal}
data-fs-element="Return to Regular Route"
>
<StopCircle />
Return to regular route
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const DetourFinishedPanel = ({
style={{
resize: "none",
}}
data-fs-element="Detour Text"
/>
</Panel.Body.ScrollArea>

Expand All @@ -51,6 +52,7 @@ export const DetourFinishedPanel = ({
<Button
className="m-3 flex-grow-1 icon-link justify-content-center"
onClick={onActivateDetour}
data-fs-element="Begin Activate Detour"
>
<BsIcons.Power />
Start Detour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export const DetourRouteSelectionPanel = ({
<Button
className="m-3 flex-grow-1 icon-link justify-content-center"
onClick={onConfirm}
data-fs-element="Start Drawing"
>
<Brush />
Start drawing detour
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const DrawDetourPanel = ({
<Button
className="flex-grow-1 m-3 icon-link justify-content-center"
onClick={onReviewDetour}
data-fs-element="Review Drawn Detour"
>
<CardChecklist />
Review
Expand Down
1 change: 1 addition & 0 deletions assets/src/components/detours/diversionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export const DiversionPage = ({
return (
<>
<article
data-fs-element="Detours"
hannahpurcell marked this conversation as resolved.
Show resolved Hide resolved
className={`l-diversion-page l-diversion-page--${displayType} h-100 border-box inherit-box`}
>
<header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ exports[`Detours Page: Open a Detour renders detour details in an open drawer on
>
<article
class="l-diversion-page l-diversion-page--mobile h-100 border-box inherit-box"
data-fs-element="Detours"
>
<header
class="l-diversion-page__header border-bottom text-bg-light"
Expand Down Expand Up @@ -409,6 +410,7 @@ exports[`Detours Page: Open a Detour renders detour details in an open drawer on
</h1>
<button
class="icon-link btn btn-outline-primary btn-sm"
data-fs-element="Copy Details"
type="button"
>
<svg
Expand Down Expand Up @@ -455,6 +457,7 @@ exports[`Detours Page: Open a Detour renders detour details in an open drawer on
</button>
<textarea
class="flex-grow-1 mb-3 form-control"
data-fs-element="Detour Text"
style="resize: none;"
/>
</div>
Expand Down Expand Up @@ -1139,6 +1142,7 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke
>
<article
class="l-diversion-page l-diversion-page--desktop h-100 border-box inherit-box"
data-fs-element="Detours"
>
<header
class="l-diversion-page__header border-bottom text-bg-light"
Expand Down Expand Up @@ -1185,6 +1189,7 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke
</h1>
<button
class="icon-link btn btn-outline-primary btn-sm"
data-fs-element="Copy Details"
type="button"
>
<svg
Expand Down Expand Up @@ -1231,6 +1236,7 @@ exports[`Detours Page: Open a Detour renders detour details modal to match mocke
</button>
<textarea
class="flex-grow-1 mb-3 form-control"
data-fs-element="Detour Text"
style="resize: none;"
/>
</div>
Expand Down
Loading