@fleetbase/fleetops-engine 0.6.65 → 0.6.66
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 +11 -6
- package/addon/components/ai/create-order-preview.hbs +10 -5
- package/addon/components/asset/pill.hbs +24 -0
- package/addon/components/asset/summary.hbs +1 -0
- package/addon/components/asset-connection/pill.hbs +24 -0
- package/addon/components/asset-connection/summary.hbs +1 -0
- package/addon/components/attachable/pill.hbs +24 -0
- package/addon/components/attachable/summary.hbs +1 -0
- package/addon/components/cell/asset-connection-identity.hbs +1 -0
- package/addon/components/cell/asset-identity.hbs +1 -0
- package/addon/components/cell/attachable-identity.hbs +1 -0
- package/addon/components/cell/contact-identity.hbs +1 -0
- package/addon/components/cell/customer-identity.hbs +1 -0
- package/addon/components/cell/device-event-identity.hbs +1 -0
- package/addon/components/cell/device-identity.hbs +1 -24
- package/addon/components/cell/driver-identity.hbs +1 -33
- package/addon/components/cell/entity-identity.hbs +1 -0
- package/addon/components/cell/equipment-identity.hbs +1 -5
- package/addon/components/cell/facilitator-identity.hbs +1 -0
- package/addon/components/cell/fleet-driver-identity.hbs +1 -0
- package/addon/components/cell/fleet-identity.hbs +1 -0
- package/addon/components/cell/fuel-provider-connection-identity.hbs +1 -0
- package/addon/components/cell/fuel-provider-transaction-identity.hbs +1 -0
- package/addon/components/cell/fuel-report-identity.hbs +1 -0
- package/addon/components/cell/inspection-form-identity.hbs +1 -0
- package/addon/components/cell/inspection-item-result-identity.hbs +1 -0
- package/addon/components/cell/inspection-submission-identity.hbs +1 -0
- package/addon/components/cell/integrated-vendor-identity.hbs +1 -0
- package/addon/components/cell/issue-identity.hbs +1 -0
- package/addon/components/cell/maintenance-identity.hbs +1 -0
- package/addon/components/cell/maintenance-schedule-identity.hbs +1 -0
- package/addon/components/cell/maintenance-subject-identity.hbs +1 -0
- package/addon/components/cell/manifest-identity.hbs +1 -0
- package/addon/components/cell/manifest-stop-identity.hbs +1 -0
- package/addon/components/cell/order-config-identity.hbs +1 -0
- package/addon/components/cell/order-identity.hbs +1 -0
- package/addon/components/cell/part-identity.hbs +1 -5
- package/addon/components/cell/payload-identity.hbs +1 -0
- package/addon/components/cell/place-identity.hbs +1 -0
- package/addon/components/cell/position-identity.hbs +1 -0
- package/addon/components/cell/purchase-rate-identity.hbs +1 -0
- package/addon/components/cell/recurring-order-schedule-identity.hbs +1 -0
- package/addon/components/cell/resource-list.hbs +10 -0
- package/addon/components/cell/resource-list.js +28 -0
- package/addon/components/cell/route-identity.hbs +1 -0
- package/addon/components/cell/sensor-identity.hbs +1 -0
- package/addon/components/cell/service-area-identity.hbs +1 -0
- package/addon/components/cell/service-quote-identity.hbs +1 -0
- package/addon/components/cell/service-quote-item-identity.hbs +1 -0
- package/addon/components/cell/service-rate-fee-identity.hbs +1 -0
- package/addon/components/cell/service-rate-identity.hbs +1 -0
- package/addon/components/cell/service-rate-parcel-fee-identity.hbs +1 -0
- package/addon/components/cell/telematic-identity.hbs +1 -0
- package/addon/components/cell/tracking-number-identity.hbs +1 -0
- package/addon/components/cell/tracking-status-identity.hbs +1 -0
- package/addon/components/cell/trailer-identity.hbs +1 -0
- package/addon/components/cell/vehicle-device-identity.hbs +1 -0
- package/addon/components/cell/vehicle-identity.hbs +1 -33
- package/addon/components/cell/vendor-identity.hbs +1 -0
- package/addon/components/cell/warranty-identity.hbs +1 -0
- package/addon/components/cell/waypoint-identity.hbs +1 -0
- package/addon/components/cell/work-order-identity.hbs +1 -0
- package/addon/components/cell/zone-identity.hbs +1 -0
- package/addon/components/contact/form.hbs +2 -4
- package/addon/components/contact/pill.hbs +24 -0
- package/addon/components/contact/summary.hbs +1 -0
- package/addon/components/customer/create-order-form.hbs +8 -4
- package/addon/components/customer/form.hbs +2 -4
- package/addon/components/customer/order-form.hbs +10 -8
- package/addon/components/customer/pill.hbs +24 -0
- package/addon/components/customer/summary.hbs +1 -0
- package/addon/components/device/details.hbs +3 -1
- package/addon/components/device/form.hbs +4 -13
- package/addon/components/device/panel-header.hbs +3 -2
- package/addon/components/device/panel-header.js +1 -5
- package/addon/components/device/panel-tabs/vehicle.hbs +2 -2
- package/addon/components/device/pill.hbs +24 -16
- package/addon/components/device/summary.hbs +1 -0
- package/addon/components/device/telemetry.hbs +17 -0
- package/addon/components/device/telemetry.js +117 -0
- package/addon/components/device-event/details.hbs +6 -24
- package/addon/components/device-event/pill.hbs +24 -0
- package/addon/components/device-event/summary.hbs +1 -0
- package/addon/components/driver/details.hbs +9 -1
- package/addon/components/driver/form.hbs +6 -18
- package/addon/components/driver/panel-header.hbs +3 -4
- package/addon/components/driver/panel-header.js +8 -1
- package/addon/components/driver/pill.hbs +16 -8
- package/addon/components/driver/summary.hbs +1 -0
- package/addon/components/entity/pill.hbs +24 -0
- package/addon/components/entity/summary.hbs +1 -0
- package/addon/components/equipment/details.hbs +6 -2
- package/addon/components/equipment/form.hbs +10 -4
- package/addon/components/equipment/pill.hbs +24 -20
- package/addon/components/equipment/summary.hbs +1 -0
- package/addon/components/facilitator/pill.hbs +24 -0
- package/addon/components/facilitator/summary.hbs +1 -0
- package/addon/components/fleet/details.hbs +6 -2
- package/addon/components/fleet/driver-listing.hbs +3 -12
- package/addon/components/fleet/form.hbs +8 -4
- package/addon/components/fleet/pill.hbs +24 -0
- package/addon/components/fleet/summary.hbs +1 -0
- package/addon/components/fleet/vehicle-listing.hbs +3 -12
- package/addon/components/fleet-driver/pill.hbs +24 -0
- package/addon/components/fleet-driver/summary.hbs +1 -0
- package/addon/components/fleet-driver-listing.hbs +2 -1
- package/addon/components/fleet-panel/details.hbs +6 -2
- package/addon/components/fleet-panel/driver-listing.hbs +2 -1
- package/addon/components/fleet-panel/vehicle-listing.hbs +2 -1
- package/addon/components/fleet-vehicle-listing.hbs +2 -1
- package/addon/components/fuel-integration/form.hbs +125 -25
- package/addon/components/fuel-integration/form.js +74 -19
- package/addon/components/fuel-integration/hub.hbs +68 -65
- package/addon/components/fuel-integration/hub.js +15 -19
- package/addon/components/fuel-provider-connection/pill.hbs +24 -0
- package/addon/components/fuel-provider-connection/summary.hbs +1 -0
- package/addon/components/fuel-provider-transaction/pill.hbs +24 -0
- package/addon/components/fuel-provider-transaction/summary.hbs +1 -0
- package/addon/components/fuel-report/details.hbs +9 -3
- package/addon/components/fuel-report/form.hbs +6 -3
- package/addon/components/fuel-report/pill.hbs +24 -0
- package/addon/components/fuel-report/summary.hbs +1 -0
- package/addon/components/fuel-transaction-status.hbs +1 -0
- package/addon/components/fuel-transaction-status.js +8 -0
- package/addon/components/geofence-map.hbs +19 -0
- package/addon/components/geofence-map.js +83 -0
- package/addon/components/inspection-field/form.hbs +103 -0
- package/addon/components/inspection-field/form.js +211 -0
- package/addon/components/inspection-field/input.hbs +270 -0
- package/addon/components/inspection-field/input.js +472 -0
- package/addon/components/inspection-field/value.hbs +90 -0
- package/addon/components/inspection-field/value.js +158 -0
- package/addon/components/inspection-flyout.hbs +34 -0
- package/addon/components/inspection-flyout.js +66 -0
- package/addon/components/inspection-form/builder.hbs +88 -0
- package/addon/components/inspection-form/builder.js +211 -0
- package/addon/components/inspection-form/details/submissions.hbs +48 -0
- package/addon/components/inspection-form/details/submissions.js +42 -0
- package/addon/components/inspection-form/details.hbs +97 -0
- package/addon/components/inspection-form/details.js +57 -0
- package/addon/components/inspection-form/form.hbs +93 -0
- package/addon/components/inspection-form/form.js +79 -0
- package/addon/components/inspection-form/pill.hbs +24 -0
- package/addon/components/inspection-form/summary.hbs +1 -0
- package/addon/components/inspection-item-result/pill.hbs +24 -0
- package/addon/components/inspection-item-result/summary.hbs +1 -0
- package/addon/components/inspection-link/list.hbs +94 -0
- package/addon/components/inspection-link/list.js +129 -0
- package/addon/components/inspection-sheet/group.hbs +45 -0
- package/addon/components/inspection-sheet/group.js +75 -0
- package/addon/components/inspection-sheet.hbs +77 -0
- package/addon/components/inspection-sheet.js +152 -0
- package/addon/components/inspection-submission/details.hbs +149 -0
- package/addon/components/inspection-submission/details.js +130 -0
- package/addon/components/inspection-submission/form.hbs +114 -0
- package/addon/components/inspection-submission/form.js +129 -0
- package/addon/components/inspection-submission/photos.hbs +20 -0
- package/addon/components/inspection-submission/photos.js +57 -0
- package/addon/components/inspection-submission/pill.hbs +24 -0
- package/addon/components/inspection-submission/summary.hbs +1 -0
- package/addon/components/integrated-vendor/pill.hbs +24 -0
- package/addon/components/integrated-vendor/summary.hbs +1 -0
- package/addon/components/issue/details.hbs +12 -0
- package/addon/components/issue/details.js +36 -0
- package/addon/components/issue/form.hbs +10 -5
- package/addon/components/issue/pill.hbs +24 -0
- package/addon/components/issue/summary.hbs +1 -0
- package/addon/components/layout/fleet-ops-sidebar.js +14 -3
- package/addon/components/maintenance/details.hbs +9 -3
- package/addon/components/maintenance/form.hbs +22 -3
- package/addon/components/maintenance/form.js +4 -4
- package/addon/components/maintenance/panel-header.hbs +14 -12
- package/addon/components/maintenance/pill.hbs +24 -0
- package/addon/components/maintenance/summary.hbs +1 -0
- package/addon/components/maintenance-schedule/details.hbs +7 -3
- package/addon/components/maintenance-schedule/form.hbs +20 -2
- package/addon/components/maintenance-schedule/form.js +6 -6
- package/addon/components/maintenance-schedule/pill.hbs +24 -0
- package/addon/components/maintenance-schedule/summary.hbs +1 -0
- package/addon/components/maintenance-schedule/work-orders.hbs +39 -0
- package/addon/components/maintenance-schedule/work-orders.js +37 -0
- package/addon/components/maintenance-subject/pill.hbs +24 -0
- package/addon/components/maintenance-subject/summary.hbs +1 -0
- package/addon/components/manifest/pill.hbs +24 -0
- package/addon/components/manifest/summary.hbs +1 -0
- package/addon/components/manifest-stop/pill.hbs +24 -0
- package/addon/components/manifest-stop/summary.hbs +1 -0
- package/addon/components/map/drawer/device-event-listing.hbs +4 -14
- package/addon/components/map/drawer/device-event-listing.js +3 -1
- package/addon/components/map/drawer/driver-listing.js +6 -2
- package/addon/components/map/drawer/position-listing.hbs +2 -16
- package/addon/components/map/drawer/vehicle-listing.js +1 -2
- package/addon/components/modals/add-driver-shift.hbs +2 -1
- package/addon/components/modals/assign-driver.hbs +2 -16
- package/addon/components/modals/attach-device.hbs +2 -1
- package/addon/components/modals/attach-equipment.hbs +2 -4
- package/addon/components/modals/attach-telematic-device.hbs +8 -1
- package/addon/components/modals/attach-trailer.hbs +2 -1
- package/addon/components/modals/bulk-assign-driver.hbs +2 -9
- package/addon/components/modals/bulk-assign-orders.hbs +2 -9
- package/addon/components/modals/driver-assign-order.hbs +2 -6
- package/addon/components/modals/driver-assign-vehicle.hbs +4 -12
- package/addon/components/modals/driver-assign-vehicle.js +30 -0
- package/addon/components/modals/driver-assign-vendor.hbs +2 -1
- package/addon/components/modals/driver-form.hbs +4 -2
- package/addon/components/modals/fleet-assign-driver.hbs +2 -1
- package/addon/components/modals/fleet-assign-vehicle.hbs +2 -1
- package/addon/components/modals/fleet-form.hbs +4 -2
- package/addon/components/modals/fuel-connection-diagnostics.hbs +35 -0
- package/addon/components/modals/fuel-connection-diagnostics.js +87 -0
- package/addon/components/modals/fuel-report-form.hbs +4 -2
- package/addon/components/modals/fuel-transaction-action.hbs +48 -0
- package/addon/components/modals/fuel-transaction-action.js +98 -0
- package/addon/components/modals/group-form.hbs +2 -1
- package/addon/components/modals/inspection-follow-up.hbs +31 -0
- package/addon/components/modals/inspection-follow-up.js +39 -0
- package/addon/components/modals/inspection-link.hbs +100 -0
- package/addon/components/modals/inspection-link.js +83 -0
- package/addon/components/modals/issue-assign.hbs +2 -1
- package/addon/components/modals/issue-from.hbs +8 -4
- package/addon/components/modals/map-layer-form.hbs +2 -1
- package/addon/components/modals/order-assign-driver.hbs +2 -16
- package/addon/components/modals/order-form.hbs +8 -46
- package/addon/components/modals/order-route-form.hbs +8 -4
- package/addon/components/modals/place-assign-vendor.hbs +3 -2
- package/addon/components/modals/place-details.hbs +1 -1
- package/addon/components/modals/point-map.hbs +1 -1
- package/addon/components/modals/radar-notice.hbs +24 -0
- package/addon/components/modals/radar-notice.js +8 -0
- package/addon/components/modals/radar-save-view.hbs +7 -0
- package/addon/components/modals/radar-select-resource.hbs +35 -0
- package/addon/components/modals/radar-send-pin.hbs +20 -0
- package/addon/components/modals/radar-send-pin.js +8 -0
- package/addon/components/modals/select-trailer.hbs +2 -4
- package/addon/components/modals/vehicle-form.hbs +2 -1
- package/addon/components/modals/vendor-form.hbs +2 -3
- package/addon/components/order/details/activity.js +9 -0
- package/addon/components/order/details/detail.hbs +2 -32
- package/addon/components/order/form/details.hbs +10 -48
- package/addon/components/order/form/route.hbs +10 -12
- package/addon/components/order/form/service-rate.hbs +2 -3
- package/addon/components/order/pill.hbs +24 -34
- package/addon/components/order/route-editor.hbs +8 -4
- package/addon/components/order/schedule-card.hbs +2 -1
- package/addon/components/order/summary.hbs +1 -0
- package/addon/components/order-config/pill.hbs +24 -0
- package/addon/components/order-config/summary.hbs +1 -0
- package/addon/components/part/details.hbs +15 -3
- package/addon/components/part/details.js +37 -1
- package/addon/components/part/form.hbs +12 -5
- package/addon/components/part/pill.hbs +24 -0
- package/addon/components/part/summary.hbs +1 -0
- package/addon/components/payload/pill.hbs +24 -0
- package/addon/components/payload/summary.hbs +1 -0
- package/addon/components/place/details.hbs +1 -1
- package/addon/components/place/pill.hbs +24 -0
- package/addon/components/place/summary.hbs +1 -0
- package/addon/components/position/pill.hbs +24 -0
- package/addon/components/position/summary.hbs +1 -0
- package/addon/components/positions-replay.hbs +2 -4
- package/addon/components/public-inspection.hbs +174 -0
- package/addon/components/public-inspection.js +279 -0
- package/addon/components/purchase-rate/pill.hbs +24 -0
- package/addon/components/purchase-rate/summary.hbs +1 -0
- package/addon/components/radar/agenda/entry.hbs +17 -0
- package/addon/components/radar/agenda/entry.js +26 -0
- package/addon/components/radar/agenda/lane.hbs +33 -0
- package/addon/components/radar/agenda/lane.js +80 -0
- package/addon/components/radar/agenda.hbs +69 -0
- package/addon/components/radar/agenda.js +29 -0
- package/addon/components/radar/briefing.hbs +108 -0
- package/addon/components/radar/briefing.js +43 -0
- package/addon/components/radar/bulk-bar.hbs +41 -0
- package/addon/components/radar/bulk-bar.js +32 -0
- package/addon/components/radar/decision-card.hbs +28 -0
- package/addon/components/radar/decision-card.js +7 -0
- package/addon/components/radar/empty-state.hbs +30 -0
- package/addon/components/radar/empty-state.js +27 -0
- package/addon/components/radar/filter-pills.hbs +22 -0
- package/addon/components/radar/filter-pills.js +3 -0
- package/addon/components/radar/handover-card.hbs +62 -0
- package/addon/components/radar/handover-card.js +14 -0
- package/addon/components/radar/header.hbs +28 -0
- package/addon/components/radar/header.js +12 -0
- package/addon/components/radar/item-drawer.hbs +92 -0
- package/addon/components/radar/item-drawer.js +37 -0
- package/addon/components/radar/item-list.hbs +20 -0
- package/addon/components/radar/item-list.js +3 -0
- package/addon/components/radar/item-row.hbs +90 -0
- package/addon/components/radar/item-row.js +43 -0
- package/addon/components/radar/keyboard-hints.hbs +8 -0
- package/addon/components/radar/keyboard-hints.js +3 -0
- package/addon/components/radar/subject.hbs +14 -0
- package/addon/components/radar/subject.js +26 -0
- package/addon/components/radar/view-bar.hbs +27 -0
- package/addon/components/radar/view-bar.js +16 -0
- package/addon/components/recurring-order-schedule/pill.hbs +24 -0
- package/addon/components/recurring-order-schedule/summary.hbs +1 -0
- package/addon/components/resource-activity.hbs +1 -0
- package/addon/components/resource-activity.js +4 -0
- package/addon/components/route/pill.hbs +24 -0
- package/addon/components/route/summary.hbs +1 -0
- package/addon/components/select-option/asset-connection.hbs +12 -0
- package/addon/components/select-option/asset.hbs +12 -0
- package/addon/components/select-option/attachable.hbs +12 -0
- package/addon/components/select-option/contact.hbs +12 -0
- package/addon/components/select-option/customer.hbs +12 -0
- package/addon/components/select-option/device-event.hbs +12 -0
- package/addon/components/select-option/device.hbs +12 -0
- package/addon/components/select-option/driver.hbs +12 -0
- package/addon/components/select-option/entity.hbs +12 -0
- package/addon/components/select-option/equipment.hbs +12 -0
- package/addon/components/select-option/facilitator.hbs +12 -0
- package/addon/components/select-option/fleet-driver.hbs +12 -0
- package/addon/components/select-option/fleet.hbs +12 -0
- package/addon/components/select-option/fuel-provider-connection.hbs +12 -0
- package/addon/components/select-option/fuel-provider-transaction.hbs +12 -0
- package/addon/components/select-option/fuel-report.hbs +12 -0
- package/addon/components/select-option/inspection-form.hbs +12 -0
- package/addon/components/select-option/inspection-item-result.hbs +12 -0
- package/addon/components/select-option/inspection-submission.hbs +12 -0
- package/addon/components/select-option/integrated-vendor.hbs +12 -0
- package/addon/components/select-option/issue.hbs +12 -0
- package/addon/components/select-option/maintenance-schedule.hbs +12 -0
- package/addon/components/select-option/maintenance-subject.hbs +12 -0
- package/addon/components/select-option/maintenance.hbs +12 -0
- package/addon/components/select-option/manifest-stop.hbs +12 -0
- package/addon/components/select-option/manifest.hbs +12 -0
- package/addon/components/select-option/order-config.hbs +12 -0
- package/addon/components/select-option/order.hbs +12 -0
- package/addon/components/select-option/part.hbs +12 -0
- package/addon/components/select-option/payload.hbs +12 -0
- package/addon/components/select-option/place.hbs +12 -0
- package/addon/components/select-option/position.hbs +12 -0
- package/addon/components/select-option/purchase-rate.hbs +12 -0
- package/addon/components/select-option/recurring-order-schedule.hbs +12 -0
- package/addon/components/select-option/route.hbs +12 -0
- package/addon/components/select-option/sensor.hbs +12 -0
- package/addon/components/select-option/service-area.hbs +12 -0
- package/addon/components/select-option/service-quote-item.hbs +12 -0
- package/addon/components/select-option/service-quote.hbs +12 -0
- package/addon/components/select-option/service-rate-fee.hbs +12 -0
- package/addon/components/select-option/service-rate-parcel-fee.hbs +12 -0
- package/addon/components/select-option/service-rate.hbs +12 -0
- package/addon/components/select-option/telematic.hbs +12 -0
- package/addon/components/select-option/trackable.hbs +8 -0
- package/addon/components/select-option/tracking-number.hbs +12 -0
- package/addon/components/select-option/tracking-status.hbs +12 -0
- package/addon/components/select-option/trailer.hbs +12 -0
- package/addon/components/select-option/vehicle-device.hbs +12 -0
- package/addon/components/select-option/vehicle.hbs +12 -0
- package/addon/components/select-option/vendor.hbs +12 -0
- package/addon/components/select-option/warranty.hbs +12 -0
- package/addon/components/select-option/waypoint.hbs +12 -0
- package/addon/components/select-option/work-order.hbs +12 -0
- package/addon/components/select-option/zone.hbs +12 -0
- package/addon/components/sensor/details.hbs +6 -2
- package/addon/components/sensor/form.hbs +6 -17
- package/addon/components/sensor/panel-header.hbs +1 -1
- package/addon/components/sensor/pill.hbs +24 -0
- package/addon/components/sensor/summary.hbs +1 -0
- package/addon/components/service-area/details.hbs +1 -20
- package/addon/components/service-area/pill.hbs +24 -0
- package/addon/components/service-area/summary.hbs +1 -0
- package/addon/components/service-quote/pill.hbs +24 -0
- package/addon/components/service-quote/summary.hbs +1 -0
- package/addon/components/service-quote-item/pill.hbs +24 -0
- package/addon/components/service-quote-item/summary.hbs +1 -0
- package/addon/components/service-rate/details.hbs +12 -6
- package/addon/components/service-rate/form.hbs +10 -8
- package/addon/components/service-rate/pill.hbs +24 -0
- package/addon/components/service-rate/summary.hbs +1 -0
- package/addon/components/service-rate-fee/pill.hbs +24 -0
- package/addon/components/service-rate-fee/summary.hbs +1 -0
- package/addon/components/service-rate-parcel-fee/pill.hbs +24 -0
- package/addon/components/service-rate-parcel-fee/summary.hbs +1 -0
- package/addon/components/table/cell/fleet-ops-option.hbs +20 -0
- package/addon/components/telematic/details.hbs +4 -1
- package/addon/components/telematic/details.js +1 -0
- package/addon/components/telematic/form.hbs +6 -1
- package/addon/components/telematic/form.js +1 -0
- package/addon/components/telematic/pill.hbs +24 -0
- package/addon/components/telematic/settings.hbs +6 -1
- package/addon/components/telematic/settings.js +1 -0
- package/addon/components/telematic/summary.hbs +1 -0
- package/addon/components/telematic/telemetry-status.hbs +43 -0
- package/addon/components/telematic/telemetry-status.js +95 -0
- package/addon/components/tracking-number/pill.hbs +24 -0
- package/addon/components/tracking-number/summary.hbs +1 -0
- package/addon/components/tracking-status/pill.hbs +24 -0
- package/addon/components/tracking-status/summary.hbs +1 -0
- package/addon/components/trailer/card.hbs +2 -5
- package/addon/components/trailer/details.hbs +11 -5
- package/addon/components/trailer/details.js +4 -0
- package/addon/components/trailer/form.hbs +6 -3
- package/addon/components/trailer/pill.hbs +24 -21
- package/addon/components/trailer/summary.hbs +1 -0
- package/addon/components/vehicle/card.hbs +4 -8
- package/addon/components/vehicle/details/inspections.hbs +49 -0
- package/addon/components/vehicle/details/inspections.js +44 -0
- package/addon/components/vehicle/details/maintenance-history.hbs +1 -1
- package/addon/components/vehicle/details/schedules.hbs +2 -2
- package/addon/components/vehicle/details/work-orders.hbs +1 -1
- package/addon/components/vehicle/details.hbs +18 -1
- package/addon/components/vehicle/form.hbs +2 -1
- package/addon/components/vehicle/panel-header.hbs +3 -4
- package/addon/components/vehicle/panel-header.js +8 -1
- package/addon/components/vehicle/pill.hbs +15 -24
- package/addon/components/vehicle/summary.hbs +1 -0
- package/addon/components/vehicle-device/pill.hbs +24 -0
- package/addon/components/vehicle-device/summary.hbs +1 -0
- package/addon/components/vendor/form.hbs +2 -4
- package/addon/components/vendor/personnel-manager.hbs +2 -9
- package/addon/components/vendor/personnel-tab.hbs +1 -0
- package/addon/components/vendor/personnel-tab.js +4 -0
- package/addon/components/vendor/pill.hbs +24 -0
- package/addon/components/vendor/summary.hbs +1 -0
- package/addon/components/warranty/details.hbs +3 -1
- package/addon/components/warranty/form.hbs +2 -1
- package/addon/components/warranty/pill.hbs +24 -0
- package/addon/components/warranty/summary.hbs +1 -0
- package/addon/components/waypoint/pill.hbs +24 -0
- package/addon/components/waypoint/summary.hbs +1 -0
- package/addon/components/widget/radar.hbs +28 -0
- package/addon/components/widget/radar.js +44 -0
- package/addon/components/work-order/details.hbs +20 -4
- package/addon/components/work-order/details.js +64 -1
- package/addon/components/work-order/form.hbs +20 -2
- package/addon/components/work-order/form.js +10 -10
- package/addon/components/work-order/panel-header.hbs +15 -13
- package/addon/components/work-order/pill.hbs +24 -0
- package/addon/components/work-order/summary.hbs +1 -0
- package/addon/components/zone/details.hbs +2 -21
- package/addon/components/zone/pill.hbs +24 -0
- package/addon/components/zone/summary.hbs +1 -0
- package/addon/controllers/connectivity/devices/index/details/sensors.js +4 -0
- package/addon/controllers/connectivity/devices/index/details.js +1 -18
- package/addon/controllers/connectivity/events/index.js +1 -4
- package/addon/controllers/connectivity/fuel-providers/details/index.js +6 -0
- package/addon/controllers/connectivity/fuel-providers/details/matching.js +13 -0
- package/addon/controllers/connectivity/fuel-providers/details/sync.js +21 -10
- package/addon/controllers/connectivity/fuel-providers/details/transactions.js +5 -16
- package/addon/controllers/connectivity/fuel-providers/details.js +76 -13
- package/addon/controllers/connectivity/fuel-providers/index.js +22 -17
- package/addon/controllers/connectivity/sensors/index.js +1 -3
- package/addon/controllers/connectivity/telematics/details/events.js +8 -0
- package/addon/controllers/connectivity/telematics/details/sensors.js +3 -2
- package/addon/controllers/connectivity/telematics/index.js +3 -1
- package/addon/controllers/maintenance/inspection-forms/index/details.js +29 -0
- package/addon/controllers/maintenance/inspection-forms/index/edit.js +39 -0
- package/addon/controllers/maintenance/inspection-forms/index/new.js +48 -0
- package/addon/controllers/maintenance/inspection-forms/index.js +90 -0
- package/addon/controllers/maintenance/inspection-submissions/index/details.js +53 -0
- package/addon/controllers/maintenance/inspection-submissions/index/edit.js +39 -0
- package/addon/controllers/maintenance/inspection-submissions/index/new.js +48 -0
- package/addon/controllers/maintenance/inspection-submissions/index.js +142 -0
- package/addon/controllers/maintenance/maintenances/index.js +6 -2
- package/addon/controllers/maintenance/schedules/index/details.js +4 -86
- package/addon/controllers/maintenance/schedules/index.js +15 -0
- package/addon/controllers/maintenance/work-orders/index.js +19 -1
- package/addon/controllers/management/contacts/customers.js +6 -4
- package/addon/controllers/management/contacts/index.js +6 -3
- package/addon/controllers/management/drivers/index/details.js +1 -66
- package/addon/controllers/management/drivers/index.js +9 -34
- package/addon/controllers/management/fleets/index/details.js +2 -15
- package/addon/controllers/management/fleets/index.js +12 -20
- package/addon/controllers/management/fuel-reports/index.js +9 -59
- package/addon/controllers/management/fuel-transactions/index/details.js +51 -48
- package/addon/controllers/management/fuel-transactions/index.js +32 -32
- package/addon/controllers/management/index.js +1367 -49
- package/addon/controllers/management/issues/index/details.js +1 -33
- package/addon/controllers/management/issues/index.js +10 -59
- package/addon/controllers/management/trailers/index/details.js +4 -78
- package/addon/controllers/management/trailers/index.js +20 -22
- package/addon/controllers/management/vehicles/index/details.js +9 -77
- package/addon/controllers/management/vehicles/index.js +50 -72
- package/addon/controllers/management/vendors/index.js +6 -3
- package/addon/controllers/operations/orders/index.js +38 -11
- package/addon/controllers/operations/service-rates/index.js +10 -2
- package/addon/controllers/settings/payments/index.js +11 -2
- package/addon/extension.js +36 -0
- package/addon/helpers/initials.js +6 -0
- package/addon/helpers/leaflet-tile-url.js +6 -1
- package/addon/instance-initializers/register-fleetops-resource-descriptors.js +29 -0
- package/addon/modifiers/inspection-flyout.js +237 -0
- package/addon/modifiers/radar-keyboard.js +78 -0
- package/addon/modifiers/sync-value.js +26 -0
- package/addon/modifiers/when-changed.js +25 -0
- package/addon/routes/connectivity/fuel-providers/details/settings.js +5 -2
- package/addon/routes/connectivity/fuel-providers/details/sync.js +6 -13
- package/addon/routes/connectivity/fuel-providers/details/transactions.js +8 -7
- package/addon/routes/connectivity/fuel-providers/details.js +15 -2
- package/addon/routes/connectivity/fuel-providers/edit.js +2 -1
- package/addon/routes/connectivity/fuel-providers/index.js +5 -0
- package/addon/routes/maintenance/inspection-forms/index/details/index.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index/details/submissions.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index/details.js +18 -0
- package/addon/routes/maintenance/inspection-forms/index/edit.js +18 -0
- package/addon/routes/maintenance/inspection-forms/index/new.js +3 -0
- package/addon/routes/maintenance/inspection-forms/index.js +22 -0
- package/addon/routes/maintenance/inspection-forms.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/audit.js +8 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/index.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index/details/photos.js +8 -0
- package/addon/routes/maintenance/inspection-submissions/index/details.js +18 -0
- package/addon/routes/maintenance/inspection-submissions/index/edit.js +18 -0
- package/addon/routes/maintenance/inspection-submissions/index/new.js +3 -0
- package/addon/routes/maintenance/inspection-submissions/index.js +25 -0
- package/addon/routes/maintenance/inspection-submissions.js +3 -0
- package/addon/routes/management/fuel-transactions/index/details.js +12 -2
- package/addon/routes/management/fuel-transactions/index.js +6 -0
- package/addon/routes/management/index.js +17 -1
- package/addon/routes/management/vehicles/index/details/inspections.js +3 -0
- package/addon/routes/management/vehicles/index.js +2 -2
- package/addon/routes.js +24 -0
- package/addon/services/contact-actions.js +22 -4
- package/addon/services/customer-actions.js +7 -4
- package/addon/services/device-actions.js +28 -0
- package/addon/services/driver-actions.js +79 -16
- package/addon/services/equipment-actions.js +15 -6
- package/addon/services/fleet-actions.js +20 -4
- package/addon/services/fuel-report-actions.js +7 -7
- package/addon/services/inspection-form-actions.js +236 -0
- package/addon/services/inspection-submission-actions.js +273 -0
- package/addon/services/issue-actions.js +58 -7
- package/addon/services/maintenance-actions.js +22 -3
- package/addon/services/maintenance-schedule-actions.js +70 -5
- package/addon/services/movement-tracker.js +52 -1
- package/addon/services/part-actions.js +13 -7
- package/addon/services/place-actions.js +8 -7
- package/addon/services/service-area-actions.js +27 -4
- package/addon/services/trailer-actions.js +60 -7
- package/addon/services/vehicle-actions.js +58 -3
- package/addon/services/vendor-actions.js +8 -7
- package/addon/services/work-order-actions.js +14 -5
- package/addon/services/zone-actions.js +27 -4
- package/addon/styles/fleetops-engine.css +3621 -75
- package/addon/templates/connectivity/devices/index/details/vehicle.hbs +2 -2
- package/addon/templates/connectivity/events/details.hbs +2 -2
- package/addon/templates/connectivity/fuel-providers/details/index.hbs +65 -35
- package/addon/templates/connectivity/fuel-providers/details/matching.hbs +2 -2
- package/addon/templates/connectivity/fuel-providers/details/sync.hbs +54 -43
- package/addon/templates/connectivity/fuel-providers/details/transactions.hbs +10 -5
- package/addon/templates/connectivity/fuel-providers/details.hbs +38 -13
- package/addon/templates/connectivity/fuel-providers/edit.hbs +1 -0
- package/addon/templates/connectivity/fuel-providers/index.hbs +2 -1
- package/addon/templates/connectivity/fuel-providers/new.hbs +1 -1
- package/addon/templates/connectivity/telematics/details/attachments.hbs +2 -1
- package/addon/templates/maintenance/inspection-forms/index/details/index.hbs +1 -0
- package/addon/templates/maintenance/inspection-forms/index/details/submissions.hbs +2 -0
- package/addon/templates/maintenance/inspection-forms/index/details.hbs +14 -0
- package/addon/templates/maintenance/inspection-forms/index/edit.hbs +11 -0
- package/addon/templates/maintenance/inspection-forms/index/new.hbs +11 -0
- package/addon/templates/maintenance/inspection-forms/index.hbs +28 -0
- package/addon/templates/maintenance/inspection-forms.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/audit.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/index.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details/photos.hbs +1 -0
- package/addon/templates/maintenance/inspection-submissions/index/details.hbs +14 -0
- package/addon/templates/maintenance/inspection-submissions/index/edit.hbs +11 -0
- package/addon/templates/maintenance/inspection-submissions/index/new.hbs +11 -0
- package/addon/templates/maintenance/inspection-submissions/index.hbs +28 -0
- package/addon/templates/maintenance/inspection-submissions.hbs +1 -0
- package/addon/templates/management/fuel-transactions/index/details.hbs +64 -62
- package/addon/templates/management/fuel-transactions/index.hbs +9 -31
- package/addon/templates/management/index.hbs +110 -102
- package/addon/templates/management/vehicles/index/details/inspections.hbs +2 -0
- package/addon/templates/operations/orders/index.hbs +2 -4
- package/addon/utils/context-panel.js +34 -0
- package/addon/utils/device-table-columns.js +18 -27
- package/addon/utils/fleet-ops-options.js +40 -0
- package/addon/utils/fuel-integration-format.js +43 -0
- package/addon/utils/fuel-transaction.js +115 -0
- package/addon/utils/identity-cell-resource.js +56 -0
- package/addon/utils/inspection-answers.js +283 -0
- package/addon/utils/inspection-field-types.js +74 -0
- package/addon/utils/inspection-form-structure.js +161 -0
- package/addon/utils/radar.js +212 -0
- package/addon/utils/relation-value.js +37 -0
- package/addon/utils/resource-descriptors/assets.js +246 -0
- package/addon/utils/resource-descriptors/connectivity.js +146 -0
- package/addon/utils/resource-descriptors/fuel.js +75 -0
- package/addon/utils/resource-descriptors/helpers.js +191 -0
- package/addon/utils/resource-descriptors/index.js +35 -0
- package/addon/utils/resource-descriptors/maintenance.js +175 -0
- package/addon/utils/resource-descriptors/operations.js +215 -0
- package/addon/utils/resource-descriptors/people.js +173 -0
- package/addon/utils/resource-descriptors/polymorphic.js +123 -0
- package/addon/utils/resource-descriptors/sub-records.js +297 -0
- package/addon/utils/telemetry-timestamp.js +6 -0
- package/app/components/asset/pill.js +1 -0
- package/app/components/asset/summary.js +1 -0
- package/app/components/asset-connection/pill.js +1 -0
- package/app/components/asset-connection/summary.js +1 -0
- package/app/components/attachable/pill.js +1 -0
- package/app/components/attachable/summary.js +1 -0
- package/app/components/cell/asset-connection-identity.js +1 -0
- package/app/components/cell/{attached-vehicle.js → asset-identity.js} +1 -1
- package/app/components/cell/attachable-identity.js +1 -0
- package/app/components/cell/{telematic-device.js → contact-identity.js} +1 -1
- package/app/components/cell/customer-identity.js +1 -0
- package/app/components/cell/device-event-identity.js +1 -0
- package/app/components/cell/entity-identity.js +1 -0
- package/app/components/cell/facilitator-identity.js +1 -0
- package/app/components/cell/fleet-driver-identity.js +1 -0
- package/app/components/cell/fleet-identity.js +1 -0
- package/app/components/cell/fuel-provider-connection-identity.js +1 -0
- package/app/components/cell/fuel-provider-transaction-identity.js +1 -0
- package/app/components/cell/fuel-report-identity.js +1 -0
- package/app/components/cell/inspection-form-identity.js +1 -0
- package/app/components/cell/inspection-item-result-identity.js +1 -0
- package/app/components/cell/inspection-submission-identity.js +1 -0
- package/app/components/cell/integrated-vendor-identity.js +1 -0
- package/app/components/cell/issue-identity.js +1 -0
- package/app/components/cell/maintenance-identity.js +1 -0
- package/app/components/cell/maintenance-schedule-identity.js +1 -0
- package/app/components/cell/maintenance-subject-identity.js +1 -0
- package/app/components/cell/manifest-identity.js +1 -0
- package/app/components/cell/manifest-stop-identity.js +1 -0
- package/app/components/cell/order-config-identity.js +1 -0
- package/app/components/cell/order-identity.js +1 -0
- package/app/components/cell/payload-identity.js +1 -0
- package/app/components/cell/place-identity.js +1 -0
- package/app/components/cell/position-identity.js +1 -0
- package/app/components/cell/purchase-rate-identity.js +1 -0
- package/app/components/cell/recurring-order-schedule-identity.js +1 -0
- package/app/components/cell/resource-list.js +1 -0
- package/app/components/cell/route-identity.js +1 -0
- package/app/components/cell/sensor-identity.js +1 -0
- package/app/components/cell/service-area-identity.js +1 -0
- package/app/components/cell/service-quote-identity.js +1 -0
- package/app/components/cell/service-quote-item-identity.js +1 -0
- package/app/components/cell/service-rate-fee-identity.js +1 -0
- package/app/components/cell/service-rate-identity.js +1 -0
- package/app/components/cell/service-rate-parcel-fee-identity.js +1 -0
- package/app/components/cell/{telematic-provider.js → telematic-identity.js} +1 -1
- package/app/components/cell/tracking-number-identity.js +1 -0
- package/app/components/cell/tracking-status-identity.js +1 -0
- package/app/components/cell/trailer-identity.js +1 -0
- package/app/components/cell/vehicle-device-identity.js +1 -0
- package/app/components/cell/vendor-identity.js +1 -0
- package/app/components/cell/warranty-identity.js +1 -0
- package/app/components/cell/waypoint-identity.js +1 -0
- package/app/components/cell/work-order-identity.js +1 -0
- package/app/components/cell/zone-identity.js +1 -0
- package/app/components/{cell/driver-name.js → contact/pill.js} +1 -1
- package/app/components/{cell/vehicle-name.js → contact/summary.js} +1 -1
- package/app/components/customer/pill.js +1 -0
- package/app/components/customer/summary.js +1 -0
- package/app/components/device/summary.js +1 -0
- package/app/components/device/telemetry.js +1 -0
- package/app/components/device-event/pill.js +1 -0
- package/app/components/device-event/summary.js +1 -0
- package/app/components/driver/summary.js +1 -0
- package/app/components/entity/pill.js +1 -0
- package/app/components/entity/summary.js +1 -0
- package/app/components/equipment/card.js +1 -0
- package/app/components/equipment/panel-header.js +1 -0
- package/app/components/equipment/summary.js +1 -0
- package/app/components/{filter/multi-model.js → facilitator/pill.js} +1 -1
- package/app/components/facilitator/summary.js +1 -0
- package/app/components/fleet/pill.js +1 -0
- package/app/components/fleet/summary.js +1 -0
- package/app/components/fleet-driver/pill.js +1 -0
- package/app/components/fleet-driver/summary.js +1 -0
- package/app/components/fuel-provider-connection/pill.js +1 -0
- package/app/components/fuel-provider-connection/summary.js +1 -0
- package/app/components/fuel-provider-transaction/pill.js +1 -0
- package/app/components/fuel-provider-transaction/summary.js +1 -0
- package/app/components/fuel-report/pill.js +1 -0
- package/app/components/fuel-report/summary.js +1 -0
- package/app/components/fuel-transaction-status.js +1 -0
- package/app/components/geofence-map.js +1 -0
- package/app/components/inspection-field/form.js +1 -0
- package/app/components/inspection-field/input.js +1 -0
- package/app/components/inspection-field/value.js +1 -0
- package/app/components/inspection-flyout.js +1 -0
- package/app/components/inspection-form/builder.js +1 -0
- package/app/components/inspection-form/details/submissions.js +1 -0
- package/app/components/inspection-form/details.js +1 -0
- package/app/components/inspection-form/form.js +1 -0
- package/app/components/inspection-form/pill.js +1 -0
- package/app/components/inspection-form/summary.js +1 -0
- package/app/components/inspection-item-result/pill.js +1 -0
- package/app/components/inspection-item-result/summary.js +1 -0
- package/app/components/inspection-link/list.js +1 -0
- package/app/components/inspection-sheet/group.js +1 -0
- package/app/components/inspection-sheet.js +1 -0
- package/app/components/inspection-submission/details.js +1 -0
- package/app/components/inspection-submission/form.js +1 -0
- package/app/components/inspection-submission/photos.js +1 -0
- package/app/components/inspection-submission/pill.js +1 -0
- package/app/components/inspection-submission/summary.js +1 -0
- package/app/components/integrated-vendor/pill.js +1 -0
- package/app/components/integrated-vendor/summary.js +1 -0
- package/app/components/issue/pill.js +1 -0
- package/app/components/issue/summary.js +1 -0
- package/app/components/issue/timeline.js +1 -0
- package/app/components/layout/fleet-ops-sidebar/operations-monitor.js +1 -0
- package/app/components/maintenance/pill.js +1 -0
- package/app/components/maintenance/summary.js +1 -0
- package/app/components/maintenance-schedule/pill.js +1 -0
- package/app/components/maintenance-schedule/summary.js +1 -0
- package/app/components/maintenance-schedule/work-orders.js +1 -0
- package/app/components/maintenance-subject/pill.js +1 -0
- package/app/components/maintenance-subject/summary.js +1 -0
- package/app/components/manifest/pill.js +1 -0
- package/app/components/manifest/summary.js +1 -0
- package/app/components/manifest-stop/pill.js +1 -0
- package/app/components/manifest-stop/summary.js +1 -0
- package/app/components/modals/fuel-connection-diagnostics.js +1 -0
- package/app/components/modals/fuel-transaction-action.js +1 -0
- package/app/components/modals/inspection-follow-up.js +1 -0
- package/app/components/modals/inspection-link.js +1 -0
- package/app/components/modals/radar-notice.js +1 -0
- package/app/components/modals/radar-save-view.js +1 -0
- package/app/components/modals/radar-select-resource.js +1 -0
- package/app/components/modals/radar-send-pin.js +1 -0
- package/app/components/order/summary.js +1 -0
- package/app/components/order-config/pill.js +1 -0
- package/app/components/order-config/summary.js +1 -0
- package/app/components/part/card.js +1 -0
- package/app/components/part/panel-header.js +1 -0
- package/app/components/part/pill.js +1 -0
- package/app/components/part/summary.js +1 -0
- package/app/components/payload/pill.js +1 -0
- package/app/components/payload/summary.js +1 -0
- package/app/components/place/pill.js +1 -0
- package/app/components/place/summary.js +1 -0
- package/app/components/position/pill.js +1 -0
- package/app/components/position/summary.js +1 -0
- package/app/components/public-inspection.js +1 -0
- package/app/components/purchase-rate/pill.js +1 -0
- package/app/components/purchase-rate/summary.js +1 -0
- package/app/components/radar/agenda/entry.js +1 -0
- package/app/components/radar/agenda/lane.js +1 -0
- package/app/components/radar/agenda.js +1 -0
- package/app/components/radar/briefing.js +1 -0
- package/app/components/radar/bulk-bar.js +1 -0
- package/app/components/radar/decision-card.js +1 -0
- package/app/components/radar/empty-state.js +1 -0
- package/app/components/radar/filter-pills.js +1 -0
- package/app/components/radar/handover-card.js +1 -0
- package/app/components/radar/header.js +1 -0
- package/app/components/radar/item-drawer.js +1 -0
- package/app/components/radar/item-list.js +1 -0
- package/app/components/radar/item-row.js +1 -0
- package/app/components/radar/keyboard-hints.js +1 -0
- package/app/components/radar/subject.js +1 -0
- package/app/components/radar/view-bar.js +1 -0
- package/app/components/recurring-order-schedule/pill.js +1 -0
- package/app/components/recurring-order-schedule/summary.js +1 -0
- package/app/components/resource-activity.js +1 -0
- package/app/components/route/pill.js +1 -0
- package/app/components/route/summary.js +1 -0
- package/app/components/select-option/asset-connection.js +1 -0
- package/app/components/select-option/asset.js +1 -0
- package/app/components/select-option/attachable.js +1 -0
- package/app/components/select-option/contact.js +1 -0
- package/app/components/select-option/customer.js +1 -0
- package/app/components/select-option/device-event.js +1 -0
- package/app/components/select-option/device.js +1 -0
- package/app/components/select-option/driver.js +1 -0
- package/app/components/select-option/entity.js +1 -0
- package/app/components/select-option/equipment.js +1 -0
- package/app/components/select-option/facilitator.js +1 -0
- package/app/components/select-option/fleet-driver.js +1 -0
- package/app/components/select-option/fleet.js +1 -0
- package/app/components/select-option/fuel-provider-connection.js +1 -0
- package/app/components/select-option/fuel-provider-transaction.js +1 -0
- package/app/components/select-option/fuel-report.js +1 -0
- package/app/components/select-option/inspection-form.js +1 -0
- package/app/components/select-option/inspection-item-result.js +1 -0
- package/app/components/select-option/inspection-submission.js +1 -0
- package/app/components/select-option/integrated-vendor.js +1 -0
- package/app/components/select-option/issue.js +1 -0
- package/app/components/select-option/maintenance-schedule.js +1 -0
- package/app/components/select-option/maintenance-subject.js +1 -0
- package/app/components/select-option/maintenance.js +1 -0
- package/app/components/select-option/manifest-stop.js +1 -0
- package/app/components/select-option/manifest.js +1 -0
- package/app/components/select-option/order-config.js +1 -0
- package/app/components/select-option/order.js +1 -0
- package/app/components/select-option/part.js +1 -0
- package/app/components/select-option/payload.js +1 -0
- package/app/components/select-option/place.js +1 -0
- package/app/components/select-option/position.js +1 -0
- package/app/components/select-option/purchase-rate.js +1 -0
- package/app/components/select-option/recurring-order-schedule.js +1 -0
- package/app/components/select-option/route.js +1 -0
- package/app/components/select-option/sensor.js +1 -0
- package/app/components/select-option/service-area.js +1 -0
- package/app/components/select-option/service-quote-item.js +1 -0
- package/app/components/select-option/service-quote.js +1 -0
- package/app/components/select-option/service-rate-fee.js +1 -0
- package/app/components/select-option/service-rate-parcel-fee.js +1 -0
- package/app/components/select-option/service-rate.js +1 -0
- package/app/components/select-option/telematic.js +1 -0
- package/app/components/select-option/trackable.js +1 -0
- package/app/components/select-option/tracking-number.js +1 -0
- package/app/components/select-option/tracking-status.js +1 -0
- package/app/components/select-option/trailer.js +1 -0
- package/app/components/select-option/vehicle-device.js +1 -0
- package/app/components/select-option/vehicle.js +1 -0
- package/app/components/select-option/vendor.js +1 -0
- package/app/components/select-option/warranty.js +1 -0
- package/app/components/select-option/waypoint.js +1 -0
- package/app/components/select-option/work-order.js +1 -0
- package/app/components/select-option/zone.js +1 -0
- package/app/components/sensor/pill.js +1 -0
- package/app/components/sensor/summary.js +1 -0
- package/app/components/service-area/pill.js +1 -0
- package/app/components/service-area/summary.js +1 -0
- package/app/components/service-quote/pill.js +1 -0
- package/app/components/service-quote/summary.js +1 -0
- package/app/components/service-quote-item/pill.js +1 -0
- package/app/components/service-quote-item/summary.js +1 -0
- package/app/components/service-rate/pill.js +1 -0
- package/app/components/service-rate/summary.js +1 -0
- package/app/components/service-rate-fee/pill.js +1 -0
- package/app/components/service-rate-fee/summary.js +1 -0
- package/app/components/service-rate-parcel-fee/pill.js +1 -0
- package/app/components/service-rate-parcel-fee/summary.js +1 -0
- package/app/components/table/cell/fleet-ops-option.js +1 -0
- package/app/components/telematic/pill.js +1 -0
- package/app/components/telematic/summary.js +1 -0
- package/app/components/telematic/telemetry-status.js +1 -0
- package/app/components/tracking-number/pill.js +1 -0
- package/app/components/tracking-number/summary.js +1 -0
- package/app/components/tracking-status/pill.js +1 -0
- package/app/components/tracking-status/summary.js +1 -0
- package/app/components/trailer/summary.js +1 -0
- package/app/components/vehicle/details/inspections.js +1 -0
- package/app/components/vehicle/summary.js +1 -0
- package/app/components/vehicle-device/pill.js +1 -0
- package/app/components/vehicle-device/summary.js +1 -0
- package/app/components/vendor/personnel-tab.js +1 -0
- package/app/components/vendor/pill.js +1 -0
- package/app/components/vendor/summary.js +1 -0
- package/app/components/warranty/pill.js +1 -0
- package/app/components/warranty/summary.js +1 -0
- package/app/components/waypoint/pill.js +1 -0
- package/app/components/waypoint/summary.js +1 -0
- package/app/components/widget/radar.js +1 -0
- package/app/components/work-order/panel-header.js +1 -0
- package/app/components/work-order/pill.js +1 -0
- package/app/components/work-order/summary.js +1 -0
- package/app/components/zone/pill.js +1 -0
- package/app/components/zone/summary.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/details.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index/new.js +1 -0
- package/app/controllers/maintenance/inspection-forms/index.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/controllers/maintenance/inspection-submissions/index.js +1 -0
- package/app/helpers/initials.js +1 -0
- package/app/modifiers/inspection-flyout.js +1 -0
- package/app/modifiers/radar-keyboard.js +1 -0
- package/app/modifiers/sync-value.js +1 -0
- package/app/modifiers/when-changed.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details/index.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details/submissions.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/details.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/routes/maintenance/inspection-forms/index/new.js +1 -0
- package/app/routes/maintenance/inspection-forms/index.js +1 -0
- package/app/routes/maintenance/inspection-forms.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/audit.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/index.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details/photos.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/routes/maintenance/inspection-submissions/index.js +1 -0
- package/app/routes/maintenance/inspection-submissions.js +1 -0
- package/app/routes/management/vehicles/index/details/inspections.js +1 -0
- package/app/services/inspection-form-actions.js +1 -0
- package/app/services/inspection-submission-actions.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details/index.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details/submissions.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/details.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/edit.js +1 -0
- package/app/templates/maintenance/inspection-forms/index/new.js +1 -0
- package/app/templates/maintenance/inspection-forms/index.js +1 -0
- package/app/templates/maintenance/inspection-forms.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/audit.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/index.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details/photos.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/details.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/edit.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index/new.js +1 -0
- package/app/templates/maintenance/inspection-submissions/index.js +1 -0
- package/app/templates/maintenance/inspection-submissions.js +1 -0
- package/app/templates/management/vehicles/index/details/inspections.js +1 -0
- package/app/utils/inspection-field-types.js +2 -0
- package/app/utils/inspection-form-structure.js +1 -0
- package/app/utils/radar.js +1 -0
- package/composer.json +1 -1
- package/docs/AFAQY.md +91 -0
- package/docs/TELEMETRY_ARCHITECTURE.md +115 -0
- package/extension.json +1 -1
- package/package.json +3 -3
- package/scripts/coverage-summary.php +11 -0
- package/scripts/pest-bootstrap.php +1 -1
- package/server/config/afaqy.php +8 -0
- package/server/config/fuel-providers.php +28 -7
- package/server/config/telematics.php +8 -1
- package/server/config/telemetry.php +17 -0
- package/server/migrations/2026_09_09_000001_create_inspection_tables.php +152 -0
- package/server/migrations/2026_09_10_000001_convert_inspection_form_items_to_field_groups.php +44 -0
- package/server/migrations/2026_09_10_000002_add_token_to_inspection_links.php +39 -0
- package/server/migrations/2026_09_11_000001_add_assignee_and_pin_to_inspection_links.php +39 -0
- package/server/migrations/2026_09_15_000001_create_telematic_telemetry_tables.php +62 -0
- package/server/migrations/2026_09_15_000002_scope_fuel_transactions_to_connection.php +25 -0
- package/server/migrations/2026_09_16_000001_add_public_id_to_alerts_table.php +45 -0
- package/server/resources/views/mail/inspection-link-pin.blade.php +34 -0
- package/server/src/Auth/Schemas/FleetOps.php +12 -0
- package/server/src/Console/Commands/DrainTelematicInbox.php +82 -0
- package/server/src/Console/Commands/ProcessMaintenanceTriggers.php +4 -1
- package/server/src/Console/Commands/SyncTelematics.php +32 -2
- package/server/src/Contracts/TelemetryProviderInterface.php +27 -0
- package/server/src/Events/DeviceTelemetryUpdated.php +37 -0
- package/server/src/Events/VehicleLocationChanged.php +8 -4
- package/server/src/Exports/InspectionExport.php +125 -0
- package/server/src/Http/Controllers/Api/v1/GeofenceController.php +1 -1
- package/server/src/Http/Controllers/Api/v1/InspectionController.php +300 -0
- package/server/src/Http/Controllers/Internal/v1/FuelProviderConnectionController.php +40 -8
- package/server/src/Http/Controllers/Internal/v1/HubController.php +36 -11
- package/server/src/Http/Controllers/Internal/v1/InspectionFormController.php +326 -0
- package/server/src/Http/Controllers/Internal/v1/InspectionSubmissionController.php +229 -0
- package/server/src/Http/Controllers/Internal/v1/RadarController.php +1117 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +67 -0
- package/server/src/Http/Controllers/Public/PublicInspectionController.php +243 -0
- package/server/src/Http/Controllers/TelematicPositionWebhookController.php +60 -0
- package/server/src/Http/Controllers/TelematicWebhookController.php +3 -0
- package/server/src/Http/Filter/FuelProviderConnectionFilter.php +1 -1
- package/server/src/Http/Middleware/ForceJsonResponse.php +25 -0
- package/server/src/Http/Resources/v1/InspectionForm.php +153 -0
- package/server/src/Http/Resources/v1/InspectionItemResult.php +77 -0
- package/server/src/Http/Resources/v1/InspectionLink.php +84 -0
- package/server/src/Http/Resources/v1/InspectionSubmission.php +173 -0
- package/server/src/Jobs/PollTelematicTelemetry.php +118 -0
- package/server/src/Jobs/ProcessTelematicDelivery.php +122 -0
- package/server/src/Jobs/SyncFuelProviderTransactionsJob.php +21 -4
- package/server/src/Mail/InspectionLinkPinMail.php +57 -0
- package/server/src/Models/Driver.php +8 -2
- package/server/src/Models/FuelProviderTransaction.php +1 -0
- package/server/src/Models/InspectionForm.php +240 -0
- package/server/src/Models/InspectionItemResult.php +90 -0
- package/server/src/Models/InspectionLink.php +284 -0
- package/server/src/Models/InspectionSubmission.php +440 -0
- package/server/src/Models/Part.php +9 -2
- package/server/src/Models/WorkOrder.php +3 -0
- package/server/src/Observers/WorkOrderObserver.php +1 -1
- package/server/src/Providers/FleetOpsServiceProvider.php +9 -0
- package/server/src/Rules/Base64OrUrl.php +54 -0
- package/server/src/Support/FuelProviders/FuelProviderService.php +64 -27
- package/server/src/Support/FuelProviders/Providers/PetroAppFuelProvider.php +81 -15
- package/server/src/Support/InspectionFileStore.php +268 -0
- package/server/src/Support/InspectionFormSync.php +231 -0
- package/server/src/Support/InspectionLinkPin.php +150 -0
- package/server/src/Support/InspectionSubmitter.php +297 -0
- package/server/src/Support/Radar/RadarAgenda.php +375 -0
- package/server/src/Support/Radar/RadarBriefing.php +504 -0
- package/server/src/Support/Radar/RadarItemState.php +435 -0
- package/server/src/Support/Radar/RadarRules.php +1424 -0
- package/server/src/Support/Reporting/FleetOpsReportSchema.php +178 -0
- package/server/src/Support/Telematics/Afaqy/Payload.php +49 -0
- package/server/src/Support/Telematics/Providers/AfaqyProvider.php +179 -61
- package/server/src/Support/Telematics/TelematicService.php +37 -6
- package/server/src/Support/Telematics/Telemetry/Configuration.php +30 -0
- package/server/src/Support/Telematics/Telemetry/Inbox.php +61 -0
- package/server/src/Support/Telematics/Telemetry/Ingestor.php +112 -0
- package/server/src/Support/Telematics/Telemetry/Queue.php +28 -0
- package/server/src/Support/Telematics/Telemetry/Sample.php +54 -0
- package/server/src/routes.php +76 -0
- package/server/tests/ApiManifestControllerContractsTest.php +9 -9
- package/server/tests/ControllerFilterContractsTest.php +1 -1
- package/server/tests/EventContractsTest.php +2 -1
- package/server/tests/Feature/Http/AfaqyRealtimeIngestionTest.php +792 -0
- package/server/tests/Feature/Http/Api/GeofenceControllerContractsTest.php +4 -4
- package/server/tests/Feature/Http/Api/TrailerControllerLifecycleTest.php +1 -1
- package/server/tests/Feature/Http/Internal/DriverControllerCreateRecordTest.php +1 -1
- package/server/tests/Feature/Http/Internal/DriverControllerExistingUserAdoptionTest.php +1 -1
- package/server/tests/Feature/Http/Internal/HubControllerTest.php +28 -2
- package/server/tests/Feature/Http/Internal/OrderControllerCreateRecordTest.php +1 -1
- package/server/tests/Feature/Http/Internal/RadarControllerDatabaseTest.php +415 -0
- package/server/tests/Feature/Http/Internal/RadarControllerTest.php +594 -0
- package/server/tests/FuelProviderConnectionControllerContractsTest.php +83 -3
- package/server/tests/FuelProviderImplementationTest.php +10 -2
- package/server/tests/HubAndGettingStartedContractsTest.php +26 -3
- package/server/tests/InspectionControllerContractsTest.php +1329 -0
- package/server/tests/InspectionFieldContractsTest.php +1019 -0
- package/server/tests/InspectionModelContractsTest.php +728 -0
- package/server/tests/InspectionSubmitterRulesTest.php +47 -0
- package/server/tests/ObserverContractsTest.php +1 -1
- package/server/tests/QueueJobContractsTest.php +3 -4
- package/server/tests/RadarRoutesTest.php +35 -0
- package/server/tests/ReportSchemaContractsTest.php +15 -1
- package/server/tests/RouteRegistrationExecutionTest.php +109 -18
- package/server/tests/Support/AfaqyTestCrypto.php +27 -0
- package/server/tests/Support/ExampleTelemetryProvider.php +82 -0
- package/server/tests/Support/TelemetryTestEnvironment.php +53 -0
- package/server/tests/TelematicsHardeningTest.php +17 -17
- package/server/tests/TrailerSupportCoverageTest.php +1 -1
- package/server/tests/Unit/Http/Resources/ManifestResourceTest.php +3 -3
- package/server/tests/Unit/Support/FuelProviderServiceMatchingTest.php +127 -0
- package/server/tests/Unit/Support/PetroAppFuelProviderTest.php +126 -1
- package/server/tests/Unit/Support/RadarAgendaTest.php +200 -0
- package/server/tests/Unit/Support/RadarBriefingTest.php +214 -0
- package/server/tests/Unit/Support/RadarItemStateTest.php +260 -0
- package/server/tests/Unit/Support/RadarRulesTest.php +523 -0
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyProviderTest.php +9 -1
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyProviderTransportTest.php +8 -0
- package/server/tests/Unit/Support/Telematics/Providers/AfaqyRealtimeContractTest.php +188 -0
- package/server/tests/Unit/Support/Telematics/TelematicServiceTelemetryTest.php +1 -0
- package/translations/ar-ae.yml +3 -1
- package/translations/bg-bg.yaml +3 -1
- package/translations/en-us.yaml +738 -15
- package/translations/es-pa.yaml +3 -1
- package/translations/fr-fr.yaml +3 -1
- package/translations/mn-mn.yaml +3 -1
- package/translations/pt-br.yaml +3 -1
- package/translations/ru-ru.yaml +3 -1
- package/translations/vi-vn.yaml +3 -1
- package/addon/components/cell/attached-vehicle.hbs +0 -10
- package/addon/components/cell/attached-vehicle.js +0 -58
- package/addon/components/cell/device-identity.js +0 -129
- package/addon/components/cell/driver-identity.js +0 -143
- package/addon/components/cell/driver-name.hbs +0 -26
- package/addon/components/cell/driver-name.js +0 -30
- package/addon/components/cell/equipment-identity.js +0 -48
- package/addon/components/cell/part-identity.js +0 -63
- package/addon/components/cell/telematic-device.hbs +0 -38
- package/addon/components/cell/telematic-device.js +0 -44
- package/addon/components/cell/telematic-provider.hbs +0 -33
- package/addon/components/cell/telematic-provider.js +0 -78
- package/addon/components/cell/vehicle-identity.js +0 -138
- package/addon/components/cell/vehicle-name.hbs +0 -23
- package/addon/components/cell/vehicle-name.js +0 -3
- package/addon/components/device/pill.js +0 -3
- package/addon/components/driver/pill.js +0 -7
- package/addon/components/equipment/pill.js +0 -3
- package/addon/components/filter/multi-model.hbs +0 -19
- package/addon/components/filter/multi-model.js +0 -90
- package/addon/components/order/pill.js +0 -3
- package/addon/components/trailer/pill.js +0 -3
- package/addon/components/vehicle/pill.js +0 -7
- package/addon/templates/connectivity/fuel-providers/details/settings.hbs +0 -11
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import generateUuid from '@fleetbase/ember-core/utils/generate-uuid';
|
|
2
|
+
import isObject from '@fleetbase/ember-core/utils/is-object';
|
|
3
|
+
import { componentForFieldType, INSPECTION_FIELD_TYPES } from './inspection-field-types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A form's structure, in the one shape the console holds it in.
|
|
7
|
+
*
|
|
8
|
+
* The `inspection-form` model belongs to `@fleetbase/fleetops-data` and
|
|
9
|
+
* declares no structure attribute, so the builder cannot hang the groups off
|
|
10
|
+
* the record and let Ember Data carry them. It reads the structure from the
|
|
11
|
+
* internal form payload and writes it back whole under
|
|
12
|
+
* `inspection_form.field_groups`, which is what
|
|
13
|
+
* `InspectionFormController::syncStructureFromRequest()` looks for and what
|
|
14
|
+
* `InspectionFormSync::sync()` matches on `uuid`.
|
|
15
|
+
*
|
|
16
|
+
* Everything here is plain objects. Nothing in this file mutates its argument.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Sorts groups or fields the way the builder laid them out. */
|
|
20
|
+
function byOrder(a, b) {
|
|
21
|
+
const ao = a?.order ?? Number.MAX_SAFE_INTEGER;
|
|
22
|
+
const bo = b?.order ?? Number.MAX_SAFE_INTEGER;
|
|
23
|
+
return ao - bo;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function metaOf(value) {
|
|
27
|
+
return isObject(value) ? { ...value } : {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** One field, as the builder and the answering screen both read it. */
|
|
31
|
+
export function normalizeField(field, index = 0) {
|
|
32
|
+
const type = INSPECTION_FIELD_TYPES.includes(field?.type) ? field.type : 'input';
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
uuid: field?.uuid ?? field?.id ?? generateUuid(),
|
|
36
|
+
name: field?.name ?? '',
|
|
37
|
+
label: field?.label ?? '',
|
|
38
|
+
description: field?.description ?? null,
|
|
39
|
+
help_text: field?.help_text ?? null,
|
|
40
|
+
type,
|
|
41
|
+
component: field?.component ?? componentForFieldType(type),
|
|
42
|
+
required: Boolean(field?.required),
|
|
43
|
+
editable: field?.editable === undefined ? true : Boolean(field.editable),
|
|
44
|
+
options: Array.isArray(field?.options) ? [...field.options] : [],
|
|
45
|
+
order: field?.order ?? index + 1,
|
|
46
|
+
meta: metaOf(field?.meta),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** One group, with its fields inside it and sorted. */
|
|
51
|
+
export function normalizeGroup(group, index = 0, fields = []) {
|
|
52
|
+
const own = Array.isArray(group?.fields) ? group.fields : Array.isArray(group?.customFields) ? group.customFields : fields;
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
uuid: group?.uuid ?? group?.id ?? generateUuid(),
|
|
56
|
+
name: group?.name ?? '',
|
|
57
|
+
description: group?.description ?? null,
|
|
58
|
+
order: group?.order ?? index + 1,
|
|
59
|
+
meta: { grid_size: 1, ...metaOf(group?.meta) },
|
|
60
|
+
fields: [...own].sort(byOrder).map((field, fieldIndex) => normalizeField(field, fieldIndex)),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The structure held in an internal form payload.
|
|
66
|
+
*
|
|
67
|
+
* A read carries `field_groups` (the groups alone) beside a flat `fields` list
|
|
68
|
+
* that names its group by `category_uuid`; `grouped_fields` carries the same
|
|
69
|
+
* thing already nested, and is what the driver API answers with. Either is
|
|
70
|
+
* accepted, so this works against a record read through the console and one
|
|
71
|
+
* read through the public link.
|
|
72
|
+
*/
|
|
73
|
+
export function normalizeFieldGroups(payload) {
|
|
74
|
+
if (!payload) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const groups = Array.isArray(payload.field_groups) ? payload.field_groups : [];
|
|
79
|
+
const fields = Array.isArray(payload.fields) ? payload.fields : [];
|
|
80
|
+
|
|
81
|
+
const fromFieldGroups = groups
|
|
82
|
+
.slice()
|
|
83
|
+
.sort(byOrder)
|
|
84
|
+
.map((group, index) => {
|
|
85
|
+
const groupUuid = group?.uuid ?? group?.id;
|
|
86
|
+
const own = fields.filter((field) => (field?.category_uuid ?? null) === groupUuid);
|
|
87
|
+
return normalizeGroup(group, index, own);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const fromGroupedFields = (Array.isArray(payload.grouped_fields) ? payload.grouped_fields : [])
|
|
91
|
+
.slice()
|
|
92
|
+
.sort(byOrder)
|
|
93
|
+
.map((group, index) => normalizeGroup(group, index));
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* Two shapes describe the same structure. `field_groups` carries no fields
|
|
97
|
+
* of its own — they arrive in the sibling `fields` array, joined on
|
|
98
|
+
* `category_uuid` — while `grouped_fields` nests them. A public payload
|
|
99
|
+
* omits `category_uuid`, so the join finds nothing and every group comes
|
|
100
|
+
* back empty; take whichever shape actually produced fields.
|
|
101
|
+
*
|
|
102
|
+
* When neither did, prefer `field_groups`: a form whose groups are laid
|
|
103
|
+
* out but still empty is a real state in the builder, and returning
|
|
104
|
+
* nothing would lose those groups.
|
|
105
|
+
*/
|
|
106
|
+
if (fromFieldGroups.some((group) => group.fields.length > 0)) {
|
|
107
|
+
return fromFieldGroups;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (fromGroupedFields.some((group) => group.fields.length > 0)) {
|
|
111
|
+
return fromGroupedFields;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return fromFieldGroups.length ? fromFieldGroups : fromGroupedFields;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Every field of every group, flattened, in the order they are answered. */
|
|
118
|
+
export function flattenFields(groups = []) {
|
|
119
|
+
return groups.reduce((carry, group) => carry.concat(Array.isArray(group?.fields) ? group.fields : []), []);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The structure as the server writes it. `order` is rewritten from the
|
|
124
|
+
* builder's own ordering so a drag or a delete renumbers the whole form, and
|
|
125
|
+
* the uuid is kept so a second save updates rather than duplicates.
|
|
126
|
+
*/
|
|
127
|
+
export function serializeFieldGroups(groups = []) {
|
|
128
|
+
return groups.map((group, groupIndex) => ({
|
|
129
|
+
uuid: group.uuid,
|
|
130
|
+
name: group.name,
|
|
131
|
+
description: group.description ?? null,
|
|
132
|
+
order: groupIndex + 1,
|
|
133
|
+
meta: metaOf(group.meta),
|
|
134
|
+
fields: (Array.isArray(group.fields) ? group.fields : []).map((field, fieldIndex) => ({
|
|
135
|
+
uuid: field.uuid,
|
|
136
|
+
name: field.name || null,
|
|
137
|
+
label: field.label,
|
|
138
|
+
description: field.description ?? null,
|
|
139
|
+
help_text: field.help_text ?? null,
|
|
140
|
+
type: field.type,
|
|
141
|
+
component: componentForFieldType(field.type),
|
|
142
|
+
required: Boolean(field.required),
|
|
143
|
+
editable: field.editable === undefined ? true : Boolean(field.editable),
|
|
144
|
+
options: Array.isArray(field.options) ? field.options.filter((option) => typeof option === 'string' && option.trim() !== '') : [],
|
|
145
|
+
order: fieldIndex + 1,
|
|
146
|
+
meta: metaOf(field.meta),
|
|
147
|
+
})),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** A blank group, ready for the builder to name. */
|
|
152
|
+
export function createFieldGroup(attributes = {}) {
|
|
153
|
+
return normalizeGroup({ uuid: generateUuid(), name: '', meta: { grid_size: 1 }, fields: [], ...attributes });
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** A blank field of the given type. */
|
|
157
|
+
export function createField(type = 'pass-fail', attributes = {}) {
|
|
158
|
+
const meta = type === 'pass-fail' ? { severity: 'medium', require_photo_on_fail: false, require_comment_on_fail: false, unsafe_on_fail: false } : {};
|
|
159
|
+
|
|
160
|
+
return normalizeField({ uuid: generateUuid(), label: '', type, meta, ...attributes });
|
|
161
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared vocabulary for the Radar page: which pills exist, how a rule maps
|
|
3
|
+
* to a badge colour, which actions are record-level, and the snooze presets.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const RADAR_PILLS = ['overdue', 'due_week', 'unassigned', 'issues', 'inspections', 'shifts', 'expiring', 'low_stock', 'fuel', 'notices'];
|
|
7
|
+
|
|
8
|
+
export const RADAR_STATUSES = ['open', 'snoozed', 'resolved'];
|
|
9
|
+
|
|
10
|
+
export const RADAR_GROUPS = ['overdue', 'today', 'week', 'later', 'none'];
|
|
11
|
+
|
|
12
|
+
/** Saved views every user starts with. */
|
|
13
|
+
export const RADAR_DEFAULT_VIEWS = [
|
|
14
|
+
{ id: 'my-assignments', intl: 'radar.saved-views.defaults.my-assignments', status: 'open', filters: '', assigned: 'me', q: '', isDefault: true },
|
|
15
|
+
{ id: 'shift-changes', intl: 'radar.saved-views.defaults.shift-changes', status: 'open', filters: 'shifts', assigned: '', q: '', isDefault: true },
|
|
16
|
+
{ id: 'due-this-week', intl: 'radar.saved-views.defaults.due-this-week', status: 'open', filters: 'due_week', assigned: '', q: '', isDefault: true },
|
|
17
|
+
{ id: 'unmatched-fuel', intl: 'radar.saved-views.defaults.unmatched-fuel', status: 'open', filters: 'fuel', assigned: '', q: '', isDefault: true },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
/** Badge status per category; issues go by severity instead. */
|
|
21
|
+
const CHIP_BY_CATEGORY = {
|
|
22
|
+
maintenance: 'warning',
|
|
23
|
+
inspections: 'violet',
|
|
24
|
+
staffing: 'info',
|
|
25
|
+
compliance: 'cyan',
|
|
26
|
+
fuel: 'sky',
|
|
27
|
+
parts: 'slate',
|
|
28
|
+
connectivity: 'slate',
|
|
29
|
+
issues: 'warning',
|
|
30
|
+
notices: 'gray',
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const CHIP_BY_RULE = {
|
|
34
|
+
work_order_overdue: 'orange',
|
|
35
|
+
work_order_blocked: 'orange',
|
|
36
|
+
shift_late_start: 'indigo',
|
|
37
|
+
shift_no_vehicle: 'indigo',
|
|
38
|
+
shift_handover: 'indigo',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function chipStatusFor(item) {
|
|
42
|
+
if (!item) {
|
|
43
|
+
return 'gray';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (item.rule === 'issue_open') {
|
|
47
|
+
return item.severity === 'critical' ? 'error' : 'warning';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return CHIP_BY_RULE[item.rule] ?? CHIP_BY_CATEGORY[item.category] ?? 'gray';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Actions that change the record itself, in the order the rail prefers
|
|
55
|
+
* them, each with its label key and icon. Everything else is state.
|
|
56
|
+
*/
|
|
57
|
+
export const RECORD_ACTIONS = {
|
|
58
|
+
create_work_order: { label: 'radar.actions.create-work-order', icon: 'clipboard-list' },
|
|
59
|
+
create_work_order_from_inspection: { label: 'radar.actions.create-work-order', icon: 'clipboard-list' },
|
|
60
|
+
create_issue_from_inspection: { label: 'radar.actions.create-issue', icon: 'triangle-exclamation' },
|
|
61
|
+
resolve_inspection: { label: 'radar.actions.mark-resolved', icon: 'check' },
|
|
62
|
+
resolve_issue: { label: 'radar.actions.mark-resolved', icon: 'check' },
|
|
63
|
+
assign_vehicle: { label: 'radar.actions.assign-vehicle', icon: 'truck' },
|
|
64
|
+
assign_driver: { label: 'radar.actions.assign-driver', icon: 'id-card' },
|
|
65
|
+
match_vehicle: { label: 'radar.actions.match-vehicle', icon: 'link' },
|
|
66
|
+
ignore_transaction: { label: 'radar.actions.ignore', icon: 'eye-slash' },
|
|
67
|
+
attach_device: { label: 'radar.actions.attach', icon: 'satellite-dish' },
|
|
68
|
+
send_pin: { label: 'radar.actions.send-pin', icon: 'paper-plane' },
|
|
69
|
+
revoke_link: { label: 'radar.actions.revoke-link', icon: 'ban' },
|
|
70
|
+
call: { label: 'radar.actions.call', icon: 'phone' },
|
|
71
|
+
cover_shift: { label: 'radar.actions.cover-shift', icon: 'people-arrows' },
|
|
72
|
+
handover: { label: 'radar.actions.reassign', icon: 'right-left' },
|
|
73
|
+
extend_shift: { label: 'radar.actions.extend-shift', icon: 'clock' },
|
|
74
|
+
resolve: { label: 'radar.actions.resolve', icon: 'check' },
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const STATE_ACTIONS = ['acknowledge', 'snooze', 'wake', 'assign', 'unassign', 'plan', 'unplan', 'open_record'];
|
|
78
|
+
|
|
79
|
+
/** The first record-level action an item offers, with its label and icon. */
|
|
80
|
+
export function primaryActionFor(item) {
|
|
81
|
+
const key = (item?.actions ?? []).find((action) => RECORD_ACTIONS[action]);
|
|
82
|
+
if (!key) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return { key, ...RECORD_ACTIONS[key] };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Every record-level action after the primary one. */
|
|
90
|
+
export function secondaryActionsFor(item) {
|
|
91
|
+
const primary = primaryActionFor(item);
|
|
92
|
+
|
|
93
|
+
return (item?.actions ?? []).filter((action) => RECORD_ACTIONS[action] && action !== primary?.key).map((key) => ({ key, ...RECORD_ACTIONS[key] }));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const SNOOZE_PRESETS = ['1h', '4h', 'tomorrow', 'next-week'];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The snooze payload for a preset: minutes for the short ones, a
|
|
100
|
+
* morning-of date for the longer ones.
|
|
101
|
+
*/
|
|
102
|
+
export function snoozePayloadFor(preset, now = new Date()) {
|
|
103
|
+
switch (preset) {
|
|
104
|
+
case '1h':
|
|
105
|
+
return { minutes: 60 };
|
|
106
|
+
case '4h':
|
|
107
|
+
return { minutes: 240 };
|
|
108
|
+
case 'tomorrow': {
|
|
109
|
+
const until = new Date(now);
|
|
110
|
+
until.setDate(until.getDate() + 1);
|
|
111
|
+
until.setHours(8, 0, 0, 0);
|
|
112
|
+
return { until: until.toISOString() };
|
|
113
|
+
}
|
|
114
|
+
case 'next-week': {
|
|
115
|
+
const until = new Date(now);
|
|
116
|
+
until.setDate(until.getDate() + 7);
|
|
117
|
+
until.setHours(8, 0, 0, 0);
|
|
118
|
+
return { until: until.toISOString() };
|
|
119
|
+
}
|
|
120
|
+
default:
|
|
121
|
+
return { minutes: 60 };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function initialsOf(name) {
|
|
126
|
+
const parts = String(name ?? '')
|
|
127
|
+
.trim()
|
|
128
|
+
.split(/\s+/)
|
|
129
|
+
.filter(Boolean);
|
|
130
|
+
if (!parts.length) {
|
|
131
|
+
return '';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const first = parts[0].charAt(0);
|
|
135
|
+
const last = parts.length > 1 ? parts[parts.length - 1].charAt(0) : '';
|
|
136
|
+
|
|
137
|
+
return (first + last).toUpperCase();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Replace one item (by key) inside a Radar items payload, or drop it when the updater returns null. */
|
|
141
|
+
export function patchPayload(payload, key, updater) {
|
|
142
|
+
if (!payload) {
|
|
143
|
+
return payload;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const apply = (item) => (item.key === key ? updater(item) : item);
|
|
147
|
+
const items = (payload.items ?? []).map(apply).filter(Boolean);
|
|
148
|
+
const groups = (payload.groups ?? [])
|
|
149
|
+
.map((group) => {
|
|
150
|
+
const members = (group.items ?? []).map(apply).filter(Boolean);
|
|
151
|
+
return { ...group, items: members, count: members.length };
|
|
152
|
+
})
|
|
153
|
+
.filter((group) => group.items.length > 0);
|
|
154
|
+
|
|
155
|
+
return { ...payload, items, groups };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* How to show a record Radar links to without leaving the page: the Ember
|
|
160
|
+
* Data model to load, the action service whose `panel.view` renders it, or
|
|
161
|
+
* the details component to open in a plain context panel when the resource
|
|
162
|
+
* has no panel of its own. Keyed by the record route's prefix; the longest
|
|
163
|
+
* matching prefix wins, so `management.vehicles.index.details.devices`
|
|
164
|
+
* resolves to the vehicle panel.
|
|
165
|
+
*/
|
|
166
|
+
export const RECORD_PANELS = {
|
|
167
|
+
'management.drivers': { modelName: 'driver', service: 'driver-actions' },
|
|
168
|
+
'management.vehicles': { modelName: 'vehicle', service: 'vehicle-actions' },
|
|
169
|
+
'management.trailers': { modelName: 'trailer', service: 'trailer-actions' },
|
|
170
|
+
'management.issues': { modelName: 'issue', service: 'issue-actions', include: ['driver', 'vehicle', 'assignee', 'reporter', 'order', 'files'] },
|
|
171
|
+
'management.fuel-transactions': { modelName: 'fuel-provider-transaction', component: 'fuel-provider-transaction/summary' },
|
|
172
|
+
'maintenance.maintenances': { modelName: 'maintenance', service: 'maintenance-actions' },
|
|
173
|
+
'maintenance.equipment': { modelName: 'equipment', service: 'equipment-actions' },
|
|
174
|
+
'maintenance.schedules': { modelName: 'maintenance-schedule', service: 'maintenance-schedule-actions' },
|
|
175
|
+
'maintenance.work-orders': { modelName: 'work-order', service: 'work-order-actions' },
|
|
176
|
+
'maintenance.parts': { modelName: 'part', service: 'part-actions' },
|
|
177
|
+
'maintenance.inspection-submissions': { modelName: 'inspection-submission', service: 'inspection-submission-actions' },
|
|
178
|
+
'maintenance.inspection-forms': { modelName: 'inspection-form', service: 'inspection-form-actions' },
|
|
179
|
+
'connectivity.devices': { modelName: 'device', service: 'device-actions' },
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/** The panel definition for a record route, or null when Radar has none for it. */
|
|
183
|
+
export function recordPanelFor(route) {
|
|
184
|
+
if (!route) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const prefix = Object.keys(RECORD_PANELS)
|
|
189
|
+
.filter((key) => route === key || route.startsWith(`${key}.`))
|
|
190
|
+
.sort((a, b) => b.length - a.length)[0];
|
|
191
|
+
|
|
192
|
+
return prefix ? RECORD_PANELS[prefix] : null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* The `{ route, model }` a Radar link points at, whichever shape it arrived
|
|
197
|
+
* in: an item (`item.record`), a decision or handover record, or a brief
|
|
198
|
+
* sentence segment carrying `route` and `model` itself.
|
|
199
|
+
*/
|
|
200
|
+
export function recordOf(target) {
|
|
201
|
+
if (!target) {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
if (target.record?.route) {
|
|
205
|
+
return target.record;
|
|
206
|
+
}
|
|
207
|
+
if (target.route && target.model) {
|
|
208
|
+
return { route: target.route, model: target.model };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { get } from '@ember/object';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reads a relation without returning a promise proxy: the loaded record for
|
|
5
|
+
* an Ember Data relationship (null while it is not loaded), the plain value
|
|
6
|
+
* for a POJO. Async belongsTo relations return an always-truthy proxy from
|
|
7
|
+
* `get`, which is why identity cells must read them this way.
|
|
8
|
+
*/
|
|
9
|
+
export default function relationValue(record, name) {
|
|
10
|
+
if (!record || !name) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (typeof record.belongsTo === 'function') {
|
|
15
|
+
try {
|
|
16
|
+
return record.belongsTo(name).value() ?? null;
|
|
17
|
+
} catch {
|
|
18
|
+
// not a belongsTo on this model
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (typeof record.hasMany === 'function') {
|
|
23
|
+
try {
|
|
24
|
+
return record.hasMany(name).value() ?? null;
|
|
25
|
+
} catch {
|
|
26
|
+
// not a hasMany either
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const value = get(record, name);
|
|
31
|
+
|
|
32
|
+
if (value && typeof value === 'object' && typeof value.then === 'function') {
|
|
33
|
+
return value.content ?? null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return value ?? null;
|
|
37
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { get } from '@ember/object';
|
|
2
|
+
import { first, present, relation, photo, icon, badge, badges, fact, relatedFact, money, join, panelOpener } from './helpers';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Vehicles, trailers, equipment, parts, generic assets and warranties.
|
|
6
|
+
*/
|
|
7
|
+
export default function buildAssetDescriptors(owner) {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
key: 'vehicle',
|
|
11
|
+
labelKey: 'resource.vehicle',
|
|
12
|
+
icon: 'truck',
|
|
13
|
+
modelNames: ['vehicle'],
|
|
14
|
+
aliases: ['attachable-vehicle', 'maintenance-subject-vehicle'],
|
|
15
|
+
polymorphicTypes: ['fleet-ops:vehicle', 'Fleetbase\\FleetOps\\Models\\Vehicle'],
|
|
16
|
+
permission: 'fleet-ops view vehicle',
|
|
17
|
+
statusTones: {
|
|
18
|
+
available: 'text-green-500',
|
|
19
|
+
active: 'text-green-500',
|
|
20
|
+
in_service: 'text-green-500',
|
|
21
|
+
maintenance: 'text-yellow-500',
|
|
22
|
+
unavailable: 'text-gray-400',
|
|
23
|
+
inactive: 'text-gray-400',
|
|
24
|
+
out_of_service: 'text-red-500',
|
|
25
|
+
},
|
|
26
|
+
title: (vehicle) =>
|
|
27
|
+
first(vehicle, 'displayName', 'display_name', 'name', 'yearMakeModel', 'public_id') ?? join([get(vehicle, 'year'), get(vehicle, 'make'), get(vehicle, 'model')]),
|
|
28
|
+
identifier: (vehicle) => first(vehicle, 'plate_number', 'call_sign', 'vin', 'serial_number'),
|
|
29
|
+
image: (vehicle) => photo(vehicle, 'vehicle'),
|
|
30
|
+
online: (vehicle) => {
|
|
31
|
+
const online = get(vehicle, 'online');
|
|
32
|
+
|
|
33
|
+
return typeof online === 'boolean' ? online : undefined;
|
|
34
|
+
},
|
|
35
|
+
status: (vehicle) => first(vehicle, 'status'),
|
|
36
|
+
badges: (vehicle) => {
|
|
37
|
+
const driver = relation(owner, vehicle, 'driver');
|
|
38
|
+
|
|
39
|
+
return badges(
|
|
40
|
+
badge('plate', 'id-card', first(vehicle, 'plate_number', 'call_sign', 'vehicle_number')),
|
|
41
|
+
badge('driver', 'user', first(driver, 'name', 'displayName') ?? first(vehicle, 'driver_name'), {
|
|
42
|
+
relatedType: 'driver',
|
|
43
|
+
relatedId: driver?.id ?? get(vehicle, 'driver_uuid'),
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
selectDetails: (vehicle) => [first(vehicle, 'plate_number', 'vin', 'serial_number', 'call_sign'), first(vehicle, 'driver_name')],
|
|
48
|
+
facts: (vehicle) => {
|
|
49
|
+
const driver = relation(owner, vehicle, 'driver');
|
|
50
|
+
const trailers = relation(owner, vehicle, 'trailers');
|
|
51
|
+
const trailer = trailers && typeof trailers.objectAt === 'function' ? trailers.objectAt(0) : Array.isArray(trailers) ? trailers[0] : null;
|
|
52
|
+
const extra = trailers?.length > 1 ? ` (+${trailers.length - 1})` : '';
|
|
53
|
+
|
|
54
|
+
return [
|
|
55
|
+
fact('make-model', join([get(vehicle, 'year'), get(vehicle, 'make'), get(vehicle, 'model'), get(vehicle, 'trim')])),
|
|
56
|
+
fact('plate', join([first(vehicle, 'plate_number'), first(vehicle, 'vin')], ' · ')),
|
|
57
|
+
relatedFact('driver', driver, 'driver', first(vehicle, 'driver_name')),
|
|
58
|
+
trailer ? { ...relatedFact('trailer', trailer, 'trailer', first(trailer, 'displayName', 'display_name', 'name')), suffix: extra } : fact('trailer', null),
|
|
59
|
+
fact('odometer', present(get(vehicle, 'odometer')) ? join([get(vehicle, 'odometer'), get(vehicle, 'odometer_unit')]) : null),
|
|
60
|
+
fact('status', first(vehicle, 'status'), { format: 'humanize' }),
|
|
61
|
+
];
|
|
62
|
+
},
|
|
63
|
+
open: panelOpener(owner, 'vehicle-actions'),
|
|
64
|
+
components: { identity: 'cell/vehicle-identity' },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'trailer',
|
|
68
|
+
labelKey: 'resource.trailer',
|
|
69
|
+
icon: 'trailer',
|
|
70
|
+
modelNames: ['trailer'],
|
|
71
|
+
aliases: ['attachable-trailer', 'maintenance-subject-trailer'],
|
|
72
|
+
polymorphicTypes: ['fleet-ops:trailer', 'Fleetbase\\FleetOps\\Models\\Trailer'],
|
|
73
|
+
permission: 'fleet-ops view trailer',
|
|
74
|
+
statusTones: { attached: 'text-green-500', detached: 'text-gray-400' },
|
|
75
|
+
title: (trailer) => first(trailer, 'displayName', 'display_name', 'name', 'public_id'),
|
|
76
|
+
identifier: (trailer) => first(trailer, 'plate_number', 'vin', 'code'),
|
|
77
|
+
image: (trailer) => photo(trailer, 'trailer'),
|
|
78
|
+
online: (trailer) => {
|
|
79
|
+
const online = get(trailer, 'isOnline') ?? get(trailer, 'online') ?? get(trailer, 'is_online');
|
|
80
|
+
|
|
81
|
+
return typeof online === 'boolean' ? online : undefined;
|
|
82
|
+
},
|
|
83
|
+
status: (trailer) => first(trailer, 'status', 'attachment_state'),
|
|
84
|
+
badges: (trailer) => {
|
|
85
|
+
const vehicle = relation(owner, trailer, 'current_vehicle');
|
|
86
|
+
|
|
87
|
+
return badges(
|
|
88
|
+
badge('plate', 'id-card', first(trailer, 'plate_number', 'code')),
|
|
89
|
+
badge('vehicle', 'truck', first(vehicle, 'displayName', 'display_name', 'name') ?? first(trailer, 'current_vehicle_name'), {
|
|
90
|
+
relatedType: 'vehicle',
|
|
91
|
+
relatedId: vehicle?.id ?? get(trailer, 'current_vehicle_id'),
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
selectDetails: (trailer) => [first(trailer, 'type'), first(trailer, 'plate_number', 'vin', 'code')],
|
|
96
|
+
facts: (trailer) => {
|
|
97
|
+
const vehicle = relation(owner, trailer, 'current_vehicle');
|
|
98
|
+
|
|
99
|
+
return [
|
|
100
|
+
fact('type', first(trailer, 'type', 'body_type'), { format: 'humanize' }),
|
|
101
|
+
fact('body-coupling', join([first(trailer, 'body_type'), first(trailer, 'coupling_type')], ' · '), { format: 'humanize' }),
|
|
102
|
+
fact('plate', join([first(trailer, 'plate_number'), first(trailer, 'vin')], ' · ')),
|
|
103
|
+
relatedFact('vehicle', vehicle, 'vehicle', first(trailer, 'current_vehicle_name')),
|
|
104
|
+
fact('axles', get(trailer, 'axle_count')),
|
|
105
|
+
fact('attachment', first(trailer, 'attachment_state'), { format: 'humanize' }),
|
|
106
|
+
];
|
|
107
|
+
},
|
|
108
|
+
open: panelOpener(owner, 'trailer-actions'),
|
|
109
|
+
components: { identity: 'cell/trailer-identity' },
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
key: 'equipment',
|
|
113
|
+
labelKey: 'resource.equipment',
|
|
114
|
+
icon: 'toolbox',
|
|
115
|
+
modelNames: ['equipment'],
|
|
116
|
+
aliases: ['maintenance-subject-equipment'],
|
|
117
|
+
polymorphicTypes: ['fleet-ops:equipment', 'Fleetbase\\FleetOps\\Models\\Equipment'],
|
|
118
|
+
permission: 'fleet-ops view equipment',
|
|
119
|
+
statusTones: {
|
|
120
|
+
active: 'text-green-500',
|
|
121
|
+
equipped: 'text-green-500',
|
|
122
|
+
available: 'text-green-500',
|
|
123
|
+
maintenance: 'text-yellow-500',
|
|
124
|
+
unequipped: 'text-gray-400',
|
|
125
|
+
inactive: 'text-gray-400',
|
|
126
|
+
retired: 'text-red-500',
|
|
127
|
+
},
|
|
128
|
+
title: (equipment) => first(equipment, 'name', 'code', 'public_id'),
|
|
129
|
+
identifier: (equipment) => first(equipment, 'serial_number', 'code'),
|
|
130
|
+
image: (equipment) => (present(get(equipment, 'photo_url')) ? { url: get(equipment, 'photo_url'), shape: 'square' } : icon('toolbox')),
|
|
131
|
+
status: (equipment) => (get(equipment, 'is_equipped') ? 'equipped' : first(equipment, 'status')),
|
|
132
|
+
selectDetails: (equipment) => [first(equipment, 'type'), first(equipment, 'serial_number', 'code')],
|
|
133
|
+
facts: (equipment) => [
|
|
134
|
+
fact('type', first(equipment, 'type'), { format: 'humanize' }),
|
|
135
|
+
fact('make-model', join([first(equipment, 'manufacturer'), first(equipment, 'model')])),
|
|
136
|
+
fact('serial', first(equipment, 'serial_number')),
|
|
137
|
+
relatedFact('equipped-to', relation(owner, equipment, 'equipable'), null, first(equipment, 'equipped_to_name')),
|
|
138
|
+
relatedFact('warranty', relation(owner, equipment, 'warranty'), 'warranty', first(equipment, 'warranty_name')),
|
|
139
|
+
fact('purchase-price', money(get(equipment, 'purchase_price'), get(equipment, 'currency'))),
|
|
140
|
+
],
|
|
141
|
+
open: panelOpener(owner, 'equipment-actions'),
|
|
142
|
+
components: { identity: 'cell/equipment-identity' },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: 'part',
|
|
146
|
+
labelKey: 'resource.part',
|
|
147
|
+
icon: 'gears',
|
|
148
|
+
modelNames: ['part'],
|
|
149
|
+
polymorphicTypes: ['fleet-ops:part', 'Fleetbase\\FleetOps\\Models\\Part'],
|
|
150
|
+
permission: 'fleet-ops view part',
|
|
151
|
+
statusTones: { in_stock: 'text-green-500', low_stock: 'text-yellow-500', out_of_stock: 'text-red-500' },
|
|
152
|
+
title: (part) => first(part, 'name', 'sku', 'public_id'),
|
|
153
|
+
identifier: (part) => first(part, 'sku', 'serial_number'),
|
|
154
|
+
image: (part) => (present(get(part, 'photo_url')) ? { url: get(part, 'photo_url'), shape: 'square' } : icon('gears')),
|
|
155
|
+
status: (part) =>
|
|
156
|
+
get(part, 'is_low_stock') ? 'low_stock' : get(part, 'is_in_stock') ? 'in_stock' : get(part, 'quantity_on_hand') === undefined ? first(part, 'status') : 'out_of_stock',
|
|
157
|
+
selectDetails: (part) => [first(part, 'sku'), first(part, 'manufacturer')],
|
|
158
|
+
facts: (part) => [
|
|
159
|
+
fact('sku', first(part, 'sku')),
|
|
160
|
+
fact('make-model', join([first(part, 'manufacturer'), first(part, 'model')])),
|
|
161
|
+
fact('quantity', present(get(part, 'quantity_on_hand')) ? `${get(part, 'quantity_on_hand')}${get(part, 'is_low_stock') ? ' (low stock)' : ''}` : null),
|
|
162
|
+
fact('unit-cost', money(get(part, 'unit_cost'), get(part, 'currency'))),
|
|
163
|
+
relatedFact('vendor', relation(owner, part, 'vendor'), 'vendor', first(part, 'vendor_name')),
|
|
164
|
+
relatedFact('fitted-to', part.__fittedTo ?? null, first(part, 'asset_type'), first(part, 'asset_name')),
|
|
165
|
+
],
|
|
166
|
+
hydrate: async (part) => {
|
|
167
|
+
const type = first(part, 'asset_type');
|
|
168
|
+
const id = first(part, 'asset_uuid');
|
|
169
|
+
const registry = owner.lookup('service:resource-registry');
|
|
170
|
+
const store = owner.lookup('service:store');
|
|
171
|
+
const key = registry?.resolveKey(type);
|
|
172
|
+
|
|
173
|
+
if (!key || !id || !store || part.__fittedTo) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
part.__fittedTo = store.peekRecord(key, id) ?? (await store.findRecord(key, id));
|
|
179
|
+
} catch {
|
|
180
|
+
part.__fittedTo = null;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return part;
|
|
184
|
+
},
|
|
185
|
+
open: panelOpener(owner, 'part-actions'),
|
|
186
|
+
components: { identity: 'cell/part-identity' },
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: 'asset',
|
|
190
|
+
labelKey: 'resource.asset',
|
|
191
|
+
icon: 'cube',
|
|
192
|
+
modelNames: ['asset'],
|
|
193
|
+
aliases: ['attachable-asset'],
|
|
194
|
+
polymorphicTypes: ['fleet-ops:asset', 'Fleetbase\\FleetOps\\Models\\Asset'],
|
|
195
|
+
title: (asset) => first(asset, 'display_name', 'displayName', 'name', 'public_id'),
|
|
196
|
+
identifier: (asset) => first(asset, 'plate_number', 'vin', 'serial_number', 'code'),
|
|
197
|
+
image: (asset) => (present(get(asset, 'photo_url')) ? { url: get(asset, 'photo_url'), shape: 'square' } : icon('cube')),
|
|
198
|
+
online: (asset) => {
|
|
199
|
+
const online = get(asset, 'is_online') ?? get(asset, 'online');
|
|
200
|
+
|
|
201
|
+
return typeof online === 'boolean' ? online : undefined;
|
|
202
|
+
},
|
|
203
|
+
status: (asset) => first(asset, 'status'),
|
|
204
|
+
selectDetails: (asset) => [first(asset, 'type'), first(asset, 'plate_number', 'vin', 'serial_number')],
|
|
205
|
+
facts: (asset) => [
|
|
206
|
+
fact('type', first(asset, 'type', 'usage_type'), { format: 'humanize' }),
|
|
207
|
+
fact('make-model', join([get(asset, 'year'), get(asset, 'make'), get(asset, 'model')])),
|
|
208
|
+
relatedFact('vendor', relation(owner, asset, 'vendor'), 'vendor', first(asset, 'vendor_name')),
|
|
209
|
+
fact('category', first(asset, 'category_name', 'category.name')),
|
|
210
|
+
fact('location', first(asset, 'current_location', 'current_place.name')),
|
|
211
|
+
],
|
|
212
|
+
open: async (asset, context) => {
|
|
213
|
+
const registry = owner.lookup('service:resource-registry');
|
|
214
|
+
const concrete = first(asset, 'asset_class', 'type');
|
|
215
|
+
const key = concrete && concrete !== 'asset' ? registry?.resolveKey(concrete) : null;
|
|
216
|
+
|
|
217
|
+
if (key && key !== 'asset') {
|
|
218
|
+
return registry.open(asset, { ...context, resourceType: key });
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return false;
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
key: 'warranty',
|
|
226
|
+
labelKey: 'resource.warranty',
|
|
227
|
+
icon: 'shield-halved',
|
|
228
|
+
modelNames: ['warranty'],
|
|
229
|
+
polymorphicTypes: ['fleet-ops:warranty', 'Fleetbase\\FleetOps\\Models\\Warranty'],
|
|
230
|
+
statusTones: { active: 'text-green-500', expired: 'text-red-500', expiring: 'text-yellow-500' },
|
|
231
|
+
title: (warranty) => join([first(warranty, 'provider'), first(warranty, 'policy_number')], ' · ') ?? first(warranty, 'public_id'),
|
|
232
|
+
identifier: (warranty) => first(warranty, 'policy_number'),
|
|
233
|
+
image: () => icon('shield-halved'),
|
|
234
|
+
status: (warranty) => (get(warranty, 'is_expired') ? 'expired' : get(warranty, 'is_active') ? 'active' : first(warranty, 'status')),
|
|
235
|
+
selectDetails: (warranty) => [first(warranty, 'provider'), first(warranty, 'policy_number')],
|
|
236
|
+
facts: (warranty) => [
|
|
237
|
+
fact('provider', first(warranty, 'provider')),
|
|
238
|
+
fact('policy', first(warranty, 'policy_number')),
|
|
239
|
+
relatedFact('vendor', relation(owner, warranty, 'vendor'), 'vendor', first(warranty, 'vendor_name')),
|
|
240
|
+
fact('subject', first(warranty, 'subject_name')),
|
|
241
|
+
fact('period', join([get(warranty, 'startDateShort') ?? get(warranty, 'start_date'), get(warranty, 'endDateShort') ?? get(warranty, 'end_date')], ' – ')),
|
|
242
|
+
fact('coverage', first(warranty, 'coverage_summary', 'coverage')),
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
];
|
|
246
|
+
}
|