Skip to content

Commit

Permalink
feat(ts/detours): add data-fs-element properties to detours flow (#…
Browse files Browse the repository at this point in the history
…2881)

* feat(ts/detours): fs-element: detours modal context tag

* feat(ts/detours): fs-element: review detour button

* feat(ts/detours): fs-element: start drawing button

* feat(ts/detours): fs-element: detour directions textarea

* feat(ts/detours): fs-element: copy details button

* feat(ts/detours): fs-element: activate detour buttons

* feat(ts/detours): fs-element: deactivate detour buttons

* feat(ts/detours): fs-element: undo and clear buttons
  • Loading branch information
firestack authored Oct 25, 2024
1 parent 9712696 commit 9f486ae
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 1 deletion.
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"
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

0 comments on commit 9f486ae

Please sign in to comment.