Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dt-6044 bike stations ids #4872

Merged
merged 117 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
1bed148
fix: new function for parsing number from string of stationId
Dvun Oct 4, 2023
021dae4
fix: id parsed with function
Dvun Oct 4, 2023
e36c406
fix: changed bikeStations to vehicleStations
Dvun Oct 5, 2023
0fc3e87
fix: changed bikeStations to vehicleStations + stopList array push fix
Dvun Oct 5, 2023
36c4352
fix: changed bikeStations to vehicleStations + graphql request fix
Dvun Oct 5, 2023
ae412f6
fix: tests repairing
Dvun Oct 5, 2023
20bec91
Revert "Revert "Fixed bicycle stations ids + all function and names r…
optionsome Oct 9, 2023
75c9939
Merge branch 'v3-upd' into DT-6044
optionsome Oct 9, 2023
78a28de
fix: removed not needed function
Dvun Oct 10, 2023
930787c
fix: changed function to get id without network
Dvun Oct 10, 2023
23c2299
fix: renamed BicycleLeg to VehicleRentalLeg
Dvun Oct 10, 2023
4b72244
fix: renamed CityVehicleStopContent to VehicleRentalStationStopContent
Dvun Oct 10, 2023
fe321c4
fix: renamed citybikes to vehicleRentalUtils
Dvun Oct 10, 2023
208bf32
fix: removed not used constants
Dvun Oct 10, 2023
73ca957
fix: vehicle search problem fix
Dvun Oct 10, 2023
cdc3186
fix: targets name update
Dvun Oct 10, 2023
1a39d65
fix: vehicle station code fix
Dvun Oct 11, 2023
7349e32
fix: vehicle station network fix + bikesAvailable to vehicleAvailable
Dvun Oct 13, 2023
a8e2168
fix: fixed path
Dvun Oct 13, 2023
4e28a81
fix: removed isRequired
Dvun Oct 13, 2023
9e5ca11
fix: removed isRequired
Dvun Oct 13, 2023
218ee84
fix: fixed add vehicle to localStorage and get from localStorage
Dvun Oct 13, 2023
d1f59ef
fix: fixed propTypes
Dvun Oct 13, 2023
6e5e504
fix: stationId not come always
Dvun Oct 16, 2023
03cf978
fix: getVehicleRentalStations function update
Dvun Oct 16, 2023
a00f317
fix: hasStationCode function update
Dvun Oct 16, 2023
2fda869
fix: hasStationCode function update
Dvun Oct 16, 2023
84f2d15
fix: hasStationCode function update
Dvun Oct 16, 2023
64aa5f4
fix: fix to check in hasStationCode only parkOrStation with stationId
Dvun Oct 16, 2023
84869e9
fix: renamed CityVehicleStopNearYou to VehicleStopNearYou
Dvun Oct 16, 2023
979c396
fix: renamed getCityVehicleAvailabilityTextColor to getVehicleAvailab…
Dvun Oct 16, 2023
47e1f74
fix: renamed getCityVehicleAvailabilityIndicatorColor to getVehicleAv…
Dvun Oct 16, 2023
9ff63bf
fix: renamed CityVehicleMarker to VehicleMarker
Dvun Oct 16, 2023
ea45d02
fix: renamed getCityBikeNetworkConfig to getVehicleRentalStationNetwo…
Dvun Oct 16, 2023
63b7f62
fix: renamed getCityBikeNetworkIcon to getVehicleRentalStationNetwork…
Dvun Oct 16, 2023
812ab6d
fix: renamed getCityBikeNetworkId to getVehicleRentalStationNetworkId
Dvun Oct 16, 2023
d0e5d73
fix: renamed getCitybikeCapacity to getVehicleCapacity
Dvun Oct 16, 2023
c70e0f8
fix: renamed getCityBikeNetworkName to getVehicleRentalStationNetwork…
Dvun Oct 16, 2023
1156790
fix: renamed CityBikeNetworkSelector to VehicleRentalStationNetworkSe…
Dvun Oct 16, 2023
11351c3
fix: renamed getCitybikeNetworks to getVehicleRentalStationNetworks
Dvun Oct 16, 2023
909f66f
fix: renamed getCityBikeMinZoomOnStopsNearYou to getVehicleMinZoomOnS…
Dvun Oct 16, 2023
2f9c772
fix: renamed getCityBikeNetworkId to getVehicleRentalStationNetworkId
Dvun Oct 16, 2023
f203a27
fix: renamed updateCitybikeNetworks to updateVehicleNetworks
Dvun Oct 16, 2023
068811d
fix: renamed import names
Dvun Oct 17, 2023
6755fbb
fix: renamed back for analytics
Dvun Oct 23, 2023
36c7de5
fix: renamed networks to network
Dvun Oct 23, 2023
f827c3e
fix: renamed networks to network
Dvun Oct 24, 2023
38e1b1e
fix: renamed ModeVehicleRentalStation to ModeBikeRentalStation
Dvun Oct 24, 2023
b4cc3e8
fix: renamed vehicleRentalStation to bikeRentalStation
Dvun Oct 24, 2023
e0c56c3
fix: renamed pattern.node.place?.networks to pattern.node.place?.network
Dvun Oct 24, 2023
89b059c
fix: renamed bikesAvailable to vehiclesAvailable
Dvun Oct 24, 2023
cb73bb4
fix: renamed bikesAvailable to vehiclesAvailable
Dvun Oct 24, 2023
6015ef0
fix: the selected station did not remain larger when the map was scal…
Dvun Oct 25, 2023
beb99f0
fix: renamed CityBikeAvailability to VehiclesRentalStationAvailability
Dvun Oct 26, 2023
5446dd7
fix: renamed CityBikeAvailability to VehicleRentalStationAvailability
Dvun Oct 26, 2023
376e379
fix: renamed SelectCityBikeRow to SelectVehicleRentalStationRow
Dvun Oct 26, 2023
6ad8bb9
fix: changed networks to network and PropTypes to string
Dvun Oct 26, 2023
e22b578
fix: updated getting network from searchObj.properties.source
Dvun Oct 26, 2023
663cd2d
fix: renamed bikerentalstation to vehiclerentalstation
Dvun Oct 26, 2023
f6b0672
fix: renamed item.type FavouriteStation to favouriteVehicleRentalStation
Dvun Oct 26, 2023
7a09880
fix: renamed bikerentalstation to vehiclerentalstation
Dvun Oct 26, 2023
80212ed
fix: renamed ModeDigiVehicleRentalStation to ModeDigiBikeRentalStation
Dvun Oct 30, 2023
3a70409
fix: changed for BikeRentalStation bikesAvailable
Dvun Oct 30, 2023
7dd91cb
fix: renamed all vehicleRentalStation to VehicleRentalStation
Dvun Oct 30, 2023
451bb6b
fix: renamed BikeRentalStations too VehicleRentalStations
Dvun Oct 30, 2023
62e955e
fix: updates
Dvun Oct 30, 2023
aca8b85
fix: renamed VehicleRentalStations to VehicleRentalStation
Dvun Oct 31, 2023
e18b0d8
fix: renamed VehicleRentalStation to vehicleRentalStation
Dvun Oct 31, 2023
59ff1a0
fix: renamed variables with name Vehicle.... to Bike... name
Dvun Oct 31, 2023
4b21103
fix: renamed VehicleRentalStations to VehicleRentalStation
Dvun Oct 31, 2023
5d3d8af
fix: renamed VehicleRentalStations to VehicleRentalStation
Dvun Oct 31, 2023
7b43480
fix: renamed favouriteBikeStations to favouriteVehicleRentalStation
Dvun Oct 31, 2023
8e443ca
fix: renamed bikestation to vehicleRentalStation
Dvun Nov 1, 2023
2e036eb
fix: update
Dvun Dec 5, 2023
d01086f
fix: update geocodingLayers
Dvun Dec 8, 2023
b06c4ca
fix: update readme searchContext object
Dvun Dec 11, 2023
7d0e6af
fix: update propTypes
Dvun Dec 11, 2023
ac8bc1c
fix: update propTypes and defaultProps
Dvun Dec 12, 2023
0bc3bdb
fix: update
Dvun Dec 15, 2023
c2c21a7
fix: update
Dvun Dec 22, 2023
fcfce11
fix: deleted unnecessary code
Dvun Dec 22, 2023
ec8758e
fix: deleted unnecessary code
Dvun Dec 22, 2023
e1f2462
fix: renamed VehicleRentalStationDurationInfo -> VehicleRentalDuratio…
Dvun Dec 22, 2023
ae1d173
fix: renamed VehicleStopNearYou -> VehicleRentalStationNearYou
Dvun Dec 22, 2023
ed58bb9
fix: renamed VehiclesRentalStationAvailability -> VehicleRentalAvaila…
Dvun Dec 22, 2023
21352cd
fix: removed vehicleRentalStation case
Dvun Dec 22, 2023
72df883
fix: removed favouriteVehiclestation case
Dvun Dec 22, 2023
d1d8b01
fix: renamed VehicleRentalStations -> VehicleRentalStation
Dvun Dec 22, 2023
d706f15
fix: version update
Dvun Dec 22, 2023
6e759cf
fix: version update
Dvun Dec 22, 2023
6645d8a
fix: version update
Dvun Dec 22, 2023
14eb169
fix: version update
Dvun Dec 22, 2023
02ea75f
fix: version update
Dvun Dec 22, 2023
e68d4b5
fix: version update
Dvun Dec 22, 2023
60c1d41
fix: version update
Dvun Dec 22, 2023
435e931
fix: fixed error
Dvun Dec 22, 2023
93e7ee2
fix: renamed all citybike variables to vehicle
Dvun Dec 22, 2023
3c3b74f
fix: schema
vesameskanen Dec 27, 2023
8fbe248
fix: use sensible names
vesameskanen Dec 27, 2023
0aa7c02
fix: better name for VehicleRentalStationStopContent
vesameskanen Dec 27, 2023
a7bbfc6
fix: use correct layer in uniq-uy-label, increase major version
vesameskanen Dec 27, 2023
741c104
fix: use correct layers in vehicleReantalStation deduplication, lift …
vesameskanen Dec 27, 2023
8302e03
chore: bump up major versions due to breaking changes
vesameskanen Dec 27, 2023
8c1a7f5
fix: update reference to removed BikeRentalStation as VehicleRentalSt…
vesameskanen Dec 27, 2023
bb12763
fix: add wrongly removed favouriteStation, remove nonexistent vehicle…
vesameskanen Dec 27, 2023
016d4a8
chore: update deps and bump up versions because of dependency changes
vesameskanen Dec 27, 2023
e4dd7c2
chore: update lockfile
vesameskanen Dec 27, 2023
b213973
chore: bike -> vehicle
vesameskanen Dec 27, 2023
269e959
fix: incorrect layer identification
vesameskanen Dec 27, 2023
bfa916f
fix: type id starts with upper case
vesameskanen Dec 27, 2023
c20a3ee
fix: remove nonexistent context func from docs
vesameskanen Dec 27, 2023
54bbc5b
fix: rename query for fetching all vehicle rental stations
vesameskanen Dec 27, 2023
59768eb
chore: rename vehicle rental search target consistently in plural form
vesameskanen Dec 27, 2023
d7fa6e2
chore: rename one target selector more
vesameskanen Dec 27, 2023
cab2e11
fix: update one more internal dependency in digitransit-component lib…
vesameskanen Dec 27, 2023
20103e7
chore: update package.lock
vesameskanen Dec 27, 2023
6bf64f3
fix: correct deduplication for vehicle rental stations
vesameskanen Dec 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/component/Availability.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,15 @@ Availability.displayName = 'Availability';
Availability.propTypes = {
available: PropTypes.number.isRequired,
total: PropTypes.number.isRequired,
fewAvailableCount: PropTypes.number.isRequired,
fewerAvailableCount: PropTypes.number.isRequired,
fewAvailableCount: PropTypes.number,
fewerAvailableCount: PropTypes.number,
text: PropTypes.node.isRequired,
showStatusBar: PropTypes.bool.isRequired,
};

