From 7384fead9c86c720343121e9d1477fbb268128d9 Mon Sep 17 00:00:00 2001 From: janelle-bouchard Date: Tue, 11 Jul 2023 19:38:10 +0000 Subject: [PATCH 1/4] Updated the label on the second new Traffic Stops by Stop Purpose and Race Count graph, added description tooltips below the Stop Purpose dropdown selector and updated the text for vehicle regulatory violation description. --- .../Charts/TrafficStops/TrafficStops.js | 15 +++++++++++++- frontend/src/util/displayDefinition.js | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js index a7af2b0f..80434544 100644 --- a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js +++ b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js @@ -47,6 +47,7 @@ import range from 'lodash.range'; import LineChart from '../../NewCharts/LineChart'; import axios from '../../../Services/Axios'; import NewModal from '../../NewCharts/NewModal'; +import displayDefinition from 'util/displayDefinition'; function TrafficStops(props) { const { agencyId } = props; @@ -493,6 +494,7 @@ function TrafficStops(props) { onChange={handleStopPurposeSelect} options={[PURPOSE_DEFAULT].concat(stopTypes)} /> +

{displayDefinition(purpose)}

Date: Tue, 18 Jul 2023 14:29:09 +0000 Subject: [PATCH 2/4] Fixed the failing tests. --- .../Components/Charts/TrafficStops/TrafficStops.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js index 80434544..02707f60 100644 --- a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js +++ b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js @@ -47,7 +47,7 @@ import range from 'lodash.range'; import LineChart from '../../NewCharts/LineChart'; import axios from '../../../Services/Axios'; import NewModal from '../../NewCharts/NewModal'; -import displayDefinition from 'util/displayDefinition'; +import displayDefinition from '../../../util/displayDefinition'; function TrafficStops(props) { const { agencyId } = props; @@ -686,17 +686,6 @@ const BY_REASON_TABLE_COLUMNS = [ }, ]; -// SPEED_LIMIT_VIOLATION = 1  # Safety Violation -// STOP_LIGHT_SIGN_VIOLATION = 2  # Safety Violation -// DRIVING_WHILE_IMPAIRED = 3  # Safety Violation -// SAFE_MOVEMENT_VIOLATION = 4  # Safety Violation -// VEHICLE_EQUIPMENT_VIOLATION = 5  # Regulatory and Equipment -// VEHICLE_REGULATORY_VIOLATION = 6  # Regulatory and Equipment -// OTHER_MOTOR_VEHICLE_VIOLATION = 9  # Regulatory and Equipment -// SEAT_BELT_VIOLATION = 7  # Investigatory -// INVESTIGATION = 8  # Investigatory -// CHECKPOINT = 10  # Investigatory - const STOP_PURPOSE_TABLE_COLUMNS = [ { Header: 'Year', From b2234e72ef7a6abc715efd2c64eaf9cdcdd0a360 Mon Sep 17 00:00:00 2001 From: janelle-bouchard Date: Wed, 19 Jul 2023 18:53:40 +0000 Subject: [PATCH 3/4] Removed the 10px margin when the stop purpose is the default. --- frontend/src/Components/Charts/TrafficStops/TrafficStops.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js index 02707f60..8e32da4b 100644 --- a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js +++ b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js @@ -494,7 +494,11 @@ function TrafficStops(props) { onChange={handleStopPurposeSelect} options={[PURPOSE_DEFAULT].concat(stopTypes)} /> -

{displayDefinition(purpose)}

+ + {purpose !== PURPOSE_DEFAULT ? ( +

{displayDefinition(purpose)}

+ ) : null} + Date: Fri, 21 Jul 2023 17:53:39 -0400 Subject: [PATCH 4/4] Use double and to show stop purpose definition --- frontend/src/Components/Charts/TrafficStops/TrafficStops.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js index 8e32da4b..5af3ef36 100644 --- a/frontend/src/Components/Charts/TrafficStops/TrafficStops.js +++ b/frontend/src/Components/Charts/TrafficStops/TrafficStops.js @@ -495,9 +495,9 @@ function TrafficStops(props) { options={[PURPOSE_DEFAULT].concat(stopTypes)} /> - {purpose !== PURPOSE_DEFAULT ? ( + {purpose !== PURPOSE_DEFAULT && (

{displayDefinition(purpose)}

- ) : null} + )}