Skip to content

Commit

Permalink
Merge pull request #5239 from HSLdevcom/DT-6709
Browse files Browse the repository at this point in the history
DT-6709 lahti ticket testing on
  • Loading branch information
vesameskanen authored Jan 28, 2025
2 parents 79ee05b + 8769ca4 commit 9b07d7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
6 changes: 0 additions & 6 deletions app/configurations/config.lahti.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,5 @@ export default configMerger(walttiConfig, {
showTicketPrice: false,

showTicketLinkOnlyWhenTesting: true,
settingsForFeatureTesting: {
walkSpeed: 0.69,
bikeSpeed: 8.33,
includeBikeSuggestions: false,
transferPenalty: 1600,
},
ticketLinkOperatorCode: 50223,
});
18 changes: 4 additions & 14 deletions app/util/fareUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { uniqBy } from 'lodash';
import { getSettings } from './planParamUtil';

// TODO: support for currency
export function formatFare(fare) {
Expand Down Expand Up @@ -85,18 +84,6 @@ export const getAlternativeFares = (zones, currentFares, allFares) => {
return alternativeFares;
};

/**
* Compare user settings with settings for feature testing.
* @param {*} config
* @returns
*/
export const shouldAllowTesting = config => {
const settings = getSettings(config);
return Object.keys(config.settingsForFeatureTesting).every(
key => config.settingsForFeatureTesting[key] === settings[key],
);
};

/**
* This function resolves if fare info should be shown.
* Fare information is shown if showTicketInformation is true in config
Expand All @@ -105,7 +92,10 @@ export const shouldAllowTesting = config => {
* @param {*} config configuration.
*/
export const shouldShowFareInfo = config =>
(!config.showTicketLinkOnlyWhenTesting || shouldAllowTesting(config)) &&
(!config.showTicketLinkOnlyWhenTesting ||
window.localStorage
.getItem('favouriteStore')
?.includes('Lippulinkkitestaus2025')) &&
config.showTicketInformation &&
config.availableTickets &&
Array.isArray(config.feedIds) &&
Expand Down

0 comments on commit 9b07d7c

Please sign in to comment.