@fleetbase/fleetops-engine 0.6.27 → 0.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/components/admin/avatar-management.js +24 -26
- package/addon/components/admin/navigator-app.hbs +1 -1
- package/addon/components/driver/details.hbs +4 -0
- package/addon/components/layout/fleet-ops-sidebar.js +3 -2
- package/addon/components/map/drawer.hbs +1 -1
- package/addon/components/map/drawer.js +2 -1
- package/addon/components/map/leaflet-live-map.js +8 -7
- package/addon/components/order/details/purchase-rate.hbs +2 -2
- package/addon/components/order/form/payload.hbs +1 -1
- package/addon/components/order-config-manager.js +2 -1
- package/addon/components/vehicle/details.hbs +5 -1
- package/addon/controllers/connectivity/devices/index/details/virtual.js +7 -0
- package/addon/controllers/connectivity/devices/index/details.js +4 -0
- package/addon/controllers/connectivity/sensors/index/details/virtual.js +7 -0
- package/addon/controllers/connectivity/sensors/index/details.js +4 -0
- package/addon/controllers/management/drivers/index/details/virtual.js +7 -0
- package/addon/controllers/management/drivers/index/details.js +4 -4
- package/addon/controllers/management/fleets/index/details/virtual.js +7 -0
- package/addon/controllers/management/fleets/index/details.js +4 -0
- package/addon/controllers/management/places/index/details/virtual.js +7 -0
- package/addon/controllers/management/places/index/details.js +22 -13
- package/addon/controllers/management/vehicles/index/details/virtual.js +7 -0
- package/addon/controllers/management/vehicles/index/details.js +4 -0
- package/addon/controllers/management/vehicles/index.js +2 -2
- package/addon/engine.js +1 -128
- package/addon/extension.js +116 -0
- package/addon/instance-initializers/register-osrm.js +32 -0
- package/addon/instance-initializers/setup-customer-portal.js +10 -0
- package/addon/routes/connectivity/devices/index/details/virtual.js +23 -0
- package/addon/routes/connectivity/sensors/index/details/virtual.js +23 -0
- package/addon/routes/management/drivers/index/details/virtual.js +23 -0
- package/addon/routes/management/drivers/index/details.js +0 -4
- package/addon/routes/management/fleets/index/details/virtual.js +23 -0
- package/addon/routes/management/places/index/details/virtual.js +23 -0
- package/addon/routes/management/vehicles/index/details/virtual.js +23 -0
- package/addon/routes/management/vehicles/index/details.js +0 -4
- package/addon/routes/virtual.js +2 -1
- package/addon/routes.js +6 -0
- package/addon/styles/fleetops-engine.css +5 -0
- package/addon/templates/connectivity/devices/index/details/virtual.hbs +1 -0
- package/addon/templates/connectivity/sensors/index/details/virtual.hbs +1 -0
- package/addon/templates/management/drivers/index/details/virtual.hbs +1 -0
- package/addon/templates/management/fleets/index/details/virtual.hbs +1 -0
- package/addon/templates/management/places/index/details/virtual.hbs +1 -0
- package/addon/templates/management/vehicles/index/details/virtual.hbs +1 -0
- package/addon/templates/virtual.hbs +1 -1
- package/addon/utils/setup-customer-portal.js +49 -23
- package/app/controllers/connectivity/devices/index/details/virtual.js +1 -0
- package/app/controllers/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/controllers/management/drivers/index/details/virtual.js +1 -0
- package/app/controllers/management/fleets/index/details/virtual.js +1 -0
- package/app/controllers/management/places/index/details/virtual.js +1 -0
- package/app/controllers/management/vehicles/index/details/virtual.js +1 -0
- package/app/routes/connectivity/devices/index/details/virtual.js +1 -0
- package/app/routes/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/routes/management/drivers/index/details/virtual.js +1 -0
- package/app/routes/management/fleets/index/details/virtual.js +1 -0
- package/app/routes/management/places/index/details/virtual.js +1 -0
- package/app/routes/management/vehicles/index/details/virtual.js +1 -0
- package/app/templates/connectivity/devices/index/details/virtual.js +1 -0
- package/app/templates/connectivity/sensors/index/details/virtual.js +1 -0
- package/app/templates/management/drivers/index/details/virtual.js +1 -0
- package/app/templates/management/fleets/index/details/virtual.js +1 -0
- package/app/templates/management/places/index/details/virtual.js +1 -0
- package/app/templates/management/vehicles/index/details/virtual.js +1 -0
- package/composer.json +1 -1
- package/config/environment.js +1 -1
- package/extension.json +1 -1
- package/index.js +0 -11
- package/package.json +3 -3
- package/addon/helpers/avatar-url.js +0 -9
- package/addon/helpers/point-coordinates.js +0 -10
- package/addon/helpers/point-to-coordinates.js +0 -32
- package/addon/helpers/unwrap-coordinates.js +0 -83
- package/app/helpers/avatar-url.js +0 -1
- package/app/helpers/point-coordinates.js +0 -1
- package/app/helpers/point-to-coordinates.js +0 -1
- package/app/helpers/unwrap-coordinates.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.29",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.23.2",
|
|
45
|
-
"@fleetbase/ember-core": "^0.3.
|
|
46
|
-
"@fleetbase/ember-ui": "^0.3.
|
|
45
|
+
"@fleetbase/ember-core": "^0.3.8",
|
|
46
|
+
"@fleetbase/ember-ui": "^0.3.14",
|
|
47
47
|
"@fleetbase/fleetops-data": "^0.1.23",
|
|
48
48
|
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
|
49
49
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { helper } from '@ember/component/helper';
|
|
2
|
-
|
|
3
|
-
export default helper(function avatarUrl([url, defaultUrl = 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png']) {
|
|
4
|
-
if (typeof url === 'string') {
|
|
5
|
-
return url;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return defaultUrl;
|
|
9
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { helper } from '@ember/component/helper';
|
|
2
|
-
import Point from '@fleetbase/fleetops-data/utils/geojson/point';
|
|
3
|
-
|
|
4
|
-
export default helper(function pointCoordinates([point]) {
|
|
5
|
-
if (point instanceof Point) {
|
|
6
|
-
return `${point.coordinates[1]} ${point.coordinates[0]}`;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return 'Invalid coordinates';
|
|
10
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { helper } from '@ember/component/helper';
|
|
2
|
-
import { isArray } from '@ember/array';
|
|
3
|
-
|
|
4
|
-
export default helper(function pointToCoordinates([point, format = 'array']) {
|
|
5
|
-
let [longitude, latitude] = [0, 0];
|
|
6
|
-
|
|
7
|
-
if (point && isArray(point.coordinates)) {
|
|
8
|
-
[longitude, latitude] = point.coordinates;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (format === 'array') {
|
|
12
|
-
return [latitude, longitude];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (format === 'latitudelongitude') {
|
|
16
|
-
return { latitude, longitude };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
if (format === 'latlng') {
|
|
20
|
-
return {
|
|
21
|
-
lat: latitude,
|
|
22
|
-
lng: longitude,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (format === 'xy') {
|
|
27
|
-
return {
|
|
28
|
-
x: latitude,
|
|
29
|
-
y: longitude,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
});
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { helper } from '@ember/component/helper';
|
|
2
|
-
import leafletUnwrapCoordinates from '../utils/leaflet-unwrap-coordinates';
|
|
3
|
-
import { isArray } from '@ember/array';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Ember helper to "unwrap" coordinate arrays for Leaflet usage.
|
|
7
|
-
*
|
|
8
|
-
* This helper converts coordinate data into a form that is compatible with Leaflet’s
|
|
9
|
-
* coordinate reference system. It supports two types of input:
|
|
10
|
-
*
|
|
11
|
-
* 1. **GeoJSON Geometry Object:**
|
|
12
|
-
* An object with a `coordinates` property. In this case the coordinates are assumed
|
|
13
|
-
* to already be in GeoJSON order ([lng, lat, ...]). The helper unwraps these
|
|
14
|
-
* coordinates using `leafletUnwrapCoordinates` and returns a new geometry object
|
|
15
|
-
* with the unwrapped coordinates.
|
|
16
|
-
*
|
|
17
|
-
* 2. **Array of Coordinates:**
|
|
18
|
-
* An array of coordinate arrays (e.g. a line string, ring, or polygon) provided in
|
|
19
|
-
* [lat, lng] order. The helper first converts these to GeoJSON order ([lng, lat])
|
|
20
|
-
* and then unwraps them using `leafletUnwrapCoordinates`.
|
|
21
|
-
*
|
|
22
|
-
* **Note:**
|
|
23
|
-
* - The unwrapping process adjusts coordinate values to ensure they form a continuous
|
|
24
|
-
* representation (for example, when dealing with dateline-crossing geometries).
|
|
25
|
-
* - If the input is neither an object with a `coordinates` property nor an array,
|
|
26
|
-
* it is returned unchanged.
|
|
27
|
-
*
|
|
28
|
-
* @param {Array|Object} input - Either:
|
|
29
|
-
* - A GeoJSON geometry object with a `coordinates` property, where coordinates are in [lng, lat] order.
|
|
30
|
-
* - An array of coordinate arrays in [lat, lng] order.
|
|
31
|
-
* @returns {Array|Object} A new geometry object or coordinate array with unwrapped coordinates,
|
|
32
|
-
* preserving the structure of the input.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Example 1: GeoJSON geometry object input:
|
|
36
|
-
* let geojson = {
|
|
37
|
-
* type: 'Polygon',
|
|
38
|
-
* coordinates: [
|
|
39
|
-
* [[-80, 26], [-80.1, 26.1], [-80.2, 26.2], [-80, 26]]
|
|
40
|
-
* ]
|
|
41
|
-
* };
|
|
42
|
-
* let result = unwrapCoordinates([geojson]);
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // Example 2: Array of coordinates in [lat, lng] order:
|
|
46
|
-
* let coords = [
|
|
47
|
-
* [26, -80],
|
|
48
|
-
* [26.1, -80.1],
|
|
49
|
-
* [26.2, -80.2]
|
|
50
|
-
* ];
|
|
51
|
-
* let result = unwrapCoordinates([coords]);
|
|
52
|
-
*/
|
|
53
|
-
export default helper(function unwrapCoordinates([input]) {
|
|
54
|
-
if (!input) {
|
|
55
|
-
return input;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// If input is an object with a "coordinates" property,
|
|
59
|
-
// assume it is a GeoJSON geometry where coordinates are in [lng, lat] order.
|
|
60
|
-
if (typeof input === 'object' && input.coordinates) {
|
|
61
|
-
const unwrappedCoordinates = leafletUnwrapCoordinates(input.coordinates);
|
|
62
|
-
return {
|
|
63
|
-
...input,
|
|
64
|
-
coordinates: unwrappedCoordinates,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Otherwise, assume input is an array of coordinates.
|
|
69
|
-
// The helper expects these coordinates to be in [lat, lng] order.
|
|
70
|
-
// Convert them to GeoJSON order ([lng, lat]) before unwrapping.
|
|
71
|
-
if (isArray(input) && input.length > 0) {
|
|
72
|
-
if (typeof input[0][0] === 'number') {
|
|
73
|
-
// Input is an array of coordinates in [lat, lng] order.
|
|
74
|
-
input = input.map(([latitude, longitude]) => [longitude, latitude]);
|
|
75
|
-
} else {
|
|
76
|
-
// If the structure is nested (e.g., for polygons or multipolygons),
|
|
77
|
-
// reverse the outer array as a fallback. (This branch can be customized as needed.)
|
|
78
|
-
input = input.reverse();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const unwrappedCoordinates = leafletUnwrapCoordinates(input);
|
|
82
|
-
return unwrappedCoordinates;
|
|
83
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, avatarUrl } from '@fleetbase/fleetops-engine/helpers/avatar-url';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, pointCoordinates } from '@fleetbase/fleetops-engine/helpers/point-coordinates';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, pointToCoordinates } from '@fleetbase/fleetops-engine/helpers/point-to-coordinates';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/helpers/unwrap-coordinates';
|