diff --git a/app/component/itinerary/CustomizeSearch.js b/app/component/itinerary/CustomizeSearch.js
index a5d48836a6..f0c4ace7ad 100644
--- a/app/component/itinerary/CustomizeSearch.js
+++ b/app/component/itinerary/CustomizeSearch.js
@@ -13,7 +13,6 @@ import AccessibilityOptionSection from './customizesearch/AccessibilityOptionSec
import TransferOptionsSection from './customizesearch/TransferOptionsSection';
import RentalNetworkSelector from './customizesearch/RentalNetworkSelector';
import ScooterNetworkSelector from './customizesearch/ScooterNetworkSelector';
-import RestoreDefaultSettingSection from './customizesearch/RestoreDefaultSettingSection';
import { getReadMessageIds, setReadMessageIds } from '../../store/localStorage';
import { isKeyboardSelectionEvent } from '../../util/browser';
import {
@@ -22,10 +21,7 @@ import {
useScooters,
} from '../../util/modeUtils';
import ScrollableWrapper from '../ScrollableWrapper';
-import {
- getDefaultSettings,
- getNumberOfCustomizedSettings,
-} from '../../util/planParamUtil';
+import { getDefaultSettings } from '../../util/planParamUtil';
import {
getCitybikeNetworks,
getScooterNetworks,
@@ -87,7 +83,6 @@ class CustomizeSearch extends React.Component {
) : (
);
- const numberOfCustomizedSettings = getNumberOfCustomizedSettings(config);
return (
0
- ? ` (${numberOfCustomizedSettings})`
- : '',
- }}
/>
diff --git a/app/component/itinerary/customize-search.scss b/app/component/itinerary/customize-search.scss
index de15c3980d..d51f352359 100644
--- a/app/component/itinerary/customize-search.scss
+++ b/app/component/itinerary/customize-search.scss
@@ -187,17 +187,6 @@
}
}
}
-
- .restore-settings-button-text {
- color: $link-color;
- text-decoration: none;
- font-weight: $font-weight-medium;
- text-align: center;
- display: block;
- width: fit-content;
- padding: 8px;
- margin: 0 auto;
- }
}
.settings-section {
@@ -216,10 +205,6 @@
&.compact-settings-section {
padding-bottom: 0;
}
-
- &.background {
- background: #f4f4f5;
- }
}
.settings-option-container {
diff --git a/app/component/itinerary/customizesearch/RestoreDefaultSettingSection.js b/app/component/itinerary/customizesearch/RestoreDefaultSettingSection.js
deleted file mode 100644
index 9e9fbe01c6..0000000000
--- a/app/component/itinerary/customizesearch/RestoreDefaultSettingSection.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* eslint-disable jsx-a11y/label-has-associated-control */
-import PropTypes from 'prop-types';
-import React from 'react';
-import { FormattedMessage, intlShape } from 'react-intl';
-import { isKeyboardSelectionEvent } from '../../../util/browser';
-import { saveRoutingSettings } from '../../../action/SearchSettingsActions';
-import {
- getDefaultSettings,
- getNumberOfCustomizedSettings,
-} from '../../../util/planParamUtil';
-import { configShape } from '../../../util/shapes';
-
-const RestoreDefaultSettingSection = ({ config }, { executeAction, intl }) => {
- const restoreDefaultSettings = () => {
- executeAction(saveRoutingSettings, {
- ...getDefaultSettings(config),
- });
- };
- const numberOfCustomizedSettings = getNumberOfCustomizedSettings(config);
-
- return (
-
- );
-};
-
-RestoreDefaultSettingSection.propTypes = {
- config: configShape.isRequired,
-};
-
-RestoreDefaultSettingSection.contextTypes = {
- executeAction: PropTypes.func.isRequired,
- intl: intlShape.isRequired,
-};
-
-export default RestoreDefaultSettingSection;
diff --git a/app/translations.js b/app/translations.js
index 079eafdaa6..1e6d9f9a16 100644
--- a/app/translations.js
+++ b/app/translations.js
@@ -1498,10 +1498,6 @@ const translations = {
'rent-e-scooter-at': 'Use an app to unlock the electric scooter',
'rent-scooter-at': 'Rent a kick scooter at {station} station',
'required-ticket': 'Ticket required for the journey',
- 'restore-default-settings':
- 'Restore default settings {numberOfCustomizedSettings}',
- 'restore-default-settings-aria-label':
- 'Restore default settings. You have {numberOfCustomizedSettings} customized settings.',
'return-cycle-to': 'Return the bike:',
'return-e-scooter-to': 'Leave the scooter in a safe location',
'return-scooter-to': 'Return the kick scooter to {station} station',
@@ -1609,7 +1605,7 @@ const translations = {
'The journey includes demand responsive transport service. Please check the payment methods and practices on ',
'set-specific-settings': 'Set more specific settings',
'set-stop-as-routes': "Set the stop as route's",
- settings: 'Settings {numberOfCustomizedSettings}',
+ settings: 'Settings',
'settings-alternative-name-rail': 'Train',
'settings-change-itinerary-settings': 'Change settings',
'settings-dropdown-close-label': 'Close options',
@@ -2794,10 +2790,6 @@ const translations = {
'rent-e-scooter-at': 'Ota sähköpotkulauta käyttöön sovelluksella',
'rent-scooter-at': 'Vuokraa potkulauta asemalta {station}',
'required-ticket': 'Reitillä tarvittava lippu',
- 'restore-default-settings':
- 'Palauta oletusasetukset {numberOfCustomizedSettings}',
- 'restore-default-settings-aria-label':
- 'Palauta oletusasetukset. Muutettuja asetuksia on {numberOfCustomizedSettings}.',
'return-cycle-to': 'Palauta kaupunkipyörä:',
'return-e-scooter-to': 'Jätä potkulauta turvalliseen paikkaan',
'return-scooter-to': 'Palauta potkulauta asemalle {station}',
@@ -2904,7 +2896,7 @@ const translations = {
'Matka sisältää kutsuliikennettä. Voit tarkistaa maksutavat ja käytännöt ',
'set-specific-settings': 'Aseta tarkemmat asetukset',
'set-stop-as-routes': 'Aseta pysäkki reitin',
- settings: 'Asetukset {numberOfCustomizedSettings}',
+ settings: 'Asetukset',
'settings-alternative-name-rail': 'Juna',
'settings-change-itinerary-settings': 'Muuta asetuksia',
'settings-dropdown-close-label': 'Sulje vaihtoehdot',
@@ -5743,10 +5735,6 @@ const translations = {
'rent-e-scooter-at': 'Ta en elsparkcykel i bruk med en app.',
'rent-scooter-at': 'Hyr en sparkcykel från stationen {station}',
'required-ticket': 'Biljett som behövs under resan',
- 'restore-default-settings':
- 'Återställ standardinställningar {numberOfCustomizedSettings}',
- 'restore-default-settings-aria-label':
- 'Återställ standardinställningar. Du har {numberOfCustomizedSettings} anpassade inställningar.',
'return-cycle-to': 'Returnera stadscykeln: ',
'return-e-scooter-to': 'Lämna elsparkcykeln på ett säkert ställe',
'return-scooter-to': 'Returnera sparkcykeln till stationen {station}',
@@ -5857,7 +5845,7 @@ const translations = {
'I resan ingår anropsbusstrafiken. Bekanta dig med betalningsmetoder och praxis på ',
'set-specific-settings': 'Ställa avancerade inställningar',
'set-stop-as-routes': 'Ställa hållplats som rutter',
- settings: 'Anpassa {numberOfCustomizedSettings}',
+ settings: 'Anpassa',
'settings-alternative-name-rail': 'Tåg',
'settings-change-itinerary-settings': 'Anpassa sökning',
'settings-dropdown-close-label': 'Stäng alternativen',
diff --git a/app/util/planParamUtil.js b/app/util/planParamUtil.js
index f96b77ad83..e298fc6b15 100644
--- a/app/util/planParamUtil.js
+++ b/app/util/planParamUtil.js
@@ -1,10 +1,6 @@
import moment from 'moment';
import isEqual from 'lodash/isEqual';
-import {
- getTransitModes,
- isTransportModeAvailable,
- networkIsActive,
-} from './modeUtils';
+import { getTransitModes, isTransportModeAvailable } from './modeUtils';
import { otpToLocation, getIntermediatePlaces } from './otpStrings';
import { getAllNetworksOfType, getDefaultNetworks } from './vehicleRentalUtils';
import { getCustomizedSettings } from '../store/localStorage';
@@ -66,41 +62,6 @@ export function getDefaultSettings(config) {
};
}
-/**
- * The number of settings that differ from the default settings.
- * @param {*} config the configuration for the software installation
- */
-export function getNumberOfCustomizedSettings(config) {
- const defaultSettings = getDefaultSettings(config);
- const customizedSettings = getCustomizedSettings();
- if (Object.keys(customizedSettings).length === 0) {
- return 0;
- }
- return Object.keys(customizedSettings).reduce((count, key) => {
- if (key === 'allowedBikeRentalNetworks') {
- return (
- count +
- customizedSettings.allowedBikeRentalNetworks.filter(network =>
- networkIsActive(config.vehicleRental.networks[network]),
- ).length
- );
- }
- if (
- Array.isArray(customizedSettings[key]) &&
- Array.isArray(defaultSettings[key])
- ) {
- return (
- count +
- Math.abs(customizedSettings[key].length - defaultSettings[key].length)
- );
- }
- if (customizedSettings[key] !== defaultSettings[key]) {
- return count + 1;
- }
- return count;
- }, 0);
-}
-
/**
* Retrieves the current (customized) settings kept in local store
* Missing setting gets a default value