@fleetbase/fleetops-engine 0.6.64 → 0.6.65

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 (284) hide show
  1. package/RELEASE.md +7 -5
  2. package/addon/components/attachment-list.hbs +65 -0
  3. package/addon/components/attachment-list.js +8 -0
  4. package/addon/components/cell/attached-vehicle.hbs +1 -1
  5. package/addon/components/cell/attached-vehicle.js +3 -3
  6. package/addon/components/cell/driver-identity.js +4 -4
  7. package/addon/components/cell/driver-name.hbs +1 -1
  8. package/addon/components/cell/translated-value.hbs +9 -0
  9. package/addon/components/cell/translated-value.js +57 -0
  10. package/addon/components/contact/card.hbs +58 -0
  11. package/addon/components/contact/card.js +19 -0
  12. package/addon/components/contact/form.hbs +1 -1
  13. package/addon/components/contact/panel-header.hbs +1 -1
  14. package/addon/components/customer/form.hbs +2 -2
  15. package/addon/components/device/manager.hbs +26 -28
  16. package/addon/components/device/manager.js +28 -2
  17. package/addon/components/device/panel-tabs/vehicle.hbs +13 -13
  18. package/addon/components/device/panel-tabs/vehicle.js +8 -0
  19. package/addon/components/driver/card.hbs +24 -13
  20. package/addon/components/driver/card.js +20 -6
  21. package/addon/components/driver/form.hbs +3 -3
  22. package/addon/components/driver/panel-header.hbs +2 -2
  23. package/addon/components/driver/pill.hbs +2 -2
  24. package/addon/components/equipment/form.js +11 -4
  25. package/addon/components/equipment/pill.hbs +20 -0
  26. package/addon/components/equipment/pill.js +3 -0
  27. package/addon/components/filter/multi-model.hbs +19 -0
  28. package/addon/components/filter/multi-model.js +90 -0
  29. package/addon/components/fleet/driver-listing.hbs +1 -1
  30. package/addon/components/fleet/vehicle-listing.hbs +1 -1
  31. package/addon/components/fleet-panel/driver-listing.hbs +1 -1
  32. package/addon/components/fleet-panel/vehicle-listing.hbs +1 -1
  33. package/addon/components/layout/fleet-ops-sidebar.js +9 -7
  34. package/addon/components/maintenance/form.js +12 -4
  35. package/addon/components/maintenance-schedule/form.js +13 -7
  36. package/addon/components/map/leaflet-live-map.hbs +52 -0
  37. package/addon/components/map/order-list-overlay/order.hbs +4 -4
  38. package/addon/components/modals/attach-equipment.hbs +22 -0
  39. package/addon/components/modals/attach-equipment.js +3 -0
  40. package/addon/components/modals/attach-telematic-device.hbs +13 -8
  41. package/addon/components/modals/attach-telematic-device.js +11 -1
  42. package/addon/components/modals/attach-trailer.hbs +30 -0
  43. package/addon/components/modals/attach-trailer.js +3 -0
  44. package/addon/components/modals/contact-form.hbs +2 -2
  45. package/addon/components/modals/convert-customer-to-vendor.hbs +1 -1
  46. package/addon/components/modals/driver-form.hbs +2 -2
  47. package/addon/components/modals/select-trailer.hbs +35 -0
  48. package/addon/components/modals/select-trailer.js +3 -0
  49. package/addon/components/modals/vehicle-form.hbs +2 -2
  50. package/addon/components/orchestrator/resource-panel.hbs +2 -2
  51. package/addon/components/order/customer-avatar-stack.hbs +2 -2
  52. package/addon/components/order/details/detail.hbs +4 -4
  53. package/addon/components/order/details/payload.hbs +2 -2
  54. package/addon/components/order/kanban-card.hbs +4 -4
  55. package/addon/components/order-list-overlay/order.hbs +4 -4
  56. package/addon/components/trailer/card.hbs +68 -0
  57. package/addon/components/trailer/card.js +22 -0
  58. package/addon/components/trailer/details/connections.hbs +57 -0
  59. package/addon/components/trailer/details/connections.js +59 -0
  60. package/addon/components/trailer/details/equipment.hbs +25 -0
  61. package/addon/components/trailer/details/equipment.js +52 -0
  62. package/addon/components/trailer/details/maintenance-history.hbs +47 -0
  63. package/addon/components/trailer/details/maintenance-history.js +40 -0
  64. package/addon/components/trailer/details/schedules.hbs +45 -0
  65. package/addon/components/trailer/details/schedules.js +40 -0
  66. package/addon/components/trailer/details/work-orders.hbs +47 -0
  67. package/addon/components/trailer/details/work-orders.js +40 -0
  68. package/addon/components/trailer/details.hbs +399 -0
  69. package/addon/components/trailer/details.js +118 -0
  70. package/addon/components/trailer/form.hbs +447 -0
  71. package/addon/components/trailer/form.js +165 -0
  72. package/addon/components/trailer/panel-header.hbs +45 -0
  73. package/addon/components/trailer/panel-header.js +3 -0
  74. package/addon/components/trailer/pill.hbs +21 -0
  75. package/addon/components/trailer/pill.js +3 -0
  76. package/addon/components/vehicle/card.hbs +42 -11
  77. package/addon/components/vehicle/card.js +31 -0
  78. package/addon/components/vehicle/details/equipment.hbs +25 -0
  79. package/addon/components/vehicle/details/equipment.js +55 -0
  80. package/addon/components/vehicle/details/trailers.hbs +35 -0
  81. package/addon/components/vehicle/details/trailers.js +55 -0
  82. package/addon/components/vehicle/form.hbs +2 -2
  83. package/addon/components/vehicle/panel-header.hbs +2 -2
  84. package/addon/components/vehicle/pill.hbs +2 -2
  85. package/addon/components/vendor/card.hbs +58 -0
  86. package/addon/components/vendor/card.js +6 -0
  87. package/addon/components/vendor/panel-header.hbs +2 -2
  88. package/addon/components/vendor/personnel-manager.hbs +2 -2
  89. package/addon/components/work-order/form.js +12 -4
  90. package/addon/controllers/connectivity/devices/index/details/vehicle.js +11 -0
  91. package/addon/controllers/connectivity/devices/index/details.js +3 -3
  92. package/addon/controllers/connectivity/devices/index.js +1 -0
  93. package/addon/controllers/connectivity/telematics/details/attachments.js +28 -47
  94. package/addon/controllers/connectivity/telematics/details/devices.js +1 -0
  95. package/addon/controllers/management/contacts/customers.js +4 -0
  96. package/addon/controllers/management/contacts/index.js +32 -0
  97. package/addon/controllers/management/trailers/index/details.js +119 -0
  98. package/addon/controllers/management/trailers/index/edit.js +67 -0
  99. package/addon/controllers/management/trailers/index/new.js +43 -0
  100. package/addon/controllers/management/trailers/index.js +599 -0
  101. package/addon/controllers/management/vehicles/index/details.js +16 -0
  102. package/addon/controllers/management/vehicles/index.js +78 -4
  103. package/addon/controllers/management/vendors/index.js +32 -0
  104. package/addon/controllers/operations/orders/index.js +3 -1
  105. package/addon/controllers/settings/custom-fields.js +8 -0
  106. package/addon/extension.js +7 -0
  107. package/addon/helpers/placeholder-image.js +6 -0
  108. package/addon/helpers/resource-image.js +10 -0
  109. package/addon/helpers/trailer-placeholder-image.js +6 -0
  110. package/addon/routes/management/trailers/index/details/connections.js +2 -0
  111. package/addon/routes/management/trailers/index/details/devices.js +2 -0
  112. package/addon/routes/management/trailers/index/details/equipment.js +2 -0
  113. package/addon/routes/management/trailers/index/details/index.js +2 -0
  114. package/addon/routes/management/trailers/index/details/maintenance-history.js +2 -0
  115. package/addon/routes/management/trailers/index/details/positions.js +2 -0
  116. package/addon/routes/management/trailers/index/details/schedules.js +2 -0
  117. package/addon/routes/management/trailers/index/details/work-orders.js +2 -0
  118. package/addon/routes/management/trailers/index/details.js +30 -0
  119. package/addon/routes/management/trailers/index/edit.js +23 -0
  120. package/addon/routes/management/trailers/index/new.js +14 -0
  121. package/addon/routes/management/trailers/index.js +42 -0
  122. package/addon/routes/management/vehicles/index/details/trailers.js +2 -0
  123. package/addon/routes/management/vehicles/index.js +7 -1
  124. package/addon/routes.js +17 -0
  125. package/addon/services/device-actions.js +26 -16
  126. package/addon/services/trailer-actions.js +394 -0
  127. package/addon/services/vehicle-actions.js +111 -0
  128. package/addon/styles/fleetops-engine.css +349 -0
  129. package/addon/templates/connectivity/devices/index/details/vehicle.hbs +19 -19
  130. package/addon/templates/connectivity/telematics/details/attachments.hbs +15 -15
  131. package/addon/templates/management/contacts/customers.hbs +48 -29
  132. package/addon/templates/management/contacts/index.hbs +52 -33
  133. package/addon/templates/management/trailers/index/details/connections.hbs +1 -0
  134. package/addon/templates/management/trailers/index/details/devices.hbs +1 -0
  135. package/addon/templates/management/trailers/index/details/equipment.hbs +1 -0
  136. package/addon/templates/management/trailers/index/details/index.hbs +1 -0
  137. package/addon/templates/management/trailers/index/details/maintenance-history.hbs +1 -0
  138. package/addon/templates/management/trailers/index/details/positions.hbs +1 -0
  139. package/addon/templates/management/trailers/index/details/schedules.hbs +1 -0
  140. package/addon/templates/management/trailers/index/details/work-orders.hbs +1 -0
  141. package/addon/templates/management/trailers/index/details.hbs +15 -0
  142. package/addon/templates/management/trailers/index/edit.hbs +12 -0
  143. package/addon/templates/management/trailers/index/new.hbs +11 -0
  144. package/addon/templates/management/trailers/index.hbs +67 -0
  145. package/addon/templates/management/vehicles/index/details/equipment.hbs +1 -1
  146. package/addon/templates/management/vehicles/index/details/trailers.hbs +1 -0
  147. package/addon/templates/management/vehicles/index/details.hbs +1 -1
  148. package/addon/templates/management/vendors/index.hbs +66 -32
  149. package/addon/utils/device-table-columns.js +10 -6
  150. package/addon/utils/live-map-card-content.js +56 -0
  151. package/addon/utils/placeholder-images.js +71 -0
  152. package/addon/utils/trailer-placeholder-image.js +11 -0
  153. package/app/components/attachment-list.js +1 -0
  154. package/app/components/cell/translated-value.js +1 -0
  155. package/app/components/contact/card.js +1 -0
  156. package/app/components/equipment/pill.js +1 -0
  157. package/app/components/filter/multi-model.js +1 -0
  158. package/app/components/modals/attach-equipment.js +1 -0
  159. package/app/components/modals/attach-trailer.js +1 -0
  160. package/app/components/modals/select-trailer.js +1 -0
  161. package/app/components/trailer/card.js +1 -0
  162. package/app/components/trailer/details/connections.js +1 -0
  163. package/app/components/trailer/details/equipment.js +1 -0
  164. package/app/components/trailer/details/maintenance-history.js +1 -0
  165. package/app/components/trailer/details/schedules.js +1 -0
  166. package/app/components/trailer/details/work-orders.js +1 -0
  167. package/app/components/trailer/details.js +1 -0
  168. package/app/components/trailer/form.js +1 -0
  169. package/app/components/trailer/panel-header.js +1 -0
  170. package/app/components/trailer/pill.js +1 -0
  171. package/app/components/vehicle/details/equipment.js +1 -0
  172. package/app/components/vehicle/details/trailers.js +1 -0
  173. package/app/components/vendor/card.js +1 -0
  174. package/app/controllers/management/trailers/index/details.js +1 -0
  175. package/app/controllers/management/trailers/index/edit.js +1 -0
  176. package/app/controllers/management/trailers/index/new.js +1 -0
  177. package/app/controllers/management/trailers/index.js +1 -0
  178. package/app/helpers/placeholder-image.js +1 -0
  179. package/app/helpers/resource-image.js +1 -0
  180. package/app/helpers/trailer-placeholder-image.js +1 -0
  181. package/app/routes/management/trailers/index/details/connections.js +1 -0
  182. package/app/routes/management/trailers/index/details/devices.js +1 -0
  183. package/app/routes/management/trailers/index/details/equipment.js +1 -0
  184. package/app/routes/management/trailers/index/details/index.js +1 -0
  185. package/app/routes/management/trailers/index/details/maintenance-history.js +1 -0
  186. package/app/routes/management/trailers/index/details/positions.js +1 -0
  187. package/app/routes/management/trailers/index/details/schedules.js +1 -0
  188. package/app/routes/management/trailers/index/details/work-orders.js +1 -0
  189. package/app/routes/management/trailers/index/details.js +1 -0
  190. package/app/routes/management/trailers/index/edit.js +1 -0
  191. package/app/routes/management/trailers/index/new.js +1 -0
  192. package/app/routes/management/trailers/index.js +1 -0
  193. package/app/routes/management/vehicles/index/details/trailers.js +1 -0
  194. package/app/services/trailer-actions.js +1 -0
  195. package/app/templates/management/trailers/index/details/connections.js +1 -0
  196. package/app/templates/management/trailers/index/details/devices.js +1 -0
  197. package/app/templates/management/trailers/index/details/equipment.js +1 -0
  198. package/app/templates/management/trailers/index/details/index.js +1 -0
  199. package/app/templates/management/trailers/index/details/maintenance-history.js +1 -0
  200. package/app/templates/management/trailers/index/details/positions.js +1 -0
  201. package/app/templates/management/trailers/index/details/schedules.js +1 -0
  202. package/app/templates/management/trailers/index/details/work-orders.js +1 -0
  203. package/app/templates/management/trailers/index/details.js +1 -0
  204. package/app/templates/management/trailers/index/edit.js +1 -0
  205. package/app/templates/management/trailers/index/new.js +1 -0
  206. package/app/templates/management/trailers/index.js +1 -0
  207. package/app/templates/management/vehicles/index/details/trailers.js +1 -0
  208. package/composer.json +1 -1
  209. package/extension.json +1 -1
  210. package/package.json +1 -1
  211. package/server/migrations/2026_09_03_000001_add_first_class_trailer_columns_to_assets_table.php +58 -0
  212. package/server/migrations/2026_09_03_000002_create_asset_connections_table.php +43 -0
  213. package/server/migrations/2026_09_03_000003_create_device_installations_table.php +33 -0
  214. package/server/src/Auth/Schemas/FleetOps.php +7 -0
  215. package/server/src/Events/TrailerLocationChanged.php +70 -0
  216. package/server/src/Exceptions/DeviceAlreadyAttachedException.php +18 -0
  217. package/server/src/Exports/TrailerExport.php +31 -0
  218. package/server/src/Http/Controllers/Api/v1/Concerns/ResolvesFleetOpsApiResources.php +8 -2
  219. package/server/src/Http/Controllers/Api/v1/DeviceController.php +22 -15
  220. package/server/src/Http/Controllers/Api/v1/EquipmentController.php +47 -0
  221. package/server/src/Http/Controllers/Api/v1/TrailerController.php +362 -0
  222. package/server/src/Http/Controllers/Api/v1/VehicleController.php +1 -0
  223. package/server/src/Http/Controllers/Internal/v1/DeviceController.php +3 -0
  224. package/server/src/Http/Controllers/Internal/v1/LiveController.php +1 -1
  225. package/server/src/Http/Controllers/Internal/v1/SearchController.php +16 -0
  226. package/server/src/Http/Controllers/Internal/v1/TrailerController.php +360 -0
  227. package/server/src/Http/Controllers/Internal/v1/VehicleController.php +74 -0
  228. package/server/src/Http/Filter/EquipmentFilter.php +51 -0
  229. package/server/src/Http/Filter/OrderFilter.php +15 -0
  230. package/server/src/Http/Filter/TrailerFilter.php +269 -0
  231. package/server/src/Http/Filter/VehicleFilter.php +70 -3
  232. package/server/src/Http/Requests/CreateDeviceRequest.php +1 -1
  233. package/server/src/Http/Requests/CreateEquipmentRequest.php +1 -1
  234. package/server/src/Http/Requests/CreateTrailerRequest.php +54 -0
  235. package/server/src/Http/Requests/UpdateTrailerRequest.php +7 -0
  236. package/server/src/Http/Resources/v1/AssetConnection.php +90 -0
  237. package/server/src/Http/Resources/v1/Device.php +3 -1
  238. package/server/src/Http/Resources/v1/Equipment.php +3 -1
  239. package/server/src/Http/Resources/v1/Index/Vehicle.php +10 -0
  240. package/server/src/Http/Resources/v1/Trailer.php +199 -0
  241. package/server/src/Http/Resources/v1/Vehicle.php +2 -0
  242. package/server/src/Http/Resources/v1/VehicleWithoutDriver.php +3 -0
  243. package/server/src/Imports/TrailerImport.php +33 -0
  244. package/server/src/Models/Asset.php +39 -10
  245. package/server/src/Models/AssetConnection.php +43 -0
  246. package/server/src/Models/Device.php +39 -8
  247. package/server/src/Models/DeviceInstallation.php +27 -0
  248. package/server/src/Models/Equipment.php +2 -0
  249. package/server/src/Models/Trailer.php +181 -0
  250. package/server/src/Models/Vehicle.php +13 -0
  251. package/server/src/Providers/FleetOpsServiceProvider.php +4 -2
  252. package/server/src/Support/Ai/FleetOpsAiQueryResources.php +22 -0
  253. package/server/src/Support/Reporting/FleetOpsReportSchema.php +38 -0
  254. package/server/src/Support/Telematics/TelematicService.php +35 -0
  255. package/server/src/Support/TrailerSummary.php +35 -0
  256. package/server/src/routes.php +29 -0
  257. package/server/tests/CompactResourceSerializationTest.php +36 -0
  258. package/server/tests/ControllerFilterContractsTest.php +29 -0
  259. package/server/tests/Feature/Http/Api/DeviceControllerContractsTest.php +30 -13
  260. package/server/tests/Feature/Http/Api/TrailerControllerLifecycleTest.php +640 -0
  261. package/server/tests/Feature/Http/Internal/DeviceControllerContractsTest.php +20 -5
  262. package/server/tests/Feature/Http/Internal/LiveControllerEndpointsTest.php +19 -0
  263. package/server/tests/ModelAccessorContractsTest.php +10 -0
  264. package/server/tests/OrderFilterExecutionTest.php +5 -0
  265. package/server/tests/PublicApiControllerInputContractsTest.php +11 -0
  266. package/server/tests/PublicFleetOpsRestEndpointsTest.php +15 -3
  267. package/server/tests/ReportSchemaContractsTest.php +4 -0
  268. package/server/tests/TelematicsHardeningTest.php +4 -2
  269. package/server/tests/TrailerSupportCoverageTest.php +524 -0
  270. package/server/tests/Unit/Http/Resources/IndexVehicleResourceTest.php +35 -0
  271. package/server/tests/Unit/Models/EquipmentTest.php +22 -0
  272. package/server/tests/Unit/Models/ModelLookupFallbackSeamsTest.php +7 -3
  273. package/server/tests/Unit/Models/TrailerTest.php +204 -0
  274. package/server/tests/Unit/Support/Telematics/TelematicServiceTelemetryTest.php +93 -0
  275. package/server/tests/VehicleControllerHelperContractsTest.php +14 -0
  276. package/translations/ar-ae.yml +396 -0
  277. package/translations/bg-bg.yaml +424 -0
  278. package/translations/en-us.yaml +423 -0
  279. package/translations/es-pa.yaml +425 -0
  280. package/translations/fr-fr.yaml +424 -0
  281. package/translations/mn-mn.yaml +424 -0
  282. package/translations/pt-br.yaml +424 -0
  283. package/translations/ru-ru.yaml +424 -0
  284. package/translations/vi-vn.yaml +435 -0
