@fleetbase/fleetops-engine 0.6.27 → 0.6.28

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.
Files changed (77) hide show
  1. package/addon/components/admin/avatar-management.js +24 -26
  2. package/addon/components/admin/navigator-app.hbs +1 -1
  3. package/addon/components/driver/details.hbs +4 -0
  4. package/addon/components/layout/fleet-ops-sidebar.js +3 -2
  5. package/addon/components/map/drawer.hbs +1 -1
  6. package/addon/components/map/drawer.js +2 -1
  7. package/addon/components/map/leaflet-live-map.js +8 -7
  8. package/addon/components/order/details/purchase-rate.hbs +2 -2
  9. package/addon/components/order/form/payload.hbs +1 -1
  10. package/addon/components/order-config-manager.js +2 -1
  11. package/addon/components/vehicle/details.hbs +5 -1
  12. package/addon/controllers/connectivity/devices/index/details/virtual.js +7 -0
  13. package/addon/controllers/connectivity/devices/index/details.js +4 -0
  14. package/addon/controllers/connectivity/sensors/index/details/virtual.js +7 -0
  15. package/addon/controllers/connectivity/sensors/index/details.js +4 -0
  16. package/addon/controllers/management/drivers/index/details/virtual.js +7 -0
  17. package/addon/controllers/management/drivers/index/details.js +4 -4
  18. package/addon/controllers/management/fleets/index/details/virtual.js +7 -0
  19. package/addon/controllers/management/fleets/index/details.js +4 -0
  20. package/addon/controllers/management/places/index/details/virtual.js +7 -0
  21. package/addon/controllers/management/places/index/details.js +22 -13
  22. package/addon/controllers/management/vehicles/index/details/virtual.js +7 -0
  23. package/addon/controllers/management/vehicles/index/details.js +4 -0
  24. package/addon/controllers/management/vehicles/index.js +2 -2
  25. package/addon/engine.js +1 -128
  26. package/addon/extension.js +116 -0
  27. package/addon/instance-initializers/register-osrm.js +32 -0
  28. package/addon/instance-initializers/setup-customer-portal.js +10 -0
  29. package/addon/routes/connectivity/devices/index/details/virtual.js +23 -0
  30. package/addon/routes/connectivity/sensors/index/details/virtual.js +23 -0
  31. package/addon/routes/management/drivers/index/details/virtual.js +23 -0
  32. package/addon/routes/management/drivers/index/details.js +0 -4
  33. package/addon/routes/management/fleets/index/details/virtual.js +23 -0
  34. package/addon/routes/management/places/index/details/virtual.js +23 -0
  35. package/addon/routes/management/vehicles/index/details/virtual.js +23 -0
  36. package/addon/routes/management/vehicles/index/details.js +0 -4
  37. package/addon/routes/virtual.js +2 -1
  38. package/addon/routes.js +6 -0
  39. package/addon/styles/fleetops-engine.css +5 -0
  40. package/addon/templates/connectivity/devices/index/details/virtual.hbs +1 -0
  41. package/addon/templates/connectivity/sensors/index/details/virtual.hbs +1 -0
  42. package/addon/templates/management/drivers/index/details/virtual.hbs +1 -0
  43. package/addon/templates/management/fleets/index/details/virtual.hbs +1 -0
  44. package/addon/templates/management/places/index/details/virtual.hbs +1 -0
  45. package/addon/templates/management/vehicles/index/details/virtual.hbs +1 -0
  46. package/addon/templates/virtual.hbs +1 -1
  47. package/addon/utils/setup-customer-portal.js +49 -23
  48. package/app/controllers/connectivity/devices/index/details/virtual.js +1 -0
  49. package/app/controllers/connectivity/sensors/index/details/virtual.js +1 -0
  50. package/app/controllers/management/drivers/index/details/virtual.js +1 -0
  51. package/app/controllers/management/fleets/index/details/virtual.js +1 -0
  52. package/app/controllers/management/places/index/details/virtual.js +1 -0
  53. package/app/controllers/management/vehicles/index/details/virtual.js +1 -0
  54. package/app/routes/connectivity/devices/index/details/virtual.js +1 -0
  55. package/app/routes/connectivity/sensors/index/details/virtual.js +1 -0
  56. package/app/routes/management/drivers/index/details/virtual.js +1 -0
  57. package/app/routes/management/fleets/index/details/virtual.js +1 -0
  58. package/app/routes/management/places/index/details/virtual.js +1 -0
  59. package/app/routes/management/vehicles/index/details/virtual.js +1 -0
  60. package/app/templates/connectivity/devices/index/details/virtual.js +1 -0
  61. package/app/templates/connectivity/sensors/index/details/virtual.js +1 -0
  62. package/app/templates/management/drivers/index/details/virtual.js +1 -0
  63. package/app/templates/management/fleets/index/details/virtual.js +1 -0
  64. package/app/templates/management/places/index/details/virtual.js +1 -0
  65. package/app/templates/management/vehicles/index/details/virtual.js +1 -0
  66. package/composer.json +1 -1
  67. package/config/environment.js +1 -1
  68. package/extension.json +1 -1
  69. package/package.json +3 -3
  70. package/addon/helpers/avatar-url.js +0 -9
  71. package/addon/helpers/point-coordinates.js +0 -10
  72. package/addon/helpers/point-to-coordinates.js +0 -32
  73. package/addon/helpers/unwrap-coordinates.js +0 -83
  74. package/app/helpers/avatar-url.js +0 -1
  75. package/app/helpers/point-coordinates.js +0 -1
  76. package/app/helpers/point-to-coordinates.js +0 -1
  77. package/app/helpers/unwrap-coordinates.js +0 -1
@@ -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';