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: add Fullstory tags to Detours flow #2870

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -29,7 +29,11 @@ export const DrawDetourPanel = ({
onReviewDetour,
onChangeRoute,
}: DrawDetourPanelProps) => (
<Panel as="article" className="c-diversion-panel">
<Panel
as="article"
className="c-diversion-panel"
data-fs-element="Drawing Panel"
>
<Panel.Header>
<h1 className="c-diversion-panel__h1 my-3">Draw Detour</h1>
</Panel.Header>
Expand Down Expand Up @@ -80,6 +84,7 @@ export const DrawDetourPanel = ({
<Button
className="flex-grow-1 m-3 icon-link justify-content-center"
onClick={onReviewDetour}
data-fs-element="Review"
>
<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 @@ -402,6 +402,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
52 changes: 34 additions & 18 deletions assets/src/models/createDetourMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
fetchRoutePatterns,
} from "../api"
import { DetourShape, FinishedDetour } from "./detour"
import { fullStoryEvent } from "../helpers/fullStory"

export const createDetourMachine = setup({
types: {
Expand Down Expand Up @@ -348,12 +349,17 @@ export const createDetourMachine = setup({
on: {
"detour.edit.place-waypoint-on-route": {
target: "Place Waypoint",
actions: {
type: "detour.add-start-point",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-start-point",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour Start Point", {})
},
],
},
},
},
Expand Down Expand Up @@ -394,21 +400,31 @@ export const createDetourMachine = setup({
"detour.edit.place-waypoint": {
target: "Place Waypoint",
reenter: true,
actions: {
type: "detour.add-waypoint",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-waypoint",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour Way-Point", {})
},
],
},
"detour.edit.place-waypoint-on-route": {
target: "Finished Drawing",
actions: {
type: "detour.add-end-point",
params: ({ event: { location } }) => ({
location,
}),
},
actions: [
{
type: "detour.add-end-point",
params: ({ event: { location } }) => ({
location,
}),
},
() => {
fullStoryEvent("Placed Detour End Point", {})
},
],
},
"detour.edit.undo": [
{
Expand Down
Loading