From 7e7052aab430ba3f573d3b47caf2aff2bbb2e774 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Thu, 16 Nov 2023 14:29:37 -0500 Subject: [PATCH] fix: hide carets when sensible --- __snapshots__/storybook.test.ts.snap | 672 +++--------------- .../src/AccessLegBody/index.tsx | 4 +- .../src/TransitLegBody/index.tsx | 4 +- yarn.lock | 22 +- 4 files changed, 102 insertions(+), 600 deletions(-) diff --git a/__snapshots__/storybook.test.ts.snap b/__snapshots__/storybook.test.ts.snap index 8dd625ea5..08a641635 100644 --- a/__snapshots__/storybook.test.ts.snap +++ b/__snapshots__/storybook.test.ts.snap @@ -12384,25 +12384,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Bike Rental Transit Itinerary 2 alerts - - -
2 alerts - - -
1 min - - - @@ -17908,7 +17851,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` style={Object {}} >
@@ -17923,7 +17866,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` className="c4 c5" >
Stop ID Stop Viewer @@ -18051,7 +17994,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` Ride 20 Burnside/Stark @@ -18122,7 +18065,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` role="group" >
Service operated by
@@ -18425,25 +18368,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` onClick={[Function]} > 1 min - - - @@ -18466,7 +18390,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Custom Time Column 2`] = ` style={Object {}} >
@@ -29216,25 +29140,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Hide Driving Directions 2`] = 2 alerts - - -
2 alerts - - -
1 min - - - @@ -51159,7 +51026,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` style={Object {}} >
@@ -51174,7 +51041,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` className="c4 c5" >
Stop ID 792 Stop Viewer @@ -51264,7 +51131,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` Ride 20 Burnside/Stark @@ -51335,7 +51202,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` role="group" >
Service operated by
@@ -51542,7 +51409,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` > Stop ID 13327 Stop Viewer @@ -51618,25 +51485,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` onClick={[Function]} > 1 min - - - @@ -51659,7 +51507,7 @@ exports[`Storyshots ItineraryBody/otp-react-redux Tnc Transit Itinerary 2`] = ` style={Object {}} >
@@ -60548,25 +60396,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Two Alerts Not Always Collapsi 2 alerts - - -
2 alerts - - -
0 min - - - @@ -82566,25 +82357,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Zero Alerts Always Collapsing onClick={[Function]} > 0 min - - - @@ -87364,25 +87136,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Zero Alerts Not Always Collaps onClick={[Function]} > 0 min - - - @@ -92161,25 +91914,6 @@ exports[`Storyshots ItineraryBody/otp-react-redux Zero Alerts Without Collapsing onClick={[Function]} > 0 min - - - @@ -101251,25 +100985,6 @@ exports[`Storyshots ItineraryBody/otp-ui Bike Rental Transit Itinerary 2`] = ` 2 alerts - - -
2 alerts - - -
2 alerts - - -
2 alerts - - -
1 min - - - @@ -141365,7 +141004,7 @@ exports[`Storyshots ItineraryBody/otp-ui Tnc Transit Itinerary 2`] = ` style={Object {}} >
@@ -141408,14 +141047,14 @@ exports[`Storyshots ItineraryBody/otp-ui Tnc Transit Itinerary 2`] = ` className="c3" >
Burnside/Stark @@ -141472,17 +141111,17 @@ exports[`Storyshots ItineraryBody/otp-ui Tnc Transit Itinerary 2`] = ` Ride
20
Burnside/Stark @@ -141528,24 +141167,24 @@ exports[`Storyshots ItineraryBody/otp-ui Tnc Transit Itinerary 2`] = ` />
@@ -142030,7 +141650,7 @@ exports[`Storyshots ItineraryBody/otp-ui Tnc Transit Itinerary 2`] = ` > - -
2 alerts - - -
0 min - - - @@ -180041,25 +179604,6 @@ exports[`Storyshots ItineraryBody/otp-ui Zero Alerts Always Collapsing 2`] = ` onClick={[Function]} > 0 min - - - @@ -184708,25 +184252,6 @@ exports[`Storyshots ItineraryBody/otp-ui Zero Alerts Not Always Collapsing 2`] = onClick={[Function]} > 0 min - - - @@ -189374,25 +188899,6 @@ exports[`Storyshots ItineraryBody/otp-ui Zero Alerts Without Collapsing Prop 2`] onClick={[Function]} > 0 min - - - diff --git a/packages/itinerary-body/src/AccessLegBody/index.tsx b/packages/itinerary-body/src/AccessLegBody/index.tsx index 5ab1c8e31..4f9a3e51b 100644 --- a/packages/itinerary-body/src/AccessLegBody/index.tsx +++ b/packages/itinerary-body/src/AccessLegBody/index.tsx @@ -138,7 +138,9 @@ class AccessLegBody extends Component { onClick={this.onStepsHeaderClick} > - {leg.steps && } + {leg.steps && leg.steps.length > 0 && ( + + )} { alertCount: alerts.length }} /> - + {!shouldOnlyShowAlertsExpanded && ( + + )} )} diff --git a/yarn.lock b/yarn.lock index cde8ef964..0bd4801d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3241,23 +3241,15 @@ resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca" integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q== -"@opentripplanner/core-utils@11.1.2": - version "11.1.2" - resolved "https://registry.yarnpkg.com/@opentripplanner/core-utils/-/core-utils-11.1.2.tgz#a99d1fa4fb1f587d58fae8fcfd70a3bfe4eed424" - integrity sha512-Rn1tBm5F+nt/A4/0cpq6cyNTprSsxfFslujMoZ4P4r6fZ7YTx0d25di+MZ/CZgSlCzHJIiGAfi8DsfJ7yStcTA== +"@opentripplanner/geocoder@^1.4.2": + version "1.4.2" + resolved "https://registry.yarnpkg.com/@opentripplanner/geocoder/-/geocoder-1.4.2.tgz#0f827dffca42c7f7a23063b54990a291dd028b80" + integrity sha512-yzMVrKXEHO6Y50j9kntk1+odvHaqn9K9D4aKJAd+EabhiZckesfScLb0updmWRUloEWjN45nuDSFto8fbU7Uiw== dependencies: + "@conveyal/geocoder-arcgis-geojson" "^0.0.3" "@conveyal/lonlat" "^1.4.1" - "@mapbox/polyline" "^1.1.0" - "@opentripplanner/geocoder" "^1.4.2" - "@styled-icons/foundation" "^10.34.0" - "@turf/along" "^6.0.1" - chroma-js "^2.4.2" - date-fns "^2.28.0" - date-fns-tz "^1.2.2" - graphql "^16.6.0" - lodash.clonedeep "^4.5.0" - lodash.isequal "^4.5.0" - qs "^6.9.1" + isomorphic-mapzen-search "^1.6.1" + lodash.memoize "^4.1.2" "@opentripplanner/types@7.0.0-alpha.2": version "7.0.0-alpha.2"