From c33222578cac6df986d3bd64d56c29fc29f03a06 Mon Sep 17 00:00:00 2001
From: Hannah Purcell <69368883+hannahpurcell@users.noreply.github.com>
Date: Thu, 12 Sep 2024 11:01:25 -0400
Subject: [PATCH] feat: Active detour panel button / icons (#2782)
* tweak: Updated ui-alert color (only used in one other place)
* feat: Updated "Return to route button" and added active alert icon
* tweak: Standardize icon-link gap of .5rem
---
assets/css/_diversion_page.scss | 5 +++
assets/css/bootstrap/_variable_overrides.scss | 2 +
assets/css/color/_definitions.scss | 2 +-
.../components/detours/activeDetourPanel.tsx | 39 ++++++++++++-------
assets/src/helpers/bsIcons.tsx | 19 +++++++++
.../detours/diversionPageActivate.test.tsx | 8 ++--
6 files changed, 56 insertions(+), 19 deletions(-)
diff --git a/assets/css/_diversion_page.scss b/assets/css/_diversion_page.scss
index 1c18745f1..c8ec4bd65 100644
--- a/assets/css/_diversion_page.scss
+++ b/assets/css/_diversion_page.scss
@@ -107,3 +107,8 @@
.c-diversion-panel__help-text {
line-height: 1.5;
}
+
+.c-active-detour__alert-icon {
+ height: 1.5rem;
+ width: 1.5rem;
+}
diff --git a/assets/css/bootstrap/_variable_overrides.scss b/assets/css/bootstrap/_variable_overrides.scss
index 0aee41a14..c3ef1dd27 100644
--- a/assets/css/bootstrap/_variable_overrides.scss
+++ b/assets/css/bootstrap/_variable_overrides.scss
@@ -34,3 +34,5 @@ $grid-breakpoints: (
// lg - Breakpoint between desktop and wide-screen desktop
lg: 1340px,
);
+
+$icon-link-gap: 0.5rem;
diff --git a/assets/css/color/_definitions.scss b/assets/css/color/_definitions.scss
index 25544338f..deabfff38 100644
--- a/assets/css/color/_definitions.scss
+++ b/assets/css/color/_definitions.scss
@@ -18,7 +18,7 @@
$primary: tokens.$eggplant-500;
$secondary: tokens.$gray-500;
$info: tokens.$kiwi-500;
-$ui-alert: tokens.$strawberry-500;
+$ui-alert: new_tokens.$strawberry-500;
$service-alert: tokens.$lemon-500;
$light: tokens.$gray-100;
$dark: tokens.$gray-900;
diff --git a/assets/src/components/detours/activeDetourPanel.tsx b/assets/src/components/detours/activeDetourPanel.tsx
index 3031dba83..49f9100bf 100644
--- a/assets/src/components/detours/activeDetourPanel.tsx
+++ b/assets/src/components/detours/activeDetourPanel.tsx
@@ -3,7 +3,11 @@ import { DetourDirection } from "../../models/detour"
import { Button, ListGroup } from "react-bootstrap"
import { Panel } from "./diversionPage"
import { Stop } from "../../schedule"
-import { ArrowLeft } from "../../helpers/bsIcons"
+import {
+ ArrowLeft,
+ ExclamationTriangleFill,
+ StopCircle,
+} from "../../helpers/bsIcons"
import { AffectedRoute, MissedStops } from "./detourPanelComponents"
export interface ActiveDetourPanelProps {
@@ -36,17 +40,19 @@ export const ActiveDetourPanel = ({
- {onNavigateBack && (
-
- )}
-
+
+ {onNavigateBack && (
+
+ )}
+
+
-
diff --git a/assets/src/helpers/bsIcons.tsx b/assets/src/helpers/bsIcons.tsx
index f6b2e47bb..623ad55b3 100644
--- a/assets/src/helpers/bsIcons.tsx
+++ b/assets/src/helpers/bsIcons.tsx
@@ -285,6 +285,25 @@ export const QuestionFill = (props: SvgProps) => (
)
+/**
+ * @returns https://icons.getbootstrap.com/icons/stop-circle/
+ */
+export const StopCircle = (props: SvgProps) => (
+
+)
+
/**
* @returns https://icons.getbootstrap.com/icons/x-square/
*/
diff --git a/assets/tests/components/detours/diversionPageActivate.test.tsx b/assets/tests/components/detours/diversionPageActivate.test.tsx
index 72bb660e4..e979e7167 100644
--- a/assets/tests/components/detours/diversionPageActivate.test.tsx
+++ b/assets/tests/components/detours/diversionPageActivate.test.tsx
@@ -96,23 +96,23 @@ describe("DiversionPage activate workflow", () => {
expect(screen.getByRole("heading", { name: "Active Detour" })).toBeVisible()
})
- test("'Active Detour' screen has a 'Deactivate Detour' button", async () => {
+ test("'Active Detour' screen has a 'Return to regular route' button", async () => {
await diversionPageOnReviewScreen()
await userEvent.click(activateDetourButton.get())
expect(
- screen.getByRole("button", { name: "Deactivate Detour" })
+ screen.getByRole("button", { name: "Return to regular route" })
).toBeVisible()
})
- test("clicking the 'Deactivate Detour' button shows the 'Past Detour' screen", async () => {
+ test("clicking the 'Return to regular route' button shows the 'Past Detour' screen", async () => {
await diversionPageOnReviewScreen()
await userEvent.click(activateDetourButton.get())
await userEvent.click(
- screen.getByRole("button", { name: "Deactivate Detour" })
+ screen.getByRole("button", { name: "Return to regular route" })
)
expect(
screen.queryByRole("heading", { name: "Active Detour" })