@fleetbase/fleetops-engine 0.6.17 → 0.6.19
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/addon/components/activity/event-selector.hbs +59 -0
- package/addon/components/activity/event-selector.js +82 -0
- package/addon/components/activity/form.hbs +62 -0
- package/addon/components/activity/form.js +78 -0
- package/addon/components/activity/logic-builder.hbs +150 -0
- package/addon/components/activity/logic-builder.js +280 -0
- package/addon/components/admin/avatar-management.hbs +7 -7
- package/addon/components/admin/avatar-management.js +35 -59
- package/addon/components/admin/navigator-app.hbs +3 -3
- package/addon/components/asset/form.js +3 -0
- package/addon/components/avatar-picker.hbs +34 -12
- package/addon/components/avatar-picker.js +55 -25
- package/addon/components/cell/driver-name.hbs +1 -1
- package/addon/components/contact/details.hbs +42 -0
- package/addon/components/contact/details.js +3 -0
- package/addon/components/contact/form.hbs +89 -0
- package/addon/components/contact/form.js +57 -0
- package/addon/components/contact/panel-header.hbs +67 -0
- package/addon/components/contact/panel-header.js +3 -0
- package/addon/components/custom-entity/form.hbs +61 -0
- package/addon/components/custom-entity/form.js +90 -0
- package/addon/components/customer/admin-settings.hbs +1 -1
- package/addon/components/customer/create-order-form.hbs +57 -75
- package/addon/components/customer/create-order-form.js +32 -103
- package/addon/components/customer/details.hbs +52 -0
- package/addon/components/customer/details.js +3 -0
- package/addon/components/customer/form.hbs +144 -0
- package/addon/components/customer/form.js +109 -0
- package/addon/components/customer/leaflet-map.js +3 -0
- package/addon/components/customer/order-details.js +3 -0
- package/addon/components/customer/order-form.hbs +476 -0
- package/addon/components/customer/order-form.js +140 -0
- package/addon/components/customer/orders.hbs +2 -2
- package/addon/components/customer/orders.js +12 -1
- package/addon/components/device/details.hbs +105 -0
- package/addon/components/device/details.js +3 -0
- package/addon/components/device/form.hbs +194 -0
- package/addon/components/device/form.js +13 -0
- package/addon/components/display-place.hbs +4 -4
- package/addon/components/driver/details.hbs +56 -0
- package/addon/components/driver/details.js +3 -0
- package/addon/components/driver/form.hbs +171 -0
- package/addon/components/driver/form.js +84 -0
- package/addon/components/driver/panel-header.hbs +40 -0
- package/addon/components/driver/panel-header.js +3 -0
- package/addon/components/driver-onboard-settings.hbs +14 -14
- package/addon/components/entity/card.hbs +28 -0
- package/addon/components/entity/card.js +6 -0
- package/addon/components/entity/details.js +3 -0
- package/addon/components/entity/form.hbs +86 -0
- package/addon/components/entity/form.js +32 -0
- package/addon/components/entity-field-editing-settings.hbs +8 -8
- package/addon/components/equipment/details.hbs +95 -0
- package/addon/components/equipment/details.js +3 -0
- package/addon/components/equipment/form.hbs +127 -0
- package/addon/components/equipment/form.js +27 -0
- package/addon/components/fleet/details.hbs +32 -0
- package/addon/components/fleet/details.js +3 -0
- package/addon/components/fleet/driver-listing.hbs +81 -0
- package/addon/components/fleet/driver-listing.js +77 -0
- package/addon/components/fleet/form.hbs +108 -0
- package/addon/components/fleet/form.js +20 -0
- package/addon/components/fleet/vehicle-listing.hbs +86 -0
- package/addon/components/fleet/vehicle-listing.js +76 -0
- package/addon/components/fleet-driver-listing.hbs +5 -5
- package/addon/components/fleet-panel/details.hbs +13 -13
- package/addon/components/fleet-panel/driver-listing.hbs +5 -5
- package/addon/components/fleet-panel/vehicle-listing.hbs +5 -5
- package/addon/components/fleet-panel/vehicle-listing.js +11 -74
- package/addon/components/fleet-vehicle-listing.hbs +5 -5
- package/addon/components/fuel-report/details.hbs +48 -0
- package/addon/components/fuel-report/details.js +3 -0
- package/addon/components/fuel-report/form.hbs +110 -0
- package/addon/components/fuel-report/form.js +14 -0
- package/addon/components/global-search.hbs +6 -6
- package/addon/components/global-search.js +30 -32
- package/addon/components/integrated-order-details.hbs +22 -22
- package/addon/components/integrated-vendor/details.hbs +34 -0
- package/addon/components/integrated-vendor/form.hbs +80 -0
- package/addon/components/integrated-vendor/form.js +11 -0
- package/addon/components/issue/details.hbs +68 -0
- package/addon/components/issue/form.hbs +183 -0
- package/addon/components/issue/form.js +3 -0
- package/addon/components/layout/fleet-ops-sidebar/driver-listing.hbs +3 -1
- package/addon/components/layout/fleet-ops-sidebar/driver-listing.js +96 -100
- package/addon/components/layout/fleet-ops-sidebar/fleet-listing.hbs +2 -0
- package/addon/components/layout/fleet-ops-sidebar/fleet-listing.js +73 -80
- package/addon/components/layout/fleet-ops-sidebar.hbs +31 -1
- package/addon/components/layout/fleet-ops-sidebar.js +150 -49
- package/addon/components/leaflet-draw-control.js +1 -0
- package/addon/components/maintenance/details.hbs +123 -0
- package/addon/components/maintenance/details.js +3 -0
- package/addon/components/maintenance/form.hbs +174 -0
- package/addon/components/maintenance/form.js +18 -0
- package/addon/components/map/container.hbs +3 -0
- package/addon/components/map/container.js +10 -0
- package/addon/components/map/drawer/driver-listing.hbs +11 -0
- package/addon/components/map/drawer/driver-listing.js +149 -0
- package/addon/components/map/drawer/event-listing.hbs +1 -0
- package/addon/components/map/drawer/event-listing.js +3 -0
- package/addon/components/map/drawer/place-listing.hbs +11 -0
- package/addon/components/map/drawer/place-listing.js +116 -0
- package/addon/components/map/drawer/vehicle-listing.hbs +11 -0
- package/addon/components/map/drawer/vehicle-listing.js +125 -0
- package/addon/components/map/drawer.hbs +5 -0
- package/addon/components/map/drawer.js +23 -0
- package/addon/components/map/leaflet-live-map.hbs +177 -0
- package/addon/components/map/leaflet-live-map.js +437 -0
- package/addon/components/map/leaflet-tracking-layer.hbs +1 -0
- package/addon/components/map/leaflet-tracking-layer.js +3 -0
- package/addon/components/map/order-list-overlay/driver-panel-title.hbs +11 -0
- package/addon/components/map/order-list-overlay/driver-panel-title.js +3 -0
- package/addon/components/map/order-list-overlay/order.hbs +106 -0
- package/addon/components/map/order-list-overlay/order.js +35 -0
- package/addon/components/map/order-list-overlay.hbs +176 -0
- package/addon/components/map/order-list-overlay.js +8 -0
- package/addon/components/map/search.hbs +1 -0
- package/addon/components/map/search.js +3 -0
- package/addon/components/map/toolbar/visibility-control-panel.hbs +130 -0
- package/addon/components/map/toolbar/visibility-control-panel.js +78 -0
- package/addon/components/map/toolbar/zones-panel.hbs +55 -0
- package/addon/components/map/toolbar/zones-panel.js +24 -0
- package/addon/components/map/toolbar.hbs +115 -0
- package/addon/components/map/toolbar.js +42 -0
- package/addon/components/map.hbs +11 -0
- package/addon/components/map.js +3 -0
- package/addon/components/modals/assign-driver.hbs +2 -2
- package/addon/components/modals/bulk-assign-driver.hbs +1 -1
- package/addon/components/modals/clone-config-form.hbs +2 -2
- package/addon/components/modals/contact-details.hbs +12 -12
- package/addon/components/modals/contact-form.hbs +11 -11
- package/addon/components/modals/driver-assign-order.hbs +2 -2
- package/addon/components/modals/driver-assign-vehicle.hbs +2 -2
- package/addon/components/modals/driver-assign-vendor.hbs +2 -2
- package/addon/components/modals/driver-details.hbs +21 -21
- package/addon/components/modals/driver-form.hbs +18 -18
- package/addon/components/modals/edit-meta-form.hbs +2 -2
- package/addon/components/modals/entity-form.hbs +21 -21
- package/addon/components/modals/entity-meta-field-prompt.hbs +1 -1
- package/addon/components/modals/fleet-details.hbs +12 -12
- package/addon/components/modals/fleet-form.hbs +8 -8
- package/addon/components/modals/fuel-report-details.hbs +16 -16
- package/addon/components/modals/fuel-report-form.hbs +8 -8
- package/addon/components/modals/group-details.hbs +4 -4
- package/addon/components/modals/group-form.hbs +5 -5
- package/addon/components/modals/install-prompt.hbs +2 -2
- package/addon/components/modals/issue-details.hbs +16 -16
- package/addon/components/modals/issue-from.hbs +21 -21
- package/addon/components/modals/map-field-form.hbs +2 -2
- package/addon/components/modals/map-field-group-form.hbs +1 -1
- package/addon/components/modals/map-layer-form.hbs +10 -10
- package/addon/components/modals/meta-field-form.hbs +2 -2
- package/addon/components/modals/meta-field-group-form.hbs +1 -1
- package/addon/components/modals/new-custom-field-group.hbs +1 -1
- package/addon/components/modals/new-order-config.hbs +4 -4
- package/addon/components/modals/order-assign-driver.hbs +2 -2
- package/addon/components/modals/order-config-new-status.hbs +2 -2
- package/addon/components/modals/order-event.hbs +4 -4
- package/addon/components/modals/order-form.hbs +12 -12
- package/addon/components/modals/order-import.hbs +10 -10
- package/addon/components/modals/order-label.hbs +1 -1
- package/addon/components/modals/order-meta.hbs +1 -10
- package/addon/components/modals/order-new-activity.hbs +10 -10
- package/addon/components/modals/order-route-form.hbs +18 -18
- package/addon/components/modals/place-assign-vendor.hbs +2 -2
- package/addon/components/modals/place-details.hbs +24 -24
- package/addon/components/modals/place-form.hbs +1 -44
- package/addon/components/modals/point-map.hbs +6 -3
- package/addon/components/modals/policy-form.hbs +5 -5
- package/addon/components/modals/role-form.hbs +3 -3
- package/addon/components/modals/select-payment-method.hbs +1 -1
- package/addon/components/modals/service-area-form.hbs +9 -9
- package/addon/components/modals/set-password.hbs +5 -5
- package/addon/components/modals/uninstall-prompt.hbs +2 -2
- package/addon/components/modals/update-order-activity.hbs +88 -0
- package/addon/components/modals/update-order-activity.js +51 -0
- package/addon/components/modals/user-form.hbs +8 -9
- package/addon/components/modals/vehicle-details.hbs +78 -78
- package/addon/components/modals/vehicle-form.hbs +74 -74
- package/addon/components/modals/vendor-details.hbs +21 -21
- package/addon/components/modals/vendor-form.hbs +50 -50
- package/addon/components/modals/view-service-area.hbs +1 -1
- package/addon/components/modals/zone-form.hbs +8 -8
- package/addon/components/order/activity-list.hbs +34 -0
- package/addon/components/order/activity-list.js +3 -0
- package/addon/components/order/activity-timeline.hbs +33 -0
- package/addon/components/order/activity-timeline.js +3 -0
- package/addon/components/order/customer-avatar-stack.hbs +21 -0
- package/addon/components/order/customer-avatar-stack.js +39 -0
- package/addon/components/order/details/activity.hbs +13 -0
- package/addon/components/order/details/activity.js +58 -0
- package/addon/components/order/details/comments.hbs +3 -0
- package/addon/components/order/details/comments.js +3 -0
- package/addon/components/order/details/custom-fields.hbs +1 -0
- package/addon/components/order/details/custom-fields.js +19 -0
- package/addon/components/order/details/detail.hbs +169 -0
- package/addon/components/order/details/detail.js +42 -0
- package/addon/components/order/details/documents.hbs +76 -0
- package/addon/components/order/details/documents.js +64 -0
- package/addon/components/order/details/integrated-vendor-details.hbs +5 -0
- package/addon/components/order/details/map.hbs +1 -0
- package/addon/components/order/details/map.js +3 -0
- package/addon/components/order/details/metadata.hbs +3 -0
- package/addon/components/order/details/metadata.js +26 -0
- package/addon/components/order/details/notes.hbs +43 -0
- package/addon/components/order/details/notes.js +42 -0
- package/addon/components/order/details/payload.hbs +97 -0
- package/addon/components/order/details/payload.js +75 -0
- package/addon/components/order/details/proof.hbs +42 -0
- package/addon/components/order/details/proof.js +3 -0
- package/addon/components/order/details/purchase-rate.hbs +39 -0
- package/addon/components/order/details/purchase-rate.js +3 -0
- package/addon/components/order/details/route.hbs +26 -0
- package/addon/components/order/details/route.js +55 -0
- package/addon/components/order/details/tracking.hbs +41 -0
- package/addon/components/order/details/tracking.js +21 -0
- package/addon/components/order/details.hbs +41 -0
- package/addon/components/order/details.js +3 -0
- package/addon/components/order/form/custom-fields.hbs +11 -0
- package/addon/components/order/form/custom-fields.js +3 -0
- package/addon/components/order/form/details.hbs +249 -0
- package/addon/components/order/form/details.js +76 -0
- package/addon/components/order/form/documents.hbs +76 -0
- package/addon/components/order/form/documents.js +64 -0
- package/addon/components/order/form/metadata.hbs +5 -0
- package/addon/components/order/form/metadata.js +3 -0
- package/addon/components/order/form/notes.hbs +11 -0
- package/addon/components/order/form/notes.js +3 -0
- package/addon/components/order/form/payload.hbs +139 -0
- package/addon/components/order/form/payload.js +73 -0
- package/addon/components/order/form/route.hbs +283 -0
- package/addon/components/order/form/route.js +214 -0
- package/addon/components/order/form/service-rate.hbs +109 -0
- package/addon/components/order/form/service-rate.js +26 -0
- package/addon/components/order/form.hbs +28 -0
- package/addon/components/order/form.js +65 -0
- package/addon/components/order/header.hbs +12 -12
- package/addon/components/order/kanban-card.hbs +85 -0
- package/addon/components/order/kanban-card.js +6 -0
- package/addon/components/order/kanban.hbs +10 -0
- package/addon/components/order/kanban.js +111 -0
- package/addon/components/order/panel-header.hbs +36 -0
- package/addon/components/order/panel-header.js +3 -0
- package/addon/components/order/place-card.hbs +2 -2
- package/addon/components/order/route-editor.hbs +192 -0
- package/addon/components/order/route-editor.js +233 -0
- package/addon/components/order/schedule-card.hbs +10 -10
- package/addon/components/order/schedule-card.js +10 -9
- package/addon/components/order-config-manager/activity-flow.hbs +1 -1
- package/addon/components/order-config-manager/activity-flow.js +47 -46
- package/addon/components/order-config-manager/custom-fields.hbs +5 -5
- package/addon/components/order-config-manager/custom-fields.js +17 -23
- package/addon/components/order-config-manager/details.hbs +10 -10
- package/addon/components/order-config-manager/details.js +4 -4
- package/addon/components/order-config-manager/entities.hbs +9 -10
- package/addon/components/order-config-manager/entities.js +30 -32
- package/addon/components/order-config-manager.hbs +1 -1
- package/addon/components/order-config-manager.js +25 -24
- package/addon/components/order-list-overlay/driver-panel-title.hbs +1 -1
- package/addon/components/order-progress-card.hbs +6 -6
- package/addon/components/part/details.hbs +108 -0
- package/addon/components/part/details.js +3 -0
- package/addon/components/part/form.hbs +163 -0
- package/addon/components/part/form.js +44 -0
- package/addon/components/place/activity.hbs +1 -0
- package/addon/components/place/activity.js +3 -0
- package/addon/components/place/card.hbs +1 -0
- package/addon/components/place/card.js +3 -0
- package/addon/components/place/comments.hbs +1 -0
- package/addon/components/place/comments.js +3 -0
- package/addon/components/place/details.hbs +106 -0
- package/addon/components/place/details.js +3 -0
- package/addon/components/place/documents.hbs +1 -0
- package/addon/components/place/documents.js +3 -0
- package/addon/components/place/driver-visits.hbs +1 -0
- package/addon/components/place/driver-visits.js +3 -0
- package/addon/components/place/form.hbs +60 -0
- package/addon/components/place/form.js +15 -0
- package/addon/components/place/frequency-map.hbs +1 -0
- package/addon/components/place/frequency-map.js +3 -0
- package/addon/components/place/map.hbs +1 -0
- package/addon/components/place/map.js +3 -0
- package/addon/components/place/operations.hbs +1 -0
- package/addon/components/place/operations.js +3 -0
- package/addon/components/place/performance.hbs +1 -0
- package/addon/components/place/performance.js +3 -0
- package/addon/components/place/recent-orders.hbs +1 -0
- package/addon/components/place/recent-orders.js +3 -0
- package/addon/components/place/rules.hbs +1 -0
- package/addon/components/place/rules.js +3 -0
- package/addon/components/place/service-areas.hbs +1 -0
- package/addon/components/place/service-areas.js +3 -0
- package/addon/components/route-list.hbs +2 -2
- package/addon/components/sensor/details.hbs +108 -0
- package/addon/components/sensor/details.js +3 -0
- package/addon/components/sensor/form.hbs +114 -0
- package/addon/components/sensor/form.js +29 -0
- package/addon/components/service-area/details.hbs +43 -0
- package/addon/components/service-area/form.hbs +49 -0
- package/addon/components/service-area/form.js +3 -0
- package/addon/components/service-rate/details.hbs +284 -0
- package/addon/components/service-rate/details.js +3 -0
- package/addon/components/service-rate/form.hbs +589 -0
- package/addon/components/service-rate/form.js +27 -0
- package/addon/components/telematic/details.hbs +85 -0
- package/addon/components/telematic/details.js +3 -0
- package/addon/components/telematic/form.hbs +84 -0
- package/addon/components/telematic/form.js +8 -0
- package/addon/components/vehicle/card.hbs +29 -0
- package/addon/components/vehicle/card.js +6 -0
- package/addon/components/vehicle/details.hbs +50 -0
- package/addon/components/vehicle/details.js +3 -0
- package/addon/components/vehicle/form.hbs +129 -0
- package/addon/components/vehicle/form.js +54 -0
- package/addon/components/vehicle/panel-header.hbs +79 -0
- package/addon/components/vehicle/panel-header.js +3 -0
- package/addon/components/vendor/details.hbs +50 -0
- package/addon/components/vendor/details.js +3 -0
- package/addon/components/vendor/form.hbs +149 -0
- package/addon/components/vendor/form.js +52 -0
- package/addon/components/warranty/details.hbs +81 -0
- package/addon/components/warranty/details.js +3 -0
- package/addon/components/warranty/form.hbs +82 -0
- package/addon/components/warranty/form.js +3 -0
- package/addon/components/widget/fleet-ops-key-metrics.hbs +1 -1
- package/addon/components/work-order/details.hbs +93 -0
- package/addon/components/work-order/details.js +3 -0
- package/addon/components/work-order/form.hbs +113 -0
- package/addon/components/work-order/form.js +13 -0
- package/addon/components/zone/details.hbs +38 -0
- package/addon/components/zone/form.hbs +33 -0
- package/addon/components/zone/form.js +3 -0
- package/addon/controllers/analytics/reports/index/details.js +24 -0
- package/addon/controllers/analytics/reports/index/edit.js +78 -0
- package/addon/controllers/analytics/reports/index/new.js +51 -0
- package/addon/controllers/analytics/reports/index.js +103 -0
- package/addon/controllers/application.js +7 -30
- package/addon/controllers/connectivity/devices/index/details/events.js +3 -0
- package/addon/controllers/connectivity/devices/index/details/index.js +3 -0
- package/addon/controllers/connectivity/devices/index/details.js +3 -0
- package/addon/controllers/connectivity/devices/index/edit.js +3 -0
- package/addon/controllers/connectivity/devices/index/new.js +32 -0
- package/addon/controllers/connectivity/devices/index.js +129 -0
- package/addon/controllers/connectivity/events/index/details.js +3 -0
- package/addon/controllers/connectivity/events/index.js +91 -0
- package/addon/controllers/connectivity/sensors/index/details/index.js +3 -0
- package/addon/controllers/connectivity/sensors/index/details.js +3 -0
- package/addon/controllers/connectivity/sensors/index/edit.js +3 -0
- package/addon/controllers/connectivity/sensors/index/new.js +32 -0
- package/addon/controllers/connectivity/sensors/index.js +129 -0
- package/addon/controllers/connectivity/telematics/index/details/devices.js +3 -0
- package/addon/controllers/connectivity/telematics/index/details/events.js +3 -0
- package/addon/controllers/connectivity/telematics/index/details/index.js +3 -0
- package/addon/controllers/connectivity/telematics/index/details/sensors.js +3 -0
- package/addon/controllers/connectivity/telematics/index/details.js +3 -0
- package/addon/controllers/connectivity/telematics/index/edit.js +3 -0
- package/addon/controllers/connectivity/telematics/index/new.js +32 -0
- package/addon/controllers/connectivity/telematics/index.js +129 -0
- package/addon/controllers/connectivity/tracking/index.js +3 -0
- package/addon/controllers/maintenance/equipment/index/details/index.js +3 -0
- package/addon/controllers/maintenance/equipment/index/details.js +3 -0
- package/addon/controllers/maintenance/equipment/index/edit.js +3 -0
- package/addon/controllers/maintenance/equipment/index/new.js +3 -0
- package/addon/controllers/maintenance/equipment/index.js +129 -0
- package/addon/controllers/maintenance/parts/index/details/index.js +3 -0
- package/addon/controllers/maintenance/parts/index/details.js +3 -0
- package/addon/controllers/maintenance/parts/index/edit.js +3 -0
- package/addon/controllers/maintenance/parts/index/new.js +3 -0
- package/addon/controllers/maintenance/parts/index.js +129 -0
- package/addon/controllers/maintenance/work-orders/index/details/index.js +3 -0
- package/addon/controllers/maintenance/work-orders/index/details.js +3 -0
- package/addon/controllers/maintenance/work-orders/index/edit.js +3 -0
- package/addon/controllers/maintenance/work-orders/index/new.js +3 -0
- package/addon/controllers/maintenance/work-orders/index.js +129 -0
- package/addon/controllers/management/contacts/customers/details.js +16 -52
- package/addon/controllers/management/contacts/customers/edit.js +40 -76
- package/addon/controllers/management/contacts/customers/new.js +25 -60
- package/addon/controllers/management/contacts/customers.js +137 -167
- package/addon/controllers/management/contacts/index/details.js +16 -52
- package/addon/controllers/management/contacts/index/edit.js +40 -76
- package/addon/controllers/management/contacts/index/new.js +25 -60
- package/addon/controllers/management/contacts/index.js +177 -338
- package/addon/controllers/management/contacts.js +23 -0
- package/addon/controllers/management/drivers/index/details.js +16 -58
- package/addon/controllers/management/drivers/index/edit.js +40 -93
- package/addon/controllers/management/drivers/index/new.js +25 -83
- package/addon/controllers/management/drivers/index.js +267 -500
- package/addon/controllers/management/fleets/index/details.js +24 -58
- package/addon/controllers/management/fleets/index/edit.js +40 -93
- package/addon/controllers/management/fleets/index/new.js +25 -83
- package/addon/controllers/management/fleets/index.js +244 -416
- package/addon/controllers/management/fuel-reports/index/details.js +15 -59
- package/addon/controllers/management/fuel-reports/index/edit.js +40 -93
- package/addon/controllers/management/fuel-reports/index/new.js +26 -90
- package/addon/controllers/management/fuel-reports/index.js +188 -365
- package/addon/controllers/management/issues/index/details.js +16 -51
- package/addon/controllers/management/issues/index/edit.js +40 -93
- package/addon/controllers/management/issues/index/new.js +25 -89
- package/addon/controllers/management/issues/index.js +219 -404
- package/addon/controllers/management/places/index/details.js +16 -52
- package/addon/controllers/management/places/index/edit.js +40 -93
- package/addon/controllers/management/places/index/new.js +25 -83
- package/addon/controllers/management/places/index.js +227 -437
- package/addon/controllers/management/vehicles/index/details.js +16 -58
- package/addon/controllers/management/vehicles/index/edit.js +39 -92
- package/addon/controllers/management/vehicles/index/new.js +26 -82
- package/addon/controllers/management/vehicles/index.js +268 -465
- package/addon/controllers/management/vendors/index/details.js +16 -52
- package/addon/controllers/management/vendors/index/edit.js +39 -92
- package/addon/controllers/management/vendors/index/new.js +32 -82
- package/addon/controllers/management/vendors/index.js +234 -435
- package/addon/controllers/management/vendors/integrated/details.js +3 -0
- package/addon/controllers/management/vendors/integrated/edit.js +3 -0
- package/addon/controllers/management/vendors/integrated/new.js +3 -0
- package/addon/controllers/management/vendors/integrated.js +3 -0
- package/addon/controllers/operations/orders/index/details/index.js +5 -0
- package/addon/controllers/operations/orders/index/details.js +129 -0
- package/addon/controllers/operations/orders/index/new.js +69 -1520
- package/addon/controllers/operations/orders/index.js +329 -1141
- package/addon/controllers/operations/routes/index/new.js +0 -1
- package/addon/controllers/operations/scheduler/index.js +5 -5
- package/addon/controllers/operations/service-rates/index/details.js +19 -0
- package/addon/controllers/operations/service-rates/index/edit.js +60 -28
- package/addon/controllers/operations/service-rates/index/new.js +30 -354
- package/addon/controllers/operations/service-rates/index.js +122 -218
- package/addon/controllers/settings/custom-fields.js +56 -0
- package/addon/controllers/settings/routing.js +1 -1
- package/addon/engine.js +26 -30
- package/addon/helpers/get-fleet-ops-options.js +6 -0
- package/addon/helpers/is-model-leaflet-layer-hidden.js +10 -0
- package/addon/helpers/point-coordinates.js +1 -1
- package/addon/initializers/leaflet-intersects-polyfill.js +23 -0
- package/addon/routes/analytics/reports/index/details/index.js +3 -0
- package/addon/routes/analytics/reports/index/details/result.js +3 -0
- package/addon/routes/analytics/reports/index/details.js +33 -0
- package/addon/routes/analytics/reports/index/edit.js +29 -0
- package/addon/routes/analytics/reports/index/new.js +3 -0
- package/addon/routes/analytics/reports/index.js +21 -0
- package/addon/routes/analytics/reports.js +3 -0
- package/addon/routes/analytics.js +3 -0
- package/addon/routes/application.js +2 -2
- package/addon/routes/connectivity/devices/index/details/events.js +3 -0
- package/addon/routes/connectivity/devices/index/details/index.js +3 -0
- package/addon/routes/connectivity/devices/index/details.js +3 -0
- package/addon/routes/connectivity/devices/index/edit.js +3 -0
- package/addon/routes/connectivity/devices/index/new.js +3 -0
- package/addon/routes/connectivity/devices/index.js +21 -0
- package/addon/routes/connectivity/devices.js +3 -0
- package/addon/routes/connectivity/events/index/details.js +3 -0
- package/addon/routes/connectivity/events/index.js +21 -0
- package/addon/routes/connectivity/events.js +3 -0
- package/addon/routes/connectivity/sensors/index/details/index.js +3 -0
- package/addon/routes/connectivity/sensors/index/details.js +3 -0
- package/addon/routes/connectivity/sensors/index/edit.js +3 -0
- package/addon/routes/connectivity/sensors/index/new.js +3 -0
- package/addon/routes/connectivity/sensors/index.js +21 -0
- package/addon/routes/connectivity/sensors.js +3 -0
- package/addon/routes/connectivity/telematics/index/details/devices.js +3 -0
- package/addon/routes/connectivity/telematics/index/details/events.js +3 -0
- package/addon/routes/connectivity/telematics/index/details/index.js +3 -0
- package/addon/routes/connectivity/telematics/index/details/sensors.js +3 -0
- package/addon/routes/connectivity/telematics/index/details.js +3 -0
- package/addon/routes/connectivity/telematics/index/edit.js +3 -0
- package/addon/routes/connectivity/telematics/index/new.js +3 -0
- package/addon/routes/connectivity/telematics/index.js +21 -0
- package/addon/routes/connectivity/telematics.js +3 -0
- package/addon/routes/connectivity/tracking/index.js +3 -0
- package/addon/routes/connectivity/tracking.js +3 -0
- package/addon/routes/connectivity.js +3 -0
- package/addon/routes/maintenance/equipment/index/details/index.js +3 -0
- package/addon/routes/maintenance/equipment/index/details.js +3 -0
- package/addon/routes/maintenance/equipment/index/edit.js +3 -0
- package/addon/routes/maintenance/equipment/index/new.js +3 -0
- package/addon/routes/maintenance/equipment/index.js +21 -0
- package/addon/routes/maintenance/equipment.js +3 -0
- package/addon/routes/maintenance/parts/index/details/index.js +3 -0
- package/addon/routes/maintenance/parts/index/details.js +3 -0
- package/addon/routes/maintenance/parts/index/edit.js +3 -0
- package/addon/routes/maintenance/parts/index/new.js +3 -0
- package/addon/routes/maintenance/parts/index.js +21 -0
- package/addon/routes/maintenance/parts.js +3 -0
- package/addon/routes/maintenance/work-orders/index/details/index.js +3 -0
- package/addon/routes/maintenance/work-orders/index/details.js +3 -0
- package/addon/routes/maintenance/work-orders/index/edit.js +3 -0
- package/addon/routes/maintenance/work-orders/index/new.js +3 -0
- package/addon/routes/maintenance/work-orders/index.js +21 -0
- package/addon/routes/maintenance/work-orders.js +3 -0
- package/addon/routes/maintenance.js +3 -0
- package/addon/routes/management/contacts/customers/details/index.js +3 -0
- package/addon/routes/management/contacts/customers.js +2 -10
- package/addon/routes/management/contacts/index/details/index.js +3 -0
- package/addon/routes/management/contacts/index.js +1 -1
- package/addon/routes/management/drivers/index/details/index.js +3 -0
- package/addon/routes/management/drivers/index/details/orders.js +3 -0
- package/addon/routes/management/drivers/index/details/schedule.js +3 -0
- package/addon/routes/management/fleets/index/details/drivers.js +3 -0
- package/addon/routes/management/fleets/index/details/index.js +3 -0
- package/addon/routes/management/fleets/index/details/vehicles.js +3 -0
- package/addon/routes/management/fuel-reports/index/details/index.js +3 -0
- package/addon/routes/management/issues/index/details/index.js +3 -0
- package/addon/routes/management/places/index/details/activity.js +3 -0
- package/addon/routes/management/places/index/details/comments.js +3 -0
- package/addon/routes/management/places/index/details/documents.js +3 -0
- package/addon/routes/management/places/index/details/index.js +3 -0
- package/addon/routes/management/places/index/details/map.js +3 -0
- package/addon/routes/management/places/index/details/operations.js +3 -0
- package/addon/routes/management/places/index/details/performance.js +3 -0
- package/addon/routes/management/places/index/details/rules.js +3 -0
- package/addon/routes/management/places/index/details.js +0 -4
- package/addon/routes/management/places/index.js +2 -2
- package/addon/routes/management/vehicles/index/details/devices.js +3 -0
- package/addon/routes/management/vehicles/index/details/equipment.js +3 -0
- package/addon/routes/management/vehicles/index/details/index.js +3 -0
- package/addon/routes/management/vendors/index/details/index.js +3 -0
- package/addon/routes/management/vendors/index/details/personnel.js +3 -0
- package/addon/routes/management/vendors/integrated/details.js +3 -0
- package/addon/routes/management/vendors/integrated/edit.js +3 -0
- package/addon/routes/management/vendors/integrated/new.js +3 -0
- package/addon/routes/management/vendors/integrated.js +3 -0
- package/addon/routes/operations/orders/index/details/index.js +3 -0
- package/addon/routes/operations/orders/index/details.js +61 -0
- package/addon/routes/operations/orders/index/new.js +1 -7
- package/addon/routes/operations/orders/index.js +2 -11
- package/addon/routes/operations/routes/index/details.js +3 -0
- package/addon/routes/operations/service-rates/index/details/index.js +3 -0
- package/addon/routes/operations/service-rates/index/details.js +29 -0
- package/addon/routes/operations/service-rates/index/edit.js +13 -36
- package/addon/routes/settings/custom-fields.js +3 -0
- package/addon/routes.js +143 -28
- package/addon/services/contact-actions.js +115 -0
- package/addon/services/customer-actions.js +84 -0
- package/addon/services/device-actions.js +81 -0
- package/addon/services/device-event-actions.js +37 -0
- package/addon/services/driver-actions.js +147 -68
- package/addon/services/entity-actions.js +41 -0
- package/addon/services/equipment-actions.js +81 -0
- package/addon/services/fleet-actions.js +84 -0
- package/addon/services/fuel-report-actions.js +102 -0
- package/addon/services/geofence.js +285 -0
- package/addon/services/global-search.js +19 -0
- package/addon/services/integrated-vendor-actions.js +84 -0
- package/addon/services/issue-actions.js +108 -0
- package/addon/services/leaflet-draw-restriction.js +150 -0
- package/addon/services/leaflet-layer-visibility-manager.js +305 -0
- package/addon/services/leaflet-map-manager.js +388 -54
- package/addon/services/leaflet-routing-control.js +8 -1
- package/addon/services/maintenance-actions.js +81 -0
- package/addon/services/map-drawer.js +81 -0
- package/addon/services/order-actions.js +500 -0
- package/addon/services/order-config-actions.js +19 -0
- package/addon/services/order-creation.js +33 -27
- package/addon/services/order-import.js +149 -0
- package/addon/services/order-list-overlay.js +206 -0
- package/addon/services/order-socket-events.js +296 -0
- package/addon/services/order-validation.js +51 -0
- package/addon/services/part-actions.js +81 -0
- package/addon/services/place-actions.js +140 -0
- package/addon/services/report-actions.js +11 -0
- package/addon/services/route-optimization.js +1 -1
- package/addon/services/sensor-actions.js +81 -0
- package/addon/services/service-area-actions.js +98 -0
- package/addon/services/service-area-manager.js +24 -0
- package/addon/services/service-areas.js +6 -6
- package/addon/services/service-rate-actions.js +186 -0
- package/addon/services/telematic-actions.js +81 -0
- package/addon/services/vehicle-actions.js +113 -29
- package/addon/services/vendor-actions.js +137 -0
- package/addon/services/work-order-actions.js +81 -0
- package/addon/services/zone-actions.js +81 -0
- package/addon/styles/fleetops-engine.css +25 -1
- package/addon/templates/analytics/reports/index/details/index.hbs +1 -0
- package/addon/templates/analytics/reports/index/details/result.hbs +1 -0
- package/addon/templates/analytics/reports/index/details.hbs +15 -0
- package/addon/templates/analytics/reports/index/edit.hbs +13 -0
- package/addon/templates/analytics/reports/index/new.hbs +14 -0
- package/addon/templates/analytics/reports/index.hbs +15 -0
- package/addon/templates/application.hbs +5 -7
- package/addon/templates/connectivity/devices/index/details/events.hbs +2 -0
- package/addon/templates/connectivity/devices/index/details/index.hbs +2 -0
- package/addon/templates/connectivity/devices/index/details.hbs +2 -0
- package/addon/templates/connectivity/devices/index/edit.hbs +12 -0
- package/addon/templates/connectivity/devices/index/new.hbs +12 -0
- package/addon/templates/connectivity/devices/index.hbs +14 -0
- package/addon/templates/connectivity/devices.hbs +2 -0
- package/addon/templates/connectivity/events/index/details.hbs +2 -0
- package/addon/templates/connectivity/events/index.hbs +14 -0
- package/addon/templates/connectivity/events.hbs +2 -0
- package/addon/templates/connectivity/sensors/index/details/index.hbs +2 -0
- package/addon/templates/connectivity/sensors/index/details.hbs +2 -0
- package/addon/templates/connectivity/sensors/index/edit.hbs +12 -0
- package/addon/templates/connectivity/sensors/index/new.hbs +12 -0
- package/addon/templates/connectivity/sensors/index.hbs +14 -0
- package/addon/templates/connectivity/sensors.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/details/devices.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/details/events.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/details/index.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/details/sensors.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/details.hbs +2 -0
- package/addon/templates/connectivity/telematics/index/edit.hbs +12 -0
- package/addon/templates/connectivity/telematics/index/new.hbs +12 -0
- package/addon/templates/connectivity/telematics/index.hbs +14 -0
- package/addon/templates/connectivity/telematics.hbs +2 -0
- package/addon/templates/connectivity/tracking.hbs +2 -0
- package/addon/templates/connectivity.hbs +2 -0
- package/addon/templates/maintenance/equipment/index/details/index.hbs +2 -0
- package/addon/templates/maintenance/equipment/index/details.hbs +2 -0
- package/addon/templates/maintenance/equipment/index/edit.hbs +2 -0
- package/addon/templates/maintenance/equipment/index/new.hbs +12 -0
- package/addon/templates/maintenance/equipment/index.hbs +14 -0
- package/addon/templates/maintenance/equipment.hbs +2 -0
- package/addon/templates/maintenance/parts/index/details/index.hbs +2 -0
- package/addon/templates/maintenance/parts/index/details.hbs +2 -0
- package/addon/templates/maintenance/parts/index/edit.hbs +2 -0
- package/addon/templates/maintenance/parts/index/new.hbs +12 -0
- package/addon/templates/maintenance/parts/index.hbs +14 -0
- package/addon/templates/maintenance/parts.hbs +2 -0
- package/addon/templates/maintenance/work-orders/index/details/index.hbs +1 -0
- package/addon/templates/maintenance/work-orders/index/details.hbs +14 -0
- package/addon/templates/maintenance/work-orders/index/edit.hbs +14 -0
- package/addon/templates/maintenance/work-orders/index/new.hbs +12 -0
- package/addon/templates/maintenance/work-orders/index.hbs +14 -0
- package/addon/templates/maintenance/work-orders.hbs +2 -0
- package/addon/templates/management/contacts/customers/details/index.hbs +1 -0
- package/addon/templates/management/contacts/customers/details.hbs +15 -1
- package/addon/templates/management/contacts/customers/edit.hbs +13 -7
- package/addon/templates/management/contacts/customers/new.hbs +14 -1
- package/addon/templates/management/contacts/customers.hbs +16 -59
- package/addon/templates/management/contacts/index/details/index.hbs +1 -0
- package/addon/templates/management/contacts/index/details.hbs +15 -1
- package/addon/templates/management/contacts/index/edit.hbs +12 -7
- package/addon/templates/management/contacts/index/new.hbs +13 -1
- package/addon/templates/management/contacts/index.hbs +15 -58
- package/addon/templates/management/contacts.hbs +18 -9
- package/addon/templates/management/drivers/index/details/index.hbs +1 -0
- package/addon/templates/management/drivers/index/details/orders.hbs +2 -0
- package/addon/templates/management/drivers/index/details/schedule.hbs +2 -0
- package/addon/templates/management/drivers/index/details.hbs +15 -1
- package/addon/templates/management/drivers/index/edit.hbs +12 -7
- package/addon/templates/management/drivers/index/new.hbs +13 -1
- package/addon/templates/management/drivers/index.hbs +13 -83
- package/addon/templates/management/fleets/index/details/drivers.hbs +1 -0
- package/addon/templates/management/fleets/index/details/index.hbs +1 -0
- package/addon/templates/management/fleets/index/details/vehicles.hbs +1 -0
- package/addon/templates/management/fleets/index/details.hbs +14 -1
- package/addon/templates/management/fleets/index/edit.hbs +12 -7
- package/addon/templates/management/fleets/index/new.hbs +13 -1
- package/addon/templates/management/fleets/index.hbs +15 -57
- package/addon/templates/management/fuel-reports/index/details/index.hbs +1 -0
- package/addon/templates/management/fuel-reports/index/details.hbs +14 -1
- package/addon/templates/management/fuel-reports/index/edit.hbs +12 -7
- package/addon/templates/management/fuel-reports/index/new.hbs +13 -1
- package/addon/templates/management/fuel-reports/index.hbs +15 -59
- package/addon/templates/management/issues/index/details/index.hbs +1 -0
- package/addon/templates/management/issues/index/details.hbs +14 -1
- package/addon/templates/management/issues/index/edit.hbs +12 -7
- package/addon/templates/management/issues/index/new.hbs +13 -1
- package/addon/templates/management/issues/index.hbs +15 -58
- package/addon/templates/management/places/index/details/activity.hbs +2 -0
- package/addon/templates/management/places/index/details/comments.hbs +2 -0
- package/addon/templates/management/places/index/details/documents.hbs +2 -0
- package/addon/templates/management/places/index/details/index.hbs +1 -0
- package/addon/templates/management/places/index/details/map.hbs +2 -0
- package/addon/templates/management/places/index/details/operations.hbs +2 -0
- package/addon/templates/management/places/index/details/performance.hbs +2 -0
- package/addon/templates/management/places/index/details/rules.hbs +2 -0
- package/addon/templates/management/places/index/details.hbs +14 -1
- package/addon/templates/management/places/index/edit.hbs +13 -7
- package/addon/templates/management/places/index/new.hbs +12 -1
- package/addon/templates/management/places/index.hbs +13 -57
- package/addon/templates/management/vehicles/index/details/devices.hbs +2 -0
- package/addon/templates/management/vehicles/index/details/equipment.hbs +2 -0
- package/addon/templates/management/vehicles/index/details/index.hbs +1 -0
- package/addon/templates/management/vehicles/index/details.hbs +15 -1
- package/addon/templates/management/vehicles/index/edit.hbs +12 -7
- package/addon/templates/management/vehicles/index/new.hbs +13 -1
- package/addon/templates/management/vehicles/index.hbs +45 -60
- package/addon/templates/management/vendors/index/details/index.hbs +1 -0
- package/addon/templates/management/vendors/index/details/personnel.hbs +2 -0
- package/addon/templates/management/vendors/index/details.hbs +14 -1
- package/addon/templates/management/vendors/index/edit.hbs +12 -7
- package/addon/templates/management/vendors/index/new.hbs +13 -1
- package/addon/templates/management/vendors/index.hbs +15 -57
- package/addon/templates/management/vendors/integrated/details.hbs +2 -0
- package/addon/templates/management/vendors/integrated/edit.hbs +2 -0
- package/addon/templates/management/vendors/integrated/new.hbs +2 -0
- package/addon/templates/management/vendors/integrated.hbs +16 -0
- package/addon/templates/operations/order-config.hbs +4 -4
- package/addon/templates/operations/orders/index/details/index.hbs +2 -0
- package/addon/templates/operations/orders/index/details.hbs +16 -0
- package/addon/templates/operations/orders/index/new.hbs +15 -976
- package/addon/templates/operations/orders/index.hbs +40 -153
- package/addon/templates/operations/routes/index/details.hbs +2 -0
- package/addon/templates/operations/scheduler/index.hbs +12 -13
- package/addon/templates/operations/service-rates/index/details/index.hbs +1 -0
- package/addon/templates/operations/service-rates/index/details.hbs +14 -0
- package/addon/templates/operations/service-rates/index/edit.hbs +12 -1
- package/addon/templates/operations/service-rates/index/new.hbs +12 -606
- package/addon/templates/operations/service-rates/index.hbs +13 -47
- package/addon/templates/settings/custom-fields.hbs +10 -0
- package/addon/templates/settings/navigator-app.hbs +1 -1
- package/addon/templates/settings/notifications.hbs +4 -4
- package/addon/templates/settings/payments/index.hbs +5 -5
- package/addon/templates/settings/payments/onboard.hbs +14 -7
- package/addon/templates/settings/routing.hbs +7 -7
- package/addon/templates/virtual.hbs +3 -3
- package/addon/utils/fleet-ops-options.js +440 -0
- package/addon/utils/leaflet-to-geojson.js +124 -0
- package/addon/utils/leaflet.js +56 -0
- package/addon/utils/serialize-payload.js +13 -0
- package/addon/utils/setup-customer-portal.js +60 -0
- package/addon/utils/to-multi-polygon.js +62 -0
- package/addon/utils/vendor-integration.js +106 -0
- package/app/components/activity/event-selector.js +1 -0
- package/app/components/activity/form.js +1 -0
- package/app/components/activity/logic-builder.js +1 -0
- package/app/components/asset/form.js +1 -0
- package/app/components/contact/details.js +1 -0
- package/app/components/contact/form.js +1 -0
- package/app/components/contact/panel-header.js +1 -0
- package/app/components/custom-entity/form.js +1 -0
- package/app/components/customer/details.js +1 -0
- package/app/components/customer/form.js +1 -0
- package/app/components/customer/leaflet-map.js +1 -0
- package/app/components/customer/order-details.js +1 -0
- package/app/components/customer/order-form.js +1 -0
- package/app/components/device/details.js +1 -0
- package/app/components/device/form.js +1 -0
- package/app/components/driver/details.js +1 -0
- package/app/components/driver/form.js +1 -0
- package/app/components/driver/panel-header.js +1 -0
- package/app/components/entity/card.js +1 -0
- package/app/components/entity/details.js +1 -0
- package/app/components/entity/form.js +1 -0
- package/app/components/equipment/details.js +1 -0
- package/app/components/equipment/form.js +1 -0
- package/app/components/fleet/details.js +1 -0
- package/app/components/fleet/driver-listing.js +1 -0
- package/app/components/fleet/form.js +1 -0
- package/app/components/fleet/vehicle-listing.js +1 -0
- package/app/components/fuel-report/details.js +1 -0
- package/app/components/fuel-report/form.js +1 -0
- package/app/components/integrated-vendor/details.js +1 -0
- package/app/components/integrated-vendor/form.js +1 -0
- package/app/components/issue/details.js +1 -0
- package/app/components/issue/form.js +1 -0
- package/app/components/maintenance/details.js +1 -0
- package/app/components/maintenance/form.js +1 -0
- package/app/components/map/container.js +1 -0
- package/app/components/map/drawer/driver-listing.js +1 -0
- package/app/components/map/drawer/event-listing.js +1 -0
- package/app/components/map/drawer/place-listing.js +1 -0
- package/app/components/map/drawer/vehicle-listing.js +1 -0
- package/app/components/map/drawer.js +1 -0
- package/app/components/map/leaflet-live-map.js +1 -0
- package/app/components/map/leaflet-tracking-layer.js +1 -0
- package/app/components/map/order-list-overlay/driver-panel-title.js +1 -0
- package/app/components/map/order-list-overlay/order.js +1 -0
- package/app/components/map/order-list-overlay.js +1 -0
- package/app/components/map/search.js +1 -0
- package/app/components/map/toolbar/visibility-control-panel.js +1 -0
- package/app/components/map/toolbar/zones-panel.js +1 -0
- package/app/components/map/toolbar.js +1 -0
- package/app/components/map.js +1 -0
- package/app/components/modals/update-order-activity.js +1 -0
- package/app/components/order/activity-list.js +1 -0
- package/app/components/order/activity-timeline.js +1 -0
- package/app/components/order/customer-avatar-stack.js +1 -0
- package/app/components/order/details/activity.js +1 -0
- package/app/components/order/details/comments.js +1 -0
- package/app/components/order/details/custom-fields.js +1 -0
- package/app/components/order/details/detail.js +1 -0
- package/app/components/order/details/documents.js +1 -0
- package/app/components/order/details/integrated-vendor-details.js +1 -0
- package/app/components/order/details/map.js +1 -0
- package/app/components/order/details/metadata.js +1 -0
- package/app/components/order/details/notes.js +1 -0
- package/app/components/order/details/payload.js +1 -0
- package/app/components/order/details/proof.js +1 -0
- package/app/components/order/details/purchase-rate.js +1 -0
- package/app/components/order/details/route.js +1 -0
- package/app/components/order/details/tracking.js +1 -0
- package/app/components/order/details.js +1 -0
- package/app/components/order/form/custom-fields.js +1 -0
- package/app/components/order/form/details.js +1 -0
- package/app/components/order/form/documents.js +1 -0
- package/app/components/order/form/metadata.js +1 -0
- package/app/components/order/form/notes.js +1 -0
- package/app/components/order/form/payload.js +1 -0
- package/app/components/order/form/route.js +1 -0
- package/app/components/order/form/service-rate.js +1 -0
- package/app/components/order/form.js +1 -0
- package/app/components/order/kanban-card.js +1 -0
- package/app/components/order/kanban.js +1 -0
- package/app/components/order/panel-header.js +1 -0
- package/app/components/order/route-editor.js +1 -0
- package/app/components/part/details.js +1 -0
- package/app/components/part/form.js +1 -0
- package/app/components/place/activity.js +1 -0
- package/app/components/place/card.js +1 -0
- package/app/components/place/comments.js +1 -0
- package/app/components/place/details.js +1 -0
- package/app/components/place/documents.js +1 -0
- package/app/components/place/driver-visits.js +1 -0
- package/app/components/place/form.js +1 -0
- package/app/components/place/frequency-map.js +1 -0
- package/app/components/place/map.js +1 -0
- package/app/components/place/operations.js +1 -0
- package/app/components/place/performance.js +1 -0
- package/app/components/place/recent-orders.js +1 -0
- package/app/components/place/rules.js +1 -0
- package/app/components/place/service-areas.js +1 -0
- package/app/components/sensor/details.js +1 -0
- package/app/components/sensor/form.js +1 -0
- package/app/components/service-area/details.js +1 -0
- package/app/components/service-area/form.js +1 -0
- package/app/components/service-rate/details.js +1 -0
- package/app/components/service-rate/form.js +1 -0
- package/app/components/telematic/details.js +1 -0
- package/app/components/telematic/form.js +1 -0
- package/app/components/vehicle/card.js +1 -0
- package/app/components/vehicle/details.js +1 -0
- package/app/components/vehicle/form.js +1 -0
- package/app/components/vehicle/panel-header.js +1 -0
- package/app/components/vendor/details.js +1 -0
- package/app/components/vendor/form.js +1 -0
- package/app/components/warranty/details.js +1 -0
- package/app/components/warranty/form.js +1 -0
- package/app/components/work-order/details.js +1 -0
- package/app/components/work-order/form.js +1 -0
- package/app/components/zone/details.js +1 -0
- package/app/components/zone/form.js +1 -0
- package/app/controllers/analytics/reports/index/details.js +1 -0
- package/app/controllers/analytics/reports/index/edit.js +1 -0
- package/app/controllers/analytics/reports/index/new.js +1 -0
- package/app/controllers/analytics/reports/index.js +1 -0
- package/app/controllers/connectivity/devices/index/details/events.js +1 -0
- package/app/controllers/connectivity/devices/index/details/index.js +1 -0
- package/app/controllers/connectivity/devices/index/details.js +1 -0
- package/app/controllers/connectivity/devices/index/edit.js +1 -0
- package/app/controllers/connectivity/devices/index/new.js +1 -0
- package/app/controllers/connectivity/devices/index.js +1 -0
- package/app/controllers/connectivity/events/index/details.js +1 -0
- package/app/controllers/connectivity/events/index.js +1 -0
- package/app/controllers/connectivity/sensors/index/details/index.js +1 -0
- package/app/controllers/connectivity/sensors/index/details.js +1 -0
- package/app/controllers/connectivity/sensors/index/edit.js +1 -0
- package/app/controllers/connectivity/sensors/index/new.js +1 -0
- package/app/controllers/connectivity/sensors/index.js +1 -0
- package/app/controllers/connectivity/telematics/index/details/devices.js +1 -0
- package/app/controllers/connectivity/telematics/index/details/events.js +1 -0
- package/app/controllers/connectivity/telematics/index/details/index.js +1 -0
- package/app/controllers/connectivity/telematics/index/details/sensors.js +1 -0
- package/app/controllers/connectivity/telematics/index/details.js +1 -0
- package/app/controllers/connectivity/telematics/index/edit.js +1 -0
- package/app/controllers/connectivity/telematics/index/new.js +1 -0
- package/app/controllers/connectivity/telematics/index.js +1 -0
- package/app/controllers/connectivity/tracking/index.js +1 -0
- package/app/controllers/maintenance/equipment/index/details/index.js +1 -0
- package/app/controllers/maintenance/equipment/index/details.js +1 -0
- package/app/controllers/maintenance/equipment/index/edit.js +1 -0
- package/app/controllers/maintenance/equipment/index/new.js +1 -0
- package/app/controllers/maintenance/equipment/index.js +1 -0
- package/app/controllers/maintenance/parts/index/details/index.js +1 -0
- package/app/controllers/maintenance/parts/index/details.js +1 -0
- package/app/controllers/maintenance/parts/index/edit.js +1 -0
- package/app/controllers/maintenance/parts/index/new.js +1 -0
- package/app/controllers/maintenance/parts/index.js +1 -0
- package/app/controllers/maintenance/work-orders/index/details/index.js +1 -0
- package/app/controllers/maintenance/work-orders/index/details.js +1 -0
- package/app/controllers/maintenance/work-orders/index/edit.js +1 -0
- package/app/controllers/maintenance/work-orders/index/new.js +1 -0
- package/app/controllers/maintenance/work-orders/index.js +1 -0
- package/app/controllers/management/contacts.js +1 -0
- package/app/controllers/management/vendors/integrated/details.js +1 -0
- package/app/controllers/management/vendors/integrated/edit.js +1 -0
- package/app/controllers/management/vendors/integrated/new.js +1 -0
- package/app/controllers/management/vendors/integrated.js +1 -0
- package/app/controllers/operations/orders/index/details/index.js +1 -0
- package/app/controllers/operations/orders/index/details.js +1 -0
- package/app/controllers/operations/service-rates/index/details.js +1 -0
- package/app/controllers/settings/custom-fields.js +1 -0
- package/app/helpers/get-fleet-ops-options.js +1 -0
- package/app/helpers/is-model-leaflet-layer-hidden.js +1 -0
- package/app/routes/analytics/reports/index/details/index.js +1 -0
- package/app/routes/analytics/reports/index/details/result.js +1 -0
- package/app/routes/analytics/reports/index/details.js +1 -0
- package/app/routes/analytics/reports/index/edit.js +1 -0
- package/app/routes/analytics/reports/index/new.js +1 -0
- package/app/routes/analytics/reports/index.js +1 -0
- package/app/routes/analytics/reports.js +1 -0
- package/app/routes/analytics.js +1 -0
- package/app/routes/connectivity/devices/index/details/events.js +1 -0
- package/app/routes/connectivity/devices/index/details/index.js +1 -0
- package/app/routes/connectivity/devices/index/details.js +1 -0
- package/app/routes/connectivity/devices/index/edit.js +1 -0
- package/app/routes/connectivity/devices/index/new.js +1 -0
- package/app/routes/connectivity/devices/index.js +1 -0
- package/app/routes/connectivity/devices.js +1 -0
- package/app/routes/connectivity/events/index/details.js +1 -0
- package/app/routes/connectivity/events/index.js +1 -0
- package/app/routes/connectivity/events.js +1 -0
- package/app/routes/connectivity/sensors/index/details/index.js +1 -0
- package/app/routes/connectivity/sensors/index/details.js +1 -0
- package/app/routes/connectivity/sensors/index/edit.js +1 -0
- package/app/routes/connectivity/sensors/index/new.js +1 -0
- package/app/routes/connectivity/sensors/index.js +1 -0
- package/app/routes/connectivity/sensors.js +1 -0
- package/app/routes/connectivity/telematics/index/details/devices.js +1 -0
- package/app/routes/connectivity/telematics/index/details/events.js +1 -0
- package/app/routes/connectivity/telematics/index/details/index.js +1 -0
- package/app/routes/connectivity/telematics/index/details/sensors.js +1 -0
- package/app/routes/connectivity/telematics/index/details.js +1 -0
- package/app/routes/connectivity/telematics/index/edit.js +1 -0
- package/app/routes/connectivity/telematics/index/new.js +1 -0
- package/app/routes/connectivity/telematics/index.js +1 -0
- package/app/routes/connectivity/telematics.js +1 -0
- package/app/routes/connectivity/tracking/index.js +1 -0
- package/app/routes/connectivity/tracking.js +1 -0
- package/app/routes/connectivity.js +1 -0
- package/app/routes/maintenance/equipment/index/details/index.js +1 -0
- package/app/routes/maintenance/equipment/index/details.js +1 -0
- package/app/routes/maintenance/equipment/index/edit.js +1 -0
- package/app/routes/maintenance/equipment/index/new.js +1 -0
- package/app/routes/maintenance/equipment/index.js +1 -0
- package/app/routes/maintenance/equipment.js +1 -0
- package/app/routes/maintenance/parts/index/details/index.js +1 -0
- package/app/routes/maintenance/parts/index/details.js +1 -0
- package/app/routes/maintenance/parts/index/edit.js +1 -0
- package/app/routes/maintenance/parts/index/new.js +1 -0
- package/app/routes/maintenance/parts/index.js +1 -0
- package/app/routes/maintenance/parts.js +1 -0
- package/app/routes/maintenance/work-orders/index/details/index.js +1 -0
- package/app/routes/maintenance/work-orders/index/details.js +1 -0
- package/app/routes/maintenance/work-orders/index/edit.js +1 -0
- package/app/routes/maintenance/work-orders/index/new.js +1 -0
- package/app/routes/maintenance/work-orders/index.js +1 -0
- package/app/routes/maintenance/work-orders.js +1 -0
- package/app/routes/maintenance.js +1 -0
- package/app/routes/management/contacts/customers/details/index.js +1 -0
- package/app/routes/management/contacts/index/details/index.js +1 -0
- package/app/routes/management/drivers/index/details/index.js +1 -0
- package/app/routes/management/drivers/index/details/orders.js +1 -0
- package/app/routes/management/drivers/index/details/schedule.js +1 -0
- package/app/routes/management/fleets/index/details/drivers.js +1 -0
- package/app/routes/management/fleets/index/details/index.js +1 -0
- package/app/routes/management/fleets/index/details/vehicles.js +1 -0
- package/app/routes/management/fuel-reports/index/details/index.js +1 -0
- package/app/routes/management/issues/index/details/index.js +1 -0
- package/app/routes/management/places/index/details/activity.js +1 -0
- package/app/routes/management/places/index/details/comments.js +1 -0
- package/app/routes/management/places/index/details/documents.js +1 -0
- package/app/routes/management/places/index/details/index.js +1 -0
- package/app/routes/management/places/index/details/map.js +1 -0
- package/app/routes/management/places/index/details/operations.js +1 -0
- package/app/routes/management/places/index/details/performance.js +1 -0
- package/app/routes/management/places/index/details/rules.js +1 -0
- package/app/routes/management/vehicles/index/details/devices.js +1 -0
- package/app/routes/management/vehicles/index/details/equipment.js +1 -0
- package/app/routes/management/vehicles/index/details/index.js +1 -0
- package/app/routes/management/vendors/index/details/index.js +1 -0
- package/app/routes/management/vendors/index/details/personnel.js +1 -0
- package/app/routes/management/vendors/integrated/details.js +1 -0
- package/app/routes/management/vendors/integrated/edit.js +1 -0
- package/app/routes/management/vendors/integrated/new.js +1 -0
- package/app/routes/management/vendors/integrated.js +1 -0
- package/app/routes/operations/orders/index/details/index.js +1 -0
- package/app/routes/operations/orders/index/details.js +1 -0
- package/app/routes/operations/routes/index/details.js +1 -0
- package/app/routes/operations/service-rates/index/details/index.js +1 -0
- package/app/routes/operations/service-rates/index/details.js +1 -0
- package/app/routes/settings/custom-fields.js +1 -0
- package/app/services/contact-actions.js +1 -0
- package/app/services/customer-actions.js +1 -0
- package/app/services/device-actions.js +1 -0
- package/app/services/device-event-actions.js +1 -0
- package/app/services/entity-actions.js +1 -0
- package/app/services/equipment-actions.js +1 -0
- package/app/services/fleet-actions.js +1 -0
- package/app/services/fuel-report-actions.js +1 -0
- package/app/services/geofence.js +1 -0
- package/app/services/global-search.js +1 -0
- package/app/services/integrated-vendor-actions.js +1 -0
- package/app/services/issue-actions.js +1 -0
- package/app/services/leaflet-draw-restriction.js +1 -0
- package/app/services/leaflet-layer-visibility-manager.js +1 -0
- package/app/services/maintenance-actions.js +1 -0
- package/app/services/map-drawer.js +1 -0
- package/app/services/order-actions.js +1 -0
- package/app/services/order-config-actions.js +1 -0
- package/app/services/order-import.js +1 -0
- package/app/services/order-list-overlay.js +1 -0
- package/app/services/order-socket-events.js +1 -0
- package/app/services/order-validation.js +1 -0
- package/app/services/part-actions.js +1 -0
- package/app/services/place-actions.js +1 -0
- package/app/services/report-actions.js +1 -0
- package/app/services/sensor-actions.js +1 -0
- package/app/services/service-area-actions.js +1 -0
- package/app/services/service-area-manager.js +1 -0
- package/app/services/service-rate-actions.js +1 -0
- package/app/services/telematic-actions.js +1 -0
- package/app/services/vendor-actions.js +1 -0
- package/app/services/work-order-actions.js +1 -0
- package/app/services/zone-actions.js +1 -0
- package/app/templates/analytics/reports/index/details/index.js +1 -0
- package/app/templates/analytics/reports/index/details/result.js +1 -0
- package/app/templates/analytics/reports/index/details.js +1 -0
- package/app/templates/analytics/reports/index/edit.js +1 -0
- package/app/templates/analytics/reports/index/new.js +1 -0
- package/app/templates/analytics/reports/index.js +1 -0
- package/app/templates/analytics/reports.js +1 -0
- package/app/templates/analytics.js +1 -0
- package/app/templates/connectivity/devices/index/details/events.js +1 -0
- package/app/templates/connectivity/devices/index/details/index.js +1 -0
- package/app/templates/connectivity/devices/index/details.js +1 -0
- package/app/templates/connectivity/devices/index/edit.js +1 -0
- package/app/templates/connectivity/devices/index/new.js +1 -0
- package/app/templates/connectivity/devices/index.js +1 -0
- package/app/templates/connectivity/devices.js +1 -0
- package/app/templates/connectivity/events/index/details.js +1 -0
- package/app/templates/connectivity/events/index.js +1 -0
- package/app/templates/connectivity/events.js +1 -0
- package/app/templates/connectivity/sensors/index/details/index.js +1 -0
- package/app/templates/connectivity/sensors/index/details.js +1 -0
- package/app/templates/connectivity/sensors/index/edit.js +1 -0
- package/app/templates/connectivity/sensors/index/new.js +1 -0
- package/app/templates/connectivity/sensors/index.js +1 -0
- package/app/templates/connectivity/sensors.js +1 -0
- package/app/templates/connectivity/telematics/index/details/devices.js +1 -0
- package/app/templates/connectivity/telematics/index/details/events.js +1 -0
- package/app/templates/connectivity/telematics/index/details/index.js +1 -0
- package/app/templates/connectivity/telematics/index/details/sensors.js +1 -0
- package/app/templates/connectivity/telematics/index/details.js +1 -0
- package/app/templates/connectivity/telematics/index/edit.js +1 -0
- package/app/templates/connectivity/telematics/index/new.js +1 -0
- package/app/templates/connectivity/telematics/index.js +1 -0
- package/app/templates/connectivity/telematics.js +1 -0
- package/app/templates/connectivity/tracking/index.js +1 -0
- package/app/templates/connectivity/tracking.js +1 -0
- package/app/templates/connectivity.js +1 -0
- package/app/templates/maintenance/equipment/index/details/index.js +1 -0
- package/app/templates/maintenance/equipment/index/details.js +1 -0
- package/app/templates/maintenance/equipment/index/edit.js +1 -0
- package/app/templates/maintenance/equipment/index/new.js +1 -0
- package/app/templates/maintenance/equipment/index.js +1 -0
- package/app/templates/maintenance/equipment.js +1 -0
- package/app/templates/maintenance/parts/index/details/index.js +1 -0
- package/app/templates/maintenance/parts/index/details.js +1 -0
- package/app/templates/maintenance/parts/index/edit.js +1 -0
- package/app/templates/maintenance/parts/index/new.js +1 -0
- package/app/templates/maintenance/parts/index.js +1 -0
- package/app/templates/maintenance/parts.js +1 -0
- package/app/templates/maintenance/work-orders/index/details/index.js +1 -0
- package/app/templates/maintenance/work-orders/index/details.js +1 -0
- package/app/templates/maintenance/work-orders/index/edit.js +1 -0
- package/app/templates/maintenance/work-orders/index/new.js +1 -0
- package/app/templates/maintenance/work-orders/index.js +1 -0
- package/app/templates/maintenance/work-orders.js +1 -0
- package/app/templates/maintenance.js +1 -0
- package/app/templates/management/contacts/customers/details/index.js +1 -0
- package/app/templates/management/contacts/index/details/index.js +1 -0
- package/app/templates/management/drivers/index/details/index.js +1 -0
- package/app/templates/management/drivers/index/details/orders.js +1 -0
- package/app/templates/management/drivers/index/details/schedule.js +1 -0
- package/app/templates/management/fleets/index/details/drivers.js +1 -0
- package/app/templates/management/fleets/index/details/index.js +1 -0
- package/app/templates/management/fleets/index/details/vehicles.js +1 -0
- package/app/templates/management/fuel-reports/index/details/index.js +1 -0
- package/app/templates/management/issues/index/details/index.js +1 -0
- package/app/templates/management/places/index/details/activity.js +1 -0
- package/app/templates/management/places/index/details/comments.js +1 -0
- package/app/templates/management/places/index/details/documents.js +1 -0
- package/app/templates/management/places/index/details/index.js +1 -0
- package/app/templates/management/places/index/details/map.js +1 -0
- package/app/templates/management/places/index/details/operations.js +1 -0
- package/app/templates/management/places/index/details/performance.js +1 -0
- package/app/templates/management/places/index/details/rules.js +1 -0
- package/app/templates/management/vehicles/index/details/devices.js +1 -0
- package/app/templates/management/vehicles/index/details/equipment.js +1 -0
- package/app/templates/management/vehicles/index/details/index.js +1 -0
- package/app/templates/management/vendors/index/details/index.js +1 -0
- package/app/templates/management/vendors/index/details/personnel.js +1 -0
- package/app/templates/management/vendors/integrated/details.js +1 -0
- package/app/templates/management/vendors/integrated/edit.js +1 -0
- package/app/templates/management/vendors/integrated/new.js +1 -0
- package/app/templates/management/vendors/integrated.js +1 -0
- package/app/templates/operations/orders/index/details/index.js +1 -0
- package/app/templates/operations/orders/index/details.js +1 -0
- package/app/templates/operations/routes/index/details.js +1 -0
- package/app/templates/operations/service-rates/index/details/index.js +1 -0
- package/app/templates/operations/service-rates/index/details.js +1 -0
- package/app/templates/settings/custom-fields.js +1 -0
- package/app/utils/fleet-ops-options.js +1 -0
- package/app/utils/leaflet-to-geojson.js +1 -0
- package/app/utils/leaflet.js +1 -0
- package/app/utils/serialize-payload.js +1 -0
- package/app/utils/setup-customer-portal.js +1 -0
- package/app/utils/to-multi-polygon.js +1 -0
- package/app/utils/vendor-integration.js +1 -0
- package/composer.json +3 -2
- package/extension.json +1 -1
- package/index.js +3 -2
- package/package.json +5 -2
- package/server/migrations/2025_08_28_054920_create_warranties_table.php +56 -0
- package/server/migrations/2025_08_28_054921_create_telematics_table.php +60 -0
- package/server/migrations/2025_08_28_054922_create_assets_table.php +94 -0
- package/server/migrations/2025_08_28_054925_create_devices_table.php +190 -0
- package/server/migrations/2025_08_28_054926_create_device_events_table.php +99 -0
- package/server/migrations/2025_08_28_054926_create_sensors_table.php +62 -0
- package/server/migrations/2025_08_28_054927_create_parts_table.php +73 -0
- package/server/migrations/2025_08_28_054929_create_equipments_table.php +58 -0
- package/server/migrations/2025_08_28_054930_create_work_orders_table.php +85 -0
- package/server/migrations/2025_08_28_054931_create_maintenances_table.php +79 -0
- package/server/migrations/2025_08_28_082002_update_vehicles_table_telematics.php +60 -0
- package/server/migrations/2025_09_10_010724_create_additional_spec_columns_for_assets_vehicles_table.php +77 -0
- package/server/migrations/2025_09_14_031758_add_provider_options_column_to_integrated_vendors_tabl.php +27 -0
- package/server/migrations/2025_09_15_031052_add_title_column_to_issues_table.php +27 -0
- package/server/migrations/2025_09_24_004700_add_vehicle_columns.php +49 -0
- package/server/migrations/2025_10_07_020406_add_max_distance_to_service_rates_table.php +28 -0
- package/server/migrations/2025_10_08_091812_add_details_column_to_vehicles_table.php +27 -0
- package/server/src/Auth/Schemas/FleetOps.php +12 -0
- package/server/src/Console/Commands/DispatchAdhocOrders.php +21 -8
- package/server/src/Http/Controllers/Api/v1/OrderController.php +6 -1
- package/server/src/Http/Controllers/Api/v1/ServiceRateController.php +1 -1
- package/server/src/Http/Controllers/Internal/v1/ContactController.php +12 -0
- package/server/src/Http/Controllers/Internal/v1/DeviceController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/DeviceEventController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/DriverController.php +17 -8
- package/server/src/Http/Controllers/Internal/v1/EquipmentController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/FleetController.php +17 -5
- package/server/src/Http/Controllers/Internal/v1/FuelReportController.php +13 -0
- package/server/src/Http/Controllers/Internal/v1/IssueController.php +13 -0
- package/server/src/Http/Controllers/Internal/v1/MaintenanceController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +141 -70
- package/server/src/Http/Controllers/Internal/v1/PartController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/PlaceController.php +11 -0
- package/server/src/Http/Controllers/Internal/v1/SensorController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/ServiceAreaController.php +13 -0
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/VehicleController.php +12 -0
- package/server/src/Http/Controllers/Internal/v1/VendorController.php +11 -0
- package/server/src/Http/Controllers/Internal/v1/WarrantyController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/WorkOrderController.php +15 -0
- package/server/src/Http/Controllers/Internal/v1/ZoneController.php +13 -0
- package/server/src/Http/Filter/DriverFilter.php +5 -2
- package/server/src/Http/Filter/FleetFilter.php +5 -2
- package/server/src/Http/Filter/IssueFilter.php +3 -8
- package/server/src/Http/Filter/PlaceFilter.php +5 -0
- package/server/src/Http/Filter/VendorFilter.php +5 -2
- package/server/src/Http/Requests/CreateServiceRateRequest.php +4 -2
- package/server/src/Http/Resources/v1/Contact.php +6 -4
- package/server/src/Http/Resources/v1/CurrentJob.php +2 -2
- package/server/src/Http/Resources/v1/Driver.php +2 -2
- package/server/src/Http/Resources/v1/Fleet.php +2 -2
- package/server/src/Http/Resources/v1/FuelReport.php +2 -2
- package/server/src/Http/Resources/v1/Issue.php +34 -31
- package/server/src/Http/Resources/v1/Order.php +82 -60
- package/server/src/Http/Resources/v1/ParentFleet.php +2 -2
- package/server/src/Http/Resources/v1/Place.php +3 -3
- package/server/src/Http/Resources/v1/ServiceArea.php +2 -2
- package/server/src/Http/Resources/v1/ServiceRate.php +45 -34
- package/server/src/Http/Resources/v1/SubFleet.php +2 -2
- package/server/src/Http/Resources/v1/Vehicle.php +3 -3
- package/server/src/Http/Resources/v1/Vendor.php +5 -3
- package/server/src/Http/Resources/v1/Zone.php +2 -2
- package/server/src/Models/Asset.php +557 -0
- package/server/src/Models/Contact.php +24 -1
- package/server/src/Models/Device.php +435 -0
- package/server/src/Models/DeviceEvent.php +501 -0
- package/server/src/Models/Driver.php +3 -1
- package/server/src/Models/Entity.php +2 -0
- package/server/src/Models/Equipment.php +483 -0
- package/server/src/Models/Fleet.php +2 -0
- package/server/src/Models/FuelReport.php +2 -0
- package/server/src/Models/IntegratedVendor.php +4 -2
- package/server/src/Models/Issue.php +23 -0
- package/server/src/Models/Maintenance.php +549 -0
- package/server/src/Models/Order.php +57 -157
- package/server/src/Models/OrderConfig.php +8 -0
- package/server/src/Models/Part.php +502 -0
- package/server/src/Models/Payload.php +101 -20
- package/server/src/Models/Place.php +12 -4
- package/server/src/Models/Sensor.php +510 -0
- package/server/src/Models/ServiceArea.php +3 -1
- package/server/src/Models/ServiceRate.php +22 -4
- package/server/src/Models/Telematic.php +336 -0
- package/server/src/Models/Vehicle.php +127 -11
- package/server/src/Models/VehicleDevice.php +1 -1
- package/server/src/Models/VehicleDeviceEvent.php +1 -1
- package/server/src/Models/Vendor.php +15 -0
- package/server/src/Models/Warranty.php +413 -0
- package/server/src/Models/Waypoint.php +58 -0
- package/server/src/Models/WorkOrder.php +532 -0
- package/server/src/Models/Zone.php +2 -0
- package/server/src/Providers/FleetOpsServiceProvider.php +1 -0
- package/server/src/Providers/ReportSchemaServiceProvider.php +22 -0
- package/server/src/Support/Reporting/FleetOpsReportSchema.php +729 -0
- package/server/src/Support/Utils.php +5 -0
- package/server/src/Traits/HasTrackingNumber.php +10 -6
- package/server/src/Traits/Maintainable.php +307 -0
- package/server/src/routes.php +9 -0
- package/translations/bg-bg.yaml +1799 -0
- package/translations/en-us.yaml +1691 -1625
- package/translations/fr-fr.yaml +1824 -0
- package/translations/mn-mn.yaml +1768 -0
- package/translations/pt-br.yaml +1789 -0
- package/translations/ru-ru.yaml +1782 -0
- package/addon/components/activity-event-selector.hbs +0 -45
- package/addon/components/activity-event-selector.js +0 -89
- package/addon/components/activity-form-panel.hbs +0 -89
- package/addon/components/activity-form-panel.js +0 -109
- package/addon/components/activity-logic-builder.hbs +0 -128
- package/addon/components/activity-logic-builder.js +0 -260
- package/addon/components/contact-form-panel.hbs +0 -158
- package/addon/components/contact-form-panel.js +0 -168
- package/addon/components/contact-panel/details.hbs +0 -40
- package/addon/components/contact-panel/details.js +0 -3
- package/addon/components/contact-panel.hbs +0 -74
- package/addon/components/contact-panel.js +0 -112
- package/addon/components/context-panel.hbs +0 -5
- package/addon/components/context-panel.js +0 -6
- package/addon/components/custom-entity-form-panel.hbs +0 -98
- package/addon/components/custom-entity-form-panel.js +0 -129
- package/addon/components/custom-field-form-panel/options-input.hbs +0 -17
- package/addon/components/custom-field-form-panel/options-input.js +0 -139
- package/addon/components/custom-field-form-panel.hbs +0 -121
- package/addon/components/custom-field-form-panel.js +0 -147
- package/addon/components/custom-field-value.hbs +0 -11
- package/addon/components/custom-field-value.js +0 -41
- package/addon/components/custom-field.hbs +0 -89
- package/addon/components/custom-field.js +0 -145
- package/addon/components/customer-form-panel.hbs +0 -215
- package/addon/components/customer-form-panel.js +0 -219
- package/addon/components/customer-panel/details.hbs +0 -52
- package/addon/components/customer-panel/details.js +0 -3
- package/addon/components/customer-panel.hbs +0 -95
- package/addon/components/customer-panel.js +0 -124
- package/addon/components/driver-card-mini.hbs +0 -12
- package/addon/components/driver-card-mini.js +0 -46
- package/addon/components/driver-card.hbs +0 -27
- package/addon/components/driver-card.js +0 -14
- package/addon/components/driver-form-panel.hbs +0 -276
- package/addon/components/driver-form-panel.js +0 -243
- package/addon/components/driver-panel/details.hbs +0 -55
- package/addon/components/driver-panel/orders.hbs +0 -144
- package/addon/components/driver-panel/orders.js +0 -44
- package/addon/components/driver-panel.hbs +0 -84
- package/addon/components/driver-panel.js +0 -164
- package/addon/components/edit-order-route-panel.hbs +0 -183
- package/addon/components/edit-order-route-panel.js +0 -322
- package/addon/components/event-timeline/event.hbs +0 -5
- package/addon/components/fleet-form-panel.hbs +0 -151
- package/addon/components/fleet-form-panel.js +0 -128
- package/addon/components/fleet-panel.hbs +0 -35
- package/addon/components/fleet-panel.js +0 -129
- package/addon/components/fuel-report-form-panel.hbs +0 -170
- package/addon/components/fuel-report-form-panel.js +0 -167
- package/addon/components/fuel-report-panel/details.hbs +0 -42
- package/addon/components/fuel-report-panel.hbs +0 -46
- package/addon/components/fuel-report-panel.js +0 -148
- package/addon/components/full-size.js +0 -1
- package/addon/components/horizontal-route.hbs +0 -38
- package/addon/components/horizontal-route.js +0 -48
- package/addon/components/issue-form-panel.hbs +0 -226
- package/addon/components/issue-form-panel.js +0 -182
- package/addon/components/issue-panel/details.hbs +0 -48
- package/addon/components/issue-panel.hbs +0 -39
- package/addon/components/issue-panel.js +0 -148
- package/addon/components/live-map-drawer/driver-listing.hbs +0 -12
- package/addon/components/live-map-drawer/driver-listing.js +0 -246
- package/addon/components/live-map-drawer/place-listing.hbs +0 -12
- package/addon/components/live-map-drawer/place-listing.js +0 -209
- package/addon/components/live-map-drawer/vehicle-listing.hbs +0 -12
- package/addon/components/live-map-drawer/vehicle-listing.js +0 -222
- package/addon/components/live-map-drawer.hbs +0 -17
- package/addon/components/live-map-drawer.js +0 -86
- package/addon/components/live-map.hbs +0 -260
- package/addon/components/live-map.js +0 -1925
- package/addon/components/map-container/toolbar/visibility-control-panel.hbs +0 -66
- package/addon/components/map-container/toolbar/visibility-control-panel.js +0 -74
- package/addon/components/map-container/toolbar/zones-panel.hbs +0 -56
- package/addon/components/map-container/toolbar/zones-panel.js +0 -138
- package/addon/components/map-container/toolbar-container.hbs +0 -1
- package/addon/components/map-container/toolbar-container.js +0 -3
- package/addon/components/map-container/toolbar.hbs +0 -123
- package/addon/components/map-container/toolbar.js +0 -63
- package/addon/components/operations-pane/pane.hbs +0 -1
- package/addon/components/order-board.hbs +0 -27
- package/addon/components/order-board.js +0 -81
- package/addon/components/order-config/activity-flow-editor.hbs +0 -149
- package/addon/components/order-config/activity-flow-editor.js +0 -374
- package/addon/components/order-config/details-editor.hbs +0 -69
- package/addon/components/order-config/details-editor.js +0 -16
- package/addon/components/order-config/entities-editor.hbs +0 -89
- package/addon/components/order-config/entities-editor.js +0 -120
- package/addon/components/order-config/fields-editor.hbs +0 -169
- package/addon/components/order-config/fields-editor.js +0 -227
- package/addon/components/order-config/selector.js +0 -3
- package/addon/components/order-config-manager-overlay.hbs +0 -36
- package/addon/components/order-config-manager-overlay.js +0 -60
- package/addon/components/order-flow.js +0 -3
- package/addon/components/order-list-overlay.hbs +0 -178
- package/addon/components/order-list-overlay.js +0 -217
- package/addon/components/place-form-panel.hbs +0 -118
- package/addon/components/place-form-panel.js +0 -179
- package/addon/components/place-panel/details.hbs +0 -81
- package/addon/components/place-panel.hbs +0 -40
- package/addon/components/place-panel.js +0 -112
- package/addon/components/settings-window.hbs +0 -39
- package/addon/components/settings-window.js +0 -63
- package/addon/components/split-grid.js +0 -1
- package/addon/components/vehicle-form-panel.hbs +0 -219
- package/addon/components/vehicle-form-panel.js +0 -203
- package/addon/components/vehicle-panel/details.hbs +0 -44
- package/addon/components/vehicle-panel.hbs +0 -79
- package/addon/components/vehicle-panel.js +0 -153
- package/addon/components/vendor-form-panel/create-form.hbs +0 -250
- package/addon/components/vendor-form-panel/create-form.js +0 -153
- package/addon/components/vendor-form-panel/edit-form.hbs +0 -234
- package/addon/components/vendor-form-panel/edit-form.js +0 -57
- package/addon/components/vendor-form-panel.hbs +0 -115
- package/addon/components/vendor-form-panel.js +0 -160
- package/addon/components/vendor-panel/details.hbs +0 -77
- package/addon/components/vendor-panel/details.js +0 -12
- package/addon/components/vendor-panel/drivers.hbs +0 -81
- package/addon/components/vendor-panel/drivers.js +0 -139
- package/addon/components/vendor-panel/personnel.js +0 -3
- package/addon/components/vendor-panel.hbs +0 -73
- package/addon/components/vendor-panel.js +0 -124
- package/addon/controllers/base-controller.js +0 -31
- package/addon/controllers/management.js +0 -3
- package/addon/controllers/operations/orders/index/config/types.js +0 -17
- package/addon/controllers/operations/orders/index/config.js +0 -13
- package/addon/controllers/operations/orders/index/view.js +0 -1028
- package/addon/helpers/feature-group.js +0 -13
- package/addon/helpers/flow-raw-status.js +0 -13
- package/addon/helpers/get-tip-amount.js +0 -19
- package/addon/helpers/is-facilitator-supported-place.js +0 -6
- package/addon/helpers/is-section-visible.js +0 -5
- package/addon/helpers/is-visibility-control-visible.js +0 -18
- package/addon/helpers/is-waypoint-record.js +0 -6
- package/addon/helpers/service-name.js +0 -6
- package/addon/routes/comms/chat.js +0 -3
- package/addon/routes/comms/intercom.js +0 -3
- package/addon/routes/comms.js +0 -3
- package/addon/routes/operations/orders/index/config/types.js +0 -18
- package/addon/routes/operations/orders/index/config.js +0 -3
- package/addon/routes/operations/orders/index/view.js +0 -113
- package/addon/routes/operations/routes/index/view.js +0 -3
- package/addon/services/context-panel.js +0 -352
- package/addon/services/leaflet-router-control.js +0 -64
- package/addon/templates/operations/orders/index/config/types.hbs +0 -30
- package/addon/templates/operations/orders/index/config.hbs +0 -23
- package/addon/templates/operations/orders/index/view.hbs +0 -876
- package/addon/utils/calculate-percentage.js +0 -1
- package/addon/utils/find-leaflet-layer.js +0 -13
- package/addon/utils/fly-to-leaflet-layer.js +0 -32
- package/addon/utils/format-currency.js +0 -1
- package/addon/utils/get-custom-field-type-map.js +0 -34
- package/addon/utils/get-issue-categories.js +0 -30
- package/addon/utils/get-issue-types.js +0 -3
- package/addon/utils/get-leaflet-layer-by-id.js +0 -12
- package/addon/utils/get-vendor-status-options.js +0 -3
- package/addon/utils/get-vendor-type-options.js +0 -44
- package/addon/utils/layer-can-bind-contextmenu.js +0 -3
- package/addon/utils/to-model.js +0 -1
- package/app/components/activity-event-selector.js +0 -1
- package/app/components/activity-form-panel.js +0 -1
- package/app/components/activity-logic-builder.js +0 -1
- package/app/components/contact-form-panel.js +0 -1
- package/app/components/contact-panel/details.js +0 -1
- package/app/components/contact-panel.js +0 -1
- package/app/components/context-panel.js +0 -1
- package/app/components/custom-entity-form-panel.js +0 -1
- package/app/components/custom-field-form-panel/options-input.js +0 -1
- package/app/components/custom-field-form-panel.js +0 -1
- package/app/components/custom-field-value.js +0 -1
- package/app/components/custom-field.js +0 -1
- package/app/components/customer-form-panel.js +0 -1
- package/app/components/customer-panel/details.js +0 -1
- package/app/components/customer-panel.js +0 -1
- package/app/components/driver-card-mini.js +0 -1
- package/app/components/driver-card.js +0 -1
- package/app/components/driver-form-panel.js +0 -1
- package/app/components/driver-panel/details.js +0 -1
- package/app/components/driver-panel/orders.js +0 -1
- package/app/components/driver-panel.js +0 -1
- package/app/components/event-timeline/event.js +0 -1
- package/app/components/fleet-form-panel.js +0 -1
- package/app/components/fleet-panel.js +0 -1
- package/app/components/fuel-report-form-panel.js +0 -1
- package/app/components/fuel-report-panel.js +0 -1
- package/app/components/full-size.js +0 -1
- package/app/components/horizontal-route.js +0 -1
- package/app/components/issue-form-panel.js +0 -1
- package/app/components/issue-panel.js +0 -1
- package/app/components/live-map-drawer/driver-listing.js +0 -1
- package/app/components/live-map-drawer/place-listing.js +0 -1
- package/app/components/live-map-drawer/vehicle-listing.js +0 -1
- package/app/components/live-map-drawer.js +0 -1
- package/app/components/live-map.js +0 -1
- package/app/components/map-container/toolbar/visibility-control-panel.js +0 -1
- package/app/components/map-container/toolbar/zones-panel.js +0 -1
- package/app/components/map-container/toolbar-container.js +0 -1
- package/app/components/map-container/toolbar.js +0 -1
- package/app/components/operations-pane/pane.js +0 -1
- package/app/components/order-board.js +0 -1
- package/app/components/order-config/activity-flow-editor.js +0 -1
- package/app/components/order-config/details-editor.js +0 -1
- package/app/components/order-config/entities-editor.js +0 -1
- package/app/components/order-config/fields-editor.js +0 -1
- package/app/components/order-config/selector.js +0 -1
- package/app/components/order-config-manager-overlay.js +0 -1
- package/app/components/order-flow.js +0 -1
- package/app/components/order-list-overlay.js +0 -1
- package/app/components/place-form-panel.js +0 -1
- package/app/components/place-panel.js +0 -1
- package/app/components/settings-window.js +0 -1
- package/app/components/split-grid.js +0 -1
- package/app/components/vehicle-form-panel.js +0 -1
- package/app/components/vehicle-panel/details.js +0 -1
- package/app/components/vehicle-panel/tracking.js +0 -1
- package/app/components/vehicle-panel.js +0 -1
- package/app/components/vendor-form-panel/create-form.js +0 -1
- package/app/components/vendor-form-panel/edit-form.js +0 -1
- package/app/components/vendor-form-panel.js +0 -1
- package/app/components/vendor-panel/details.js +0 -1
- package/app/components/vendor-panel/drivers.js +0 -1
- package/app/components/vendor-panel/personnel.js +0 -1
- package/app/components/vendor-panel.js +0 -1
- package/app/controllers/base-controller.js +0 -1
- package/app/controllers/management.js +0 -1
- package/app/controllers/operations/orders/index/config/types.js +0 -1
- package/app/controllers/operations/orders/index/config.js +0 -1
- package/app/controllers/operations/orders/index/view.js +0 -1
- package/app/helpers/feature-group.js +0 -1
- package/app/helpers/flow-raw-status.js +0 -1
- package/app/helpers/get-tip-amount.js +0 -1
- package/app/helpers/is-facilitator-supported-place.js +0 -1
- package/app/helpers/is-section-visible.js +0 -1
- package/app/helpers/is-visibility-control-visible.js +0 -1
- package/app/helpers/is-waypoint-record.js +0 -1
- package/app/helpers/service-name.js +0 -1
- package/app/routes/operations/orders/index/config/types.js +0 -1
- package/app/routes/operations/orders/index/config.js +0 -1
- package/app/routes/operations/orders/index/view.js +0 -1
- package/app/routes/operations/routes/index/view.js +0 -1
- package/app/services/context-panel.js +0 -1
- package/app/services/leaflet-router-control.js +0 -1
- package/app/templates/operations/orders/index/config/types.js +0 -1
- package/app/templates/operations/orders/index/config.js +0 -1
- package/app/templates/operations/orders/index/view.js +0 -1
- package/app/templates/operations/routes/index/view.js +0 -1
- package/app/utils/calculate-percentage.js +0 -1
- package/app/utils/find-leaflet-layer.js +0 -1
- package/app/utils/fly-to-leaflet-layer.js +0 -1
- package/app/utils/format-currency.js +0 -1
- package/app/utils/get-custom-field-type-map.js +0 -1
- package/app/utils/get-issue-categories.js +0 -1
- package/app/utils/get-issue-types.js +0 -1
- package/app/utils/get-leaflet-layer-by-id.js +0 -1
- package/app/utils/get-vendor-status-options.js +0 -1
- package/app/utils/get-vendor-type-options.js +0 -1
- package/app/utils/layer-can-bind-contextmenu.js +0 -1
- package/app/utils/to-model.js +0 -1
- /package/addon/components/{order-config/selector.hbs → asset/form.hbs} +0 -0
- /package/addon/components/{order-flow.hbs → customer/leaflet-map.hbs} +0 -0
- /package/addon/components/{vehicle-panel/tracking.hbs → customer/order-details.hbs} +0 -0
- /package/addon/components/{vendor-panel/personnel.hbs → entity/details.hbs} +0 -0
- /package/addon/templates/{comms/chat.hbs → analytics/reports.hbs} +0 -0
- /package/addon/templates/{comms.hbs → analytics.hbs} +0 -0
- /package/addon/templates/{comms/intercom.hbs → connectivity/tracking/index.hbs} +0 -0
- /package/addon/templates/{operations/routes/index/view.hbs → maintenance.hbs} +0 -0
|
@@ -1,1925 +0,0 @@
|
|
|
1
|
-
import Component from '@glimmer/component';
|
|
2
|
-
import { tracked } from '@glimmer/tracking';
|
|
3
|
-
import { inject as service } from '@ember/service';
|
|
4
|
-
import { action, set } from '@ember/object';
|
|
5
|
-
import { isArray } from '@ember/array';
|
|
6
|
-
import { dasherize, camelize, classify } from '@ember/string';
|
|
7
|
-
import { singularize } from 'ember-inflector';
|
|
8
|
-
import { later } from '@ember/runloop';
|
|
9
|
-
import { debug } from '@ember/debug';
|
|
10
|
-
import { allSettled } from 'rsvp';
|
|
11
|
-
import { task } from 'ember-concurrency';
|
|
12
|
-
import { Control as RoutingControl } from '@fleetbase/leaflet-routing-machine';
|
|
13
|
-
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Component which displays live activity.
|
|
17
|
-
*
|
|
18
|
-
* @class
|
|
19
|
-
*/
|
|
20
|
-
const MAP_TARGET_FOCUS_PADDING_BOTTOM_RIGHT = [200, 0];
|
|
21
|
-
const MAP_TARGET_FOCUS_REFOCUS_PANBY = [150, 0];
|
|
22
|
-
export default class LiveMapComponent extends Component {
|
|
23
|
-
@service store;
|
|
24
|
-
@service intl;
|
|
25
|
-
@service fetch;
|
|
26
|
-
@service socket;
|
|
27
|
-
@service currentUser;
|
|
28
|
-
@service notifications;
|
|
29
|
-
@service serviceAreas;
|
|
30
|
-
@service location;
|
|
31
|
-
@service appCache;
|
|
32
|
-
@service universe;
|
|
33
|
-
@service abilities;
|
|
34
|
-
@service movementTracker;
|
|
35
|
-
@service crud;
|
|
36
|
-
@service contextPanel;
|
|
37
|
-
@service leafletMapManager;
|
|
38
|
-
@service leafletContextmenuManager;
|
|
39
|
-
@service leafletRoutingControl;
|
|
40
|
-
@service theme;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* An array of routes.
|
|
44
|
-
* @type {Array}
|
|
45
|
-
* @memberof LiveMapComponent
|
|
46
|
-
*/
|
|
47
|
-
@tracked routes = [];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* An array of drivers.
|
|
51
|
-
* @type {Array}
|
|
52
|
-
* @memberof LiveMapComponent
|
|
53
|
-
*/
|
|
54
|
-
@tracked drivers = [];
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* An array of vehicles.
|
|
58
|
-
* @type {Array}
|
|
59
|
-
* @memberof LiveMapComponent
|
|
60
|
-
*/
|
|
61
|
-
@tracked vehicles = [];
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* An array of places.
|
|
65
|
-
* @type {Array}
|
|
66
|
-
* @memberof LiveMapComponent
|
|
67
|
-
*/
|
|
68
|
-
@tracked places = [];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* An array of channels.
|
|
72
|
-
* @type {Array}
|
|
73
|
-
* @memberof LiveMapComponent
|
|
74
|
-
*/
|
|
75
|
-
@tracked channels = [];
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Indicates if data is loading.
|
|
79
|
-
* @type {boolean}
|
|
80
|
-
* @memberof LiveMapComponent
|
|
81
|
-
*/
|
|
82
|
-
@tracked isLoading = true;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Indicates if the component is ready.
|
|
86
|
-
* @type {boolean}
|
|
87
|
-
* @memberof LiveMapComponent
|
|
88
|
-
*/
|
|
89
|
-
@tracked isReady = false;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Indicates if all the data requested has completed loading.
|
|
93
|
-
* @type {boolean}
|
|
94
|
-
* @memberof LiveMapComponent
|
|
95
|
-
*/
|
|
96
|
-
@tracked isDataLoaded = false;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Controls for visibility.
|
|
100
|
-
* @type {Object}
|
|
101
|
-
* @memberof LiveMapComponent
|
|
102
|
-
*/
|
|
103
|
-
@tracked visibilityControls = {
|
|
104
|
-
vehicles: true,
|
|
105
|
-
onlineVehicles: true,
|
|
106
|
-
offlineVehicles: true,
|
|
107
|
-
drivers: true,
|
|
108
|
-
onlineDrivers: true,
|
|
109
|
-
offlineDrivers: true,
|
|
110
|
-
places: true,
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* An array of active service areas.
|
|
115
|
-
* @type {Array}
|
|
116
|
-
* @memberof LiveMapComponent
|
|
117
|
-
*/
|
|
118
|
-
@tracked activeServiceAreas = [];
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* An array of editable map layers.
|
|
122
|
-
* @type {Array}
|
|
123
|
-
* @memberof LiveMapComponent
|
|
124
|
-
*/
|
|
125
|
-
@tracked editableLayers = [];
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* The Leaflet map instance.
|
|
129
|
-
* @type {Object}
|
|
130
|
-
* @memberof LiveMapComponent
|
|
131
|
-
*/
|
|
132
|
-
@tracked leafletMap;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The Drawer component context API.
|
|
136
|
-
* @type {Object}
|
|
137
|
-
* @memberof LiveMapComponent
|
|
138
|
-
*/
|
|
139
|
-
@tracked drawer;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The map's zoom level.
|
|
143
|
-
* @type {number}
|
|
144
|
-
* @memberof LiveMapComponent
|
|
145
|
-
*/
|
|
146
|
-
@tracked zoom = 12;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The feature group for drawing on the map.
|
|
150
|
-
* @type {Object}
|
|
151
|
-
* @memberof LiveMapComponent
|
|
152
|
-
*/
|
|
153
|
-
@tracked drawFeatureGroup;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* The draw control for the map.
|
|
157
|
-
* @type {Object}
|
|
158
|
-
* @memberof LiveMapComponent
|
|
159
|
-
*/
|
|
160
|
-
@tracked drawControl;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* The URL for the map's tile source.
|
|
164
|
-
* @type {string}
|
|
165
|
-
* @memberof LiveMapComponent
|
|
166
|
-
*/
|
|
167
|
-
@tracked tileSourceUrl = 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png';
|
|
168
|
-
@tracked mapTheme = 'light';
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The latitude for the map view.
|
|
172
|
-
* @type {number}
|
|
173
|
-
* @memberof LiveMapComponent
|
|
174
|
-
*/
|
|
175
|
-
@tracked latitude = this.location.getLatitude();
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* The longitude for the map view.
|
|
179
|
-
* @type {number}
|
|
180
|
-
* @memberof LiveMapComponent
|
|
181
|
-
*/
|
|
182
|
-
@tracked longitude = this.location.getLongitude();
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Indicates if coordinate setting should be skipped.
|
|
186
|
-
* @type {boolean}
|
|
187
|
-
* @memberof LiveMapComponent
|
|
188
|
-
*/
|
|
189
|
-
@tracked skipSetCoordinates = false;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* ID of interval to check if leaflet plugins has loaded.
|
|
193
|
-
* @type {boolean}
|
|
194
|
-
* @memberof LiveMapComponent
|
|
195
|
-
*/
|
|
196
|
-
@tracked leafletPluginsLoadedCheckId = false;
|
|
197
|
-
|
|
198
|
-
@tracked focusedVehicle;
|
|
199
|
-
@tracked focusedDriver;
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Cache for storing original state of resource arrays.
|
|
203
|
-
* @type {Object.<string, Array>}
|
|
204
|
-
* @memberof LiveMapComponent
|
|
205
|
-
*/
|
|
206
|
-
originalResources = {};
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Creates an instance of LiveMapComponent.
|
|
210
|
-
* @memberof LiveMapComponent
|
|
211
|
-
*/
|
|
212
|
-
constructor(owner, { zoom = 12 }) {
|
|
213
|
-
super(...arguments);
|
|
214
|
-
|
|
215
|
-
this.zoom = zoom;
|
|
216
|
-
this.changeTileSource('light');
|
|
217
|
-
this.movementTracker.registerTrackingMarker(owner);
|
|
218
|
-
this.setupComponent();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
changeTileSource(sourceUrl = null) {
|
|
222
|
-
if (sourceUrl === 'dark') {
|
|
223
|
-
this.mapTheme = 'dark';
|
|
224
|
-
this.tileSourceUrl = 'https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png';
|
|
225
|
-
} else if (sourceUrl === 'light') {
|
|
226
|
-
this.mapTheme = 'light';
|
|
227
|
-
this.tileSourceUrl = 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png';
|
|
228
|
-
} else if (typeof sourceUrl === 'string' && sourceUrl.startsWith('https://')) {
|
|
229
|
-
this.mapTheme = 'custom';
|
|
230
|
-
this.tileSourceUrl = sourceUrl;
|
|
231
|
-
} else {
|
|
232
|
-
this.mapTheme = 'light';
|
|
233
|
-
this.tileSourceUrl = 'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png';
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Initializes the LiveMapComponent by triggering events, setting initial coordinates,
|
|
239
|
-
* and loading required live data.
|
|
240
|
-
*
|
|
241
|
-
* @memberof LiveMapComponent
|
|
242
|
-
* @action
|
|
243
|
-
* @function
|
|
244
|
-
*/
|
|
245
|
-
async setupComponent() {
|
|
246
|
-
// set initial coordinates
|
|
247
|
-
await this.setInitialCoordinates();
|
|
248
|
-
|
|
249
|
-
// Check if leaflet plugins loaded
|
|
250
|
-
this.leafletPluginsLoadedCheckId = setInterval(() => {
|
|
251
|
-
if (window.fleetopsLeafletPluginsLoaded === true) {
|
|
252
|
-
clearInterval(this.leafletPluginsLoadedCheckId);
|
|
253
|
-
this.ready();
|
|
254
|
-
}
|
|
255
|
-
}, 100);
|
|
256
|
-
|
|
257
|
-
// load data and complete setup
|
|
258
|
-
await this.completeSetup([
|
|
259
|
-
this.loadLiveData.perform('routes'),
|
|
260
|
-
this.loadLiveData.perform('vehicles'),
|
|
261
|
-
this.loadLiveData.perform('drivers'),
|
|
262
|
-
this.loadLiveData.perform('places'),
|
|
263
|
-
this.loadServiceAreas.perform(),
|
|
264
|
-
]);
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Completes the setup of the component by processing an array of live data promises.
|
|
269
|
-
* It waits for all the provided promises to settle and then sets a flag indicating
|
|
270
|
-
* that data fetching is complete. It ensures that any final listening and readiness
|
|
271
|
-
* processes are invoked at the end of the setup process.
|
|
272
|
-
*
|
|
273
|
-
* @param {Promise[]} liveDataPromises - An array of promises that fetch live data.
|
|
274
|
-
* @returns {Promise} A promise that resolves when all data-fetching promises have settled.
|
|
275
|
-
*/
|
|
276
|
-
async completeSetup(liveDataPromises) {
|
|
277
|
-
await allSettled(liveDataPromises);
|
|
278
|
-
this.isDataLoaded = true;
|
|
279
|
-
this.listen();
|
|
280
|
-
this.universe.trigger('fleet-ops.live-map.loaded', this);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Reloads the live map data.
|
|
285
|
-
*
|
|
286
|
-
* @memberof LiveMapComponent
|
|
287
|
-
*/
|
|
288
|
-
async reload() {
|
|
289
|
-
this.isDataLoaded = false;
|
|
290
|
-
await this.completeSetup([
|
|
291
|
-
this.loadLiveData.perform('routes'),
|
|
292
|
-
this.loadLiveData.perform('vehicles'),
|
|
293
|
-
this.loadLiveData.perform('drivers'),
|
|
294
|
-
this.loadLiveData.perform('places'),
|
|
295
|
-
this.loadServiceAreas.perform(),
|
|
296
|
-
]);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Marks the LiveMapComponent as ready by setting the "isReady" property and triggering
|
|
301
|
-
* the "onReady" action and a "fleetops.live-map.ready" event.
|
|
302
|
-
*
|
|
303
|
-
* @memberof LiveMapComponent
|
|
304
|
-
* @function
|
|
305
|
-
*/
|
|
306
|
-
ready() {
|
|
307
|
-
this.isReady = true;
|
|
308
|
-
this.triggerAction('onReady');
|
|
309
|
-
this.universe.trigger('fleet-ops.live-map.ready', this);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Sets the initial coordinates for the LiveMapComponent.
|
|
314
|
-
*
|
|
315
|
-
* This function checks if initial coordinates are available in the appCache, and if not,
|
|
316
|
-
* it fetches the coordinates using the "getInitialCoordinates" function. It sets the
|
|
317
|
-
* latitude and longitude properties and triggers an event to notify that coordinates
|
|
318
|
-
* have been set.
|
|
319
|
-
*
|
|
320
|
-
* @memberof LiveMapComponent
|
|
321
|
-
* @async
|
|
322
|
-
* @function
|
|
323
|
-
* @returns {Promise<[number, number] | null>} An array containing the latitude and longitude
|
|
324
|
-
* if available, or null if the function is skipped.
|
|
325
|
-
*/
|
|
326
|
-
async setInitialCoordinates() {
|
|
327
|
-
try {
|
|
328
|
-
const { latitude, longitude } = await this.location.getUserLocation();
|
|
329
|
-
|
|
330
|
-
this.latitude = latitude || this.location.DEFAULT_LATITUDE;
|
|
331
|
-
this.longitude = longitude || this.location.DEFAULT_LONGITUDE;
|
|
332
|
-
} catch (error) {
|
|
333
|
-
this.latitude = this.location.DEFAULT_LATITUDE;
|
|
334
|
-
this.longitude = this.location.DEFAULT_LONGITUDE;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
// Trigger that initial coordinates are set to live map component
|
|
338
|
-
this.universe.trigger('fleet-ops.live-map.has_coordinates', {
|
|
339
|
-
latitude: this.latitude,
|
|
340
|
-
longitude: this.longitude,
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Sets up the LiveMap component and the Leaflet map instance.
|
|
346
|
-
*
|
|
347
|
-
* This function initializes the LiveMap component, associates it with the Leaflet map instance,
|
|
348
|
-
* triggers the "fleetops.live-map.leaflet_ready" event, and performs additional setup tasks like
|
|
349
|
-
* configuring context menus, hiding draw controls, and associating the map with the "serviceAreas"
|
|
350
|
-
* service. It also triggers the "onLoad" action with the provided event and target.
|
|
351
|
-
*
|
|
352
|
-
* @action
|
|
353
|
-
* @function
|
|
354
|
-
* @param {Event} event - The event object.
|
|
355
|
-
*/
|
|
356
|
-
@action setupMap(event) {
|
|
357
|
-
const { target } = event;
|
|
358
|
-
|
|
359
|
-
// set liveMapComponent component to instance
|
|
360
|
-
set(target, 'liveMap', this);
|
|
361
|
-
|
|
362
|
-
// set map instance
|
|
363
|
-
this.leafletMap = target;
|
|
364
|
-
|
|
365
|
-
// trigger liveMap ready through universe
|
|
366
|
-
this.universe.trigger('fleet-ops.live-map.leaflet_ready', event, target);
|
|
367
|
-
|
|
368
|
-
// make fleetops map globally available on the window
|
|
369
|
-
window.FleetOpsLeafletMap = target;
|
|
370
|
-
|
|
371
|
-
// store this component to universe
|
|
372
|
-
this.universe.set('component:fleet-ops:live-map', this);
|
|
373
|
-
|
|
374
|
-
// setup context menu
|
|
375
|
-
this.createMapContextMenu(target);
|
|
376
|
-
|
|
377
|
-
// hide draw controls by default
|
|
378
|
-
this.hideDrawControls();
|
|
379
|
-
|
|
380
|
-
// set instance to service areas service
|
|
381
|
-
this.serviceAreas.setMapInstance(target);
|
|
382
|
-
|
|
383
|
-
// Update event
|
|
384
|
-
event.target = target;
|
|
385
|
-
|
|
386
|
-
// trigger map loaded event
|
|
387
|
-
this.triggerAction('onLoad', event);
|
|
388
|
-
|
|
389
|
-
// handle theme change
|
|
390
|
-
// this._checkThemeChanged();
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
_checkThemeChanged() {
|
|
394
|
-
const observer = new MutationObserver((mutations) => {
|
|
395
|
-
mutations.forEach((mutation) => {
|
|
396
|
-
if (mutation.type === 'attributes' && mutation.attributeName === 'data-theme') {
|
|
397
|
-
const theme = document.body.getAttribute(mutation.attributeName);
|
|
398
|
-
if (theme === 'light' || theme === 'dark') {
|
|
399
|
-
this.changeTileSource(theme);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
observer.observe(document.body, { attributes: true, attributeFilter: ['data-theme'] });
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Invokes an action by name on the current component and its arguments (if defined).
|
|
410
|
-
*
|
|
411
|
-
* This function checks if an action with the specified name exists on the current component.
|
|
412
|
-
* If found, it invokes the action with the provided parameters. It also checks the component's
|
|
413
|
-
* arguments for the action and invokes it if defined.
|
|
414
|
-
*
|
|
415
|
-
* @action
|
|
416
|
-
* @function
|
|
417
|
-
* @param {string} actionName - The name of the action to trigger.
|
|
418
|
-
* @param {...any} params - Optional parameters to pass to the action.
|
|
419
|
-
*/
|
|
420
|
-
@action triggerAction(actionName, ...params) {
|
|
421
|
-
if (typeof this[actionName] === 'function') {
|
|
422
|
-
this[actionName](...params);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (typeof this.args[actionName] === 'function') {
|
|
426
|
-
this.args[actionName](...params);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Asynchronously loads live data for a specified path and updates the component's state.
|
|
432
|
-
* This function uses Ember Concurrency to handle the asynchronous operation, ensuring
|
|
433
|
-
* better handling of concurrency and potential task cancellation.
|
|
434
|
-
*
|
|
435
|
-
* @memberof LiveMapComponent
|
|
436
|
-
* @task
|
|
437
|
-
* @generator
|
|
438
|
-
* @param {string} path - The path for fetching live data.
|
|
439
|
-
* @param {Object} [options={}] - Configuration options for the data loading process.
|
|
440
|
-
* @param {Object} [options.params={}] - Additional parameters to include in the request.
|
|
441
|
-
* @param {Function} [options.onLoaded] - Callback function executed when data is successfully loaded.
|
|
442
|
-
* @param {Function} [options.onFailure] - Callback function executed in case of a failure in data loading.
|
|
443
|
-
* @returns {Promise<Object|undefined>} A promise that resolves with the fetched data, or undefined if an error occurs.
|
|
444
|
-
*
|
|
445
|
-
* @example
|
|
446
|
-
* // To load data and execute specific actions on load and failure
|
|
447
|
-
* this.loadLiveData.perform('some/path', {
|
|
448
|
-
* params: { key: 'value' },
|
|
449
|
-
* onLoaded: (data) => { debug('Data loaded', data); },
|
|
450
|
-
* onFailure: (error) => { console.error('Failed to load data', error); }
|
|
451
|
-
* });
|
|
452
|
-
*/
|
|
453
|
-
@task *loadLiveData(path, options = {}) {
|
|
454
|
-
if (this.abilities.cannot(`fleet-ops list ${path}`)) {
|
|
455
|
-
return [];
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
const internalName = camelize(path);
|
|
459
|
-
const callbackFnName = `on${internalName}Loaded`;
|
|
460
|
-
const params = getWithDefault(options, 'params', {});
|
|
461
|
-
const url = `fleet-ops/live/${path}`;
|
|
462
|
-
|
|
463
|
-
try {
|
|
464
|
-
let data = yield this.fetch.get(url, params, { normalizeToEmberData: true, normalizeModelType: singularize(internalName) });
|
|
465
|
-
if (isArray(data)) {
|
|
466
|
-
data = [...data];
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
this.triggerAction(callbackFnName);
|
|
470
|
-
this.createVisibilityControl(internalName);
|
|
471
|
-
this[internalName] = data;
|
|
472
|
-
this.cacheOriginalResources(internalName);
|
|
473
|
-
|
|
474
|
-
if (typeof options.onLoaded === 'function') {
|
|
475
|
-
options.onLoaded(data);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
return data;
|
|
479
|
-
} catch (error) {
|
|
480
|
-
if (typeof options.onFailure === 'function') {
|
|
481
|
-
options.onFailure(error);
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Creates or updates a visibility control for a specific element by name.
|
|
488
|
-
*
|
|
489
|
-
* @function
|
|
490
|
-
* @param {string} name - The name or identifier for the visibility control.
|
|
491
|
-
* @param {boolean} [visible=true] - A boolean value indicating whether the element is initially visible (default is true).
|
|
492
|
-
*/
|
|
493
|
-
createVisibilityControl(name, visible = true) {
|
|
494
|
-
this.visibilityControls = {
|
|
495
|
-
...this.visibilityControls,
|
|
496
|
-
[name]: visible,
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Hide all visibility controls associated with the current instance.
|
|
502
|
-
*/
|
|
503
|
-
hideAll(callback = null) {
|
|
504
|
-
const controls = Object.keys(this.visibilityControls);
|
|
505
|
-
|
|
506
|
-
for (let i = 0; i < controls.length; i++) {
|
|
507
|
-
const control = controls.objectAt(i);
|
|
508
|
-
this.hide(control);
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
if (typeof callback === 'function') {
|
|
512
|
-
callback();
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Show all visibility controls associated with the current instance.
|
|
518
|
-
*/
|
|
519
|
-
showAll(callback = null) {
|
|
520
|
-
const controls = Object.keys(this.visibilityControls);
|
|
521
|
-
|
|
522
|
-
for (let i = 0; i < controls.length; i++) {
|
|
523
|
-
const control = controls.objectAt(i);
|
|
524
|
-
this.show(control);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
if (typeof callback === 'function') {
|
|
528
|
-
callback();
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* Hides a specific element by name using a visibility control.
|
|
534
|
-
*
|
|
535
|
-
* @function
|
|
536
|
-
* @param {string} name - The name or identifier of the element to hide.
|
|
537
|
-
*/
|
|
538
|
-
hide(name, callback = null) {
|
|
539
|
-
if (isArray(name)) {
|
|
540
|
-
return name.forEach(this.hide.bind(this));
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
this.createVisibilityControl(name, false);
|
|
544
|
-
if (typeof callback === 'function') {
|
|
545
|
-
callback();
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* Shows a specific element by name using a visibility control.
|
|
551
|
-
*
|
|
552
|
-
* @function
|
|
553
|
-
* @param {string} name - The name or identifier of the element to show.
|
|
554
|
-
*/
|
|
555
|
-
show(name, callback = null) {
|
|
556
|
-
if (isArray(name)) {
|
|
557
|
-
return name.forEach(this.show.bind(this));
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
this.createVisibilityControl(name, true);
|
|
561
|
-
if (typeof callback === 'function') {
|
|
562
|
-
callback();
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Toggles the visibility of a control by its name.
|
|
568
|
-
* Calls `hide()` if the control is currently visible, and `show()` otherwise.
|
|
569
|
-
*
|
|
570
|
-
* @param {string} name - The name of the control to toggle.
|
|
571
|
-
* @memberof LiveMapComponent
|
|
572
|
-
*/
|
|
573
|
-
toggleVisibility(name, callback = null) {
|
|
574
|
-
if (this.isVisible(name)) {
|
|
575
|
-
this.hide(name, callback);
|
|
576
|
-
} else {
|
|
577
|
-
this.show(name, callback);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* Check if a specific element or feature is currently visible based on its name.
|
|
583
|
-
*
|
|
584
|
-
* @param {string} name - The name of the element or feature to check visibility for.
|
|
585
|
-
* @returns {boolean} Returns `true` if the element or feature is currently visible, `false` otherwise.
|
|
586
|
-
* @memberof LiveMapComponent
|
|
587
|
-
*/
|
|
588
|
-
isVisible(name) {
|
|
589
|
-
return this.visibilityControls[name] === true;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Caches the original state of a resource array.
|
|
594
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
595
|
-
* @memberof LiveMapComponent
|
|
596
|
-
*/
|
|
597
|
-
cacheOriginalResources(name) {
|
|
598
|
-
if (!this.originalResources[name]) {
|
|
599
|
-
this.originalResources[name] = [...this[name]];
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* Retrieves the original resources array for a given name.
|
|
605
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
606
|
-
* @returns {Array} - The original array of resources; an empty array if not set.
|
|
607
|
-
* @memberof LiveMapComponent
|
|
608
|
-
*/
|
|
609
|
-
getOriginalResources(name) {
|
|
610
|
-
if (isArray(this.originalResources[name])) {
|
|
611
|
-
return this.originalResources[name];
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
return [];
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Shows all online and offline resources for a given name.
|
|
619
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
620
|
-
* @memberof LiveMapComponent
|
|
621
|
-
*/
|
|
622
|
-
showAllOnlineOffline(name) {
|
|
623
|
-
this.show(name);
|
|
624
|
-
this.showOnline(name);
|
|
625
|
-
this.showOffline(name);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Hides all online and offline resources for a given name.
|
|
630
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
631
|
-
* @memberof LiveMapComponent
|
|
632
|
-
*/
|
|
633
|
-
hideAllOnlineOffline(name) {
|
|
634
|
-
this.hide(name);
|
|
635
|
-
this.hideOnline(name);
|
|
636
|
-
this.hideOffline(name);
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Toggles the visibility of all online and offline resources for a given name.
|
|
641
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
642
|
-
* @memberof LiveMapComponent
|
|
643
|
-
*/
|
|
644
|
-
toggleAllOnlineOffline(name) {
|
|
645
|
-
if (this.isVisible(name)) {
|
|
646
|
-
this.hideAllOnlineOffline(name);
|
|
647
|
-
} else {
|
|
648
|
-
this.showAllOnlineOffline(name);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* Toggles the visibility of online resources for a given array.
|
|
654
|
-
* @method toggleOnline
|
|
655
|
-
* @param {string} name - The name of the resource array (e.g., 'vehicles', 'drivers').
|
|
656
|
-
* @memberof LiveMapComponent
|
|
657
|
-
*/
|
|
658
|
-
toggleOnline(name) {
|
|
659
|
-
const visibilityControlName = `online${classify(name)}`;
|
|
660
|
-
|
|
661
|
-
if (this.isVisible(visibilityControlName)) {
|
|
662
|
-
this.hideOnline(name);
|
|
663
|
-
} else {
|
|
664
|
-
this.showOnline(name);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Toggles the visibility of offline resources for a given array.
|
|
670
|
-
* @method toggleOffline
|
|
671
|
-
* @param {string} name - The name of the resource array (e.g., 'vehicles', 'drivers').
|
|
672
|
-
* @memberof LiveMapComponent
|
|
673
|
-
*/
|
|
674
|
-
toggleOffline(name) {
|
|
675
|
-
const visibilityControlName = `offline${classify(name)}`;
|
|
676
|
-
|
|
677
|
-
if (this.isVisible(visibilityControlName)) {
|
|
678
|
-
this.hideOffline(name);
|
|
679
|
-
} else {
|
|
680
|
-
this.showOffline(name);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* Hides online resources from a given array and updates it.
|
|
686
|
-
* @method hideOnline
|
|
687
|
-
* @param {string} name - The name of the resource array (e.g., 'vehicles', 'drivers').
|
|
688
|
-
* @memberof LiveMapComponent
|
|
689
|
-
*/
|
|
690
|
-
hideOnline(name) {
|
|
691
|
-
this[name] = this.getOriginalResources(name).filter((resource) => !resource.online);
|
|
692
|
-
|
|
693
|
-
// track with visibility controls
|
|
694
|
-
this.createVisibilityControl(`online${classify(name)}`, false);
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Shows online resources from a given array and updates it.
|
|
699
|
-
* @method showOnline
|
|
700
|
-
* @param {string} name - The name of the resource array (e.g., 'vehicles', 'drivers').
|
|
701
|
-
* @memberof LiveMapComponent
|
|
702
|
-
*/
|
|
703
|
-
showOnline(name) {
|
|
704
|
-
this[name] = this.getOriginalResources(name).filter((resource) => resource.online);
|
|
705
|
-
|
|
706
|
-
// track with visibility controls
|
|
707
|
-
this.createVisibilityControl(`online${classify(name)}`, true);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Hides offline resources from a specified array.
|
|
712
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
713
|
-
* @memberof LiveMapComponent
|
|
714
|
-
*/
|
|
715
|
-
hideOffline(name) {
|
|
716
|
-
this[name] = this.getOriginalResources(name).filter((resource) => resource.online);
|
|
717
|
-
|
|
718
|
-
// track with visibility controls
|
|
719
|
-
this.createVisibilityControl(`offline${classify(name)}`, false);
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Shows offline resources from a specified array.
|
|
724
|
-
* @param {string} name - Name of the resource array (e.g., 'vehicles', 'drivers').
|
|
725
|
-
* @memberof LiveMapComponent
|
|
726
|
-
*/
|
|
727
|
-
showOffline(name) {
|
|
728
|
-
this[name] = this.getOriginalResources(name).filter((resource) => !resource.online);
|
|
729
|
-
|
|
730
|
-
// track with visibility controls
|
|
731
|
-
this.createVisibilityControl(`offline${classify(name)}`, true);
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* Toggles the context menu item for enabling/disabling draw controls.
|
|
736
|
-
*
|
|
737
|
-
* @param {Object} [options] - Optional settings for the context menu item.
|
|
738
|
-
* @param {string} [options.onText='Hide draw controls...'] - Text to display when enabling draw controls.
|
|
739
|
-
* @param {string} [options.offText='Enable draw controls...'] - Text to display when disabling draw controls.
|
|
740
|
-
* @param {string} [options.callback=function] - Callback function to trigger after toggle.
|
|
741
|
-
* @memberof LiveMapComponent
|
|
742
|
-
*/
|
|
743
|
-
toggleDrawControlContextMenuItem(options = {}) {
|
|
744
|
-
const toggle = !this.isVisible('drawControls');
|
|
745
|
-
|
|
746
|
-
this.leafletContextmenuManager.toggleContextMenuItem('map', 'draw controls', {
|
|
747
|
-
onText: this.intl.t('fleet-ops.component.live-map.onText'),
|
|
748
|
-
offText: this.intl.t('fleet-ops.component.live-map.offText'),
|
|
749
|
-
toggle,
|
|
750
|
-
callback: (isToggled) => {
|
|
751
|
-
if (isToggled) {
|
|
752
|
-
this.showDrawControls();
|
|
753
|
-
} else {
|
|
754
|
-
this.hideDrawControls();
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
...options,
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Removes a specific service area from the context menu.
|
|
763
|
-
*
|
|
764
|
-
* @param {Object} serviceArea - The service area to be removed from the context menu.
|
|
765
|
-
* @memberof LiveMapComponent
|
|
766
|
-
*/
|
|
767
|
-
removeServiceAreaFromContextMenu(serviceArea) {
|
|
768
|
-
this.leafletContextmenuManager.removeItemFromContextMenu('map', `Focus Service Area: ${serviceArea.name}`);
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Get a Leaflet layer from the map based on its ID.
|
|
773
|
-
*
|
|
774
|
-
* @param {string} id - The ID of the Leaflet layer to retrieve.
|
|
775
|
-
* @returns {Object|null} The found Leaflet layer or `null` if not found.
|
|
776
|
-
* @memberof LiveMapComponent
|
|
777
|
-
*/
|
|
778
|
-
getLeafletLayerById(id) {
|
|
779
|
-
return this.leafletMapManager.getLeafletLayerById(this.leafletMap, id);
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* Find a specific Leaflet layer on the map using a callback function.
|
|
784
|
-
*
|
|
785
|
-
* @param {Function} callback - A callback function that defines the condition for finding the layer.
|
|
786
|
-
* @returns {Object|null} The found Leaflet layer or `null` if not found.
|
|
787
|
-
* @memberof LiveMapComponent
|
|
788
|
-
*/
|
|
789
|
-
findLeafletLayer(callback) {
|
|
790
|
-
return this.leafletMapManager.findLeafletLayer(this.leafletMap, callback);
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* Find an editable layer in the collection by its record ID.
|
|
795
|
-
*
|
|
796
|
-
* @param {Object} record - The record with the ID used for lookup.
|
|
797
|
-
* @returns {Layer|null} The found editable layer, or null if not found.
|
|
798
|
-
* @memberof LiveMapComponent
|
|
799
|
-
*/
|
|
800
|
-
getLeafletLayerByRecordId(record) {
|
|
801
|
-
const id = getWithDefault(record, 'id', record);
|
|
802
|
-
let targetLayer = null;
|
|
803
|
-
|
|
804
|
-
this.leafletMap.eachLayer((layer) => {
|
|
805
|
-
// Check if the layer has an ID property
|
|
806
|
-
if (layer.record_id === id) {
|
|
807
|
-
targetLayer = layer;
|
|
808
|
-
}
|
|
809
|
-
});
|
|
810
|
-
|
|
811
|
-
return targetLayer;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* Push an editable layer to the collection of editable layers.
|
|
816
|
-
*
|
|
817
|
-
* @param {Layer} layer - The layer to be added to the collection.
|
|
818
|
-
* @memberof LiveMapComponent
|
|
819
|
-
*/
|
|
820
|
-
pushEditableLayer(layer) {
|
|
821
|
-
if (!this.editableLayers.includes(layer)) {
|
|
822
|
-
this.editableLayers.pushObject(layer);
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* Remove an editable layer from the collection by its record ID.
|
|
828
|
-
*
|
|
829
|
-
* @param {Object} record - The record with the ID used for removal.
|
|
830
|
-
* @memberof LiveMapComponent
|
|
831
|
-
*/
|
|
832
|
-
removeEditableLayerByRecordId(record) {
|
|
833
|
-
const id = getWithDefault(record, 'id', record);
|
|
834
|
-
const index = this.editableLayers.findIndex((layer) => layer.record_id === id);
|
|
835
|
-
const layer = this.editableLayers.objectAt(index);
|
|
836
|
-
|
|
837
|
-
if (this.drawFeatureGroup) {
|
|
838
|
-
this.drawFeatureGroup.addLayer(layer);
|
|
839
|
-
this.editableLayers.removeAt(index);
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* Find an editable layer in the collection by its record ID.
|
|
845
|
-
*
|
|
846
|
-
* @param {Object} record - The record with the ID used for lookup.
|
|
847
|
-
* @returns {Layer|null} The found editable layer, or null if not found.
|
|
848
|
-
* @memberof LiveMapComponent
|
|
849
|
-
*/
|
|
850
|
-
findEditableLayerByRecordId(record) {
|
|
851
|
-
const id = getWithDefault(record, 'id', record);
|
|
852
|
-
return this.editableLayers.find((layer) => layer.record_id === id);
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* Peek a record for a given layer by its record ID and type.
|
|
857
|
-
*
|
|
858
|
-
* @param {Layer} layer - The layer associated with a record.
|
|
859
|
-
* @returns {Object|null} The peeked record, or null if not found.
|
|
860
|
-
* @memberof LiveMapComponent
|
|
861
|
-
*/
|
|
862
|
-
peekRecordForLayer(layer) {
|
|
863
|
-
if (layer.record_id && layer.record_type) {
|
|
864
|
-
return this.store.peekRecord(dasherize(layer.record_type), layer.record_id);
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
return null;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
/**
|
|
871
|
-
* Sets the drawer component context api.
|
|
872
|
-
*
|
|
873
|
-
* @param {Object} drawerApi
|
|
874
|
-
* @memberof LiveMapComponent
|
|
875
|
-
*/
|
|
876
|
-
@action setDrawerContext(drawerApi) {
|
|
877
|
-
this.drawer = drawerApi;
|
|
878
|
-
|
|
879
|
-
if (typeof this.args.onDrawerReady === 'function') {
|
|
880
|
-
this.args.onDrawerReady(...arguments);
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* Handle the 'drawstop' event.
|
|
886
|
-
*
|
|
887
|
-
* @param {Event} event - The 'drawstop' event object.
|
|
888
|
-
* @param {Layer} layer - The layer associated with the event.
|
|
889
|
-
* @memberof LiveMapComponent
|
|
890
|
-
*/
|
|
891
|
-
@action onDrawDrawstop(event, layer) {
|
|
892
|
-
this.serviceAreas.createGenericLayer(event, layer);
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
/**
|
|
896
|
-
* Handle the 'deleted' event for drawn elements.
|
|
897
|
-
*
|
|
898
|
-
* @param {Event} event - The 'deleted' event object.
|
|
899
|
-
* @memberof LiveMapComponent
|
|
900
|
-
*/
|
|
901
|
-
@action onDrawDeleted(event) {
|
|
902
|
-
/** @var {L.LayerGroup} layers */
|
|
903
|
-
const { layers } = event;
|
|
904
|
-
|
|
905
|
-
const records = layers.getLayers().map(this.peekRecordForLayer).filter(Boolean);
|
|
906
|
-
const requests = records.map((record) => {
|
|
907
|
-
this.blurServiceArea(record);
|
|
908
|
-
this.removeServiceAreaFromContextMenu(record);
|
|
909
|
-
|
|
910
|
-
return record.destroyRecord();
|
|
911
|
-
});
|
|
912
|
-
|
|
913
|
-
allSettled(requests).then(() => {
|
|
914
|
-
records.forEach((record) => this.serviceAreas.removeFromCache(record));
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* Handle the 'edited' event for drawn elements.
|
|
920
|
-
*
|
|
921
|
-
* @param {Event} event - The 'edited' event object.
|
|
922
|
-
* @memberof LiveMapComponent
|
|
923
|
-
*/
|
|
924
|
-
@action onDrawEdited(event) {
|
|
925
|
-
/** @var {L.LayerGroup} layers */
|
|
926
|
-
const { layers } = event;
|
|
927
|
-
|
|
928
|
-
const requests = layers.getLayers().map((layer) => {
|
|
929
|
-
const record = this.peekRecordForLayer(layer);
|
|
930
|
-
|
|
931
|
-
let border;
|
|
932
|
-
|
|
933
|
-
if (layer.record_type === 'zone') {
|
|
934
|
-
border = this.serviceAreas.layerToTerraformerPrimitive(layer);
|
|
935
|
-
} else {
|
|
936
|
-
border = this.serviceAreas.layerToTerraformerMultiPolygon(layer);
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
record.set('border', border);
|
|
940
|
-
|
|
941
|
-
return record.save();
|
|
942
|
-
});
|
|
943
|
-
|
|
944
|
-
allSettled(requests);
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* Handle the addition of a service area layer.
|
|
949
|
-
*
|
|
950
|
-
* @param {ServiceAreaModel} serviceArea - The service area object.
|
|
951
|
-
* @param {Event} event - The event object associated with the addition.
|
|
952
|
-
* @memberof LiveMapComponent
|
|
953
|
-
*/
|
|
954
|
-
@action onServiceAreaLayerAdded(serviceArea, event) {
|
|
955
|
-
const { target } = event;
|
|
956
|
-
|
|
957
|
-
set(target, 'record_id', serviceArea.id);
|
|
958
|
-
set(target, 'record_type', 'service-area');
|
|
959
|
-
|
|
960
|
-
// set the layer instance to the serviceArea model
|
|
961
|
-
set(serviceArea, '_layer', target);
|
|
962
|
-
|
|
963
|
-
if (this.drawFeatureGroup) {
|
|
964
|
-
// add to draw feature group
|
|
965
|
-
this.drawFeatureGroup.addLayer(target);
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
// this.flyToBoundsOnly(target);
|
|
969
|
-
this.createServiceAreaContextMenu(serviceArea, target);
|
|
970
|
-
this.pushEditableLayer(target);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
/**
|
|
974
|
-
* Handle the addition of a zone layer.
|
|
975
|
-
*
|
|
976
|
-
* @param {ZoneModel} zone - The zone object.
|
|
977
|
-
* @param {Event} event - The event object associated with the addition.
|
|
978
|
-
* @memberof LiveMapComponent
|
|
979
|
-
*/
|
|
980
|
-
@action onZoneLayerAdd(zone, event) {
|
|
981
|
-
const { target } = event;
|
|
982
|
-
|
|
983
|
-
set(target, 'record_id', zone.id);
|
|
984
|
-
set(target, 'record_type', 'zone');
|
|
985
|
-
|
|
986
|
-
// set the layer instance to the zone model
|
|
987
|
-
set(zone, '_layer', target);
|
|
988
|
-
|
|
989
|
-
// // if zone has a service area and service area is active then add zone to active service area
|
|
990
|
-
// const serviceAreaId = zone.get('service_area_uuid');
|
|
991
|
-
// if (serviceAreaId) {
|
|
992
|
-
// const serviceArea = this.activeServiceAreas.find((serviceArea) => serviceArea.get('id') === serviceAreaId);
|
|
993
|
-
// if (serviceArea) {
|
|
994
|
-
// const zones = serviceArea.get('zones') ? [...serviceArea.get('zones')] : [];
|
|
995
|
-
// const hasZoneAlready = zones.find((z) => z.get('id') === zone.get('id'));
|
|
996
|
-
// if (!hasZoneAlready) {
|
|
997
|
-
// serviceArea.set('zones', zones);
|
|
998
|
-
// }
|
|
999
|
-
// }
|
|
1000
|
-
// }
|
|
1001
|
-
|
|
1002
|
-
if (this.drawFeatureGroup) {
|
|
1003
|
-
// add to draw feature group
|
|
1004
|
-
this.drawFeatureGroup.addLayer(target);
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
this.createZoneContextMenu(zone, target);
|
|
1008
|
-
this.pushEditableLayer(target);
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
/**
|
|
1012
|
-
* Handle the creation of the draw feature group.
|
|
1013
|
-
*
|
|
1014
|
-
* @param {DrawFeatureGroup} drawFeatureGroup - The draw feature group instance.
|
|
1015
|
-
* @memberof LiveMapComponent
|
|
1016
|
-
*/
|
|
1017
|
-
@action onDrawFeatureGroupCreated(drawFeatureGroup) {
|
|
1018
|
-
this.drawFeatureGroup = drawFeatureGroup;
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
/**
|
|
1022
|
-
* Handle the addition of a driver marker.
|
|
1023
|
-
*
|
|
1024
|
-
* @param {DriverModel} driver - The driver object.
|
|
1025
|
-
* @param {Event} event - The event object associated with the addition.
|
|
1026
|
-
* @memberof LiveMapComponent
|
|
1027
|
-
*/
|
|
1028
|
-
@action onDriverAdded(driver, event) {
|
|
1029
|
-
const { target } = event;
|
|
1030
|
-
|
|
1031
|
-
set(target, 'record_id', driver.id);
|
|
1032
|
-
set(target, 'record_type', 'driver');
|
|
1033
|
-
|
|
1034
|
-
// set the marker instance to the driver model
|
|
1035
|
-
set(driver, '_marker', target);
|
|
1036
|
-
|
|
1037
|
-
this.createDriverContextMenu(driver, target);
|
|
1038
|
-
this.movementTracker.track(driver);
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
/**
|
|
1042
|
-
* Handle the click event of a driver marker.
|
|
1043
|
-
*
|
|
1044
|
-
* @param {DriverModel} driver - The driver object.
|
|
1045
|
-
* @param {Event} event - The event object associated with the addition.
|
|
1046
|
-
* @memberof LiveMapComponent
|
|
1047
|
-
*/
|
|
1048
|
-
@action onDriverClicked(driver) {
|
|
1049
|
-
this.contextPanel.clear();
|
|
1050
|
-
this.contextPanel.focus(driver, 'viewing', {
|
|
1051
|
-
args: {
|
|
1052
|
-
width: '450px',
|
|
1053
|
-
onOpen: () => {
|
|
1054
|
-
this.leafletMap.once('moveend', () => {
|
|
1055
|
-
this.leafletMap.panBy([200, 0]);
|
|
1056
|
-
});
|
|
1057
|
-
},
|
|
1058
|
-
},
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
/**
|
|
1063
|
-
* Handle the addition of a vehicle marker.
|
|
1064
|
-
*
|
|
1065
|
-
* @param {VehicleModel} vehicle - The vehicle object.
|
|
1066
|
-
* @param {Event} event - The event object associated with the addition.
|
|
1067
|
-
* @memberof LiveMapComponent
|
|
1068
|
-
*/
|
|
1069
|
-
@action onVehicleAdded(vehicle, event) {
|
|
1070
|
-
const { target } = event;
|
|
1071
|
-
|
|
1072
|
-
set(target, 'record_id', vehicle.id);
|
|
1073
|
-
set(target, 'record_type', 'vehicle');
|
|
1074
|
-
|
|
1075
|
-
// set the marker instance to the vehicle model
|
|
1076
|
-
set(vehicle, '_marker', target);
|
|
1077
|
-
|
|
1078
|
-
this.createVehicleContextMenu(vehicle, target);
|
|
1079
|
-
this.movementTracker.track(vehicle);
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
* Handle the addition of a place marker.
|
|
1084
|
-
*
|
|
1085
|
-
* @param {PlaceModel} place - The place object.
|
|
1086
|
-
* @param {Event} event - The event object associated with the addition.
|
|
1087
|
-
* @memberof LiveMapComponent
|
|
1088
|
-
*/
|
|
1089
|
-
@action onPlaceAdded(place, event) {
|
|
1090
|
-
const { target } = event;
|
|
1091
|
-
|
|
1092
|
-
set(target, 'record_id', place.id);
|
|
1093
|
-
set(target, 'record_type', 'place');
|
|
1094
|
-
|
|
1095
|
-
// set the marker instance to the vehicle model
|
|
1096
|
-
set(place, '_marker', target);
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* Handle the click event of a vehicle marker.
|
|
1101
|
-
*
|
|
1102
|
-
* @param {VehicleModel} vehicle - The vehicle object.
|
|
1103
|
-
* @param {Event} event - The event object associated with the addition.
|
|
1104
|
-
* @memberof LiveMapComponent
|
|
1105
|
-
*/
|
|
1106
|
-
@action onVehicleClicked(vehicle) {
|
|
1107
|
-
this.contextPanel.clear();
|
|
1108
|
-
this.contextPanel.focus(vehicle, 'viewing', {
|
|
1109
|
-
args: {
|
|
1110
|
-
width: '450px',
|
|
1111
|
-
onOpen: () => {
|
|
1112
|
-
this.leafletMap.once('moveend', () => {
|
|
1113
|
-
this.leafletMap.panBy([200, 0]);
|
|
1114
|
-
});
|
|
1115
|
-
},
|
|
1116
|
-
},
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
@action previewOrderRoute(order) {
|
|
1121
|
-
// Hide all elements on map
|
|
1122
|
-
this.hideAll();
|
|
1123
|
-
|
|
1124
|
-
// Show drivers
|
|
1125
|
-
this.show('drivers');
|
|
1126
|
-
|
|
1127
|
-
// create order route preview
|
|
1128
|
-
const waypoints = this.getRouteCoordinatesFromOrder(order);
|
|
1129
|
-
if (this.cannotRouteWaypoints(waypoints)) {
|
|
1130
|
-
return;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
// center on first coordinate
|
|
1134
|
-
try {
|
|
1135
|
-
this.leafletMap.stop();
|
|
1136
|
-
this.leafletMap.flyTo(waypoints.firstObject);
|
|
1137
|
-
} catch (error) {
|
|
1138
|
-
// unable to stop map
|
|
1139
|
-
debug(`Leaflet Map Error: ${error.message}`);
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
const routingService = this.currentUser.getOption('routing', { router: 'osrm' }).router;
|
|
1143
|
-
const { router, formatter } = this.leafletRoutingControl.get(routingService);
|
|
1144
|
-
|
|
1145
|
-
this.routeControl = new RoutingControl({
|
|
1146
|
-
router,
|
|
1147
|
-
formatter,
|
|
1148
|
-
waypoints,
|
|
1149
|
-
fitSelectedRoutes: false,
|
|
1150
|
-
alternativeClassName: 'hidden',
|
|
1151
|
-
addWaypoints: false,
|
|
1152
|
-
markerOptions: {
|
|
1153
|
-
draggable: false,
|
|
1154
|
-
icon: L.icon({
|
|
1155
|
-
iconUrl: '/assets/images/marker-icon.png',
|
|
1156
|
-
iconRetinaUrl: '/assets/images/marker-icon-2x.png',
|
|
1157
|
-
shadowUrl: '/assets/images/marker-shadow.png',
|
|
1158
|
-
iconSize: [25, 41],
|
|
1159
|
-
iconAnchor: [12, 41],
|
|
1160
|
-
}),
|
|
1161
|
-
},
|
|
1162
|
-
}).addTo(this.leafletMap);
|
|
1163
|
-
|
|
1164
|
-
this.routeControl.on('routingerror', (error) => {
|
|
1165
|
-
debug(`Routing Control Error: ${error.error.message}`);
|
|
1166
|
-
});
|
|
1167
|
-
|
|
1168
|
-
this.routeControl.on('routesfound', () => {
|
|
1169
|
-
this.leafletMap.flyToBounds(waypoints, {
|
|
1170
|
-
paddingBottomRight: MAP_TARGET_FOCUS_PADDING_BOTTOM_RIGHT,
|
|
1171
|
-
maxZoom: waypoints.length === 2 ? 13 : 12,
|
|
1172
|
-
animate: true,
|
|
1173
|
-
});
|
|
1174
|
-
this.leafletMap.once('moveend', () => {
|
|
1175
|
-
this.leafletMap.panBy(MAP_TARGET_FOCUS_REFOCUS_PANBY);
|
|
1176
|
-
});
|
|
1177
|
-
});
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
getRouteCoordinatesFromOrder(order) {
|
|
1181
|
-
const payload = order.payload;
|
|
1182
|
-
const waypoints = [];
|
|
1183
|
-
const coordinates = [];
|
|
1184
|
-
|
|
1185
|
-
waypoints.pushObjects([payload.pickup, ...payload.waypoints.toArray(), payload.dropoff]);
|
|
1186
|
-
waypoints.forEach((place) => {
|
|
1187
|
-
if (place && place.get('longitude') && place.get('latitude')) {
|
|
1188
|
-
if (place.hasInvalidCoordinates) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
coordinates.pushObject([place.get('latitude'), place.get('longitude')]);
|
|
1193
|
-
}
|
|
1194
|
-
});
|
|
1195
|
-
|
|
1196
|
-
return coordinates;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
cannotRouteWaypoints(waypoints = []) {
|
|
1200
|
-
return !this.leafletMap || !isArray(waypoints) || waypoints.length < 2;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
@action restoreDefaultLiveMap() {
|
|
1204
|
-
this.removeRouteControl();
|
|
1205
|
-
this.showAll();
|
|
1206
|
-
this.leafletMap.flyTo([this.latitude, this.longitude], 13);
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
removeRouteControl() {
|
|
1210
|
-
if (this.routeControl && this.routeControl instanceof RoutingControl) {
|
|
1211
|
-
try {
|
|
1212
|
-
this.routeControl.remove();
|
|
1213
|
-
} catch (error) {
|
|
1214
|
-
debug(`LiveMapComponent Error: ${error.message}`);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
/**
|
|
1220
|
-
* Handle the creation of the draw control.
|
|
1221
|
-
*
|
|
1222
|
-
* @param {DrawControl} drawControl - The draw control instance.
|
|
1223
|
-
* @memberof LiveMapComponent
|
|
1224
|
-
*/
|
|
1225
|
-
@action onDrawControlCreated(drawControl) {
|
|
1226
|
-
this.drawControl = drawControl;
|
|
1227
|
-
}
|
|
1228
|
-
|
|
1229
|
-
/**
|
|
1230
|
-
* Hide the draw controls on the map.
|
|
1231
|
-
*
|
|
1232
|
-
* @param {Object} [options={}] - Additional options.
|
|
1233
|
-
* @param {string|boolean} [options.text] - Text to set for the menu item or `true` to set the default text.
|
|
1234
|
-
* @param {function} [options.callback] - A callback function to execute.
|
|
1235
|
-
* @memberof LiveMapComponent
|
|
1236
|
-
*/
|
|
1237
|
-
@action hideDrawControls(options = {}) {
|
|
1238
|
-
this.hide('drawControls');
|
|
1239
|
-
|
|
1240
|
-
const text = getWithDefault(options, 'text', true);
|
|
1241
|
-
const callback = getWithDefault(options, 'callback');
|
|
1242
|
-
|
|
1243
|
-
if (typeof callback === 'function') {
|
|
1244
|
-
callback();
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
if (typeof text === 'string') {
|
|
1248
|
-
this.leafletContextmenuManager.changeMenuItemText('map', 'draw controls', text);
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
if (text === true) {
|
|
1252
|
-
this.leafletContextmenuManager.changeMenuItemText('map', 'draw controls', 'Enable draw controls...');
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
if (this.drawControl) {
|
|
1256
|
-
this.leafletMap.removeControl(this.drawControl);
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* Show the draw controls on the map.
|
|
1262
|
-
*
|
|
1263
|
-
* @param {Object} [options={}] - Additional options.
|
|
1264
|
-
* @param {string|boolean} [options.text] - Text to set for the menu item or `true` to set the default text.
|
|
1265
|
-
* @param {function} [options.callback] - A callback function to execute.
|
|
1266
|
-
* @memberof LiveMapComponent
|
|
1267
|
-
*/
|
|
1268
|
-
@action showDrawControls(options = {}) {
|
|
1269
|
-
this.show('drawControls');
|
|
1270
|
-
|
|
1271
|
-
const text = getWithDefault(options, 'text');
|
|
1272
|
-
const callback = getWithDefault(options, 'callback');
|
|
1273
|
-
|
|
1274
|
-
if (typeof callback === 'function') {
|
|
1275
|
-
callback();
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
if (typeof text === 'string') {
|
|
1279
|
-
this.leafletContextmenuManager.changeMenuItemText('map', 'draw controls', text);
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
if (text === true) {
|
|
1283
|
-
this.leafletContextmenuManager.changeMenuItemText('map', 'draw controls', 'Hide draw controls...');
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
if (this.drawControl) {
|
|
1287
|
-
this.leafletMap.addControl(this.drawControl);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1292
|
-
* Focus on a layer associated with a record.
|
|
1293
|
-
*
|
|
1294
|
-
* @param {Object} record - The record to focus on.
|
|
1295
|
-
* @memberof LiveMapComponent
|
|
1296
|
-
*/
|
|
1297
|
-
@action focusLayerBoundsByRecord(record) {
|
|
1298
|
-
const layer = this.getLeafletLayerByRecordId(record);
|
|
1299
|
-
|
|
1300
|
-
if (layer) {
|
|
1301
|
-
this.flyToBoundsOnly(layer);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
* Fly to a service area layer on the map.
|
|
1307
|
-
*
|
|
1308
|
-
* @param {ServiceAreaModel} serviceArea - The service area object to fly to.
|
|
1309
|
-
* @memberof LiveMapComponent
|
|
1310
|
-
*/
|
|
1311
|
-
@action flyToServiceArea(serviceArea) {
|
|
1312
|
-
const layer = this.findEditableLayerByRecordId(serviceArea);
|
|
1313
|
-
|
|
1314
|
-
if (layer) {
|
|
1315
|
-
this.flyToBoundsOnly(layer);
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
/**
|
|
1320
|
-
* Focus on a service area by activating it and then flying to it on the map.
|
|
1321
|
-
*
|
|
1322
|
-
* @param {ServiceArea} serviceArea - The service area to focus on.
|
|
1323
|
-
* @memberof LiveMapComponent
|
|
1324
|
-
*/
|
|
1325
|
-
@action focusServiceArea(serviceArea) {
|
|
1326
|
-
this.activateServiceArea(serviceArea);
|
|
1327
|
-
|
|
1328
|
-
later(
|
|
1329
|
-
this,
|
|
1330
|
-
() => {
|
|
1331
|
-
this.flyToServiceArea(serviceArea);
|
|
1332
|
-
},
|
|
1333
|
-
100
|
|
1334
|
-
);
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
/**
|
|
1338
|
-
* Blur all service areas except for those specified in the 'except' array.
|
|
1339
|
-
*
|
|
1340
|
-
* @param {Array} except - An array of records to exclude from blurring.
|
|
1341
|
-
* @memberof LiveMapComponent
|
|
1342
|
-
*/
|
|
1343
|
-
blurAllServiceAreas(except = []) {
|
|
1344
|
-
if (!isArray(except)) {
|
|
1345
|
-
except = [];
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
// map except into ids only
|
|
1349
|
-
except = except
|
|
1350
|
-
.filter(Boolean)
|
|
1351
|
-
.filter((record) => typeof record !== 'string' && !record?.id)
|
|
1352
|
-
.map((record) => record.id);
|
|
1353
|
-
|
|
1354
|
-
for (let i = 0; i < this.activeServiceAreas.length; i++) {
|
|
1355
|
-
const serviceArea = this.activeServiceAreas.objectAt(i);
|
|
1356
|
-
|
|
1357
|
-
if (isArray(except) && except.includes(serviceArea.id)) {
|
|
1358
|
-
continue;
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
this.blurServiceArea(serviceArea);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
for (let i = 0; i < this.editableLayers.length; i++) {
|
|
1365
|
-
const layer = this.editableLayers.objectAt(i);
|
|
1366
|
-
|
|
1367
|
-
if (isArray(except) && except.includes(layer.record_id)) {
|
|
1368
|
-
continue;
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
this.editableLayers.removeObject(layer);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
/**
|
|
1376
|
-
* Focus on all service areas except for those specified in the 'except' array by activating them.
|
|
1377
|
-
*
|
|
1378
|
-
* @param {Array} except - An array of records to exclude from activation.
|
|
1379
|
-
* @memberof LiveMapComponent
|
|
1380
|
-
*/
|
|
1381
|
-
focusAllServiceAreas(except = []) {
|
|
1382
|
-
if (!isArray(except)) {
|
|
1383
|
-
except = [];
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
// map except into ids only
|
|
1387
|
-
except = except
|
|
1388
|
-
.filter(Boolean)
|
|
1389
|
-
.filter((record) => typeof record !== 'string' && !record?.id)
|
|
1390
|
-
.map((record) => record.id);
|
|
1391
|
-
|
|
1392
|
-
for (let i = 0; i < this.serviceAreaRecords.length; i++) {
|
|
1393
|
-
const serviceArea = this.serviceAreaRecords.objectAt(i);
|
|
1394
|
-
|
|
1395
|
-
if (isArray(except) && except.includes(serviceArea.id)) {
|
|
1396
|
-
continue;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
this.activateServiceArea(serviceArea);
|
|
1400
|
-
}
|
|
1401
|
-
}
|
|
1402
|
-
|
|
1403
|
-
/**
|
|
1404
|
-
* Blur a specific service area by removing it from the active service areas.
|
|
1405
|
-
*
|
|
1406
|
-
* @param {ServiceAreaModel} serviceArea - The service area to blur.
|
|
1407
|
-
* @memberof LiveMapComponent
|
|
1408
|
-
*/
|
|
1409
|
-
blurServiceArea(serviceArea) {
|
|
1410
|
-
if (this.activeServiceAreas.includes(serviceArea)) {
|
|
1411
|
-
this.activeServiceAreas.removeObject(serviceArea);
|
|
1412
|
-
}
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* Activate a service area by adding it to the active service areas.
|
|
1417
|
-
*
|
|
1418
|
-
* @param {ServiceAreaModel} serviceArea - The service area to activate.
|
|
1419
|
-
* @memberof LiveMapComponent
|
|
1420
|
-
*/
|
|
1421
|
-
activateServiceArea(serviceArea) {
|
|
1422
|
-
if (!this.activeServiceAreas.includes(serviceArea)) {
|
|
1423
|
-
this.activeServiceAreas.pushObject(serviceArea);
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
/**
|
|
1428
|
-
* Show coordinates information by displaying them as an info notification.
|
|
1429
|
-
*
|
|
1430
|
-
* @param {Event} event - The event containing latitude and longitude information.
|
|
1431
|
-
* @memberof LiveMapComponent
|
|
1432
|
-
*/
|
|
1433
|
-
@action showCoordinates(event) {
|
|
1434
|
-
const wrappedLatLng = event.latlng.wrap();
|
|
1435
|
-
this.notifications.info(wrappedLatLng);
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
/**
|
|
1439
|
-
* Center the map on a specific location provided in the event.
|
|
1440
|
-
*
|
|
1441
|
-
* @param {Event} event - The event containing the target location (latlng).
|
|
1442
|
-
* @memberof LiveMapComponent
|
|
1443
|
-
*/
|
|
1444
|
-
@action centerMap(event) {
|
|
1445
|
-
this.leafletMap.panTo(event.latlng);
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
/**
|
|
1449
|
-
* Zoom in on the map.
|
|
1450
|
-
*
|
|
1451
|
-
* @memberof LiveMapComponent
|
|
1452
|
-
*/
|
|
1453
|
-
@action zoomIn() {
|
|
1454
|
-
this.leafletMap.zoomIn();
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
/**
|
|
1458
|
-
* Zoom out on the map.
|
|
1459
|
-
*
|
|
1460
|
-
* @memberof LiveMapComponent
|
|
1461
|
-
*/
|
|
1462
|
-
@action zoomOut() {
|
|
1463
|
-
this.leafletMap.zoomOut();
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* Set the maximum bounds of the map based on the provided layer's bounds.
|
|
1468
|
-
*
|
|
1469
|
-
* @param {Layer} layer - The layer used to determine the map's maximum bounds.
|
|
1470
|
-
* @memberof LiveMapComponent
|
|
1471
|
-
*/
|
|
1472
|
-
setMaxBoundsFromLayer(layer) {
|
|
1473
|
-
if (layer && typeof layer.getBounds === 'function') {
|
|
1474
|
-
const bounds = layer.getBounds();
|
|
1475
|
-
|
|
1476
|
-
this.leafletMap.flyToBounds(bounds);
|
|
1477
|
-
this.leafletMap.setMaxBounds(bounds);
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
/**
|
|
1482
|
-
* Fly to and focus on a specific layer's bounds on the map.
|
|
1483
|
-
*
|
|
1484
|
-
* @param {Layer} layer - The layer to focus on.
|
|
1485
|
-
* @memberof LiveMapComponent
|
|
1486
|
-
*/
|
|
1487
|
-
flyToBoundsOnly(layer) {
|
|
1488
|
-
if (layer && typeof layer.getBounds === 'function') {
|
|
1489
|
-
const bounds = layer.getBounds();
|
|
1490
|
-
|
|
1491
|
-
this.leafletMap.flyToBounds(bounds);
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
* Focus on a specific layer and optionally zoom in/out on it.
|
|
1497
|
-
*
|
|
1498
|
-
* @param {Layer} layer - The layer to focus on.
|
|
1499
|
-
* @param {number} zoom - The zoom level for the focus operation.
|
|
1500
|
-
* @param {Object} options - Additional options for the focus operation.
|
|
1501
|
-
* @memberof LiveMapComponent
|
|
1502
|
-
*/
|
|
1503
|
-
@action focusLayer(layer, zoom, options = {}) {
|
|
1504
|
-
this.leafletMapManager.flyToLayer(this.leafletMap, layer, zoom, options);
|
|
1505
|
-
|
|
1506
|
-
if (typeof options.onAfterFocus === 'function') {
|
|
1507
|
-
options.onAfterFocus(layer);
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
* Focuses the Leaflet map on a specific layer associated with a record.
|
|
1513
|
-
*
|
|
1514
|
-
* @param {Object} record - The record associated with the target layer.
|
|
1515
|
-
* @param {number} zoom - The desired zoom level for the map.
|
|
1516
|
-
* @param {Object} [options={}] - Additional options for the map focus.
|
|
1517
|
-
* @returns {void}
|
|
1518
|
-
*
|
|
1519
|
-
* @example
|
|
1520
|
-
* focusLayerByRecord(recordData, 12, { animate: true });
|
|
1521
|
-
*/
|
|
1522
|
-
@action focusLayerByRecord(record, zoom, options = {}) {
|
|
1523
|
-
const layer = this.getLeafletLayerByRecordId(record);
|
|
1524
|
-
|
|
1525
|
-
if (layer) {
|
|
1526
|
-
this.focusLayer(layer, zoom, options);
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
if (typeof options.onAfterFocusWithRecord === 'function') {
|
|
1530
|
-
options.onAfterFocusWithRecord(record, layer);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* Create a context menu for the map with various options.
|
|
1536
|
-
*
|
|
1537
|
-
* @param {L.Map} map - The map to which the context menu is attached.
|
|
1538
|
-
* @memberof LiveMapComponent
|
|
1539
|
-
*/
|
|
1540
|
-
@action createMapContextMenu(map) {
|
|
1541
|
-
const contextmenuItems = [
|
|
1542
|
-
{
|
|
1543
|
-
text: this.intl.t('fleet-ops.component.live-map.show-coordinates'),
|
|
1544
|
-
callback: this.showCoordinates,
|
|
1545
|
-
index: 0,
|
|
1546
|
-
},
|
|
1547
|
-
{
|
|
1548
|
-
text: this.intl.t('fleet-ops.component.live-map.center-map'),
|
|
1549
|
-
callback: this.centerMap,
|
|
1550
|
-
index: 1,
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
text: this.intl.t('fleet-ops.component.live-map.zoom-in'),
|
|
1554
|
-
callback: this.zoomIn,
|
|
1555
|
-
index: 2,
|
|
1556
|
-
},
|
|
1557
|
-
{
|
|
1558
|
-
text: this.intl.t('fleet-ops.component.live-map.zoom-out'),
|
|
1559
|
-
callback: this.zoomOut,
|
|
1560
|
-
index: 3,
|
|
1561
|
-
},
|
|
1562
|
-
{
|
|
1563
|
-
text: this.isVisible('drawControls') ? this.intl.t('fleet-ops.component.live-map.hide-draw') : this.intl.t('fleet-ops.component.live-map.enable-draw'),
|
|
1564
|
-
callback: this.toggleDrawControlContextMenuItem.bind(this),
|
|
1565
|
-
index: 4,
|
|
1566
|
-
},
|
|
1567
|
-
{
|
|
1568
|
-
separator: true,
|
|
1569
|
-
},
|
|
1570
|
-
{
|
|
1571
|
-
text: this.intl.t('fleet-ops.component.live-map.create-new-service'),
|
|
1572
|
-
callback: this.serviceAreas.createServiceArea,
|
|
1573
|
-
index: 5,
|
|
1574
|
-
},
|
|
1575
|
-
];
|
|
1576
|
-
|
|
1577
|
-
// Add Service Area Context Menu Items
|
|
1578
|
-
const serviceAreas = this.serviceAreas.getFromCache();
|
|
1579
|
-
|
|
1580
|
-
if (isArray(serviceAreas) && serviceAreas.length) {
|
|
1581
|
-
contextmenuItems.pushObject({
|
|
1582
|
-
separator: true,
|
|
1583
|
-
});
|
|
1584
|
-
|
|
1585
|
-
// Add for each Service Area
|
|
1586
|
-
for (let i = 0; i < serviceAreas.length; i++) {
|
|
1587
|
-
const serviceArea = serviceAreas.objectAt(i);
|
|
1588
|
-
const nextIndex = contextmenuItems.length + 2;
|
|
1589
|
-
|
|
1590
|
-
contextmenuItems.pushObject({
|
|
1591
|
-
text: this.intl.t('fleet-ops.component.live-map.focus-service', { serviceName: serviceArea.name }),
|
|
1592
|
-
callback: () => this.focusServiceArea(serviceArea),
|
|
1593
|
-
index: nextIndex,
|
|
1594
|
-
});
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
// create contextmenu registry
|
|
1599
|
-
const contextmenuRegistry = this.leafletContextmenuManager.createContextMenu('map', map, contextmenuItems);
|
|
1600
|
-
|
|
1601
|
-
// trigger that contextmenu registry was created
|
|
1602
|
-
this.universe.createRegistryEvent('fleet-ops:contextmenu:map', 'created', contextmenuRegistry, this.leafletContextmenuManager);
|
|
1603
|
-
|
|
1604
|
-
return contextmenuRegistry;
|
|
1605
|
-
}
|
|
1606
|
-
|
|
1607
|
-
/**
|
|
1608
|
-
* Rebuild the context menu for the map.
|
|
1609
|
-
* This function calls the `createMapContextMenu` method.
|
|
1610
|
-
* @memberof LiveMapComponent
|
|
1611
|
-
*/
|
|
1612
|
-
rebuildMapContextMenu() {
|
|
1613
|
-
this.createMapContextMenu(this.leafletMap);
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
/**
|
|
1617
|
-
* Create a context menu for a driver marker on the map.
|
|
1618
|
-
*
|
|
1619
|
-
* @param {DriverModel} driver - The driver associated with the marker.
|
|
1620
|
-
* @param {L.Layer} layer - The layer representing the driver marker.
|
|
1621
|
-
* @memberof LiveMapComponent
|
|
1622
|
-
*/
|
|
1623
|
-
@action createDriverContextMenu(driver, layer) {
|
|
1624
|
-
let contextmenuItems = [
|
|
1625
|
-
{
|
|
1626
|
-
separator: true,
|
|
1627
|
-
},
|
|
1628
|
-
{
|
|
1629
|
-
text: this.intl.t('fleet-ops.component.live-map.view-driver', { driverName: driver.name }),
|
|
1630
|
-
callback: () => this.contextPanel.focus(driver),
|
|
1631
|
-
},
|
|
1632
|
-
{
|
|
1633
|
-
text: this.intl.t('fleet-ops.component.live-map.edit-driver', { driverName: driver.name }),
|
|
1634
|
-
callback: () => this.contextPanel.focus(driver, 'editing'),
|
|
1635
|
-
},
|
|
1636
|
-
{
|
|
1637
|
-
text: this.intl.t('fleet-ops.component.live-map.delete-driver', { driverName: driver.name }),
|
|
1638
|
-
callback: () => this.crud.delete(driver),
|
|
1639
|
-
},
|
|
1640
|
-
{
|
|
1641
|
-
text: this.intl.t('fleet-ops.component.live-map.view-vehicle-for', { driverName: driver.name }),
|
|
1642
|
-
callback: () => this.contextPanel.focus(driver.vehicle),
|
|
1643
|
-
},
|
|
1644
|
-
];
|
|
1645
|
-
|
|
1646
|
-
// append items from universe registry
|
|
1647
|
-
const registeredContextMenuItems = this.universe.getMenuItemsFromRegistry('fleet-ops:contextmenu:driver');
|
|
1648
|
-
if (isArray(registeredContextMenuItems)) {
|
|
1649
|
-
contextmenuItems = [
|
|
1650
|
-
...contextmenuItems,
|
|
1651
|
-
...registeredContextMenuItems.map((menuItem) => {
|
|
1652
|
-
return {
|
|
1653
|
-
text: menuItem.title,
|
|
1654
|
-
callback: () => {
|
|
1655
|
-
const callbackContext = {
|
|
1656
|
-
driver,
|
|
1657
|
-
layer,
|
|
1658
|
-
contextmenuService: this.leafletContextmenuManager,
|
|
1659
|
-
menuItem,
|
|
1660
|
-
};
|
|
1661
|
-
return menuItem.onClick(callbackContext);
|
|
1662
|
-
},
|
|
1663
|
-
};
|
|
1664
|
-
}),
|
|
1665
|
-
];
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
// create contextmenu registry
|
|
1669
|
-
const contextmenuRegistry = this.leafletContextmenuManager.createContextMenu(`driver:${driver.public_id}`, layer, contextmenuItems, { driver });
|
|
1670
|
-
|
|
1671
|
-
// trigger that contextmenu registry was created
|
|
1672
|
-
this.universe.createRegistryEvent('fleet-ops:contextmenu:driver', 'created', contextmenuRegistry, this.leafletContextmenuManager);
|
|
1673
|
-
|
|
1674
|
-
return contextmenuRegistry;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
/**
|
|
1678
|
-
* Create a context menu for a vehicle marker on the map.
|
|
1679
|
-
*
|
|
1680
|
-
* @param {Vehicle} vehicle - The vehicle associated with the marker.
|
|
1681
|
-
* @param {Layer} layer - The layer representing the vehicle marker.
|
|
1682
|
-
* @memberof LiveMapComponent
|
|
1683
|
-
*/
|
|
1684
|
-
@action createVehicleContextMenu(vehicle, layer) {
|
|
1685
|
-
let contextmenuItems = [
|
|
1686
|
-
{
|
|
1687
|
-
separator: true,
|
|
1688
|
-
},
|
|
1689
|
-
{
|
|
1690
|
-
text: this.intl.t('fleet-ops.component.live-map.view-vehicle', { vehicleName: vehicle.displayName }),
|
|
1691
|
-
callback: () => this.contextPanel.focus(vehicle),
|
|
1692
|
-
},
|
|
1693
|
-
{
|
|
1694
|
-
text: this.intl.t('fleet-ops.component.live-map.edit-vehicle', { vehicleName: vehicle.displayName }),
|
|
1695
|
-
callback: () => this.contextPanel.focus(vehicle, 'editing'),
|
|
1696
|
-
},
|
|
1697
|
-
{
|
|
1698
|
-
text: this.intl.t('fleet-ops.component.live-map.delete-vehicle', { vehicleName: vehicle.displayName }),
|
|
1699
|
-
callback: () => this.crud.delete(vehicle),
|
|
1700
|
-
},
|
|
1701
|
-
];
|
|
1702
|
-
|
|
1703
|
-
// append items from universe registry
|
|
1704
|
-
const registeredContextMenuItems = this.universe.getMenuItemsFromRegistry('fleet-ops:contextmenu:vehicle');
|
|
1705
|
-
if (isArray(registeredContextMenuItems)) {
|
|
1706
|
-
contextmenuItems = [
|
|
1707
|
-
...contextmenuItems,
|
|
1708
|
-
...registeredContextMenuItems.map((menuItem) => {
|
|
1709
|
-
return {
|
|
1710
|
-
text: menuItem.title,
|
|
1711
|
-
callback: () => {
|
|
1712
|
-
const callbackContext = {
|
|
1713
|
-
vehicle,
|
|
1714
|
-
layer,
|
|
1715
|
-
contextmenuService: this.leafletContextmenuManager,
|
|
1716
|
-
menuItem,
|
|
1717
|
-
};
|
|
1718
|
-
return menuItem.onClick(callbackContext);
|
|
1719
|
-
},
|
|
1720
|
-
};
|
|
1721
|
-
}),
|
|
1722
|
-
];
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
// create contextmenu registry
|
|
1726
|
-
const contextmenuRegistry = this.leafletContextmenuManager.createContextMenu(`vehicle:${vehicle.public_id}`, layer, contextmenuItems, { vehicle });
|
|
1727
|
-
|
|
1728
|
-
// trigger that contextmenu registry was created
|
|
1729
|
-
this.universe.createRegistryEvent('fleet-ops:contextmenu:vehicle', 'created', contextmenuRegistry, this.leafletContextmenuManager);
|
|
1730
|
-
|
|
1731
|
-
return contextmenuRegistry;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
/**
|
|
1735
|
-
* Create a context menu for a zone layer on the map.
|
|
1736
|
-
*
|
|
1737
|
-
* @param {ZoneModel} zone - The zone associated with the layer.
|
|
1738
|
-
* @param {Layer} layer - The layer representing the zone.
|
|
1739
|
-
* @memberof LiveMapComponent
|
|
1740
|
-
*/
|
|
1741
|
-
@action createZoneContextMenu(zone, layer) {
|
|
1742
|
-
let contextmenuItems = [
|
|
1743
|
-
{
|
|
1744
|
-
separator: true,
|
|
1745
|
-
},
|
|
1746
|
-
{
|
|
1747
|
-
text: this.intl.t('fleet-ops.component.live-map.edit-zone', { zoneName: zone.name }),
|
|
1748
|
-
callback: () => this.serviceAreas.editZone(zone),
|
|
1749
|
-
},
|
|
1750
|
-
{
|
|
1751
|
-
text: this.intl.t('fleet-ops.component.live-map.delete-zone', { zoneName: zone.name }),
|
|
1752
|
-
callback: () =>
|
|
1753
|
-
this.serviceAreas.deleteZone(zone, {
|
|
1754
|
-
onFinish: () => {
|
|
1755
|
-
this.removeEditableLayerByRecordId(zone);
|
|
1756
|
-
},
|
|
1757
|
-
}),
|
|
1758
|
-
},
|
|
1759
|
-
{
|
|
1760
|
-
text: this.intl.t('fleet-ops.component.live-map.assign-zone', { zoneName: zone.name }),
|
|
1761
|
-
callback: () => {},
|
|
1762
|
-
},
|
|
1763
|
-
];
|
|
1764
|
-
|
|
1765
|
-
// create contextmenu registry
|
|
1766
|
-
const contextmenuRegistry = this.leafletContextmenuManager.createContextMenu(`zone:${zone.public_id}`, layer, contextmenuItems, { zone });
|
|
1767
|
-
|
|
1768
|
-
// trigger that contextmenu registry was created
|
|
1769
|
-
this.universe.createRegistryEvent('fleet-ops:contextmenu:zone', 'created', contextmenuRegistry, this.leafletContextmenuManager);
|
|
1770
|
-
|
|
1771
|
-
return contextmenuRegistry;
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
|
-
/**
|
|
1775
|
-
* Create a context menu for a service area layer on the map.
|
|
1776
|
-
*
|
|
1777
|
-
* @param {ServiceAreaModel} serviceArea - The service area associated with the layer.
|
|
1778
|
-
* @param {Layer} layer - The layer representing the service area.
|
|
1779
|
-
* @memberof LiveMapComponent
|
|
1780
|
-
*/
|
|
1781
|
-
@action createServiceAreaContextMenu(serviceArea, layer) {
|
|
1782
|
-
let contextmenuItems = [
|
|
1783
|
-
{
|
|
1784
|
-
separator: true,
|
|
1785
|
-
},
|
|
1786
|
-
{
|
|
1787
|
-
text: this.intl.t('fleet-ops.component.live-map.blur-service', { serviceName: serviceArea.name }),
|
|
1788
|
-
callback: () => this.blurServiceArea(serviceArea),
|
|
1789
|
-
},
|
|
1790
|
-
{
|
|
1791
|
-
text: this.intl.t('fleet-ops.component.live-map.create-zone', { serviceName: serviceArea.name }),
|
|
1792
|
-
callback: () => this.serviceAreas.createZone(serviceArea),
|
|
1793
|
-
},
|
|
1794
|
-
{
|
|
1795
|
-
text: this.intl.t('fleet-ops.component.live-map.assign-fleet', { serviceName: serviceArea.name }),
|
|
1796
|
-
callback: () => {},
|
|
1797
|
-
},
|
|
1798
|
-
{
|
|
1799
|
-
text: this.intl.t('fleet-ops.component.live-map.edit-service', { serviceName: serviceArea.name }),
|
|
1800
|
-
callback: () => this.serviceAreas.editServiceAreaDetails(serviceArea),
|
|
1801
|
-
},
|
|
1802
|
-
{
|
|
1803
|
-
text: this.intl.t('fleet-ops.component.live-map.delete-service', { serviceName: serviceArea.name }),
|
|
1804
|
-
callback: () =>
|
|
1805
|
-
this.serviceAreas.deleteServiceArea(serviceArea, {
|
|
1806
|
-
onFinish: () => {
|
|
1807
|
-
this.rebuildMapContextMenu();
|
|
1808
|
-
this.removeEditableLayerByRecordId(serviceArea);
|
|
1809
|
-
},
|
|
1810
|
-
}),
|
|
1811
|
-
},
|
|
1812
|
-
];
|
|
1813
|
-
|
|
1814
|
-
// create contextmenu registry
|
|
1815
|
-
const contextmenuRegistry = this.leafletContextmenuManager.createContextMenu(`service-area:${serviceArea.public_id}`, layer, contextmenuItems, { serviceArea });
|
|
1816
|
-
|
|
1817
|
-
// trigger that contextmenu registry was created
|
|
1818
|
-
this.universe.createRegistryEvent('fleet-ops:contextmenu:service-area', 'created', contextmenuRegistry, this.leafletContextmenuManager);
|
|
1819
|
-
|
|
1820
|
-
return contextmenuRegistry;
|
|
1821
|
-
}
|
|
1822
|
-
|
|
1823
|
-
/**
|
|
1824
|
-
* Listens for events on the company channel and logs incoming data.
|
|
1825
|
-
*
|
|
1826
|
-
* This function sets up a WebSocket connection, subscribes to the company-specific channel,
|
|
1827
|
-
* and listens for events. When events are received, it logs them to the console.
|
|
1828
|
-
*
|
|
1829
|
-
* @async
|
|
1830
|
-
* @function
|
|
1831
|
-
*/
|
|
1832
|
-
async listen() {
|
|
1833
|
-
// setup socket
|
|
1834
|
-
const socket = this.socket.instance();
|
|
1835
|
-
|
|
1836
|
-
// listen on company channel
|
|
1837
|
-
const channelId = `company.${this.currentUser.companyId}`;
|
|
1838
|
-
const channel = socket.subscribe(channelId);
|
|
1839
|
-
|
|
1840
|
-
// track channel
|
|
1841
|
-
this.channels.pushObject(channel);
|
|
1842
|
-
|
|
1843
|
-
// listen to channel for events
|
|
1844
|
-
await channel.listener('subscribe').once();
|
|
1845
|
-
|
|
1846
|
-
// get incoming data and console out
|
|
1847
|
-
(async () => {
|
|
1848
|
-
for await (let output of channel) {
|
|
1849
|
-
const { event, data } = output;
|
|
1850
|
-
|
|
1851
|
-
debug(`[channel ${channelId}]`, output, event, data);
|
|
1852
|
-
}
|
|
1853
|
-
})();
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
/**
|
|
1857
|
-
* Close all socket channels associated subscribed to.
|
|
1858
|
-
* @memberof LiveMapComponent
|
|
1859
|
-
*/
|
|
1860
|
-
@action closeChannels() {
|
|
1861
|
-
if (isArray(this.channels)) {
|
|
1862
|
-
for (let i = 0; i < this.channels.length; i++) {
|
|
1863
|
-
const channel = this.channels.objectAt(i);
|
|
1864
|
-
|
|
1865
|
-
channel.close();
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Fetch service areas and cache them if not already cached.
|
|
1872
|
-
*
|
|
1873
|
-
* @returns {Promise} A promise that resolves to an array of service area records.
|
|
1874
|
-
* @memberof LiveMapComponent
|
|
1875
|
-
*/
|
|
1876
|
-
@task *loadServiceAreas(options = {}) {
|
|
1877
|
-
if (this.abilities.cannot('fleet-ops list service-area')) {
|
|
1878
|
-
return [];
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
if (this.serviceAreas && typeof this.serviceAreas.getFromCache === 'function') {
|
|
1882
|
-
const cachedRecords = this.serviceAreas.getFromCache('serviceAreas', 'service-area');
|
|
1883
|
-
|
|
1884
|
-
if (cachedRecords) {
|
|
1885
|
-
this.serviceAreaRecords = cachedRecords;
|
|
1886
|
-
if (typeof options.onLoaded === 'function') {
|
|
1887
|
-
options.onLoaded(cachedRecords);
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
return cachedRecords;
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
|
|
1894
|
-
try {
|
|
1895
|
-
this.serviceAreaRecords = yield this.store.query('service-area', { with: ['zones'] });
|
|
1896
|
-
if (this.serviceAreaRecords) {
|
|
1897
|
-
this.appCache.setEmberData('serviceAreas', this.serviceAreaRecords);
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
if (typeof options.onLoaded === 'function') {
|
|
1901
|
-
options.onLoaded(this.serviceAreaRecords);
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
return this.serviceAreaRecords;
|
|
1905
|
-
} catch (error) {
|
|
1906
|
-
this.notifications.serverError(error);
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
focusDriver(driver) {
|
|
1911
|
-
this.focusedDriver = driver;
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
|
-
focusVehicle(vehicle) {
|
|
1915
|
-
this.focusedVehicle = vehicle;
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
|
-
blurDriver() {
|
|
1919
|
-
this.focusedDriver = null;
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
blurVehicle() {
|
|
1923
|
-
this.focusedVehicle = null;
|
|
1924
|
-
}
|
|
1925
|
-
}
|