From f1406d0686b7e42a339814dc501235d4b1f1751b Mon Sep 17 00:00:00 2001 From: Peter Date: Sat, 16 Dec 2023 16:17:44 +0100 Subject: [PATCH] remove road_access --- config.js | 1 - src/api/graphhopper.d.ts | 1 - src/sidebar/RoutingResults.tsx | 21 --------------------- src/stores/RouteStore.ts | 5 ++--- test/routing/Api.test.ts | 4 ---- 5 files changed, 2 insertions(+), 30 deletions(-) diff --git a/config.js b/config.js index 89052c84..528c4979 100644 --- a/config.js +++ b/config.js @@ -23,7 +23,6 @@ const config = { details: [ 'road_class', 'road_environment', - 'road_access', 'surface', 'max_speed', 'average_speed', diff --git a/src/api/graphhopper.d.ts b/src/api/graphhopper.d.ts index 5aeee47b..527ca060 100644 --- a/src/api/graphhopper.d.ts +++ b/src/api/graphhopper.d.ts @@ -97,7 +97,6 @@ interface Details { readonly toll: [number, number, string][] readonly max_speed: [number, number, number][] readonly road_class: [number, number, string][] - readonly road_access: [number, number, string][] readonly road_environment: [number, number, string][] readonly track_type: [number, number, string][] readonly country: [number, number, string][] diff --git a/src/sidebar/RoutingResults.tsx b/src/sidebar/RoutingResults.tsx index baae8b4c..4c2ada36 100644 --- a/src/sidebar/RoutingResults.tsx +++ b/src/sidebar/RoutingResults.tsx @@ -67,13 +67,6 @@ function RoutingResult({ const fordInfo = getInfoFor(path.points, path.details.road_environment, { ford: true }) const tollInfo = getInfoFor(path.points, path.details.toll, { all: true, hgv: ApiImpl.isTruck(profile) }) const ferryInfo = getInfoFor(path.points, path.details.road_environment, { ferry: true }) - const privateOrDeliveryInfo = ApiImpl.isMotorVehicle(profile) - ? getInfoFor(path.points, path.details.road_access, { - private: true, - customers: true, - delivery: true, - }) - : new RouteInfo() const badTrackInfo = !ApiImpl.isMotorVehicle(profile) ? new RouteInfo() : getInfoFor(path.points, path.details.track_type, { grade2: true, grade3: true, grade4: true, grade5: true }) @@ -93,7 +86,6 @@ function RoutingResult({ fordInfo.distance > 0 || tollInfo.distance > 0 || ferryInfo.distance > 0 || - privateOrDeliveryInfo.distance > 0 || trunkInfo.distance > 0 || badTrackInfo.distance > 0 || stepsInfo.distance > 0 || @@ -179,19 +171,6 @@ function RoutingResult({ selected={selectedRH} segments={ferryInfo.segments} /> - setDescriptionRH(b)} - description={tr('way_contains', [tr('private_sections')])} - setType={t => setSelectedRH(t)} - type={'private'} - child={} - value={ - privateOrDeliveryInfo.distance > 0 && - metersToShortText(privateOrDeliveryInfo.distance, showDistanceInMiles) - } - selected={selectedRH} - segments={privateOrDeliveryInfo.segments} - /> setDescriptionRH(b)} description={tr('way_contains_toll')} diff --git a/src/stores/RouteStore.ts b/src/stores/RouteStore.ts index a917c116..66b7a194 100644 --- a/src/stores/RouteStore.ts +++ b/src/stores/RouteStore.ts @@ -1,8 +1,8 @@ import Store from '@/stores/Store' import { Action } from '@/stores/Dispatcher' import { ClearPoints, ClearRoute, RemovePoint, RouteRequestSuccess, SetPoint, SetSelectedPath } from '@/actions/Actions' -import QueryStore, { RequestState } from '@/stores/QueryStore' -import { Path, RoutingArgs, RoutingResult } from '@/api/graphhopper' +import QueryStore from '@/stores/QueryStore' +import { Path, RoutingResult } from '@/api/graphhopper' export interface RouteStoreState { routingResult: RoutingResult @@ -34,7 +34,6 @@ export default class RouteStore extends Store { track_type: [], country: [], get_off_bike: [], - road_access: [], }, distance: 0, points_order: [], diff --git a/test/routing/Api.test.ts b/test/routing/Api.test.ts index 44b310d7..9ab902ad 100644 --- a/test/routing/Api.test.ts +++ b/test/routing/Api.test.ts @@ -115,7 +115,6 @@ describe('route', () => { details: [ 'road_class', 'road_environment', - 'road_access', 'surface', 'max_speed', 'average_speed', @@ -157,7 +156,6 @@ describe('route', () => { details: [ 'road_class', 'road_environment', - 'road_access', 'surface', 'max_speed', 'average_speed', @@ -208,7 +206,6 @@ describe('route', () => { details: [ 'road_class', 'road_environment', - 'road_access', 'surface', 'max_speed', 'average_speed', @@ -315,7 +312,6 @@ describe('route', () => { details: [ 'road_class', 'road_environment', - 'road_access', 'surface', 'max_speed', 'average_speed',