Skip to content

Commit 291474f

Browse files
committed
Merge branch 'v3' into env-cleanup
2 parents 13e4907 + 5812fab commit 291474f

File tree

12 files changed

+84
-102
lines changed

12 files changed

+84
-102
lines changed

app/component/DisruptionBanner.js

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
3-
import { createFragmentContainer, graphql } from 'react-relay';
43
import connectToStores from 'fluxible-addons-react/connectToStores';
54
import isEmpty from 'lodash/isEmpty';
65
import { configShape, alertShape } from '../util/shapes';
@@ -110,37 +109,13 @@ class DisruptionBanner extends React.Component {
110109
}
111110
const DisruptionBannerWithBreakpoint = withBreakpoint(DisruptionBanner);
112111

113-
const containerComponent = createFragmentContainer(
114-
connectToStores(
115-
DisruptionBannerWithBreakpoint,
116-
['TimeStore', 'PreferencesStore'],
117-
({ getStore }) => ({
118-
currentTime: getStore('TimeStore').getCurrentTime(),
119-
language: getStore('PreferencesStore').getLanguage(),
120-
}),
121-
),
122-
{
123-
alerts: graphql`
124-
fragment DisruptionBanner_alerts on Alert @relay(plural: true) {
125-
feed
126-
id
127-
alertSeverityLevel
128-
alertHeaderText
129-
alertEffect
130-
alertCause
131-
alertDescriptionText
132-
effectiveStartDate
133-
effectiveEndDate
134-
entities {
135-
__typename
136-
... on Route {
137-
mode
138-
shortName
139-
}
140-
}
141-
}
142-
`,
143-
},
112+
const containerComponent = connectToStores(
113+
DisruptionBannerWithBreakpoint,
114+
['TimeStore', 'PreferencesStore'],
115+
({ getStore }) => ({
116+
currentTime: getStore('TimeStore').getCurrentTime(),
117+
language: getStore('PreferencesStore').getLanguage(),
118+
}),
144119
);
145120

146121
export { containerComponent as default, DisruptionBanner as Component };

app/component/departure.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362
background-color: currentcolor;
363363
position: relative;
364364
border-radius: 3px;
365+
font-family: $id-font-family;
365366

366367
a {
367368
justify-content: center;

app/component/map/NearYouMap.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ const handleBounds = (location, edges) => {
117117
};
118118

119119
const getLocationMarker = location => {
120-
return <LocationMarker position={location} type="from" />;
120+
return (
121+
<LocationMarker
122+
key={`from-${location.lat}:${location.lat}`}
123+
position={location}
124+
type="from"
125+
/>
126+
);
121127
};
122128

123129
function NearYouMap(

app/component/nearyou/NearYouPage.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
checkPositioningPermission,
2323
startLocationWatch,
2424
} from '../../action/PositionActions';
25-
import DisruptionBanner from '../DisruptionBanner';
2625
import StopsNearYouSearch from './StopsNearYouSearch';
2726
import {
2827
getGeolocationState,
@@ -247,7 +246,6 @@ class NearYouPage extends React.Component {
247246
filterByModes: modes,
248247
filterByPlaceTypes: placeTypes,
249248
omitNonPickups: this.context.config.omitNonPickups,
250-
feedIds: this.context.config.feedIds,
251249
prioritizedStopIds: prioritizedStops,
252250
filterByNetwork: allowedNetworks,
253251
};
@@ -438,7 +436,6 @@ class NearYouPage extends React.Component {
438436
$maxResults: Int!
439437
$maxDistance: Int!
440438
$omitNonPickups: Boolean!
441-
$feedIds: [String!]
442439
$filterByNetwork: [String!]
443440
) {
444441
stopPatterns: viewer {
@@ -455,9 +452,6 @@ class NearYouPage extends React.Component {
455452
filterByNetwork: $filterByNetwork
456453
)
457454
}
458-
alerts: alerts(feeds: $feedIds, severityLevel: [SEVERE]) {
459-
...DisruptionBanner_alerts
460-
}
461455
}
462456
`}
463457
variables={this.getQueryVariables(nearByStopMode)}
@@ -482,13 +476,6 @@ class NearYouPage extends React.Component {
482476
config.prioritizedStopsNearYou[nearByStopMode.toLowerCase()];
483477
return (
484478
<div className="stops-near-you-page">
485-
{renderDisruptionBanner && (
486-
<DisruptionBanner
487-
alerts={(props && props.alerts) || []}
488-
mode={nearByStopMode}
489-
trafficNowLink={config.trafficNowLink}
490-
/>
491-
)}
492479
{renderSearch && (
493480
<StopsNearYouSearch
494481
mode={nearByStopMode}
@@ -623,6 +610,8 @@ class NearYouPage extends React.Component {
623610
stopPatterns={props.stopPatterns}
624611
position={this.state.searchPosition}
625612
withSeparator={!renderSearch}
613+
nearByStopMode={nearByStopMode}
614+
renderDisruptionBanner={renderDisruptionBanner}
626615
/>
627616
)}
628617
</div>

app/component/nearyou/StopsNearYouContainer.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import CityBikeStopNearYou from './VehicleRentalStationNearYou';
1515
import Loading from '../Loading';
1616
import Icon from '../Icon';
1717
import { getDefaultNetworks } from '../../util/vehicleRentalUtils';
18+
import DisruptionBanner from '../DisruptionBanner';
1819

1920
class StopsNearYouContainer extends React.Component {
2021
static propTypes = {
@@ -33,12 +34,15 @@ class StopsNearYouContainer extends React.Component {
3334
}).isRequired,
3435
withSeparator: PropTypes.bool,
3536
prioritizedStops: PropTypes.arrayOf(PropTypes.string),
37+
nearByStopMode: PropTypes.string.isRequired,
38+
renderDisruptionBanner: PropTypes.bool,
3639
};
3740

3841
static defaultProps = {
3942
stopPatterns: undefined,
4043
withSeparator: false,
4144
prioritizedStops: undefined,
45+
renderDisruptionBanner: false,
4246
};
4347

4448
static contextTypes = {
@@ -254,12 +258,23 @@ class StopsNearYouContainer extends React.Component {
254258
/>
255259
);
256260
const stops = this.createNearbyStops().filter(e => e);
261+
const alerts = stops
262+
.flatMap(stop => stop.props.stop?.routes || [])
263+
.flatMap(route => route?.alerts || [])
264+
.filter(alert => alert.alertSeverityLevel === 'SEVERE');
257265
const noStopsFound =
258266
!stops.length &&
259267
this.state.refetches >= this.state.maxRefetches &&
260268
!this.state.isLoadingmoreStops;
261269
return (
262270
<>
271+
{this.props.renderDisruptionBanner && (
272+
<DisruptionBanner
273+
alerts={alerts || []}
274+
mode={this.props.nearByStopMode}
275+
trafficNowLink={this.context.config.trafficNowLink}
276+
/>
277+
)}
263278
{((!this.props.relay.hasMore() &&
264279
!stops.length &&
265280
!this.props.prioritizedStops?.length) ||
@@ -389,6 +404,28 @@ const refetchContainer = createPaginationContainer(
389404
) {
390405
scheduledArrival
391406
}
407+
routes {
408+
... on Route {
409+
alerts {
410+
feed
411+
id
412+
alertSeverityLevel
413+
alertHeaderText
414+
alertEffect
415+
alertCause
416+
alertDescriptionText
417+
effectiveStartDate
418+
effectiveEndDate
419+
entities {
420+
__typename
421+
... on Route {
422+
mode
423+
shortName
424+
}
425+
}
426+
}
427+
}
428+
}
392429
}
393430
}
394431
}

app/translations.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ const translations = {
736736
'swap-order-button-label': 'Start und Ziel tauschen',
737737
'swipe-result-tab-left': 'Show the previous tab.',
738738
'swipe-result-tab-right': 'Show the next tab.',
739-
'swipe-result-tabs': 'Switch tabs using arrow keys.',
740739
'terminal-page.description': 'Terminal - {name}',
741740
'terminal-page.title': 'Terminal',
742741
'terminal-page.title-short': 'Terminal - {name}',
@@ -857,8 +856,6 @@ const translations = {
857856
back: 'Back',
858857
'buy-in-app': 'Buy in App',
859858
'search-autosuggest-label': 'Venue, place and stopsearch.',
860-
'search-autosuggest-label-instructions':
861-
'Navigate list with arrow keys and select with enter key.',
862859
'search-autosuggest-label-move-to-destination':
863860
'After selecting the starting location you are automatically moved to the destination field.',
864861
'search-autosuggest-len':
@@ -1705,7 +1702,6 @@ const translations = {
17051702
'swipe-message-bar-tab': 'Message swipe result tabs',
17061703
'swipe-result-tab-left': 'Show the previous tab.',
17071704
'swipe-result-tab-right': 'Show the next tab.',
1708-
'swipe-result-tabs': 'Switch tabs using arrow keys.',
17091705
'swipe-sr-new-tab-opened': 'Tab {number} opened.',
17101706
'swipe-stops-near-you-tab': 'Stops near you swipe result tabs.',
17111707
'swipe-summary-page-tab': 'Itinerary swipe result tabs',
@@ -2172,8 +2168,6 @@ const translations = {
21722168
'as-viapoint': 'Välipisteeksi',
21732169
'buy-in-app': 'Osta sovelluksessa',
21742170
'search-autosuggest-label': 'Paikka, linja ja pysäkkihaku.',
2175-
'search-autosuggest-label-instructions':
2176-
'Navigoi listassa nuolinäppäimillä ja valitse enterillä.',
21772171
'search-autosuggest-label-move-to-destination':
21782172
'Valittuasi lähtöpaikan siirrytään suoraan määränpää-kenttään.',
21792173
'search-autosuggest-len':
@@ -3017,7 +3011,6 @@ const translations = {
30173011
'swipe-message-bar-tab': 'Viestivälilehti {number}',
30183012
'swipe-result-tab-left': 'Näytä edellinen välilehti.',
30193013
'swipe-result-tab-right': 'Näytä seuraava välilehti.',
3020-
'swipe-result-tabs': 'Selaa välilehtiä nuolinäppäimillä.',
30213014
'swipe-sr-new-tab-opened': 'Välilehti {number} avattu.',
30223015
'swipe-stops-near-you-tab': 'Lähipysäkkivälilehti {number}',
30233016
'swipe-summary-page-tab': 'Reittiehdotus {number}',
@@ -3777,8 +3770,6 @@ const translations = {
37773770
'as-origin': 'Początek',
37783771
'as-viapoint': 'Punkt pośredni',
37793772
'search-autosuggest-label': 'Miejsce, lokalizacja i przystanek.',
3780-
'search-autosuggest-label-instructions':
3781-
'Nawiguj po liście używając strzałek i wybieraj klawiszem Enter.',
37823773
'search-autosuggest-label-move-to-destination':
37833774
'Po wybraniu lokalizacji początkowej, automatycznie przejdziesz do pola miejsca docelowego.',
37843775
'search-autosuggest-len':
@@ -4493,7 +4484,6 @@ const translations = {
44934484
'swipe-message-bar-tab': 'Message swipe result tabs',
44944485
'swipe-result-tab-left': 'Aby wyświetlić poprzednią kartę.',
44954486
'swipe-result-tab-right': 'Aby wyświetlić następną kartę.',
4496-
'swipe-result-tabs': 'Przełącz karty klawiszami strzałek.',
44974487
'swipe-sr-new-tab-opened': 'Otwarto kartę {number}.',
44984488
'swipe-stops-near-you-tab': 'Stops near you swipe result tabs.',
44994489
'swipe-summary-page-tab': 'Itinerary swipe result tabs',
@@ -5024,7 +5014,6 @@ const translations = {
50245014
'swap-order-button-label': 'Schimbați originea cu destinația',
50255015
'swipe-result-tab-left': 'Show the previous tab.',
50265016
'swipe-result-tab-right': 'Show the next tab.',
5027-
'swipe-result-tabs': 'Switch tabs using arrow keys.',
50285017
'terminal-page.description': 'Terminalul {name}',
50295018
'terminal-page.title': 'Terminalul {name}',
50305019
'terminal-page.title-short': 'Terminal',
@@ -5133,8 +5122,6 @@ const translations = {
51335122
'Tilaa kyyti sovelluksella ja jää odottamaan sen saapumista:',
51345123
'buy-in-app': 'Köp i appen',
51355124
'search-autosuggest-label': 'Plats, linje och hållplatssökning.',
5136-
'search-autosuggest-label-instructions':
5137-
'Navigera listan med piltangenterna och välj med Enter-tangeten.',
51385125
'search-autosuggest-label-move-to-destination':
51395126
'Efter att du valt avgångsplatsen tas du direkt till Destination-fältet.',
51405127
'search-autosuggest-len': 'Hittade {len} förslag',
@@ -5969,7 +5956,6 @@ const translations = {
59695956
'Navigeringsknapp för att kunna bläddra stäng banner',
59705957
'swipe-result-tab-left': 'Gå till föregående blad.',
59715958
'swipe-result-tab-right': 'Gå till följande blad.',
5972-
'swipe-result-tabs': 'Bläddra mellan blad med pilknapparna.',
59735959
'swipe-sr-new-tab-opened': 'Blad {number} öppnad.',
59745960
'swipe-stops-near-you-tab':
59755961
'Navigeringsknapp för att kunna bläddra hållplatser nära mig.',

digitransit-component/packages/digitransit-component-datetimepicker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@digitransit-component/digitransit-component-datetimepicker",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "digitransit-component datetimepicker module",
55
"main": "index.js",
66
"files": [

0 commit comments

Comments
 (0)