@@ -1,34 +1,53 @@
1
- <Layout::Resource::Tabular
2
- @resource="contact"
3
- @title={{t "resource.contacts"}}
4
- @searchQuery={{this.query}}
5
- @onSearch={{perform this.contactActions.controllerSearchTask this}}
6
- @data={{@model}}
7
- @columns={{this.columns}}
8
- @page={{this.page}}
9
- @onPageChange={{fn (mut this.page)}}
10
- @setupTable={{fn (mut this.table)}}
11
- @actionButtons={{this.actionButtons}}
12
- @bulkActions={{this.bulkActions}}
13
- @controller={{this}}
14
- @emptyStateComponent={{component
15
- "table/empty-state"
16
- icon="address-book"
17
- title="Add your first contact"
18
- description="Contacts keep customer, vendor, and internal stakeholder details ready for orders and communication."
19
- filteredTitle="No contacts match your filters"
20
- filteredDescription="Adjust the search or filters to find another contact."
21
- primaryText="New contact"
22
- primaryIcon="plus"
23
- primaryAction=this.contactActions.transition.create
24
- secondaryText="Import"
25
- secondaryIcon="upload"
26
- secondaryAction=this.contactActions.import
27
- docsSlug="fleet-ops/resources/contacts/overview"
28
- docsTitle="Contacts guide"
29
- docsText="Contacts guide"
30
- docsSource="fleet-ops-empty-contacts"
31
- }}
32
- @withoutHeader={{true}}
33
- />
1
+ {{#if (eq this.layout "table")}}
2
+ <Layout::Resource::Tabular
3
+ @resource="contact"
4
+ @title={{t "resource.contacts"}}
5
+ @searchQuery={{this.query}}
6
+ @onSearch={{perform this.contactActions.controllerSearchTask this}}
7
+ @data={{@model}}
8
+ @columns={{this.columns}}
9
+ @page={{this.page}}
10
+ @onPageChange={{fn (mut this.page)}}
11
+ @setupTable={{fn (mut this.table)}}
12
+ @actionButtons={{this.actionButtons}}
13
+ @bulkActions={{this.bulkActions}}
14
+ @controller={{this}}
15
+ @emptyStateComponent={{component
16
+ "table/empty-state"
17
+ icon="address-book"
18
+ title="Add your first contact"
19
+ description="Contacts keep customer, vendor, and internal stakeholder details ready for orders and communication."
20
+ filteredTitle="No contacts match your filters"
21
+ filteredDescription="Adjust the search or filters to find another contact."
22
+ primaryText="New contact"
23
+ primaryIcon="plus"
24
+ primaryAction=this.contactActions.transition.create
25
+ secondaryText="Import"
26
+ secondaryIcon="upload"
27
+ secondaryAction=this.contactActions.import
28
+ docsSlug="fleet-ops/resources/contacts/overview"
29
+ docsTitle="Contacts guide"
30
+ docsText="Contacts guide"
31
+ docsSource="fleet-ops-empty-contacts"
32
+ }}
33
+ @withoutHeader={{true}}
34
+ />
35
+ {{else}}
36
+ <Layout::Section::Body class="overflow-y-scroll-i h-full">
37
+ <Layout::Resource::CardsGrid
38
+ @resource="contact"
39
+ @data={{@model}}
40
+ @columns="4"
41
+ @showPagination={{true}}
42
+ @page={{this.page}}
43
+ @onPageChange={{fn (mut this.page)}}
44
+ @paginationMeta={{@model.meta}}
45
+ @containerClass="p-4"
46
+ class="h-full"
47
+ as |Item|
48
+ >
49
+ <Contact::Card @resource={{Item.model}} />
50
+ </Layout::Resource::CardsGrid>
51
+ </Layout::Section::Body>
52
+ {{/if}}
34
53
  {{outlet}}
@@ -0,0 +1 @@
1
+ <Trailer::Details::Connections @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Device::Manager @resource={{@model}} @endpoint="trailers" />
@@ -0,0 +1 @@
1
+ <Trailer::Details::Equipment @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Trailer::Details @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Trailer::Details::MaintenanceHistory @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <PositionsReplay @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Trailer::Details::Schedules @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Trailer::Details::WorkOrders @resource={{@model}} />
@@ -0,0 +1,15 @@
1
+ <Layout::Resource::Panel
2
+ @resource={{@model}}
3
+ @controller={{this}}
4
+ @headerComponent={{component "trailer/panel-header" resource=@model actionButtons=this.actionButtons}}
5
+ @headerTitle={{@model.displayName}}
6
+ @actionButtons={{this.actionButtons}}
7
+ @onPressCancel={{transition-to "management.trailers.index"}}
8
+ @onOverlayReady={{fn (mut this.overlay)}}
9
+ @headerClass="no-bottom-border"
10
+ @bodyClass="no-scroll"
11
+ >
12
+ <TabNavigation @tabs={{this.tabs}} @containerClass="tab-navigation-fill" @contentClass="scrollable" @tablistClass="pl-2">
13
+ {{outlet}}
14
+ </TabNavigation>
15
+ </Layout::Resource::Panel>
@@ -0,0 +1,12 @@
1
+ <Layout::Resource::Panel
2
+ @resource={{@model}}
3
+ @controller={{this}}
4
+ @headerTitle={{t "common.edit-resource-name" resourceName=@model.displayName}}
5
+ @actionButtons={{this.actionButtons}}
6
+ @saveTask={{this.save}}
7
+ @onPressCancel={{this.cancel}}
8
+ @onOverlayReady={{fn (mut this.overlay)}}
9
+ >
10
+ <Trailer::Form @resource={{@model}} @controller={{this}} />
11
+ <Spacer @height="200px" />
12
+ </Layout::Resource::Panel>
@@ -0,0 +1,11 @@
1
+ <Layout::Resource::Panel
2
+ @resource={{this.trailer}}
3
+ @controller={{this}}
4
+ @headerTitle={{t "common.create-a-new-resource" resource=(t "resource.trailer")}}
5
+ @saveTask={{this.save}}
6
+ @onPressCancel={{transition-to "management.trailers.index"}}
7
+ @onOverlayReady={{fn (mut this.overlay)}}
8
+ >
9
+ <Trailer::Form @resource={{this.trailer}} @controller={{this}} />
10
+ <Spacer @height="200px" />
11
+ </Layout::Resource::Panel>
@@ -0,0 +1,67 @@
1
+ {{#if (eq this.layout "table")}}
2
+ <Layout::Resource::Tabular
3
+ @resource="trailer"
4
+ @title={{t "resource.trailers"}}
5
+ @searchQuery={{this.query}}
6
+ @onSearch={{perform this.trailerActions.controllerSearchTask this}}
7
+ @data={{@model}}
8
+ @columns={{this.columns}}
9
+ @page={{this.page}}
10
+ @onPageChange={{fn (mut this.page)}}
11
+ @setupTable={{fn (mut this.table)}}
12
+ @actionButtons={{this.actionButtons}}
13
+ @bulkActions={{this.bulkActions}}
14
+ @controller={{this}}
15
+ @emptyStateComponent={{component
16
+ "table/empty-state"
17
+ icon="trailer"
18
+ title=(t "trailer.empty.title")
19
+ description=(t "trailer.empty.description")
20
+ filteredTitle=(t "trailer.empty.filtered-title")
21
+ filteredDescription=(t "trailer.empty.filtered-description")
22
+ primaryText=(t "trailer.actions.new")
23
+ primaryIcon="plus"
24
+ primaryAction=this.trailerActions.transition.create
25
+ secondaryText=(t "common.import")
26
+ secondaryIcon="upload"
27
+ secondaryAction=this.trailerActions.import
28
+ docsSlug="fleet-ops/resources/trailers/overview"
29
+ docsTitle=(t "trailer.docs.title")
30
+ docsText=(t "trailer.docs.link")
31
+ docsSource="fleet-ops-empty-trailers"
32
+ }}
33
+ />
34
+ {{else}}
35
+ <Layout::Section::Header @title={{t "resource.trailers"}} @actionsWrapperClass="space-x-1">
36
+ <Layout::Resource::TabularActions
37
+ @searchQuery={{this.query}}
38
+ @onSearch={{perform this.trailerActions.controllerSearchTask this}}
39
+ @columns={{this.columns}}
40
+ @page={{this.page}}
41
+ @onPageChange={{fn (mut this.page)}}
42
+ @setupTable={{fn (mut this.table)}}
43
+ @actionButtons={{this.actionButtons}}
44
+ @bulkActions={{this.bulkActions}}
45
+ @controller={{this}}
46
+ @hideColumnsPicker={{true}}
47
+ />
48
+ </Layout::Section::Header>
49
+
50
+ <Layout::Section::Body class="overflow-y-scroll-i h-full">
51
+ <Layout::Resource::CardsGrid
52
+ @resource="trailer"
53
+ @data={{@model}}
54
+ @columns="4"
55
+ @showPagination={{true}}
56
+ @page={{this.page}}
57
+ @onPageChange={{fn (mut this.page)}}
58
+ @paginationMeta={{@model.meta}}
59
+ @containerClass="p-4"
60
+ class="h-full"
61
+ as |Item|
62
+ >
63
+ <Trailer::Card @resource={{Item.model}} />
64
+ </Layout::Resource::CardsGrid>
65
+ </Layout::Section::Body>
66
+ {{/if}}
67
+ {{outlet}}
@@ -1 +1 @@
1
- {{outlet}}
1
+ <Vehicle::Details::Equipment @resource={{@model}} />
@@ -0,0 +1 @@
1
+ <Vehicle::Details::Trailers @resource={{@model}} />
@@ -9,7 +9,7 @@
9
9
  @headerClass="no-bottom-border"
10
10
  @bodyClass="no-scroll"
11
11
  >
12
- <TabNavigation @tabs={{this.tabs}} @contentClass="scrollable" @tablistClass="pl-2">
12
+ <TabNavigation @tabs={{this.tabs}} @containerClass="tab-navigation-fill" @contentClass="scrollable" @tablistClass="pl-2">
13
13
  {{outlet}}
14
14
  </TabNavigation>
15
15
  </Layout::Resource::Panel>
@@ -1,33 +1,67 @@
1
- <Layout::Resource::Tabular
2
- @resource="vendor"
3
- @title={{t "resource.vendors"}}
4
- @searchQuery={{this.query}}
5
- @onSearch={{perform this.vendorActions.controllerSearchTask this}}
6
- @data={{@model}}
7
- @columns={{this.columns}}
8
- @page={{this.page}}
9
- @onPageChange={{fn (mut this.page)}}
10
- @setupTable={{fn (mut this.table)}}
11
- @actionButtons={{this.actionButtons}}
12
- @bulkActions={{this.bulkActions}}
13
- @controller={{this}}
14
- @emptyStateComponent={{component
15
- "table/empty-state"
16
- icon="building"
17
- title="Add your first vendor"
18
- description="Vendors let your team manage external carriers, service providers, and operational partners."
19
- filteredTitle="No vendors match your filters"
20
- filteredDescription="Adjust the search or filters to find another vendor."
21
- primaryText="New vendor"
22
- primaryIcon="plus"
23
- primaryAction=this.vendorActions.transition.create
24
- secondaryText="Import"
25
- secondaryIcon="upload"
26
- secondaryAction=this.vendorActions.import
27
- docsSlug="fleet-ops/resources/vendors/overview"
28
- docsTitle="Vendors guide"
29
- docsText="Vendor guide"
30
- docsSource="fleet-ops-empty-vendors"
31
- }}
32
- />
1
+ {{#if (eq this.layout "table")}}
2
+ <Layout::Resource::Tabular
3
+ @resource="vendor"
4
+ @title={{t "resource.vendors"}}
5
+ @searchQuery={{this.query}}
6
+ @onSearch={{perform this.vendorActions.controllerSearchTask this}}
7
+ @data={{@model}}
8
+ @columns={{this.columns}}
9
+ @page={{this.page}}
10
+ @onPageChange={{fn (mut this.page)}}
11
+ @setupTable={{fn (mut this.table)}}
12
+ @actionButtons={{this.actionButtons}}
13
+ @bulkActions={{this.bulkActions}}
14
+ @controller={{this}}
15
+ @emptyStateComponent={{component
16
+ "table/empty-state"
17
+ icon="building"
18
+ title="Add your first vendor"
19
+ description="Vendors let your team manage external carriers, service providers, and operational partners."
20
+ filteredTitle="No vendors match your filters"
21
+ filteredDescription="Adjust the search or filters to find another vendor."
22
+ primaryText="New vendor"
23
+ primaryIcon="plus"
24
+ primaryAction=this.vendorActions.transition.create
25
+ secondaryText="Import"
26
+ secondaryIcon="upload"
27
+ secondaryAction=this.vendorActions.import
28
+ docsSlug="fleet-ops/resources/vendors/overview"
29
+ docsTitle="Vendors guide"
30
+ docsText="Vendor guide"
31
+ docsSource="fleet-ops-empty-vendors"
32
+ }}
33
+ />
34
+ {{else}}
35
+ <Layout::Section::Header @title={{t "resource.vendors"}} @actionsWrapperClass="space-x-1">
36
+ <Layout::Resource::TabularActions
37
+ @searchQuery={{this.query}}
38
+ @onSearch={{perform this.vendorActions.controllerSearchTask this}}
39
+ @columns={{this.columns}}
40
+ @page={{this.page}}
41
+ @onPageChange={{fn (mut this.page)}}
42
+ @setupTable={{fn (mut this.table)}}
43
+ @actionButtons={{this.actionButtons}}
44
+ @bulkActions={{this.bulkActions}}
45
+ @controller={{this}}
46
+ @hideColumnsPicker={{true}}
47
+ />
48
+ </Layout::Section::Header>
49
+
50
+ <Layout::Section::Body class="overflow-y-scroll-i h-full">
51
+ <Layout::Resource::CardsGrid
52
+ @resource="vendor"
53
+ @data={{@model}}
54
+ @columns="4"
55
+ @showPagination={{true}}
56
+ @page={{this.page}}
57
+ @onPageChange={{fn (mut this.page)}}
58
+ @paginationMeta={{@model.meta}}
59
+ @containerClass="p-4"
60
+ class="h-full"
61
+ as |Item|
62
+ >
63
+ <Vendor::Card @resource={{Item.model}} />
64
+ </Layout::Resource::CardsGrid>
65
+ </Layout::Section::Body>
66
+ {{/if}}
33
67
  {{outlet}}
@@ -64,12 +64,16 @@ export default function buildDeviceTableColumns(controller, options = {}) {
64
64
  filterComponent: 'filter/string',
65
65
  };
66
66
  const vehicleColumn = {
67
- label: 'Vehicle',
67
+ label: controller.intl?.t('device.attachment.asset') ?? 'Attached asset',
68
68
  valuePath: 'attached_to_name',
69
69
  cellComponent: 'cell/vehicle-identity',
70
70
  action: async (vehicle) => {
71
71
  const resolvedVehicle = vehicle?.loadResource ? ((await vehicle.loadResource()) ?? vehicle) : vehicle;
72
72
 
73
+ const type = `${vehicle?.attachable_type ?? resolvedVehicle?.constructor?.modelName ?? ''}`.toLowerCase();
74
+ if (type.includes('trailer') && resolvedVehicle?.id && controller.trailerActions?.transition?.view) {
75
+ return controller.trailerActions.transition.view(resolvedVehicle);
76
+ }
73
77
  if (resolvedVehicle?.id && controller.vehicleActions?.panel?.view) {
74
78
  return controller.vehicleActions.panel.view(resolvedVehicle);
75
79
  }
@@ -81,7 +85,7 @@ export default function buildDeviceTableColumns(controller, options = {}) {
81
85
  resourcePath: (device) => {
82
86
  const attachableType = `${device?.attachable_type ?? ''}`.toLowerCase();
83
87
 
84
- if (!device?.attachable_uuid || (attachableType && !attachableType.includes('vehicle'))) {
88
+ if (!device?.attachable_uuid || (attachableType && !attachableType.includes('vehicle') && !attachableType.includes('trailer'))) {
85
89
  return null;
86
90
  }
87
91
 
@@ -238,12 +242,12 @@ export default function buildDeviceTableColumns(controller, options = {}) {
238
242
  permission: 'fleet-ops update device',
239
243
  },
240
244
  {
241
- label: 'Attach or change vehicle',
245
+ label: controller.intl.t('device.attachment.attach-or-change'),
242
246
  fn: controller.openAttachDeviceModal ?? controller.deviceActions.attachToVehicle,
243
247
  permission: 'fleet-ops update device',
244
248
  },
245
249
  {
246
- label: controller.intl.t('device.actions.detach-from-vehicle'),
250
+ label: controller.intl.t('device.attachment.detach'),
247
251
  fn: controller.deviceActions.detachFromVehicle,
248
252
  permission: 'fleet-ops update device',
249
253
  isVisible: controller.hasAttachedVehicle,
@@ -253,13 +257,13 @@ export default function buildDeviceTableColumns(controller, options = {}) {
253
257
  isVisible: controller.hasAttachedVehicle,
254
258
  },
255
259
  {
256
- label: 'View attached vehicle',
260
+ label: controller.intl.t('device.attachment.view-attached'),
257
261
  fn: controller.viewAttachedVehicle,
258
262
  permission: 'fleet-ops view vehicle',
259
263
  isVisible: controller.hasAttachedVehicle,
260
264
  },
261
265
  {
262
- label: 'Locate attached vehicle on map',
266
+ label: controller.intl.t('device.attachment.locate-attached'),
263
267
  fn: controller.locateAttachedVehicle,
264
268
  permission: 'fleet-ops view vehicle',
265
269
  isVisible: controller.hasAttachedVehicle,
@@ -23,6 +23,44 @@ function buildStatusBadge(status, label = status) {
23
23
  </div>`;
24
24
  }
25
25
 
26
+ function escapeHtml(value) {
27
+ return `${value ?? ''}`.replace(/[&<>"']/g, (character) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character]);
28
+ }
29
+
30
+ function toPlainArray(value) {
31
+ if (!value) {
32
+ return [];
33
+ }
34
+
35
+ if (typeof value.toArray === 'function') {
36
+ return value.toArray();
37
+ }
38
+
39
+ return isArray(value) ? Array.from(value) : [];
40
+ }
41
+
42
+ /**
43
+ * Stacked list of attached assets (trailers, devices) with an online dot per row,
44
+ * or a dash when nothing is attached. Names are user data, so they are escaped.
45
+ */
46
+ function buildAttachmentList(items, resolveName) {
47
+ if (items.length === 0) {
48
+ return '-';
49
+ }
50
+
51
+ return items
52
+ .map((item) => {
53
+ const onlineClass = item.online ? 'bg-green-400' : 'bg-gray-500';
54
+
55
+ return `
56
+ <div class="flex items-center gap-1 min-w-0">
57
+ <span class="inline-block w-1.5 h-1.5 rounded-full shrink-0 ${onlineClass}"></span>
58
+ <span class="truncate">${escapeHtml(resolveName(item))}</span>
59
+ </div>`;
60
+ })
61
+ .join('');
62
+ }
63
+
26
64
  function buildMetaCell(label, value, valueClass = '') {
27
65
  const shouldTruncate = valueClass.split(' ').includes('truncate');
28
66
  const flowClass = shouldTruncate ? 'min-w-0 w-full' : 'whitespace-normal break-words';
@@ -65,6 +103,22 @@ function resolveVehicleNumber(vehicle) {
65
103
  return vehicle.internal_id ?? vehicle.public_id ?? vehicle.plate_number ?? vehicle.serial_number ?? vehicle.vin ?? '-';
66
104
  }
67
105
 
106
+ function resolveTrailerName(trailer) {
107
+ return trailer.displayName ?? trailer.display_name ?? trailer.name ?? trailer.public_id ?? '-';
108
+ }
109
+
110
+ function resolveDeviceName(device) {
111
+ return device.displayName ?? device.display_name ?? device.name ?? device.device_id ?? device.public_id ?? '-';
112
+ }
113
+
114
+ export function resolveVehicleTrailers(vehicle) {
115
+ return toPlainArray(vehicle.trailers);
116
+ }
117
+
118
+ export function resolveVehicleDevices(vehicle) {
119
+ return toPlainArray(vehicle.devices);
120
+ }
121
+
68
122
  function resolveVehicleStatus(vehicle) {
69
123
  return vehicle.meta?.status_label ?? vehicle.current_status ?? vehicle.status ?? '-';
70
124
  }
@@ -143,6 +197,8 @@ export function buildVehicleLiveMapContent(vehicle, framed = false) {
143
197
  <div class="grid grid-cols-2 gap-1">
144
198
  ${buildMetaCell('Vehicle #', resolveVehicleNumber(vehicle))}
145
199
  ${buildMetaCell('Driver', vehicle.driver_name ?? vehicle.driver?.name ?? '-')}
200
+ ${buildMetaCell('Trailers', buildAttachmentList(resolveVehicleTrailers(vehicle), resolveTrailerName))}
201
+ ${buildMetaCell('Devices', buildAttachmentList(resolveVehicleDevices(vehicle), resolveDeviceName))}
146
202
  ${buildMetaCell('Order', vehicle.meta?.current_order_reference ?? '-')}
147
203
  ${buildMetaCell('Speed', resolveVehicleSpeed(vehicle))}
148
204
  ${buildMetaCell('Heading', resolveVehicleHeading(vehicle))}
@@ -0,0 +1,71 @@
1
+ import config from 'ember-get-config';
2
+
3
+ /**
4
+ * Flat silhouettes shown wherever a resource has no photo, in one consistent style
5
+ * across the console. They are inline data URIs so the engine does not depend on a
6
+ * hosted asset; a console can override any of them through
7
+ * `defaultValues.placeholders.<type>` in its environment config.
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DAtMjIgOC0yNiAyMEw2MCAyNDR2ODB6IiBmaWxsPSIjYmRiZGJkIiBzdHJva2U9IiNkZWRlZGUiIHN0cm9rZS13aWR0aD0iMTAiLz48cGF0aCBkPSJNMTA0IDIwNmg4OHY1Mkg4NHoiIGZpbGw9IiNkOWQ5ZDkiLz48cmVjdCB4PSI2MCIgeT0iMzI0IiB3aWR0aD0iNTA2IiBoZWlnaHQ9IjE4IiByeD0iNiIgZmlsbD0iI2E5YTlhOSIvPjxyZWN0IHg9IjU2IiB5PSIyOTIiIHdpZHRoPSIxOCIgaGVpZ2h0PSIzMCIgcng9IjUiIGZpbGw9IiNkOWQ5ZDkiLz48Y2lyY2xlIGN4PSIxNTAiIGN5PSIzNjYiIHI9IjQwIiBmaWxsPSIjOGY4ZjhmIiBzdHJva2U9IiNkZWRlZGUiIHN0cm9rZS13aWR0aD0iOCIvPjxjaXJjbGUgY3g9IjE1MCIgY3k9IjM2NiIgcj0iMTYiIGZpbGw9IiNkOWQ5ZDkiLz48Y2lyY2xlIGN4PSI0NzAiIGN5PSIzNjYiIHI9IjQwIiBmaWxsPSIjOGY4ZjhmIiBzdHJva2U9IiNkZWRlZGUiIHN0cm9rZS13aWR0aD0iOCIvPjxjaXJjbGUgY3g9IjQ3MCIgY3k9IjM2NiIgcj0iMTYiIGZpbGw9IiNkOWQ5ZDkiLz48L2c+PC9nPjwvc3ZnPg==',
21
+ };
22
+
23
+ /**
24
+ * Hosted images the data models and console config fall back to when a record has no
25
+ * photo. Treat them as "no photo" so the styled placeholder wins over the legacy PNG.
26
+ */
27
+ const LEGACY_DEFAULT_PATTERN = /(no-avatar|vehicle-placeholder|image-file-icon|fallback-placeholder|default-extension-icon)\.(png|svg|jpe?g)/i;
28
+
29
+ const CONFIG_KEYS = {
30
+ vehicle: 'vehicleImage',
31
+ driver: 'driverImage',
32
+ vendor: 'vendorImage',
33
+ contact: 'contactImage',
34
+ customer: 'customerImage',
35
+ fleet: 'fleetImage',
36
+ trailer: 'trailerImage',
37
+ };
38
+
39
+ export function getPlaceholderImage(type = 'contact') {
40
+ const overrides = config?.defaultValues?.placeholders ?? {};
41
+ // A console that already replaced its hosted defaults with inline images wins;
42
+ // hosted PNG defaults are ignored so the silhouette set stays consistent.
43
+ const configured = config?.defaultValues?.[CONFIG_KEYS[type]];
44
+ const inlineConfigured = typeof configured === 'string' && configured.startsWith('data:') ? configured : null;
45
+
46
+ return overrides[type] || inlineConfigured || PLACEHOLDER_IMAGES[type] || PLACEHOLDER_IMAGES.contact;
47
+ }
48
+
49
+ export function isDefaultImage(url) {
50
+ if (typeof url !== 'string' || url.trim() === '') {
51
+ return true;
52
+ }
53
+
54
+ if (LEGACY_DEFAULT_PATTERN.test(url)) {
55
+ return true;
56
+ }
57
+
58
+ const defaults = Object.values(config?.defaultValues ?? {}).filter((value) => typeof value === 'string');
59
+
60
+ return defaults.includes(url);
61
+ }
62
+
63
+ /**
64
+ * The image to show for a record: its own photo, or the styled placeholder when the
65
+ * photo is missing or one of the legacy hosted defaults.
66
+ */
67
+ export function resolveResourceImage(url, type) {
68
+ return isDefaultImage(url) ? getPlaceholderImage(type) : url;
69
+ }
70
+
71
+ export default getPlaceholderImage;
@@ -0,0 +1,11 @@
1
+ import { PLACEHOLDER_IMAGES, getPlaceholderImage } from './placeholder-images';
2
+
3
+ /**
4
+ * Kept for callers that import the trailer placeholder directly; the full set lives in
5
+ * `placeholder-images`.
6
+ */
7
+ export const TRAILER_PLACEHOLDER_IMAGE = PLACEHOLDER_IMAGES.trailer;
8
+
9
+ export default function getTrailerPlaceholderImage() {
10
+ return getPlaceholderImage('trailer');
11
+ }
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/attachment-list';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/cell/translated-value';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/contact/card';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/equipment/pill';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/filter/multi-model';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/modals/attach-equipment';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/modals/attach-trailer';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/modals/select-trailer';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/card';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details/connections';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details/equipment';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details/maintenance-history';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details/schedules';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details/work-orders';
@@ -0,0 +1 @@
1
+ export { default } from '@fleetbase/fleetops-engine/components/trailer/details';