@fleetbase/fleetops-engine 0.6.63 → 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.
- package/RELEASE.md +7 -6
- package/addon/components/attachment-list.hbs +65 -0
- package/addon/components/attachment-list.js +8 -0
- package/addon/components/cell/attached-vehicle.hbs +1 -1
- package/addon/components/cell/attached-vehicle.js +3 -3
- package/addon/components/cell/driver-identity.js +4 -4
- package/addon/components/cell/driver-name.hbs +1 -1
- package/addon/components/cell/translated-value.hbs +9 -0
- package/addon/components/cell/translated-value.js +57 -0
- package/addon/components/contact/card.hbs +58 -0
- package/addon/components/contact/card.js +19 -0
- package/addon/components/contact/form.hbs +1 -1
- package/addon/components/contact/panel-header.hbs +1 -1
- package/addon/components/customer/form.hbs +2 -2
- package/addon/components/device/manager.hbs +26 -28
- package/addon/components/device/manager.js +28 -2
- package/addon/components/device/panel-tabs/vehicle.hbs +13 -13
- package/addon/components/device/panel-tabs/vehicle.js +8 -0
- package/addon/components/driver/card.hbs +24 -13
- package/addon/components/driver/card.js +20 -6
- package/addon/components/driver/form.hbs +3 -3
- package/addon/components/driver/panel-header.hbs +2 -2
- package/addon/components/driver/pill.hbs +2 -2
- package/addon/components/equipment/form.js +11 -4
- package/addon/components/equipment/pill.hbs +20 -0
- package/addon/components/equipment/pill.js +3 -0
- package/addon/components/filter/multi-model.hbs +19 -0
- package/addon/components/filter/multi-model.js +90 -0
- package/addon/components/fleet/driver-listing.hbs +1 -1
- package/addon/components/fleet/vehicle-listing.hbs +1 -1
- package/addon/components/fleet-panel/driver-listing.hbs +1 -1
- package/addon/components/fleet-panel/vehicle-listing.hbs +1 -1
- package/addon/components/layout/fleet-ops-sidebar.js +9 -7
- package/addon/components/maintenance/form.js +12 -4
- package/addon/components/maintenance-schedule/form.js +13 -7
- package/addon/components/map/leaflet-live-map.hbs +52 -0
- package/addon/components/map/order-list-overlay/order.hbs +4 -4
- package/addon/components/modals/attach-equipment.hbs +22 -0
- package/addon/components/modals/attach-equipment.js +3 -0
- package/addon/components/modals/attach-telematic-device.hbs +13 -8
- package/addon/components/modals/attach-telematic-device.js +11 -1
- package/addon/components/modals/attach-trailer.hbs +30 -0
- package/addon/components/modals/attach-trailer.js +3 -0
- package/addon/components/modals/contact-form.hbs +2 -2
- package/addon/components/modals/convert-customer-to-vendor.hbs +1 -1
- package/addon/components/modals/driver-form.hbs +2 -2
- package/addon/components/modals/select-trailer.hbs +35 -0
- package/addon/components/modals/select-trailer.js +3 -0
- package/addon/components/modals/vehicle-form.hbs +2 -2
- package/addon/components/orchestrator/resource-panel.hbs +2 -2
- package/addon/components/order/customer-avatar-stack.hbs +2 -2
- package/addon/components/order/details/detail.hbs +4 -4
- package/addon/components/order/details/payload.hbs +2 -2
- package/addon/components/order/kanban-card.hbs +4 -4
- package/addon/components/order-list-overlay/order.hbs +4 -4
- package/addon/components/trailer/card.hbs +68 -0
- package/addon/components/trailer/card.js +22 -0
- package/addon/components/trailer/details/connections.hbs +57 -0
- package/addon/components/trailer/details/connections.js +59 -0
- package/addon/components/trailer/details/equipment.hbs +25 -0
- package/addon/components/trailer/details/equipment.js +52 -0
- package/addon/components/trailer/details/maintenance-history.hbs +47 -0
- package/addon/components/trailer/details/maintenance-history.js +40 -0
- package/addon/components/trailer/details/schedules.hbs +45 -0
- package/addon/components/trailer/details/schedules.js +40 -0
- package/addon/components/trailer/details/work-orders.hbs +47 -0
- package/addon/components/trailer/details/work-orders.js +40 -0
- package/addon/components/trailer/details.hbs +399 -0
- package/addon/components/trailer/details.js +118 -0
- package/addon/components/trailer/form.hbs +447 -0
- package/addon/components/trailer/form.js +165 -0
- package/addon/components/trailer/panel-header.hbs +45 -0
- package/addon/components/trailer/panel-header.js +3 -0
- package/addon/components/trailer/pill.hbs +21 -0
- package/addon/components/trailer/pill.js +3 -0
- package/addon/components/vehicle/card.hbs +42 -11
- package/addon/components/vehicle/card.js +31 -0
- package/addon/components/vehicle/details/equipment.hbs +25 -0
- package/addon/components/vehicle/details/equipment.js +55 -0
- package/addon/components/vehicle/details/trailers.hbs +35 -0
- package/addon/components/vehicle/details/trailers.js +55 -0
- package/addon/components/vehicle/form.hbs +2 -2
- package/addon/components/vehicle/panel-header.hbs +2 -2
- package/addon/components/vehicle/pill.hbs +2 -2
- package/addon/components/vendor/card.hbs +58 -0
- package/addon/components/vendor/card.js +6 -0
- package/addon/components/vendor/panel-header.hbs +2 -2
- package/addon/components/vendor/personnel-manager.hbs +2 -2
- package/addon/components/work-order/form.js +12 -4
- package/addon/controllers/connectivity/devices/index/details/vehicle.js +11 -0
- package/addon/controllers/connectivity/devices/index/details.js +3 -3
- package/addon/controllers/connectivity/devices/index.js +1 -0
- package/addon/controllers/connectivity/telematics/details/attachments.js +28 -47
- package/addon/controllers/connectivity/telematics/details/devices.js +1 -0
- package/addon/controllers/management/contacts/customers.js +4 -0
- package/addon/controllers/management/contacts/index.js +32 -0
- package/addon/controllers/management/trailers/index/details.js +119 -0
- package/addon/controllers/management/trailers/index/edit.js +67 -0
- package/addon/controllers/management/trailers/index/new.js +43 -0
- package/addon/controllers/management/trailers/index.js +599 -0
- package/addon/controllers/management/vehicles/index/details.js +16 -0
- package/addon/controllers/management/vehicles/index.js +78 -4
- package/addon/controllers/management/vendors/index.js +32 -0
- package/addon/controllers/operations/orders/index.js +3 -1
- package/addon/controllers/settings/custom-fields.js +8 -0
- package/addon/extension.js +7 -0
- package/addon/helpers/placeholder-image.js +6 -0
- package/addon/helpers/resource-image.js +10 -0
- package/addon/helpers/trailer-placeholder-image.js +6 -0
- package/addon/routes/management/trailers/index/details/connections.js +2 -0
- package/addon/routes/management/trailers/index/details/devices.js +2 -0
- package/addon/routes/management/trailers/index/details/equipment.js +2 -0
- package/addon/routes/management/trailers/index/details/index.js +2 -0
- package/addon/routes/management/trailers/index/details/maintenance-history.js +2 -0
- package/addon/routes/management/trailers/index/details/positions.js +2 -0
- package/addon/routes/management/trailers/index/details/schedules.js +2 -0
- package/addon/routes/management/trailers/index/details/work-orders.js +2 -0
- package/addon/routes/management/trailers/index/details.js +30 -0
- package/addon/routes/management/trailers/index/edit.js +23 -0
- package/addon/routes/management/trailers/index/new.js +14 -0
- package/addon/routes/management/trailers/index.js +42 -0
- package/addon/routes/management/vehicles/index/details/trailers.js +2 -0
- package/addon/routes/management/vehicles/index.js +7 -1
- package/addon/routes.js +17 -0
- package/addon/services/device-actions.js +26 -16
- package/addon/services/trailer-actions.js +394 -0
- package/addon/services/vehicle-actions.js +111 -0
- package/addon/styles/fleetops-engine.css +349 -0
- package/addon/templates/connectivity/devices/index/details/vehicle.hbs +19 -19
- package/addon/templates/connectivity/telematics/details/attachments.hbs +15 -15
- package/addon/templates/management/contacts/customers.hbs +48 -29
- package/addon/templates/management/contacts/index.hbs +52 -33
- package/addon/templates/management/trailers/index/details/connections.hbs +1 -0
- package/addon/templates/management/trailers/index/details/devices.hbs +1 -0
- package/addon/templates/management/trailers/index/details/equipment.hbs +1 -0
- package/addon/templates/management/trailers/index/details/index.hbs +1 -0
- package/addon/templates/management/trailers/index/details/maintenance-history.hbs +1 -0
- package/addon/templates/management/trailers/index/details/positions.hbs +1 -0
- package/addon/templates/management/trailers/index/details/schedules.hbs +1 -0
- package/addon/templates/management/trailers/index/details/work-orders.hbs +1 -0
- package/addon/templates/management/trailers/index/details.hbs +15 -0
- package/addon/templates/management/trailers/index/edit.hbs +12 -0
- package/addon/templates/management/trailers/index/new.hbs +11 -0
- package/addon/templates/management/trailers/index.hbs +67 -0
- package/addon/templates/management/vehicles/index/details/equipment.hbs +1 -1
- package/addon/templates/management/vehicles/index/details/trailers.hbs +1 -0
- package/addon/templates/management/vehicles/index/details.hbs +1 -1
- package/addon/templates/management/vendors/index.hbs +66 -32
- package/addon/utils/device-table-columns.js +10 -6
- package/addon/utils/live-map-card-content.js +56 -0
- package/addon/utils/placeholder-images.js +71 -0
- package/addon/utils/trailer-placeholder-image.js +11 -0
- package/app/components/attachment-list.js +1 -0
- package/app/components/cell/translated-value.js +1 -0
- package/app/components/contact/card.js +1 -0
- package/app/components/equipment/pill.js +1 -0
- package/app/components/filter/multi-model.js +1 -0
- package/app/components/modals/attach-equipment.js +1 -0
- package/app/components/modals/attach-trailer.js +1 -0
- package/app/components/modals/select-trailer.js +1 -0
- package/app/components/trailer/card.js +1 -0
- package/app/components/trailer/details/connections.js +1 -0
- package/app/components/trailer/details/equipment.js +1 -0
- package/app/components/trailer/details/maintenance-history.js +1 -0
- package/app/components/trailer/details/schedules.js +1 -0
- package/app/components/trailer/details/work-orders.js +1 -0
- package/app/components/trailer/details.js +1 -0
- package/app/components/trailer/form.js +1 -0
- package/app/components/trailer/panel-header.js +1 -0
- package/app/components/trailer/pill.js +1 -0
- package/app/components/vehicle/details/equipment.js +1 -0
- package/app/components/vehicle/details/trailers.js +1 -0
- package/app/components/vendor/card.js +1 -0
- package/app/controllers/management/trailers/index/details.js +1 -0
- package/app/controllers/management/trailers/index/edit.js +1 -0
- package/app/controllers/management/trailers/index/new.js +1 -0
- package/app/controllers/management/trailers/index.js +1 -0
- package/app/helpers/placeholder-image.js +1 -0
- package/app/helpers/resource-image.js +1 -0
- package/app/helpers/trailer-placeholder-image.js +1 -0
- package/app/routes/management/trailers/index/details/connections.js +1 -0
- package/app/routes/management/trailers/index/details/devices.js +1 -0
- package/app/routes/management/trailers/index/details/equipment.js +1 -0
- package/app/routes/management/trailers/index/details/index.js +1 -0
- package/app/routes/management/trailers/index/details/maintenance-history.js +1 -0
- package/app/routes/management/trailers/index/details/positions.js +1 -0
- package/app/routes/management/trailers/index/details/schedules.js +1 -0
- package/app/routes/management/trailers/index/details/work-orders.js +1 -0
- package/app/routes/management/trailers/index/details.js +1 -0
- package/app/routes/management/trailers/index/edit.js +1 -0
- package/app/routes/management/trailers/index/new.js +1 -0
- package/app/routes/management/trailers/index.js +1 -0
- package/app/routes/management/vehicles/index/details/trailers.js +1 -0
- package/app/services/trailer-actions.js +1 -0
- package/app/templates/management/trailers/index/details/connections.js +1 -0
- package/app/templates/management/trailers/index/details/devices.js +1 -0
- package/app/templates/management/trailers/index/details/equipment.js +1 -0
- package/app/templates/management/trailers/index/details/index.js +1 -0
- package/app/templates/management/trailers/index/details/maintenance-history.js +1 -0
- package/app/templates/management/trailers/index/details/positions.js +1 -0
- package/app/templates/management/trailers/index/details/schedules.js +1 -0
- package/app/templates/management/trailers/index/details/work-orders.js +1 -0
- package/app/templates/management/trailers/index/details.js +1 -0
- package/app/templates/management/trailers/index/edit.js +1 -0
- package/app/templates/management/trailers/index/new.js +1 -0
- package/app/templates/management/trailers/index.js +1 -0
- package/app/templates/management/vehicles/index/details/trailers.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +1 -1
- package/server/migrations/2026_09_03_000001_add_first_class_trailer_columns_to_assets_table.php +58 -0
- package/server/migrations/2026_09_03_000002_create_asset_connections_table.php +43 -0
- package/server/migrations/2026_09_03_000003_create_device_installations_table.php +33 -0
- package/server/src/Auth/Schemas/FleetOps.php +7 -0
- package/server/src/Events/TrailerLocationChanged.php +70 -0
- package/server/src/Exceptions/DeviceAlreadyAttachedException.php +18 -0
- package/server/src/Exports/TrailerExport.php +31 -0
- package/server/src/Http/Controllers/Api/v1/Concerns/ResolvesFleetOpsApiResources.php +8 -2
- package/server/src/Http/Controllers/Api/v1/DeviceController.php +22 -15
- package/server/src/Http/Controllers/Api/v1/EquipmentController.php +47 -0
- package/server/src/Http/Controllers/Api/v1/TrailerController.php +362 -0
- package/server/src/Http/Controllers/Api/v1/VehicleController.php +1 -0
- package/server/src/Http/Controllers/Internal/v1/DeviceController.php +3 -0
- package/server/src/Http/Controllers/Internal/v1/LiveController.php +1 -1
- package/server/src/Http/Controllers/Internal/v1/SearchController.php +16 -0
- package/server/src/Http/Controllers/Internal/v1/TrailerController.php +360 -0
- package/server/src/Http/Controllers/Internal/v1/VehicleController.php +74 -0
- package/server/src/Http/Filter/EquipmentFilter.php +51 -0
- package/server/src/Http/Filter/OrderFilter.php +15 -0
- package/server/src/Http/Filter/TrailerFilter.php +269 -0
- package/server/src/Http/Filter/VehicleFilter.php +70 -3
- package/server/src/Http/Requests/CreateDeviceRequest.php +1 -1
- package/server/src/Http/Requests/CreateEquipmentRequest.php +1 -1
- package/server/src/Http/Requests/CreateTrailerRequest.php +54 -0
- package/server/src/Http/Requests/UpdateTrailerRequest.php +7 -0
- package/server/src/Http/Resources/v1/AssetConnection.php +90 -0
- package/server/src/Http/Resources/v1/Concerns/ResolvesPublicRelationFields.php +29 -3
- package/server/src/Http/Resources/v1/Device.php +3 -1
- package/server/src/Http/Resources/v1/Equipment.php +3 -1
- package/server/src/Http/Resources/v1/Fleet.php +3 -1
- package/server/src/Http/Resources/v1/Index/Vehicle.php +10 -0
- package/server/src/Http/Resources/v1/Trailer.php +199 -0
- package/server/src/Http/Resources/v1/Vehicle.php +2 -0
- package/server/src/Http/Resources/v1/VehicleWithoutDriver.php +3 -0
- package/server/src/Imports/TrailerImport.php +33 -0
- package/server/src/Models/Asset.php +39 -10
- package/server/src/Models/AssetConnection.php +43 -0
- package/server/src/Models/Device.php +39 -8
- package/server/src/Models/DeviceInstallation.php +27 -0
- package/server/src/Models/Equipment.php +2 -0
- package/server/src/Models/Trailer.php +181 -0
- package/server/src/Models/Vehicle.php +13 -0
- package/server/src/Providers/FleetOpsServiceProvider.php +4 -2
- package/server/src/Support/Ai/FleetOpsAiQueryResources.php +22 -0
- package/server/src/Support/Reporting/FleetOpsReportSchema.php +38 -0
- package/server/src/Support/Telematics/TelematicService.php +35 -0
- package/server/src/Support/TrailerSummary.php +35 -0
- package/server/src/routes.php +29 -0
- package/server/tests/CompactResourceSerializationTest.php +36 -0
- package/server/tests/ControllerFilterContractsTest.php +29 -0
- package/server/tests/Feature/Http/Api/DeviceControllerContractsTest.php +30 -13
- package/server/tests/Feature/Http/Api/TrailerControllerLifecycleTest.php +640 -0
- package/server/tests/Feature/Http/Api/VehiclePublicContractTest.php +23 -0
- package/server/tests/Feature/Http/Internal/DeviceControllerContractsTest.php +20 -5
- package/server/tests/Feature/Http/Internal/LiveControllerEndpointsTest.php +19 -0
- package/server/tests/ModelAccessorContractsTest.php +10 -0
- package/server/tests/OrderFilterExecutionTest.php +5 -0
- package/server/tests/PublicApiControllerInputContractsTest.php +11 -0
- package/server/tests/PublicFleetOpsRestEndpointsTest.php +15 -3
- package/server/tests/ReportSchemaContractsTest.php +4 -0
- package/server/tests/TelematicsHardeningTest.php +4 -2
- package/server/tests/TrailerSupportCoverageTest.php +524 -0
- package/server/tests/Unit/Http/Resources/FleetResourceTest.php +17 -0
- package/server/tests/Unit/Http/Resources/IndexVehicleResourceTest.php +35 -0
- package/server/tests/Unit/Models/EquipmentTest.php +22 -0
- package/server/tests/Unit/Models/ModelLookupFallbackSeamsTest.php +7 -3
- package/server/tests/Unit/Models/TrailerTest.php +204 -0
- package/server/tests/Unit/Support/Telematics/TelematicServiceTelemetryTest.php +93 -0
- package/server/tests/VehicleControllerHelperContractsTest.php +14 -0
- package/server/tests/VehicleResourceContractsTest.php +39 -0
- package/translations/ar-ae.yml +396 -0
- package/translations/bg-bg.yaml +424 -0
- package/translations/en-us.yaml +423 -0
- package/translations/es-pa.yaml +425 -0
- package/translations/fr-fr.yaml +424 -0
- package/translations/mn-mn.yaml +424 -0
- package/translations/pt-br.yaml +424 -0
- package/translations/ru-ru.yaml +424 -0
- package/translations/vi-vn.yaml +435 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{#let (or @trailer @resource) as |resource|}}
|
|
2
|
+
<Pill
|
|
3
|
+
@resource={{resource}}
|
|
4
|
+
@imageSrc={{resource.photo_url}}
|
|
5
|
+
@imageFallback={{(trailer-placeholder-image)}}
|
|
6
|
+
@showOnlineIndicator={{true}}
|
|
7
|
+
@noTooltip={{true}}
|
|
8
|
+
@onClick={{@onClick}}
|
|
9
|
+
@anchorClass={{@anchorClass}}
|
|
10
|
+
@imageClass={{@imageClass}}
|
|
11
|
+
@imageWrapperClass={{@imageWrapperClass}}
|
|
12
|
+
@contentWrapperClass="min-w-0 {{@contentWrapperClass}}"
|
|
13
|
+
...attributes
|
|
14
|
+
>
|
|
15
|
+
<div class="text-sm truncate {{@titleClass}}">{{or resource.displayName resource.display_name resource.name resource.public_id}}</div>
|
|
16
|
+
<div class="text-xs text-gray-400 dark:text-gray-500 truncate {{@subtitleClass}}">
|
|
17
|
+
{{#if resource.type}}{{t (concat "trailer.types." resource.type)}}{{/if}}
|
|
18
|
+
{{#if (or resource.plate_number resource.vin resource.code)}}<span class="mx-1">·</span>{{or resource.plate_number resource.vin resource.code}}{{/if}}
|
|
19
|
+
</div>
|
|
20
|
+
</Pill>
|
|
21
|
+
{{/let}}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
<Layout::Resource::Card ...attributes as |Card|>
|
|
1
|
+
<Layout::Resource::Card class="fleetops-resource-card vehicle-card" ...attributes as |Card|>
|
|
2
2
|
<Card.header class="{{@headerClass}}">
|
|
3
3
|
<RegistryYield @registry="fleet-ops:component:vehicle:card:header:start" as |RegistryComponent|>
|
|
4
4
|
<RegistryComponent @order={{@resource}} @resource={{@resource}} />
|
|
5
5
|
</RegistryYield>
|
|
6
|
-
<div class="
|
|
6
|
+
<div class="fleetops-card-title">
|
|
7
|
+
<div class="font-semibold flex-1 truncate">{{or @resource.name @resource.yearMakeModel}}</div>
|
|
8
|
+
<FaIcon @icon="circle" @size="xs" class="fleetops-card-title-indicator {{if @resource.online 'text-green-500' 'text-gray-400'}}" />
|
|
9
|
+
</div>
|
|
7
10
|
<div class="text-gray-400 dark:text-gray-500 text-sm w-full truncate">{{or @resource.plate_number @resource.vin @resource.serial_number @resource.call_sign @resource.public_id}}</div>
|
|
8
11
|
{{#if (has-block "header")}}
|
|
9
12
|
{{yield to="header"}}
|
|
@@ -12,8 +15,8 @@
|
|
|
12
15
|
<RegistryComponent @order={{@resource}} @resource={{@resource}} />
|
|
13
16
|
</RegistryYield>
|
|
14
17
|
</Card.header>
|
|
15
|
-
<Card.body class={{@bodyClass}}>
|
|
16
|
-
<Image src={{@resource.photo_url}} class="card-
|
|
18
|
+
<Card.body class="{{@bodyClass}} h-40 overflow-hidden">
|
|
19
|
+
<Image src={{resource-image @resource.photo_url "vehicle"}} @fallbackSrc={{(placeholder-image "vehicle")}} alt={{or @resource.name @resource.yearMakeModel}} class="fleetops-card-image fleetops-card-image--cover" />
|
|
17
20
|
{{#if (has-block "body")}}
|
|
18
21
|
{{yield to="body"}}
|
|
19
22
|
{{/if}}
|
|
@@ -22,10 +25,13 @@
|
|
|
22
25
|
<RegistryYield @registry="fleet-ops:component:vehicle:card:footer:start" as |RegistryComponent|>
|
|
23
26
|
<RegistryComponent @order={{@resource}} @resource={{@resource}} />
|
|
24
27
|
</RegistryYield>
|
|
25
|
-
<div class="flex flex-row items-center
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
28
|
+
<div class="flex flex-row items-center justify-between w-full">
|
|
29
|
+
<Badge @status={{or @resource.status "default"}} @size="xs" />
|
|
30
|
+
<div class="flex flex-row items-center space-x-1">
|
|
31
|
+
<Button @icon="eye" @size="xs" @helpText={{t "common.view"}} @onClick={{fn this.vehicleActions.transition.view @resource}} @permission="fleet-ops view vehicle" />
|
|
32
|
+
<Button @icon="pencil" @size="xs" @helpText={{t "common.edit"}} @onClick={{fn this.vehicleActions.transition.edit @resource}} @permission="fleet-ops update vehicle" />
|
|
33
|
+
<Button @icon="trash" @size="xs" @type="danger" @helpText={{t "common.delete"}} @onClick={{fn this.vehicleActions.delete @resource}} @permission="fleet-ops delete vehicle" />
|
|
34
|
+
</div>
|
|
29
35
|
</div>
|
|
30
36
|
<RegistryYield @registry="fleet-ops:component:vehicle:card:footer:end" as |RegistryComponent|>
|
|
31
37
|
<RegistryComponent @order={{@resource}} @resource={{@resource}} />
|
|
@@ -33,9 +39,34 @@
|
|
|
33
39
|
{{#if (has-block "footer")}}
|
|
34
40
|
{{yield to="footer"}}
|
|
35
41
|
{{/if}}
|
|
36
|
-
<div class="
|
|
37
|
-
<div class="
|
|
42
|
+
<div class="fleetops-card-meta-list">
|
|
43
|
+
<div class="fleetops-card-meta">
|
|
44
|
+
<FaIcon @icon="id-card" @prefix="fas" />
|
|
45
|
+
<span class="fleetops-card-meta-value">
|
|
46
|
+
{{#if this.driverName}}
|
|
47
|
+
{{#if @resource.driver}}
|
|
48
|
+
<a href="javascript:;" class="fleetops-card-meta-link" {{on "click" this.viewDriver}}>{{this.driverName}}</a>
|
|
49
|
+
{{else}}
|
|
50
|
+
{{this.driverName}}
|
|
51
|
+
{{/if}}
|
|
52
|
+
{{else}}
|
|
53
|
+
{{t "common.no-driver-assigned"}}
|
|
54
|
+
{{/if}}
|
|
55
|
+
</span>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="fleetops-card-meta">
|
|
58
|
+
<FaIcon @icon="trailer" @prefix="fas" />
|
|
59
|
+
<span class="fleetops-card-meta-value">
|
|
60
|
+
{{#each @resource.trailers as |trailer index|}}
|
|
61
|
+
{{#if index}}, {{/if}}
|
|
62
|
+
<a href="javascript:;" class="fleetops-card-meta-link" {{on "click" (fn this.viewTrailer trailer)}}>{{trailer.displayName}}</a>
|
|
63
|
+
{{else}}
|
|
64
|
+
{{t "vehicle.empty.trailers"}}
|
|
65
|
+
{{/each}}
|
|
66
|
+
</span>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="fleetops-card-meta">{{t "common.last-modified"}}: {{@resource.updatedAt}}</div>
|
|
38
69
|
</div>
|
|
39
70
|
</Card.footer>
|
|
40
71
|
</Layout::Resource::Card>
|
|
41
|
-
{{yield}}
|
|
72
|
+
{{yield}}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { inject as service } from '@ember/service';
|
|
3
|
+
import { action } from '@ember/object';
|
|
3
4
|
|
|
4
5
|
export default class VehicleCardComponent extends Component {
|
|
5
6
|
@service vehicleActions;
|
|
7
|
+
@service driverActions;
|
|
8
|
+
@service trailerActions;
|
|
9
|
+
|
|
10
|
+
get driverName() {
|
|
11
|
+
const vehicle = this.args.resource;
|
|
12
|
+
|
|
13
|
+
return vehicle?.driver_name ?? vehicle?.driver?.name ?? null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@action viewDriver() {
|
|
17
|
+
const driver = this.args.resource?.driver;
|
|
18
|
+
|
|
19
|
+
if (!driver) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (this.driverActions.panel?.view) {
|
|
24
|
+
return this.driverActions.panel.view(driver);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return this.driverActions.transition.view(driver);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@action viewTrailer(trailer) {
|
|
31
|
+
if (this.trailerActions.panel?.view) {
|
|
32
|
+
return this.trailerActions.panel.view(trailer);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return this.trailerActions.transition.view(trailer);
|
|
36
|
+
}
|
|
6
37
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<AttachmentList
|
|
2
|
+
@title={{t "resource.equipment"}}
|
|
3
|
+
@description={{t "vehicle.equipment.description"}}
|
|
4
|
+
@actionText={{t "vehicle.actions.attach-equipment"}}
|
|
5
|
+
@actionIcon="plus"
|
|
6
|
+
@onAction={{this.attach}}
|
|
7
|
+
@actionPermission="fleet-ops update vehicle"
|
|
8
|
+
@isLoading={{this.loadEquipment.isRunning}}
|
|
9
|
+
@items={{this.equipment}}
|
|
10
|
+
@emptyIcon="toolbox"
|
|
11
|
+
@emptyTitle={{t "vehicle.empty.equipment"}}
|
|
12
|
+
@emptyDescription={{t "vehicle.empty.equipment-description"}}
|
|
13
|
+
class="vehicle-details-equipment"
|
|
14
|
+
>
|
|
15
|
+
<:item as |item|>
|
|
16
|
+
<Equipment::Pill @equipment={{item}} @onClick={{fn this.view item}} />
|
|
17
|
+
{{#if item.status}}
|
|
18
|
+
<Badge @status={{item.status}} @size="xs" class="fleetops-attachment-list-item-badge" />
|
|
19
|
+
{{/if}}
|
|
20
|
+
</:item>
|
|
21
|
+
<:itemActions as |item|>
|
|
22
|
+
<Button @icon="eye" @size="xs" @helpText={{t "common.view"}} @onClick={{fn this.view item}} @permission="fleet-ops view equipment" />
|
|
23
|
+
<Button @icon="unlink" @size="xs" @type="danger" @helpText={{t "vehicle.actions.detach-equipment"}} @onClick={{fn this.detach item}} @permission="fleet-ops update vehicle" />
|
|
24
|
+
</:itemActions>
|
|
25
|
+
</AttachmentList>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Equipment currently equipped to a vehicle, with attach/detach controls.
|
|
9
|
+
*/
|
|
10
|
+
export default class VehicleDetailsEquipmentComponent extends Component {
|
|
11
|
+
@service store;
|
|
12
|
+
@service notifications;
|
|
13
|
+
@service equipmentActions;
|
|
14
|
+
@service vehicleActions;
|
|
15
|
+
@tracked equipment = [];
|
|
16
|
+
|
|
17
|
+
get vehicle() {
|
|
18
|
+
return this.args.resource ?? this.args.vehicle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.loadEquipment.perform();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@task *loadEquipment() {
|
|
27
|
+
try {
|
|
28
|
+
const equipment = yield this.store.query('equipment', {
|
|
29
|
+
equipable_type: 'fleet-ops:vehicle',
|
|
30
|
+
equipable: this.vehicle.public_id ?? this.vehicle.id,
|
|
31
|
+
sort: '-created_at',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
this.equipment = Array.from(equipment ?? []);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
this.notifications.serverError(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@action attach() {
|
|
41
|
+
return this.vehicleActions.attachEquipment(this.vehicle, { callback: () => this.loadEquipment.perform() });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@action detach(equipment) {
|
|
45
|
+
return this.vehicleActions.detachEquipment(this.vehicle, equipment, { callback: () => this.loadEquipment.perform() });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@action view(equipment) {
|
|
49
|
+
if (this.equipmentActions.panel?.view) {
|
|
50
|
+
return this.equipmentActions.panel.view(equipment);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this.equipmentActions.transition.view(equipment);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<AttachmentList
|
|
2
|
+
@title={{t "resource.trailers"}}
|
|
3
|
+
@description={{t "vehicle.trailers.description"}}
|
|
4
|
+
@actionText={{t "vehicle.actions.attach-trailer"}}
|
|
5
|
+
@actionIcon="link"
|
|
6
|
+
@onAction={{this.attach}}
|
|
7
|
+
@actionPermission="fleet-ops attach-vehicle-for trailer"
|
|
8
|
+
@isLoading={{this.loadTrailers.isRunning}}
|
|
9
|
+
@items={{this.trailers}}
|
|
10
|
+
@emptyIcon="trailer"
|
|
11
|
+
@emptyTitle={{t "vehicle.empty.trailers"}}
|
|
12
|
+
@emptyDescription={{t "vehicle.empty.trailers-description"}}
|
|
13
|
+
class="vehicle-details-trailers"
|
|
14
|
+
>
|
|
15
|
+
<:item as |trailer|>
|
|
16
|
+
<Trailer::Pill @trailer={{trailer}} @onClick={{fn this.view trailer}} />
|
|
17
|
+
<div class="fleetops-attachment-list-item-meta">
|
|
18
|
+
{{#if trailer.current_connection.position}}
|
|
19
|
+
<span class="fleetops-attachment-list-item-meta-entry">
|
|
20
|
+
<FaIcon @icon="arrow-down-1-9" class="mr-1" />{{t "trailer.attachment.position" position=trailer.current_connection.position}}
|
|
21
|
+
</span>
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#if trailer.attached_at}}
|
|
24
|
+
<span class="fleetops-attachment-list-item-meta-entry">
|
|
25
|
+
<FaIcon @icon="link" class="mr-1" />{{t "trailer.connections.connected" date=(format-date-fns trailer.attached_at "dd MMM yyyy, HH:mm")}}
|
|
26
|
+
</span>
|
|
27
|
+
{{/if}}
|
|
28
|
+
<Badge @status={{or trailer.connectivity_status "never_connected"}} @size="xs" @text={{t (concat "trailer.connectivity." (or trailer.connectivity_status "never_connected"))}} />
|
|
29
|
+
</div>
|
|
30
|
+
</:item>
|
|
31
|
+
<:itemActions as |trailer|>
|
|
32
|
+
<Button @icon="eye" @size="xs" @helpText={{t "common.view"}} @onClick={{fn this.view trailer}} @permission="fleet-ops view trailer" />
|
|
33
|
+
<Button @icon="unlink" @size="xs" @type="danger" @helpText={{t "trailer.actions.detach-vehicle"}} @onClick={{fn this.detach trailer}} @permission="fleet-ops detach-vehicle-for trailer" />
|
|
34
|
+
</:itemActions>
|
|
35
|
+
</AttachmentList>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Trailers currently coupled to a vehicle, with attach/detach controls.
|
|
9
|
+
*/
|
|
10
|
+
export default class VehicleDetailsTrailersComponent extends Component {
|
|
11
|
+
@service store;
|
|
12
|
+
@service notifications;
|
|
13
|
+
@service trailerActions;
|
|
14
|
+
@service vehicleActions;
|
|
15
|
+
@tracked trailers = [];
|
|
16
|
+
|
|
17
|
+
get vehicle() {
|
|
18
|
+
return this.args.resource ?? this.args.vehicle;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.loadTrailers.perform();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@task *loadTrailers() {
|
|
27
|
+
try {
|
|
28
|
+
const trailers = yield this.store.query('trailer', {
|
|
29
|
+
vehicle: this.vehicle.id,
|
|
30
|
+
attachment_state: 'attached',
|
|
31
|
+
sort: '-created_at',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
this.trailers = Array.from(trailers ?? []);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
this.notifications.serverError(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@action attach() {
|
|
41
|
+
return this.vehicleActions.attachTrailer(this.vehicle, { callback: () => this.loadTrailers.perform() });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@action detach(trailer) {
|
|
45
|
+
return this.trailerActions.detachVehicle(trailer, { callback: () => this.loadTrailers.perform() });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@action view(trailer) {
|
|
49
|
+
if (this.trailerActions.panel?.view) {
|
|
50
|
+
return this.trailerActions.panel.view(trailer);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return this.trailerActions.transition.view(trailer);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<div class="flex flex-row space-x-3 mb-3">
|
|
9
9
|
<div class="flex items-center justify-start rounded-full">
|
|
10
10
|
<Image
|
|
11
|
-
src={{@resource.photo_url}}
|
|
12
|
-
@fallbackSrc={{
|
|
11
|
+
src={{resource-image @resource.photo_url "vehicle"}}
|
|
12
|
+
@fallbackSrc={{(placeholder-image "vehicle")}}
|
|
13
13
|
alt={{@resource.name}}
|
|
14
14
|
height="48"
|
|
15
15
|
width="48"
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<div class="flex flex-row space-x-3">
|
|
4
4
|
<div class="flex items-start justify-start rounded-full">
|
|
5
5
|
<Image
|
|
6
|
-
src={{@resource.photo_url}}
|
|
7
|
-
@fallbackSrc={{
|
|
6
|
+
src={{resource-image @resource.photo_url "vehicle"}}
|
|
7
|
+
@fallbackSrc={{(placeholder-image "vehicle")}}
|
|
8
8
|
alt={{@resource.displayName}}
|
|
9
9
|
height="48"
|
|
10
10
|
width="48"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<Pill
|
|
2
2
|
@this.resource={{this.resource}}
|
|
3
|
-
@imageSrc={{this.resource.photo_url}}
|
|
4
|
-
@
|
|
3
|
+
@imageSrc={{resource-image this.resource.photo_url "vehicle"}}
|
|
4
|
+
@imageFallback={{(placeholder-image "vehicle")}}
|
|
5
5
|
@showOnlineIndicator={{if this.resource true false}}
|
|
6
6
|
@noTooltip={{not this.resource}}
|
|
7
7
|
@onClick={{@onClick}}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<Layout::Resource::Card class="fleetops-resource-card vendor-card" ...attributes as |Card|>
|
|
2
|
+
<Card.header class={{@headerClass}}>
|
|
3
|
+
<RegistryYield @registry="fleet-ops:component:vendor:card:header:start" as |RegistryComponent|>
|
|
4
|
+
<RegistryComponent @resource={{@resource}} />
|
|
5
|
+
</RegistryYield>
|
|
6
|
+
<div class="fleetops-card-title">
|
|
7
|
+
<div class="font-semibold flex-1 truncate">{{n-a @resource.name}}</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="text-gray-400 dark:text-gray-500 text-sm w-full truncate">{{n-a @resource.internal_id @resource.business_id @resource.public_id}}</div>
|
|
10
|
+
{{#if (has-block "header")}}
|
|
11
|
+
{{yield to="header"}}
|
|
12
|
+
{{/if}}
|
|
13
|
+
<RegistryYield @registry="fleet-ops:component:vendor:card:header:end" as |RegistryComponent|>
|
|
14
|
+
<RegistryComponent @resource={{@resource}} />
|
|
15
|
+
</RegistryYield>
|
|
16
|
+
</Card.header>
|
|
17
|
+
<Card.body class="{{@bodyClass}} h-40 overflow-hidden">
|
|
18
|
+
<Image src={{resource-image @resource.logo_url "vendor"}} @fallbackSrc={{(placeholder-image "vendor")}} alt={{@resource.name}} class="fleetops-card-image fleetops-card-image--cover" />
|
|
19
|
+
{{#if (has-block "body")}}
|
|
20
|
+
{{yield to="body"}}
|
|
21
|
+
{{/if}}
|
|
22
|
+
</Card.body>
|
|
23
|
+
<Card.footer class={{@footerClass}}>
|
|
24
|
+
<RegistryYield @registry="fleet-ops:component:vendor:card:footer:start" as |RegistryComponent|>
|
|
25
|
+
<RegistryComponent @resource={{@resource}} />
|
|
26
|
+
</RegistryYield>
|
|
27
|
+
<div class="flex flex-row items-center justify-between w-full">
|
|
28
|
+
<Badge @status={{or @resource.status "default"}} @size="xs" />
|
|
29
|
+
<div class="flex flex-row items-center space-x-1">
|
|
30
|
+
<Button @icon="eye" @size="xs" @helpText={{t "common.view"}} @onClick={{fn this.vendorActions.transition.view @resource}} @permission="fleet-ops view vendor" />
|
|
31
|
+
<Button @icon="pencil" @size="xs" @helpText={{t "common.edit"}} @onClick={{fn this.vendorActions.transition.edit @resource}} @permission="fleet-ops update vendor" />
|
|
32
|
+
<Button @icon="trash" @size="xs" @type="danger" @helpText={{t "common.delete"}} @onClick={{fn this.vendorActions.delete @resource}} @permission="fleet-ops delete vendor" />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<RegistryYield @registry="fleet-ops:component:vendor:card:footer:end" as |RegistryComponent|>
|
|
36
|
+
<RegistryComponent @resource={{@resource}} />
|
|
37
|
+
</RegistryYield>
|
|
38
|
+
{{#if (has-block "footer")}}
|
|
39
|
+
{{yield to="footer"}}
|
|
40
|
+
{{/if}}
|
|
41
|
+
<div class="fleetops-card-meta-list">
|
|
42
|
+
<div class="fleetops-card-meta">
|
|
43
|
+
<FaIcon @icon="envelope" @prefix="fas" />
|
|
44
|
+
<span class="fleetops-card-meta-value">{{#if @resource.email}}<a href="mailto:{{@resource.email}}" class="fleetops-card-meta-link">{{@resource.email}}</a>{{else}}-{{/if}}</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="fleetops-card-meta">
|
|
47
|
+
<FaIcon @icon="phone" @prefix="fas" />
|
|
48
|
+
<span class="fleetops-card-meta-value">{{#if @resource.phone}}<a href="tel:{{@resource.phone}}" class="fleetops-card-meta-link">{{@resource.phone}}</a>{{else}}-{{/if}}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="fleetops-card-meta">
|
|
51
|
+
<FaIcon @icon="location-dot" @prefix="fas" />
|
|
52
|
+
<span class="fleetops-card-meta-value">{{n-a @resource.address @resource.place.address @resource.country}}</span>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="fleetops-card-meta">{{t "common.last-modified"}}: {{@resource.updatedAt}}</div>
|
|
55
|
+
</div>
|
|
56
|
+
</Card.footer>
|
|
57
|
+
</Layout::Resource::Card>
|
|
58
|
+
{{yield}}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<div class="flex min-w-0 flex-row items-start gap-3">
|
|
4
4
|
<div class="relative flex flex-shrink-0 items-start justify-start">
|
|
5
5
|
<Image
|
|
6
|
-
src={{this.imageUrl}}
|
|
7
|
-
@fallbackSrc={{
|
|
6
|
+
src={{resource-image this.imageUrl "vendor"}}
|
|
7
|
+
@fallbackSrc={{(placeholder-image "vendor")}}
|
|
8
8
|
alt={{this.name}}
|
|
9
9
|
height="48"
|
|
10
10
|
width="48"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
>
|
|
45
45
|
<div class="flex flex-row items-center">
|
|
46
46
|
<div class="mr-2 w-6">
|
|
47
|
-
<Image src={{model.photo_url}} @fallbackSrc={{
|
|
47
|
+
<Image src={{resource-image model.photo_url "contact"}} @fallbackSrc={{(placeholder-image "contact")}} alt={{model.name}} class="h-6 w-6 rounded-md" />
|
|
48
48
|
</div>
|
|
49
49
|
<div class="min-w-0">
|
|
50
50
|
<div class="truncate font-semibold">{{model.name}}</div>
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
{{#each this.personnels as |personnel|}}
|
|
136
136
|
<div class="grid grid-cols-12 items-center border-b border-gray-100 px-3 py-2 text-xs last:border-b-0 dark:border-gray-700 dark:text-gray-100">
|
|
137
137
|
<div class="col-span-6 flex min-w-0 items-center">
|
|
138
|
-
<Image src={{personnel.photo_url}} @fallbackSrc={{
|
|
138
|
+
<Image src={{resource-image personnel.photo_url "contact"}} @fallbackSrc={{(placeholder-image "contact")}} alt={{personnel.name}} class="mr-2 h-7 w-7 rounded-md" />
|
|
139
139
|
<div class="min-w-0">
|
|
140
140
|
<div class="truncate font-semibold">{{or personnel.name personnel.public_id}}</div>
|
|
141
141
|
<div class="truncate text-gray-500 dark:text-gray-400">{{n-a personnel.email}} {{n-a personnel.phone}}</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
+
import { inject as service } from '@ember/service';
|
|
4
5
|
import { workOrderCategories, workOrderStatuses } from '../../utils/fleet-ops-options';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -9,6 +10,7 @@ import { workOrderCategories, workOrderStatuses } from '../../utils/fleet-ops-op
|
|
|
9
10
|
*/
|
|
10
11
|
const TYPE_TO_MODEL = {
|
|
11
12
|
'fleet-ops:vehicle': 'vehicle',
|
|
13
|
+
'fleet-ops:trailer': 'trailer',
|
|
12
14
|
'fleet-ops:equipment': 'equipment',
|
|
13
15
|
'fleet-ops:vendor': 'vendor',
|
|
14
16
|
'fleet-ops:contact': 'contact',
|
|
@@ -22,9 +24,11 @@ const TYPE_TO_MODEL = {
|
|
|
22
24
|
*/
|
|
23
25
|
const TARGET_MODEL_TO_TYPE = {
|
|
24
26
|
'maintenance-subject-vehicle': 'fleet-ops:vehicle',
|
|
27
|
+
'maintenance-subject-trailer': 'fleet-ops:trailer',
|
|
25
28
|
'maintenance-subject-equipment': 'fleet-ops:equipment',
|
|
26
29
|
// Fall-through for raw models passed from vehicle-actions.js
|
|
27
30
|
vehicle: 'fleet-ops:vehicle',
|
|
31
|
+
trailer: 'fleet-ops:trailer',
|
|
28
32
|
equipment: 'fleet-ops:equipment',
|
|
29
33
|
};
|
|
30
34
|
|
|
@@ -42,6 +46,7 @@ const ASSIGNEE_MODEL_TO_TYPE = {
|
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export default class WorkOrderFormComponent extends Component {
|
|
49
|
+
@service intl;
|
|
45
50
|
/** Status options for work orders. */
|
|
46
51
|
statusOptions = workOrderStatuses;
|
|
47
52
|
|
|
@@ -54,10 +59,13 @@ export default class WorkOrderFormComponent extends Component {
|
|
|
54
59
|
/**
|
|
55
60
|
* Polymorphic target type options — the asset a work order is raised against.
|
|
56
61
|
*/
|
|
57
|
-
targetTypeOptions
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
get targetTypeOptions() {
|
|
63
|
+
return [
|
|
64
|
+
{ value: 'fleet-ops:vehicle', label: this.intl.t('resource.vehicle') },
|
|
65
|
+
{ value: 'fleet-ops:trailer', label: this.intl.t('resource.trailer') },
|
|
66
|
+
{ value: 'fleet-ops:equipment', label: this.intl.t('resource.equipment') },
|
|
67
|
+
];
|
|
68
|
+
}
|
|
61
69
|
|
|
62
70
|
/**
|
|
63
71
|
* Polymorphic assignee type options — who is responsible for completing
|
|
@@ -9,6 +9,7 @@ export default class ConnectivityDevicesIndexDetailsVehicleController extends Co
|
|
|
9
9
|
@service intl;
|
|
10
10
|
@service mapManager;
|
|
11
11
|
@service vehicleActions;
|
|
12
|
+
@service trailerActions;
|
|
12
13
|
|
|
13
14
|
@tracked queryParams = [];
|
|
14
15
|
|
|
@@ -20,6 +21,10 @@ export default class ConnectivityDevicesIndexDetailsVehicleController extends Co
|
|
|
20
21
|
return this.device?.attachable;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
get isTrailer() {
|
|
25
|
+
return `${this.device?.attachable_type ?? ''}`.toLowerCase().includes('trailer');
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
get positions() {
|
|
24
29
|
return Array.from(this.model?.positions ?? []);
|
|
25
30
|
}
|
|
@@ -86,12 +91,18 @@ export default class ConnectivityDevicesIndexDetailsVehicleController extends Co
|
|
|
86
91
|
|
|
87
92
|
@action openVehicle() {
|
|
88
93
|
if (this.vehicle?.id) {
|
|
94
|
+
if (this.isTrailer) {
|
|
95
|
+
return this.trailerActions.transition.view(this.vehicle);
|
|
96
|
+
}
|
|
89
97
|
return this.hostRouter.transitionTo('console.fleet-ops.management.vehicles.index.details', this.vehicle.public_id);
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
@action openVehiclePositions() {
|
|
94
102
|
if (this.vehicle?.id) {
|
|
103
|
+
if (this.isTrailer) {
|
|
104
|
+
return this.hostRouter.transitionTo('console.fleet-ops.management.trailers.index.details.positions', this.vehicle.public_id);
|
|
105
|
+
}
|
|
95
106
|
return this.hostRouter.transitionTo('console.fleet-ops.management.vehicles.index.details.positions', this.vehicle.public_id);
|
|
96
107
|
}
|
|
97
108
|
}
|
|
@@ -17,7 +17,7 @@ export default class ConnectivityDevicesIndexDetailsController extends Controlle
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
route: 'connectivity.devices.index.details.vehicle',
|
|
20
|
-
label: this.intl.t('
|
|
20
|
+
label: this.intl.t('device.attachment.asset'),
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
route: 'connectivity.devices.index.details.sensors',
|
|
@@ -44,7 +44,7 @@ export default class ConnectivityDevicesIndexDetailsController extends Controlle
|
|
|
44
44
|
renderInPlace: true,
|
|
45
45
|
items: [
|
|
46
46
|
{
|
|
47
|
-
text: this.intl.t('device.actions.attach-to-
|
|
47
|
+
text: this.intl.t('device.actions.attach-to-asset'),
|
|
48
48
|
icon: 'link',
|
|
49
49
|
fn: () => this.deviceActions.attachToVehicle(this.model),
|
|
50
50
|
permission: 'fleet-ops update device',
|
|
@@ -52,7 +52,7 @@ export default class ConnectivityDevicesIndexDetailsController extends Controlle
|
|
|
52
52
|
...(this.model.attachable_uuid || this.model.attached_to_name || this.model.attachable
|
|
53
53
|
? [
|
|
54
54
|
{
|
|
55
|
-
text: this.intl.t('device.
|
|
55
|
+
text: this.intl.t('device.attachment.detach'),
|
|
56
56
|
icon: 'unlink',
|
|
57
57
|
fn: () => this.deviceActions.detachFromVehicle(this.model),
|
|
58
58
|
permission: 'fleet-ops update device',
|