Skip to content

Commit

Permalink
wip!
Browse files Browse the repository at this point in the history
  • Loading branch information
firestack committed Oct 21, 2024
4 parents fe3676c + bed475f + b5dac4c + e67a4cf commit 385fd3f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
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 @@ -84,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
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

0 comments on commit 385fd3f

Please sign in to comment.