@fleetbase/fleetops-engine 0.2.8 → 0.2.9

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 (45) hide show
  1. package/addon/components/context-panel.hbs +5 -0
  2. package/addon/components/context-panel.js +6 -0
  3. package/addon/components/driver-form-panel.hbs +22 -22
  4. package/addon/components/driver-form-panel.js +28 -3
  5. package/addon/components/driver-panel.hbs +8 -8
  6. package/addon/components/driver-panel.js +23 -6
  7. package/addon/components/fleet-vehicle-listing.hbs +1 -1
  8. package/addon/components/live-map.hbs +20 -9
  9. package/addon/components/live-map.js +1045 -354
  10. package/addon/components/settings-window.hbs +1 -1
  11. package/addon/components/vehicle-form-panel.hbs +24 -24
  12. package/addon/components/vehicle-form-panel.js +26 -3
  13. package/addon/components/vehicle-panel.hbs +8 -9
  14. package/addon/components/vehicle-panel.js +21 -4
  15. package/addon/controllers/operations/orders/index/new.js +3 -5
  16. package/addon/controllers/operations/orders/index/view.js +5 -7
  17. package/addon/controllers/operations/orders/index.js +15 -2
  18. package/addon/engine.js +6 -0
  19. package/addon/routes/operations/orders/index/view.js +4 -2
  20. package/addon/routes/operations/orders/index.js +5 -1
  21. package/addon/services/context-panel.js +106 -0
  22. package/addon/services/leaflet-contextmenu-manager.js +311 -0
  23. package/addon/services/leaflet-map-manager.js +61 -0
  24. package/addon/services/service-areas.js +242 -32
  25. package/addon/templates/application.hbs +2 -1
  26. package/addon/utils/find-leaflet-layer.js +13 -0
  27. package/addon/utils/fly-to-leaflet-layer.js +25 -0
  28. package/addon/utils/get-leaflet-layer-by-id.js +12 -0
  29. package/addon/utils/layer-can-bind-contextmenu.js +3 -0
  30. package/app/components/context-panel.js +1 -0
  31. package/app/services/context-panel.js +1 -0
  32. package/app/services/leaflet-contextmenu-manager.js +1 -0
  33. package/app/services/leaflet-map-manager.js +1 -0
  34. package/app/utils/find-leaflet-layer.js +1 -0
  35. package/app/utils/fly-to-leaflet-layer.js +1 -0
  36. package/app/utils/get-leaflet-layer-by-id.js +1 -0
  37. package/app/utils/layer-can-bind-contextmenu.js +1 -0
  38. package/composer.json +11 -1
  39. package/extension.json +1 -1
  40. package/package.json +2 -2
  41. package/server/src/Http/Controllers/Internal/v1/LiveController.php +7 -4
  42. package/server/src/Http/Filter/VehicleFilter.php +7 -0
  43. package/server/src/Http/Resources/v1/Vehicle.php +51 -39
  44. package/addon/services/map-manager.js +0 -3
  45. package/app/services/map-manager.js +0 -1
@@ -4,6 +4,7 @@ namespace Fleetbase\FleetOps\Http\Resources\v1;
4
4
 
5
5
  use Fleetbase\Http\Resources\FleetbaseResource;
6
6
  use Fleetbase\Support\Http;
7
+ use Grimzy\LaravelMysqlSpatial\Types\Point;
7
8
 
8
9
  class Vehicle extends FleetbaseResource
