Skip to content

Commit 06d499d

Browse files
committed
fix: add disabledActions
roundtrip and addPlaceInput buttons are no longer shown, since they do nothing in the optimization tab anyway
1 parent 280945b commit 06d499d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/config-examples/app-config-example.js

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const appConfig = {
3636

3737
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
3838

39+
disabledActionsForOptimization: ['addPlaceInput', 'roundtrip'], // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter`
3940
disabledActionsForIsochrones: ['roundtrip'], // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter`
4041
disabledActionsForPlacesAndDirections: [], // // Possible values: `addPlaceInput`, `clearPlaces`, `reverseRoute`, `roundtrip`, `routeImporter`
4142
supportsPlacesAndDirections: true, // If the whole places and directions feature is supported/enabled in the application

src/fragments/forms/map-form/components/optimization/Optimization.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
</div>
6363
</template>
6464
</v-tooltip>
65-
<form-actions :place-inputs="jobs.length"
66-
@addPlaceInput="addPlaceInput"
65+
<form-actions :place-inputs="jobs.length" :disabled-actions="disabledActions"
6766
@clearPlaces="clearPlaces"
6867
@reverseRoute="reverseRoute"
6968
@contentUploaded="contentUploaded">

src/fragments/forms/map-form/components/optimization/optimization.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Optimization } from '@/support/ors-api-runner'
77
import AppMode from '@/support/app-modes/app-mode'
88
import MapViewData from '@/models/map-view-data'
99
import constants from '@/resources/constants'
10+
import appConfig from '@/config/app-config'
1011
import Place from '@/models/place'
1112
import Job from '@/models/job'
1213
import Vehicle from '@/models/vehicle'
@@ -88,6 +89,9 @@ export default {
8889
}
8990
}
9091
return skillIds
92+
},
93+
disabledActions () {
94+
return appConfig.disabledActionsForOptimization
9195
}
9296
},
9397
created () {

0 commit comments

Comments
 (0)