From 06d499d7569356edd60bc5ad24407ead2ad8353c Mon Sep 17 00:00:00 2001 From: Emma Hegarty Date: Mon, 3 Jun 2024 11:10:07 +0200 Subject: [PATCH] fix: add disabledActions roundtrip and addPlaceInput buttons are no longer shown, since they do nothing in the optimization tab anyway --- src/config-examples/app-config-example.js | 1 + .../forms/map-form/components/optimization/Optimization.vue | 3 +-- .../forms/map-form/components/optimization/optimization.js | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config-examples/app-config-example.js b/src/config-examples/app-config-example.js index 771e3b615..031c437dc 100755 --- a/src/config-examples/app-config-example.js +++ b/src/config-examples/app-config-example.js @@ -36,6 +36,7 @@ const appConfig = { autoSelectFirstExactAddressMatchOnSearchEnter: true, // If the first exact address match must be auto selected when the user type a text and in the place search and hit enter/return + disabledActionsForOptimization: ['addPlaceInput', 'roundtrip'], // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter` disabledActionsForIsochrones: ['roundtrip'], // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter` disabledActionsForPlacesAndDirections: [], // // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter` supportsPlacesAndDirections: true, // If the whole places and directions feature is supported/enabled in the application diff --git a/src/fragments/forms/map-form/components/optimization/Optimization.vue b/src/fragments/forms/map-form/components/optimization/Optimization.vue index b357b8a49..5bd4c0ceb 100644 --- a/src/fragments/forms/map-form/components/optimization/Optimization.vue +++ b/src/fragments/forms/map-form/components/optimization/Optimization.vue @@ -62,8 +62,7 @@ - diff --git a/src/fragments/forms/map-form/components/optimization/optimization.js b/src/fragments/forms/map-form/components/optimization/optimization.js index c622e0bc2..62e2869f5 100644 --- a/src/fragments/forms/map-form/components/optimization/optimization.js +++ b/src/fragments/forms/map-form/components/optimization/optimization.js @@ -7,6 +7,7 @@ import { Optimization } from '@/support/ors-api-runner' import AppMode from '@/support/app-modes/app-mode' import MapViewData from '@/models/map-view-data' import constants from '@/resources/constants' +import appConfig from '@/config/app-config' import Place from '@/models/place' import Job from '@/models/job' import Vehicle from '@/models/vehicle' @@ -88,6 +89,9 @@ export default { } } return skillIds + }, + disabledActions () { + return appConfig.disabledActionsForOptimization } }, created () {