Skip to content

Commit 7d993b9

Browse files
Refactor/clean up code (#451)
2 parents 394a589 + 78c11f6 commit 7d993b9

File tree

43 files changed

+95
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+95
-168
lines changed

src/fragments/box/box.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ export default {
162162
* if it is not the last one (over the other)
163163
* Method is intended to be called when the global
164164
* event `boxMaximizedStackChanged` if emitted
165-
* @param {*} value
166165
*/
167166
syncBoxesMaximized () {
168167
// We can have a list of boxes considered as maximized, but only the

src/fragments/charts/altitude/altitude.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import MapViewData from '@/models/map-view-data'
44
import {EventBus} from '@/common/event-bus'
55
import theme from '@/config/theme'
66
import {
7-
Chart as ChartJS,
87
CategoryScale,
8+
Chart as ChartJS,
9+
Filler,
10+
Legend,
911
LinearScale,
10-
PointElement,
1112
LineElement,
12-
Tooltip,
13-
Legend,
14-
Filler
13+
PointElement,
14+
Tooltip
1515
} from 'chart.js'
1616

1717
ChartJS.register(

src/fragments/footer/footer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import appConfig from '@/config/app-config'
22
import theme from '@/config/theme'
3+
34
export default {
45
data () {
56
return {

src/fragments/forms/fields-container/components/form-fields/form-fields.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ export default {
127127
/**
128128
* Update filed modal when the combo component triggers an update
129129
* @param {*} index
130-
* @param {*} newVal
131130
*/
132131
sliderComboUpdated (index) {
133132
let parameter = this.parameters[index]
@@ -156,6 +155,7 @@ export default {
156155
/**
157156
* Set item option structure and translation
158157
* @param {Array} items
158+
* @param parameter
159159
* @return {Array} items
160160
*/
161161
adjustItems (items, parameter) {
@@ -187,6 +187,7 @@ export default {
187187
/**
188188
* Get item translation by item value
189189
* @param {String} itemValue
190+
* @param parameter
190191
* @returns {String}
191192
*/
192193
getItemTranslation (itemValue, parameter) {

src/fragments/forms/fields-container/components/slider-combo/slider-combo.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import customSlider from './custom-slider'
32

43
export default {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import OrsParamsParser from '@/support/map-data-services/ors-params-parser'
2-
import { Directions } from '@/support/ors-api-runner'
2+
import {Directions} from '@/support/ors-api-runner'
33
import MapViewData from '@/models/map-view-data'
44
import constants from '@/resources/constants'
55
import toKml from '@maphubs/tokml'

src/fragments/forms/map-form/components/isochrones/isochrones.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ ul.place-inputs li {
1414
}
1515

1616
ul.place-inputs {
17-
padding: 0;
18-
padding-top: 10px;
19-
padding-bottom: 10px;
17+
padding: 10px 0;
2018
}
2119

2220
.extra-btn {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import MapViewDataBuilder from '@/support/map-data-services/map-view-data-builde
33
import FieldsContainer from '@/fragments/forms/fields-container/FieldsContainer'
44
import OrsFilterUtil from '@/support/map-data-services/ors-filter-util'
55
import PlaceInput from '@/fragments/forms/place-input/PlaceInput.vue'
6-
import { Isochrones } from '@/support/ors-api-runner'
6+
import {Isochrones} 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'
@@ -261,7 +261,6 @@ export default {
261261
/**
262262
* Handle the route places error response displaying the correct message
263263
* @param {*} result
264-
* @param {*} args
265264
*/
266265
handleCalculateIsochronesError (result) {
267266
this.$root.appHooks.run('beforeHandleIsochronesError', result)

src/fragments/forms/map-form/components/place-and-directions/components/route-details/components/extras/route-extras.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export default {
8989
* Build and return
9090
* the segment style object
9191
* @param {String} extraKey
92-
* @param {Number} amount
92+
* @param summary amount, value
9393
* @param {Integer} index
9494
* @returns {Object}
9595
*/

src/fragments/forms/map-form/components/place-and-directions/places-and-directions.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
}
1212

1313
ul.place-inputs {
14-
padding: 0;
15-
padding-top: 10px;
16-
padding-bottom: 10px;
14+
padding: 10px 0;
1715
}
1816

1917
ul.place-inputs li {

src/fragments/forms/map-form/components/place-and-directions/places-and-directions.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import OrsParamsParser from '@/support/map-data-services/ors-params-parser'
44
import OrsFilterUtil from '@/support/map-data-services/ors-filter-util'
55
import PlaceInput from '@/fragments/forms/place-input/PlaceInput.vue'
66
import MapFormBtn from '@/fragments/forms/map-form-btn/MapFormBtn'
7-
import { Directions } from '@/support/ors-api-runner'
7+
import {Directions} from '@/support/ors-api-runner'
88
import AppMode from '@/support/app-modes/app-mode'
99
import MapViewData from '@/models/map-view-data'
1010
import constants from '@/resources/constants'
@@ -668,7 +668,6 @@ export default {
668668
/**
669669
* Handle the route places error response displaying the correct message
670670
* @param {*} result
671-
* @param {*} args
672671
*/
673672
handleCalculateDirectionsError (result) {
674673
this.$root.appHooks.run('beforeHandleDirectionsError', result)
@@ -905,7 +904,6 @@ export default {
905904

906905
/**
907906
* Toggle the round trip state view mode
908-
* @param {Boolean} roundTripActive
909907
*/
910908
toggleRoundTrip () {
911909
// If it is in roundTrip mode, we must be reset to single place mode

src/fragments/forms/map-form/map-form.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
}
1212

1313
ul.place-inputs {
14-
padding: 0;
15-
padding-top: 10px;
14+
padding: 10px 0 0;
1615
}
1716

1817
ul.place-inputs li {

src/fragments/forms/place-input/place-input.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PlacesSearch, ReverseGeocode } from '@/support/ors-api-runner'
1+
import {PlacesSearch, ReverseGeocode} from '@/support/ors-api-runner'
22
import AppMode from '@/support/app-modes/app-mode'
33
import constants from '@/resources/constants'
44
import appConfig from '@/config/app-config'
@@ -214,7 +214,6 @@ export default {
214214
},
215215
/**
216216
* Get the place input label based on the current view mode
217-
* @param {*} index
218217
*/
219218
placeInputLabel () {
220219
let label = null
@@ -332,7 +331,7 @@ export default {
332331
/**
333332
* highlight typed place name
334333
* @param {String} placeName
335-
* @returns {Html}
334+
* @returns {string}
336335
*/
337336
highlightedName (placeName) {
338337
let searchMask = this.localModel.placeName
@@ -738,7 +737,6 @@ export default {
738737

739738
/**
740739
* Reset a place input at a given index
741-
* @param {*} index
742740
*/
743741
placeCleared () {
744742
if (!this.model.isEmpty()) {

src/fragments/forms/profile-selector/components/profile-selector-option/profile-selector-option.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import utils from '@/support/utils'
32

43
export default {

src/fragments/forms/profile-selector/profile-selector.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ export default {
6969
return filterRef.value
7070
},
7171

72-
/**
73-
* Get the primary profiles
74-
* @returns {Array}
75-
*/
76-
getPrimaryProfiles () {
77-
const primaryProfiles = this.lodash.filter(this.profilesMapping, (p) => {
78-
return p.primary === true
79-
})
80-
return primaryProfiles
81-
},
82-
8372
notifyProfileChanged () {
8473
EventBus.$emit('filtersChangedExternally')
8574
},

src/fragments/forms/route-importer/route-importer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export default {
5858
* Catch file contents and type, parse and call load
5959
* @param {*} fileContent
6060
* @param {*} type
61+
* @param timestamp
6162
*/
6263
catchAndParseFile (fileContent, type, timestamp) {
6364
let fileType = null

src/fragments/map-view/components/map-left-click/map-left-click.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @listens mapRightClicked
77
* @listens mapLeftClicked (to close the right click pop up)
88
*/
9-
import { ReverseGeocode } from '@/support/ors-api-runner'
9+
import {ReverseGeocode} from '@/support/ors-api-runner'
1010
import GeoUtils from '@/support/geo-utils'
1111
import Place from '@/models/place'
1212
import {EventBus} from '@/common/event-bus'
@@ -99,9 +99,8 @@ export default {
9999
},
100100
/**
101101
* Resolve the coordinates of a point to a qualified location
102-
* @param lar
102+
* @param lat
103103
* @param lng
104-
* @param options
105104
* @returns {Promise}
106105
* @emits showLoading (via EventBus)
107106
*/

src/fragments/map-view/components/map-view-markers/map-view-markers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue2LeafletMarkerCluster from 'vue2-leaflet-markercluster'
22
import constants from '@/resources/constants'
3-
import {LMarker, LPopup } from 'vue2-leaflet'
3+
import {LMarker, LPopup} from 'vue2-leaflet'
44
import appConfig from '@/config/app-config'
55

66
import 'leaflet.markercluster/dist/MarkerCluster.css'

src/fragments/map-view/components/ors-l-polyline/ors-extended-polyline.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,7 @@ class OrsExtendedPolyline {
367367
return true
368368
}
369369

370-
if ((this.options.vertices.middle === false || this.options.vertices.insert === false) && index === -1) {
371-
return true
372-
}
373-
return false
370+
return (this.options.vertices.middle === false || this.options.vertices.insert === false) && index === -1
374371
}
375372

376373
/**
@@ -455,7 +452,6 @@ class OrsExtendedPolyline {
455452
/**
456453
* Process the polyline drag by adding a temporary
457454
* vertex to represent user drag action
458-
* @param {*} event
459455
*/
460456
processDrag () {
461457
const closestIndex = this._getClosestIndex()

src/fragments/map-view/map-definitions.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import store from '@/store/store'
55
const mapDefinitions = {
66
/**
77
* Reorder the values of an array of coordinates switching the position of lat and long of each coordinate
8-
* @param {*} coordinatesArr
98
* @returns {Array} of reordered coordinates
9+
* @param polylineMeasureTranslations
1010
*/
1111
polylineMeasureOptions: (polylineMeasureTranslations) => {
1212
// eslint-disable-block no-multi-spaces
13-
const options = {
13+
return {
1414
// language options
1515
...polylineMeasureTranslations,
1616
// other options
@@ -58,7 +58,6 @@ const mapDefinitions = {
5858
radius: 6 // Radius of the circle
5959
}
6060
}
61-
return options
6261
},
6362
/**
6463
* Build the draw options object

0 commit comments

Comments
 (0)