Members
# constant APIUrls
- To Do:
-
- Use these variables instead of hardcoded URLs
- Rename with prefix to indicate method. Example: APIV2_POST, APIV3_PATCH
# constant APIV3RequestDatetimeFormat
- To Do:
-
- Replace hardcoded moment format with these variables in the entire application
# constant autoRefreshMixin
Location module results can auto refresh each X seconds
# blacklistedSearchModuleFormTabs
Some clients do not have right to perform a search realtime/history ib certain tab (i.g driver)
# circuitServiceDuration
Use now as end date if null is supplied
# currentFormattedAddress
Used by NearbyVehiclesFeature
# currentLayoutName
Customize current layout name Used by V3 - Location Module - Table+Map mode -> To preserve the map if details windows is closed
# constant defaultSensorsVisibility
Used by Diagnostics module to determine whenever to show/hide tor/ana by default
# disableLeafletMapInvalidateSize
Prevent child maps to re-compute their size if hidden
# constant envNames
Some frameworks prefix variables differently
- To Do:
-
- Resemble all the env names here (Each time you see process.env.VUE_APP..., replace with getEnvValue)
# constant layoutStaticContext
Used by MapToolbox to hide itself if Table+Carto (i.g Location module) (Module context pattern)
# constant LoginNewsMixin
- Retrieves application messages from geonline news
- Compute notice message like follow: newest message matching the current locale
# constant mitt
Mitt default instance
IMPORTANT NOTICE: Avoid using mitt as much as possible. Ask for alternative communication strategies.
# constant providerState
Module context pattern
# constant wrapper
Map singleton that holds references to active maps.
Methods
# after()
Fit bounds over vehicle markers
# compiledLineStrings(state)
Group and compil multiples polylines in only one polyline
Parameters:
| Name | Type | Description |
|---|---|---|
state |
# computeFilenameFromTableCode(code)
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
code |
*
|
table-export | i.g locationDetailsCircuit |
# convertLinestringToPolylines()
APIV2: linestring can be String or Array of strings (Zone interdiction might split trip history sometimes)
# createEchartDateValueTooltipFormatter(unit) → {Object}
Used by diagnostics module Expects echarts serie data item value to be [timestamp, value]
Parameters:
| Name | Type | Description |
|---|---|---|
unit |
String
|
i.g 'km' |
options.i18n |
Object
|
i18n instance |
echart series item tooltip formatter handler
Object
# createLeafletWrapperPolylineItem(linestring, options)
Wrapper for Leaflet polyline (Array of LatLng)
Parameters:
| Name | Type | Description |
|---|---|---|
linestring |
*
|
|
options |
*
|
# createMarkerFromRealtimeItem(item)
Used by Location module (Real-time) to render real-time results in the map (Vehicle markers).
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
Wrapper on top of location item (main results) that includes a Leaflet icon. |
# createSimplicitiErrorLogger()
Custom error logger. Initially, we use to send errors to server (APIV3) but this was disabled in favor of Sentry.
# createSinglePolylineEntity(item, singleLinestring, options)
Wrapper for Leaflet polyline (Array of LatLng)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
|
singleLinestring |
*
|
|
options |
*
|
# defineFeatureCircuitExecStepHighlightShowStartStopMarkers()
Used by CircuitRef / Location Will display Stop/Start markers when the user highlight a circuit exec step.
# dispatchAlertForAPIV2Error(err, dispatch) → {*}
Parameters:
| Name | Type | Description |
|---|---|---|
err |
*
|
|
dispatch |
*
|
*
# drawCircuitVersions()
# drawClientZones()
Draws client zones on the map based on the current bounds. Clustering is enabled at certain zoom levels. If non-clustering, zones are filtered out if outside viewport.
# drawLocateAddressMarker(mapVm, lat, lng, formattedAddress, options)
Used by
- LocationAddressNatural.vue (Autocomplete)
- LocateAddressFeature (Form)
- LocateAddressLatLng (Reverse)
Parameters:
| Name | Type | Description |
|---|---|---|
mapVm |
*
|
|
lat |
*
|
|
lng |
*
|
|
formattedAddress |
*
|
|
options |
*
|
# drawPositionsMarkersFromData()
Draw common position markers (without sensor data) Border: Same as trip history Fill: #cccccc (Same as V2)
# drawSensorMarkersFromData()
Draw sensor markers (positions with sensor data) using LeafletMap::drawGeometries Border: Trip history polyline color Fill: Sensor color
# echartMixin(echarts, domElement)
Wrapper on top of echart vue components
Parameters:
| Name | Type | Description |
|---|---|---|
echarts |
Object
|
Echarts core singleton (i.e import * as echarts from 'echarts/core'; echarts.use([GaugeChart, CanvasRenderer])) |
domElement |
Object
|
Dom element used to render the chart |
options.optionsHandler |
function
|
Handler to compute echart options |
Example
{
mixins: [
echartMixin((vm) => vm.$refs.chart, {
optionsHandler: createEchartInstanceOptions,
renderOnMounted: true,
}),
],
watch:{
value(){
this.renderChart();
}
}
}
# encodeLoginNameClientId(loginName, clientId) → {String}
Used by settings store to cache settings parameters
Parameters:
| Name | Type | Description |
|---|---|---|
loginName |
*
|
|
clientId |
*
|
encoded string
String
# exportDatatable()
Parameters:
| Name | Type | Description |
|---|---|---|
options.data |
Array
|
arrayOfObjects |
options.tableCode |
String
|
i.g locationIdentification |
options.format |
String
|
csv/xls (default to csv) |
options.columns |
Array
|
# exportToCSV(arrayOfObjects, filename)
Parameters:
| Name | Type | Description |
|---|---|---|
arrayOfObjects |
*
|
|
filename |
*
|
Example
exportToCSV([{name:"FOO",size:"200"},{name:"BAR",size:"300"}],"test")
exportToCSV([{name:"FOO",size:"200"},{name:"BAR",size:"300"}],"test",{columns:['NAME','SIZE']})
# exportToXLS(columns, data, name)
Parameters:
| Name | Type | Description |
|---|---|---|
columns |
Array
|
|
data |
Array
|
|
name |
*
|
i.g test |
Example
exportToXLS([{name:"FOO",size:"200"},{name:"BAR",size:"300"}],"test")
exportToXLS([{ name: "FOO", size: "200" },{ name: "BAR", size: "300" }],"test",{columns: {name:"NOMBRE",size:"TAMAÑO"},});
exportToXLS([{ name: "FOO", size: "200" },{ name: "BAR", size: "300" }],"test",{columns: ["NAME", "SIZE"]});
# fetchCircuits(transform)
Parameters:
| Name | Type | Description |
|---|---|---|
transform |
*
|
- To Do:
-
- SearchModule: Move the normalization from search_module into this function (default normalization)
# fetchCircuitVersionSections(circuitId, versionId, circuitActivities)
Parameters:
| Name | Type | Description |
|---|---|---|
circuitId |
*
|
|
versionId |
*
|
|
circuitActivities |
Array
|
Circuit activities: Used during normalization |
# fetchCircuitVersionStepLastExecutions(circuitId, versionId, sectionId)
Retrieve the last five circuit execution steps given a circuit, version and step id
Parameters:
| Name | Type | Description |
|---|---|---|
circuitId |
*
|
|
versionId |
*
|
|
sectionId |
*
|
# fetchEvents()
Used by events module.
- Data used for: Map markers and table
Split: 5 element, then 1 date (i.g: 1 request per vehicle/date)
Parameters:
| Name | Type | Description |
|---|---|---|
options.elementIds |
Array
|
Vehicle or circuit ids [1,2,3] |
options.dates |
Array
|
Dates ['2022-04-29'] or [Moment] |
options.filters |
Object
|
Custom querystring parameters |
options.elementType |
String
|
Helps build the uri (vehicle/circuit) |
options.fetchOptions |
Object
|
Give options to axios |
options.handleResults |
function
|
(results)=>({}) Each time results are available |
- To Do:
-
- To be able to stop the search (i.g user stop an automatic search)
# fetchEventsCumulation(elementIds, dates, options)
Replace JSON mock with hardcoded/auto-generated mock inside the code source (Optimize)
Parameters:
| Name | Type | Description |
|---|---|---|
elementIds |
*
|
|
dates |
*
|
|
options |
*
|
# fetchVehicleCategories(transformer)
Parameters:
| Name | Type | Description |
|---|---|---|
transformer |
*
|
- To Do:
-
- Add server order/sort asc once 502 issue is resolved
# fetchVehicles(transformer)
- @todo Add server order/sort asc once 502 issue is resolved
Parameters:
| Name | Type | Description |
|---|---|---|
transformer |
*
|
# formatLinestring(linestring)
Format a linestring for LPolyline
Parameters:
| Name | Type | Description |
|---|---|---|
linestring |
# generateChartReferenceDataForDynamicSensor(sensorName)
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
sensorName |
String
|
tor | tor/ana |
- See:
-
- colors.scss
# generateLeafletGeometriesBulkAsync_DISABLED()
POC: Snap poylines to street (using a routing machine that hits an OSM server)
# generateLeafletZoneGeometriesFromItem(item, param1)
Will generate a Circle/Polygon along with an access point icon and the Zone name (Text node)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
|
param1 |
*
|
# generateShortId(prefix)
Wrap unique id generator
Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
*
|
- To Do:
-
- Replace shortid with a new algorithm (shortid is now unsafe: https://www.npmjs.com/package/shortid )
# getBearingFromTwoLatAndLng(prevLatLng, nextLatLng)
Used by Diagnostics module to compute the vehicle marker bearing angle.
Bearing from point A to B https://www.igismap.com/formula-to-find-bearing-or-heading-angle-between-two-points-latitude-longitude/
Parameters:
| Name | Type | Description |
|---|---|---|
prevLatLng |
*
|
|
nextLatLng |
*
|
# getBoxSensorAssigments(boxConfigurationId)
- Used by Diagnostics module
Parameters:
| Name | Type | Description |
|---|---|---|
boxConfigurationId |
*
|
# getCanValueFromItem(item, canName)
Used by SensorsInfos to grab CAN values from an mixed object (location result or position result)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
|
canName |
*
|
# getCircuitExecutionDetails(circuitId, date)
Used by: Location - Main search -> History by Circuit Location - Main search -> History by Vehicle/Driver -> Circuit Tab
Parameters:
| Name | Type | Description |
|---|---|---|
circuitId |
Number
|
[OPTIONAL] |
date |
String
|
Circuit execution start date |
Normalized circuit execution detail item
# getCircuitExecutionSteps(vehicleId, circuitId, fromDate, toDate)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
Number
|
|
circuitId |
Number
|
|
fromDate |
String
|
Circuit execution start date |
toDate |
String
|
Circuit execution end date |
# getClientChildsClientsProgressively(callback, options)
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function
|
Called each time a response is finish. Return false to abort operation. |
options |
Object
|
axios wrapper get options |
- To Do:
-
- Replace with getAPIV3Pooling Fetch client childs (clients) from current user progressively
# getClientLoginAsToken(jwt, clientId, userId)
Parameters:
| Name | Type | Description |
|---|---|---|
jwt |
*
|
api jwt need to be supplied manually (i.g: nested login as) |
clientId |
*
|
|
userId |
*
|
# getClientLogoAsBase64(getOptions) → {String}
Grab logo client from APIV3
Parameters:
| Name | Type | Description |
|---|---|---|
getOptions |
Object
|
AXIOS options (Optional) |
base64 or defaultValue
String
# getClientParameter(key, getOptions)
Parameters:
| Name | Type | Description |
|---|---|---|
key |
*
|
|
getOptions |
*
|
- To Do:
-
- Refactor/Move into client-service
# getClusterIcon(cluster)
Uses the same icon as identification module
Parameters:
| Name | Type | Description |
|---|---|---|
cluster |
*
|
# getComputedLanguageCodeFromCountryCode(countryCode)
Parameters:
| Name | Type | Description |
|---|---|---|
countryCode |
*
|
# getDriverChronoStatus(value)
Parameters:
| Name | Type | Description |
|---|---|---|
value |
*
|
- To Do:
-
- Move to chrono-service
View Source services/entities/location-main-search-item.js, line 543
# getEnvValue(name) → {String}
Wrapper to retrieve env values. Adapt to different frameworks if needed (i.g vite)
Parameters:
| Name | Type | Description |
|---|---|---|
name |
*
|
String
# getFirstProperty(object)
Used by: Location - Main search -> Real-time by Vehicle/Driver/Circuit
Parameters:
| Name | Type | Description |
|---|---|---|
object |
*
|
# getHistoryAPIQueryStringDatePart(selectedDateRanges, isFirstAndLastDay,)
Helper to compute querystring date parameters (v2 historique APIs) from Array of date ranges.
Parameters:
| Name | Type | Description |
|---|---|---|
selectedDateRanges |
||
isFirstAndLastDay, |
Boolean that indicate if the search is for the first and last day |
# getItemsFromHistoryCircuitAPIV2Response(responseData)
Parses APIV2 response (by_circuit_dates) into flat array.
Note: Response can contain multiple "historique" (circuit executions) for a single date/circuit_id
Parameters:
| Name | Type | Description |
|---|---|---|
responseData |
Object
|
Example
Input: apiv2_response.data.items
Output: Array of histories (circuit)
# getItemsFromHistoryDriverAPIV2Response(responseData)
Parses APIV2 response (by_chauffeur_dates) into flat array.
Parameters:
| Name | Type | Description |
|---|---|---|
responseData |
Object
|
Example
Input: apiv2_response.data.items
Output: Array of histories (driver)
# getItemsFromHistoryVehicleDriverAPIV2Response(responseData)
Parses APIV2 response (by_vehicule_dates) into flat array.
Parameters:
| Name | Type | Description |
|---|---|---|
responseData |
Object
|
Example
Input: apiv2_response.data.items
Output: Array of histories (vehicle)
# getLastCircuitExecutionDetails({vehicleId})
Used by: Location - Main search -> Real-time by Vehicle/Driver/Circuit
Get last executed circuit infos from fixtures or API.
Parameters:
| Name | Type | Description |
|---|---|---|
{vehicleId} |
Object
|
- To Do:
-
- Remove fixtures feature without braking unit test
Normalized circuit execution detail item
# getLeafletPolylinesArrayFromMultipleItems(items)
Used by Location module Some items might have multiple associated polylines (relatedPolylines attribute)
Parameters:
| Name | Type | Description |
|---|---|---|
items |
*
|
Normalized array of items |
# getNormalizedLatLngValueForAPI()
API stores Lat/Lng as integer (multiply by latLngScaleFactor and remove decimals)
# getNormalizedResults()
Normalizes API responses into a flat array
-APIV2 Responses are not flat and there are different (history/realtime)
# getPolylineFromLinestring(linestring)
Linestring example: 1.4659516666667 45.162342314815,1.4659516666667 45.162342314815 Polyline example: [[1.4659516666667,45.162342314815],[1.4659516666667,45.162342314815]]
Parameters:
| Name | Type | Description |
|---|---|---|
linestring |
*
|
# getPolylinesFromItemLinestring(linestring, options)
Special polyline entity used by Location - History, Location - Realtime - Circuit getNormalizedItem: To be able to retrieve item details from leaflet popup (Trip-history/Circuit-exec polyline popup)
Parameters:
| Name | Type | Description |
|---|---|---|
linestring |
*
|
|
options |
*
|
# getPositionBorderColor()
Border color: same as trip history polyline if available
# getSensors(vehicleId, datetimeStart, datetimeEnd, options)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
datetimeStart |
*
|
|
datetimeEnd |
*
|
|
options |
*
|
{positions: false, sensors: false} |
# getSettingsParamFromRemote() → {Object}
Used to retrieve defaultMapPredefinedView Parses onlinePersistanceConfig and call 'retrieve' method for each key.
Object key/value pairs i.g {defaultMapPredefinedView:1}
Object
# getTerrestrialDistance(la1, lo1, la2, lo2)
Calculates the distance between two coordinates Copied from generic.inc.php "DistanceTerrestre"
Parameters:
| Name | Type | Description |
|---|---|---|
la1 |
*
|
|
lo1 |
*
|
|
la2 |
*
|
|
lo2 |
*
|
# getUserParametersAsObject(currentUserLogin) → {Object}
Used by Settings store.
Parameters:
| Name | Type | Description |
|---|---|---|
currentUserLogin |
*
|
Settings state object Example: { defaultMapZoomLevel: 14, userBaseLayer: cBaseLayerSabatier }
Object
# getVehicleBoxAllocations(vehicleId) → {Array}
Used by Diagnostics module
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
Number
|
Required |
filterParams.boxNumber |
Number
|
Array
|
i.g 43 or [43,85,23] |
Array of vehicle box allocations (Affectation boitier)
Array
# getVehicleCategoryObject(vehicleId, rootGetters)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
rootGetters |
*
|
- To Do:
-
- Refactor/Improve Get vehicle category object from search module loaded dataset
# getVehicleChrono()
Used by Location module - Chrono tab Used by Diagnostics module
Parameters:
| Name | Type | Description |
|---|---|---|
params.date |
String
|
Date
|
Moment
|
Date or Moment |
params.vehicleId |
String
|
Vehicle identifier |
params.startDate |
Date
|
Moment
|
|
params.endDate |
Date
|
Moment
|
|
params.apiHandler |
function
|
(unit-test only) |
# getVehicleHistoryFromDate(vehicleId, date) → {Object}
Used by Diagnostic module to fetch vehicle overview information about the trip history for a particular date.
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
Number
|
|
date |
Date
|
Moment
|
Overview information about the trip history
Object
# getVehicleHistoryPositionDetailsFromDateLegacy(vehicleId, datetime)
Used by Diagnostic module
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
datetime |
*
|
- Version:
- APIV2
- To Do:
-
- Remove when unused
# getVehicleHistoryStepsFromDate(vehicleId, date)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
date |
*
|
- Version:
- APIV2
# getVehicleIconHTML(vehicleClassName, options)
Used by Location module. Get vehicle svg based on vehicle type (className)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleClassName |
*
|
I.g: 30070 (Vehicule leger) |
options |
*
|
options.className override svg class |
# getVehiclePositions(vehicleId, date, options)
Used by Diagnostic module
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
date |
*
|
|
options |
*
|
- Version:
- APIV3
- To Do:
-
- Use properties[positions][]= to reduce size of nested objects (It doesn't work with arrays like tor/ana)
# getVehicleSensorsConfiguration(vehicleId, date) → {Array}
Used by Location module (Trip history details - table) to load positions and sensors configuration
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleId |
*
|
|
date |
*
|
Array
# getVehiculesPositions(vehicleIds, startDatetime, endDatetime)
Parameters:
| Name | Type | Description |
|---|---|---|
vehicleIds |
*
|
|
startDatetime |
*
|
|
endDatetime |
*
|
# immediateDeepWatchHandlerForChartUpdate()
Otherwise, multiple watchers compete for the same action
# injectJWTAndLanguageParametersToURL(url)
Parameters:
| Name | Type | Description |
|---|---|---|
url |
String
|
i.g https://dev-geored.geored.fr/desktop |
Example
Input: https://dev-geored.geored.fr/desktop
Output: https://dev-geored.geored.fr/desktop?_token=JWT&lg=fr
# isMapSelectablePolylinesFeatureEnabled()
Polylines can be click. A popup is shown. Used by Location - History - Vehicle/Driver/Circuit (Main search) Enable by default
# isSearchModuleDatePickerDisabledHandler()
Some clients do not have right to history mode on certain tab (i.g circuit)
# isSearchModuleDatePickerEnabled()
Some clients do not have right to history mode at all
# isValidPositionId(positionId)
Valid APIV3 position id has the following format: {serverId}{boxId}{timestamp80}
Count the number of occurences of one character in the string ("41_123_12312312312".match(new RegExp("_", "g")) || []).length
Parameters:
| Name | Type | Description |
|---|---|---|
positionId |
*
|
# linestringsToPolylines(linestrings)
Used by: Location - Real-time - Circuit Location - Circuit tab Location - History tab Diagnostics Converts Array of items containing a linestring property (APV2 format) into an array of polylines (Format accepted by LeafletMap wrapper) The linestring property can be either an string or an array (multiple linestrings) (#31781)
Parameters:
| Name | Type | Description |
|---|---|---|
linestrings |
String
|
Array of LatLng I.g: "lat1 lng1, lat2 lng2" |
# loginWithToken(jwt, viewPath)
Used by dev to login quicky into a view
Parameters:
| Name | Type | Description |
|---|---|---|
jwt |
*
|
|
viewPath |
String
|
ig diagnostics |
# mutateNormalize(item)
Normalize Zone to APIV3 entity format
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
# normalizeAnalyzeHistorySegment(response)
Used by Diagnostic module
Parameters:
| Name | Type | Description |
|---|---|---|
response |
*
|
- To Do:
-
- Refactor/Move into entity "diagnostic-analysis-entity"
# normalizeAPIV3Item(item)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object
|
Object to transform |
- To Do:
-
- Immatriculation
# normalizeChronoResponseDetails(item)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
- To Do:
-
- Map type to custom values ['driving', 'available', 'resting', 'working'],
# normalizeCircuitActivityItem()
# normalizeCircuitExecutionDetailsItem(item)
Transform/Presenter function for circuit execution details item
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
Details item from APIV2 Historique by_circuit_dates or APIV2 dernier_circuit |
# normalizeLatLng(latOrLng)
Server stores Lat/Lng coordinates as Integer values.
Parameters:
| Name | Type | Description |
|---|---|---|
latOrLng |
*
|
# normalizePositionTorsForDiagnosticsModule(position, activeTorPositions, sensorAssignments)
Will inject startTimestamp/endTimestamp to TORs with measureType "temps" (Those attributes are then used to render a duration chart)
Parameters:
| Name | Type | Description |
|---|---|---|
position |
*
|
|
activeTorPositions |
*
|
|
sensorAssignments |
*
|
# normalizeTripHistoryItem()
# normalizeVehicleHistoryPositions(positions, vehicleId)
Unused
Parameters:
| Name | Type | Description |
|---|---|---|
positions |
Array
|
|
vehicleId |
String
|
# normalizeWmsOptions(options)
Creates the projection object (crs) just before configuring leaflet tilelayer
Parameters:
| Name | Type | Description |
|---|---|---|
options |
*
|
# onAnimate(currentIndex)
Parameters:
| Name | Type | Description |
|---|---|---|
currentIndex |
*
|
- To Do:
-
- Drawing operations could be split using requestAnimationFrame
# onSearchModuleDatePickerPredefinedSelectionClick()
Provide handler to react to date picker predefined options change and limit date range selection if necessary
- See:
-
- SMDatePicker.vue Date picker will inject this handler
# openMapToolboxFeature(featureName)
Used internally to open reverse geocoding view if map menu context option "nearby vehicles" is clicked
Parameters:
| Name | Type | Description |
|---|---|---|
featureName |
*
|
# parseHistoryItem(item)
Parses item from API /v2/historique/
- Circuit: by_circuit_dates
- Vehicle/Driver: by_vehicule_dates/by_chauffeur_dates
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object
|
|
options.selectionType |
String
|
vehicle/driver/circuit |
options.relatedPolylines |
Array
|
# parseLocationItem(item, options, rootGetters)
Parses Location module item from main search Item comes from API (temp reel / historique)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
|
options |
*
|
|
rootGetters |
*
|
- To Do:
-
- Refactor/Move into services/entities/location-main-search-entity
# parseLocationItemDates(item, options)
Parse dates fields from both real-time/history
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
|
options |
*
|
# parseLocationItemSensors(item)
Parses sensor infos (Temp reel)
Parameters:
| Name | Type | Description |
|---|---|---|
item |
*
|
# performMultipleSearch()
While in "Free search" (Input in on top of map), the user can combine vehicles/drivers/circuits. For now, we should call the APIs separately, at the same time (Multiple search)
# pickColor(conso, panel) → {string}
Get linestring color for given conso.
Parameters:
| Name | Type | Description |
|---|---|---|
conso |
||
panel |
string
# reactToMapPredefinedViewsListUpdate()
Used MapPredefinedViewSettingsSelect.vue to update itself if an item is added/removed.
# reduceAttributesIntoNestedProperty(obj, attribute)
Used by Datatable library. Datatable expects a language property which is a nested object: https://www.datatables.net/plug-ins/i18n/English But we store translations in a plain object:
- datatable.paginate.next
- datatable.paginate.prev This function will collect all the keys starting with datatable. and build a nested object similar to the one expected by datatable.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object
|
Plain object |
attribute |
String
|
Object attribute (Computed nested object) |
# saveSettingsParamLocally(name, value)
Uses browser client-side storage.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String
|
|
value |
Any
|
|
options.suffix |
String
|
Optional |
# saveSettingsParamRemotely(name, value)
Used to save defaultMapZoomLevel and userBaseLayer Used to save defaultMapPredefinedView
Parameters:
| Name | Type | Description |
|---|---|---|
name |
*
|
|
value |
*
|
# SensorPopupSectionMixin()
Retrieves position details (including sensor infos) from vehicle_id and date.
# setHigherMapToolboxZIndex()
Svelte module context patron: https://svelte.dev/tutorial/module-exports
# setLowerMapToolboxZIndex()
This was added to prevent the map toolbox from overlapping on top of other components (because of his position being absolute).
Faq: This map toolbox is associated to the map, why is being present when the map is hidden? Because this component is wrapped in a portal (portal-vue)
Used by Location (Full table mode) Used by Routing (Full table mode)
Svelte module context patron: https://svelte.dev/tutorial/module-exports
# SimplicitiLoggerPlugin()
This plugin will automatically catch all errors. and send them to server (APIV3)
If the error states 'Script Error', take a look at: https://scotch.io/bar-talk/what-the-heck-is-script-error
- Deprecated:
- server logging disabled due to Sentry being enough (and some APIV3 issues)
Example
Usage (From outside components)
Vue.ErrorLogger.logError(error)
Usage (From inside components)
this.$logError(error)
Usage (Listen errors)
Vue.ErrorLogger.$on("error")
# sortableColumn()
- To Do:
-
- Refactor/Extract
View Source components/location/LocationEvents/LocationEventsTable.vue, line 18
# updateCanSection()
Will update Can section with Can information from API
# updateCircuitExecutionDetails() → {Boolean}
Real-time: Load last circuit execution details History: Load related circuit execution details
True if success
Boolean
# updateTorAnaSection()
Will update popupSections with Tor/Ana information from API
# useMapToolbox()
# watchAndReactToMapMenuContextOptions()
- Will open reverse geocoding view automatically
Type Definitions
Object
# dynamicToggleControlSectionsMixin
Dynamic toggle control sections allow us to define toggle controls once. Each toggle control will automatically show/hide itself and show/hide related leaflet layers.
- To Do:
-
- Refactor existing layers toggles (i.g zone) into a dynamic section Note: Add extra sections in the related vuex store "map_options/index.js"
View Source components/location/MapOptions/MapOptions.vue, line 22