9
10
  {
@@ -19,27 +20,33 @@ class Vehicle extends FleetbaseResource
19
20
  return array_merge(
20
21
  $this->getInternalIds(),
21
22
  [
22
- 'id' => $this->when(Http::isInternalRequest(), $this->id, $this->public_id),
23
- 'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
24
- 'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
25
- 'internal_id' => $this->internal_id,
26
- 'name' => $this->display_name,
27
- 'display_name' => $this->when(Http::isInternalRequest(), $this->display_name),
28
- 'vin' => $this->vin ?? null,
29
- 'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
30
- 'photo' => $this->photoUrl,
31
- 'make' => $this->make,
32
- 'model' => $this->model,
33
- 'year' => $this->year,
34
- 'trim' => $this->trim,
35
- 'type' => $this->type,
36
- 'plate_number' => $this->plate_number,
37
- 'vin_data' => $this->vin_data,
38
- 'status' => $this->status,
39
- 'online' => $this->online,
40
- 'meta' => $this->meta ?? [],
41
- 'updated_at' => $this->updated_at,
42
- 'created_at' => $this->created_at,
23
+ 'id' => $this->when(Http::isInternalRequest(), $this->id, $this->public_id),
24
+ 'uuid' => $this->when(Http::isInternalRequest(), $this->uuid),
25
+ 'public_id' => $this->when(Http::isInternalRequest(), $this->public_id),
26
+ 'internal_id' => $this->internal_id,
27
+ 'name' => $this->display_name,
28
+ 'display_name' => $this->when(Http::isInternalRequest(), $this->display_name),
29
+ 'vin' => $this->vin ?? null,
30
+ 'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
31
+ 'devices' => $this->whenLoaded('devices', $this->devices),
32
+ 'photo' => $this->photoUrl,
33
+ 'make' => $this->make,
34
+ 'model' => $this->model,
35
+ 'year' => $this->year,
36
+ 'trim' => $this->trim,
37
+ 'type' => $this->type,
38
+ 'plate_number' => $this->plate_number,
39
+ 'vin' => $this->vin,
40
+ 'vin_data' => $this->vin_data,
41
+ 'status' => $this->status,
42
+ 'online' => $this->online,
43
+ 'location' => data_get($this, 'location', new Point(0, 0)),
44
+ 'heading' => (int) data_get($this, 'heading', 0),
45
+ 'altitude' => (int) data_get($this, 'altitude', 0),
46
+ 'speed' => (int) data_get($this, 'speed', 0),
47
+ 'meta' => $this->meta ?? [],
48
+ 'updated_at' => $this->updated_at,
49
+ 'created_at' => $this->created_at,
43
50
  ]
44
51
  );
45
52
  }
@@ -52,24 +59,29 @@ class Vehicle extends FleetbaseResource
52
59
  public function toWebhookPayload()
53
60
  {
54
61
  return [
55
- 'id' => $this->public_id,
56
- 'internal_id' => $this->internal_id,
57
- 'name' => $this->name,
58
- 'vin' => $this->vin ?? null,
59
- 'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
60
- 'photo' => $this->photoUrl,
61
- 'make' => $this->make,
62
- 'model' => $this->model,
63
- 'year' => $this->year,
64
- 'trim' => $this->trim,
65
- 'type' => $this->type,
66
- 'plate_number' => $this->plate_number,
67
- 'vin_data' => $this->vin_data,
68
- 'status' => $this->status,
69
- 'online' => $this->online,
70
- 'meta' => $this->meta ?? [],
71
- 'updated_at' => $this->updated_at,
72
- 'created_at' => $this->created_at,
62
+ 'id' => $this->public_id,
63
+ 'internal_id' => $this->internal_id,
64
+ 'name' => $this->name,
65
+ 'vin' => $this->vin ?? null,
66
+ 'driver' => $this->whenLoaded('driver', new Driver($this->driver)),
67
+ 'photo' => $this->photoUrl,
68
+ 'make' => $this->make,
69
+ 'model' => $this->model,
70
+ 'year' => $this->year,
71
+ 'trim' => $this->trim,
72
+ 'type' => $this->type,
73
+ 'plate_number' => $this->plate_number,
74
+ 'vin' => $this->vin,
75
+ 'vin_data' => $this->vin_data,
76
+ 'status' => $this->status,
77
+ 'online' => $this->online,
78
+ 'location' => data_get($this, 'location', new Point(0, 0)),
79
+ 'heading' => (int) data_get($this, 'heading', 0),
80
+ 'altitude' => (int) data_get($this, 'altitude', 0),
81
+ 'speed' => (int) data_get($this, 'speed', 0),
82
+ 'meta' => $this->meta ?? [],
83
+ 'updated_at' => $this->updated_at,
84
+ 'created_at' => $this->created_at,
73
85
  ];
74
86
  }
75
87
  }
@@ -1,3 +0,0 @@
1
- import Service from '@ember/service';
2
-
3
- export default class MapManagerService extends Service {}
@@ -1 +0,0 @@
1
- export { default } from '@fleetbase/fleetops-engine/services/map-manager';