Availability.defaultProps = {
fewAvailableCount: undefined,
fewerAvailableCount: undefined,
};

export default Availability;
31 changes: 15 additions & 16 deletions app/component/BicycleLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import ItineraryCircleLine from './ItineraryCircleLine';
import ItineraryCircleLineLong from './ItineraryCircleLineLong';
import { PREFIX_STOPS } from '../util/path';
import {
getCityBikeNetworkConfig,
getCityBikeNetworkId,
getVehicleRentalStationNetworkConfig,
CityBikeNetworkType,
} from '../util/citybikes';
} from '../util/vehicleRentalUtils';
import ItineraryCircleLineWithIcon from './ItineraryCircleLineWithIcon';
import { splitStringToAddressAndPlace } from '../util/otpStrings';
import CityBikeLeg from './CityBikeLeg';
import VehicleRentalLeg from './VehicleRentalLeg';
import StopCode from './StopCode';
import PlatformNumber from './PlatformNumber';

Expand All @@ -41,9 +40,9 @@ function BicycleLeg(
const [address, place] = splitStringToAddressAndPlace(leg.from.name);
const networkConfig =
leg.rentedBike &&
leg.from.bikeRentalStation &&
getCityBikeNetworkConfig(
getCityBikeNetworkId(leg.from.bikeRentalStation.networks),
leg.from.vehicleRentalStation &&
getVehicleRentalStationNetworkConfig(
leg.from.vehicleRentalStation.network,
config,
);
const isFirstLeg = i => i === 0;
Expand Down Expand Up @@ -200,10 +199,10 @@ function BicycleLeg(
/>
</div>
) : (
<CityBikeLeg
<VehicleRentalLeg
stationName={leg.from.name}
isScooter={isScooter}
bikeRentalStation={leg.from.bikeRentalStation}
vehicleRentalStation={leg.from.vehicleRentalStation}
/>
)}
{bicycleWalkLeg?.from.stop && (
Expand Down Expand Up @@ -311,9 +310,9 @@ BicycleLeg.propTypes = {
distance: PropTypes.number.isRequired,
from: PropTypes.shape({
name: PropTypes.string.isRequired,
bikeRentalStation: PropTypes.shape({
bikesAvailable: PropTypes.number.isRequired,
networks: PropTypes.array.isRequired,
vehicleRentalStation: PropTypes.shape({
vehiclesAvailable: PropTypes.number.isRequired,
network: PropTypes.string.isRequired,
}),
stop: PropTypes.object,
}).isRequired,
Expand All @@ -332,12 +331,12 @@ BicycleLeg.propTypes = {
startTime: PropTypes.number.isRequired,
from: PropTypes.shape({
name: PropTypes.string.isRequired,
bikeRentalStation: PropTypes.shape({
bikesAvailable: PropTypes.number.isRequired,
networks: PropTypes.array.isRequired,
vehicleRentalStation: PropTypes.shape({
vehiclesAvailable: PropTypes.number.isRequired,
network: PropTypes.string.isRequired,
}),
stop: PropTypes.object,
}).isRequired,
}),
to: PropTypes.shape({
name: PropTypes.string.isRequired,
stop: PropTypes.object,
Expand Down
8 changes: 4 additions & 4 deletions app/component/BikeParkLeg.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ BikeParkLeg.contextTypes = {
BikeParkLeg.propTypes = {
index: PropTypes.number.isRequired,
focusAction: PropTypes.func.isRequired,
bikePark: PropTypes.object,
bikePark: PropTypes.object.isRequired,
leg: PropTypes.shape({
endTime: PropTypes.number.isRequired,
duration: PropTypes.number.isRequired,
startTime: PropTypes.number.isRequired,
distance: PropTypes.number.isRequired,
from: PropTypes.shape({
name: PropTypes.string.isRequired,
bikeRentalStation: PropTypes.shape({
bikesAvailable: PropTypes.number.isRequired,
networks: PropTypes.array.isRequired,
vehicleRentalStation: PropTypes.shape({
vehiclesAvailable: PropTypes.number.isRequired,
network: PropTypes.string.isRequired,
}),
stop: PropTypes.object,
}).isRequired,
Expand Down
45 changes: 0 additions & 45 deletions app/component/BikeRentalStationPageMapContainer.js

This file was deleted.

69 changes: 0 additions & 69 deletions app/component/CityBikeStopContent.js

This file was deleted.

8 changes: 4 additions & 4 deletions app/component/CustomizeSearchNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import TransportModesSection from './customizesearch/TransportModesSection';
import WalkingOptionsSection from './customizesearch/WalkingOptionsSection';
import AccessibilityOptionSection from './customizesearch/AccessibilityOptionSection';
import TransferOptionsSection from './customizesearch/TransferOptionsSection';
import CityBikeNetworkSelector from './customizesearch/CityBikeNetworkSelector';
import VehicleRentalStationNetworkSelector from './customizesearch/VehicleRentalStationNetworkSelector';
import { showModeSettings, useCitybikes } from '../util/modeUtils';
import ScrollableWrapper from './ScrollableWrapper';
import { getDefaultSettings } from '../util/planParamUtil';
import { getCitybikeNetworks } from '../util/citybikes';
import { getVehicleRentalStationNetworks } from '../util/vehicleRentalUtils';

class CustomizeSearch extends React.Component {
static contextTypes = {
Expand Down Expand Up @@ -126,8 +126,8 @@ class CustomizeSearch extends React.Component {
/>
</legend>
<div className="transport-modes-container">
<CityBikeNetworkSelector
currentOptions={getCitybikeNetworks(config)}
<VehicleRentalStationNetworkSelector
currentOptions={getVehicleRentalStationNetworks(config)}
/>
</div>
</fieldset>
Expand Down
3 changes: 2 additions & 1 deletion app/component/DepartureRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ DepartureRow.propTypes = {
showPlatformCode: PropTypes.bool,
canceled: PropTypes.bool,
className: PropTypes.string,
onCapacityClick: PropTypes.func.isRequired,
// eslint-disable-next-line react/require-default-props
onCapacityClick: PropTypes.func,
};

DepartureRow.contextTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ import Favourite from './Favourite';
import { saveFavourite, deleteFavourite } from '../action/FavouriteActions';
import { addAnalyticsEvent } from '../util/analyticsUtils';

const FavouriteBikeRentalStationContainer = connectToStores(
const FavouriteVehicleRentalStationContainer = connectToStores(
Favourite,
['FavouriteStore', 'UserStore', 'PreferencesStore'],
(context, { bikeRentalStation }) => ({
(context, { vehicleRentalStation }) => ({
favourite: context
.getStore('FavouriteStore')
.isFavouriteBikeRentalStation(
bikeRentalStation.stationId,
bikeRentalStation.networks,
.isFavouriteVehicleRentalStation(
vehicleRentalStation.stationId,
vehicleRentalStation.network,
),
isFetching: context.getStore('FavouriteStore').getStatus() === 'fetching',
addFavourite: () => {
context.executeAction(saveFavourite, {
lat: bikeRentalStation.lat,
lon: bikeRentalStation.lon,
networks: bikeRentalStation.networks,
name: bikeRentalStation.name,
stationId: bikeRentalStation.stationId,
lat: vehicleRentalStation.lat,
lon: vehicleRentalStation.lon,
network: vehicleRentalStation.network,
name: vehicleRentalStation.name,
stationId: vehicleRentalStation.stationId,
type: 'bikeStation',
});
addAnalyticsEvent({
category: 'BikeRentalStation',
action: 'MarkBikeRentalStationAsFavourite',
name: !context
.getStore('FavouriteStore')
.isFavouriteBikeRentalStation(
bikeRentalStation.stationId,
bikeRentalStation.networks,
.isFavouriteVehicleRentalStation(
vehicleRentalStation.stationId,
vehicleRentalStation.network,
),
});
},
deleteFavourite: () => {
const bikeRentalStationToDelete = context
const vehicleRentalStationToDelete = context
.getStore('FavouriteStore')
.getByStationIdAndNetworks(
bikeRentalStation.stationId,
bikeRentalStation.networks,
vehicleRentalStation.stationId,
vehicleRentalStation.network,
);
context.executeAction(deleteFavourite, bikeRentalStationToDelete);
context.executeAction(deleteFavourite, vehicleRentalStationToDelete);
addAnalyticsEvent({
category: 'BikeRentalStation',
action: 'MarkBikeRentalStationAsFavourite',
name: !context
.getStore('FavouriteStore')
.isFavouriteBikeRentalStation(
bikeRentalStation.stationId,
bikeRentalStation.networks,
.isFavouriteVehicleRentalStation(
vehicleRentalStation.stationId,
vehicleRentalStation.network,
),
});
},
Expand All @@ -62,10 +62,10 @@ const FavouriteBikeRentalStationContainer = connectToStores(
}),
);

FavouriteBikeRentalStationContainer.contextTypes = {
FavouriteVehicleRentalStationContainer.contextTypes = {
getStore: PropTypes.func.isRequired,
executeAction: PropTypes.func.isRequired,
config: PropTypes.object.isRequired,
};

export default FavouriteBikeRentalStationContainer;
export default FavouriteVehicleRentalStationContainer;
2 changes: 1 addition & 1 deletion app/component/FavouritesContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class FavouritesContainer extends React.Component {
if (
useCitybikes(this.context.config.cityBike?.networks, this.context.config)
) {
targets.push('BikeRentalStations');
targets.push('VehicleRentalStations');
}
if (this.context.config.includeParkAndRideSuggestions) {
targets.push('ParkingAreas');
Expand Down
4 changes: 2 additions & 2 deletions app/component/IndexPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ class IndexPage extends React.Component {
];

if (useCitybikes(config.cityBike?.networks, config)) {
stopAndRouteSearchTargets.push('BikeRentalStations');
locationSearchTargets.push('BikeRentalStations');
stopAndRouteSearchTargets.push('VehicleRentalStations');
locationSearchTargets.push('VehicleRentalStations');
}
if (config.includeParkAndRideSuggestions) {
stopAndRouteSearchTargets.push('ParkingAreas');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ const containerComponent = createFragmentContainer(
effectiveStartDate
}
}
bikeRentalStation {
bikesAvailable
networks
vehicleRentalStation {
vehiclesAvailable
network
}
}
to {
Expand Down
Loading
Loading