@fleetbase/fleetops-engine 0.0.1
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/LICENSE.md +9 -0
- package/README.md +32 -0
- package/addon/components/cell/driver-name.hbs +13 -0
- package/addon/components/cell/driver-name.js +30 -0
- package/addon/components/custom-field-value.hbs +11 -0
- package/addon/components/custom-field-value.js +41 -0
- package/addon/components/custom-field.hbs +42 -0
- package/addon/components/custom-field.js +46 -0
- package/addon/components/display-place.hbs +52 -0
- package/addon/components/display-place.js +11 -0
- package/addon/components/driver-card-mini.hbs +12 -0
- package/addon/components/driver-card-mini.js +25 -0
- package/addon/components/driver-card.hbs +27 -0
- package/addon/components/driver-card.js +14 -0
- package/addon/components/event-timeline/event.hbs +5 -0
- package/addon/components/event-timeline.hbs +7 -0
- package/addon/components/event-timeline.js +423 -0
- package/addon/components/file-icon.js +1 -0
- package/addon/components/fleet-driver-listing.hbs +73 -0
- package/addon/components/fleet-driver-listing.js +117 -0
- package/addon/components/full-calendar/draggable.js +1 -0
- package/addon/components/full-calendar.js +1 -0
- package/addon/components/full-size.js +1 -0
- package/addon/components/global-search.hbs +84 -0
- package/addon/components/global-search.js +52 -0
- package/addon/components/horizontal-route.hbs +33 -0
- package/addon/components/horizontal-route.js +48 -0
- package/addon/components/integrated-order-details.hbs +117 -0
- package/addon/components/integrated-order-details.js +10 -0
- package/addon/components/leaflet-draw-control.js +147 -0
- package/addon/components/leaflet-rotated-marker.js +24 -0
- package/addon/components/live-map.hbs +63 -0
- package/addon/components/live-map.js +856 -0
- package/addon/components/map-container/toolbar/zones-panel.hbs +41 -0
- package/addon/components/map-container/toolbar/zones-panel.js +106 -0
- package/addon/components/map-container/toolbar-container.hbs +1 -0
- package/addon/components/map-container/toolbar-container.js +3 -0
- package/addon/components/map-container/toolbar.hbs +51 -0
- package/addon/components/map-container/toolbar.js +34 -0
- package/addon/components/map-container/topbar.hbs +1 -0
- package/addon/components/map-container/topbar.js +3 -0
- package/addon/components/map-container/view-switch.hbs +1 -0
- package/addon/components/map-container/view-switch.js +3 -0
- package/addon/components/map-container.hbs +1 -0
- package/addon/components/map-container.js +15 -0
- package/addon/components/modals/assign-driver.hbs +24 -0
- package/addon/components/modals/assign-driver.js +3 -0
- package/addon/components/modals/clone-config-form.hbs +6 -0
- package/addon/components/modals/contact-details.hbs +44 -0
- package/addon/components/modals/contact-form.hbs +56 -0
- package/addon/components/modals/driver-assign-order.hbs +67 -0
- package/addon/components/modals/driver-assign-vehicle.hbs +20 -0
- package/addon/components/modals/driver-assign-vendor.hbs +20 -0
- package/addon/components/modals/driver-details.hbs +85 -0
- package/addon/components/modals/driver-form.hbs +83 -0
- package/addon/components/modals/edit-meta-form.hbs +20 -0
- package/addon/components/modals/entity-form.hbs +57 -0
- package/addon/components/modals/entity-meta-field-prompt.hbs +6 -0
- package/addon/components/modals/fleet-details.hbs +31 -0
- package/addon/components/modals/fleet-form.hbs +26 -0
- package/addon/components/modals/fuel-report-details.hbs +34 -0
- package/addon/components/modals/fuel-report-form.hbs +26 -0
- package/addon/components/modals/group-details.hbs +42 -0
- package/addon/components/modals/group-form.hbs +54 -0
- package/addon/components/modals/install-prompt.hbs +21 -0
- package/addon/components/modals/map-field-form.hbs +9 -0
- package/addon/components/modals/map-field-group-form.hbs +6 -0
- package/addon/components/modals/map-layer-form.hbs +29 -0
- package/addon/components/modals/meta-field-form.hbs +8 -0
- package/addon/components/modals/meta-field-group-form.hbs +5 -0
- package/addon/components/modals/new-order-config.hbs +11 -0
- package/addon/components/modals/option-prompt.hbs +17 -0
- package/addon/components/modals/order-assign-driver.hbs +25 -0
- package/addon/components/modals/order-config-new-status.hbs +5 -0
- package/addon/components/modals/order-event.hbs +18 -0
- package/addon/components/modals/order-form.hbs +63 -0
- package/addon/components/modals/order-import.hbs +84 -0
- package/addon/components/modals/order-label.hbs +7 -0
- package/addon/components/modals/order-meta.hbs +12 -0
- package/addon/components/modals/order-new-activity.hbs +62 -0
- package/addon/components/modals/order-route-form.hbs +111 -0
- package/addon/components/modals/place-assign-vendor.hbs +20 -0
- package/addon/components/modals/place-details.hbs +105 -0
- package/addon/components/modals/place-form.hbs +30 -0
- package/addon/components/modals/point-map.hbs +16 -0
- package/addon/components/modals/policy-form.hbs +22 -0
- package/addon/components/modals/resend-verification-email.hbs +25 -0
- package/addon/components/modals/role-form.hbs +16 -0
- package/addon/components/modals/select-payment-method.hbs +12 -0
- package/addon/components/modals/service-area-form.hbs +31 -0
- package/addon/components/modals/set-password.hbs +15 -0
- package/addon/components/modals/uninstall-prompt.hbs +21 -0
- package/addon/components/modals/user-form.hbs +56 -0
- package/addon/components/modals/vehicle-details.hbs +227 -0
- package/addon/components/modals/vehicle-form.hbs +282 -0
- package/addon/components/modals/vendor-details.hbs +77 -0
- package/addon/components/modals/vendor-form.hbs +168 -0
- package/addon/components/modals/view-service-area.hbs +12 -0
- package/addon/components/modals/view-zone.hbs +12 -0
- package/addon/components/modals/zone-form.hbs +16 -0
- package/addon/components/operations-pane/pane.hbs +1 -0
- package/addon/components/order/header.hbs +48 -0
- package/addon/components/order/header.js +26 -0
- package/addon/components/order/place-card.hbs +51 -0
- package/addon/components/order/place-card.js +33 -0
- package/addon/components/order/schedule-card.hbs +35 -0
- package/addon/components/order/schedule-card.js +17 -0
- package/addon/components/order/sub-header/item.hbs +16 -0
- package/addon/components/order/sub-header.hbs +3 -0
- package/addon/components/order-config/activity-flow-editor.hbs +108 -0
- package/addon/components/order-config/activity-flow-editor.js +374 -0
- package/addon/components/order-config/details-editor.hbs +32 -0
- package/addon/components/order-config/details-editor.js +16 -0
- package/addon/components/order-config/entities-editor.hbs +84 -0
- package/addon/components/order-config/entities-editor.js +123 -0
- package/addon/components/order-config/fields-editor.hbs +122 -0
- package/addon/components/order-config/fields-editor.js +233 -0
- package/addon/components/order-config/selector.hbs +1 -0
- package/addon/components/order-config/selector.js +3 -0
- package/addon/components/order-config.hbs +66 -0
- package/addon/components/order-config.js +296 -0
- package/addon/components/order-list-overlay/driver-panel-title.hbs +6 -0
- package/addon/components/order-list-overlay/order.hbs +22 -0
- package/addon/components/order-list-overlay/order.js +3 -0
- package/addon/components/order-list-overlay.hbs +120 -0
- package/addon/components/order-list-overlay.js +227 -0
- package/addon/components/route-list.hbs +47 -0
- package/addon/components/route-list.js +11 -0
- package/addon/components/settings-window.hbs +15 -0
- package/addon/components/settings-window.js +62 -0
- package/addon/components/split-grid.js +1 -0
- package/addon/components/widget/fleet-ops-quickstart.hbs +40 -0
- package/addon/components/widget/fleet-ops-quickstart.js +58 -0
- package/addon/components/widget/issues.hbs +1 -0
- package/addon/components/widget/key-metrics.hbs +121 -0
- package/addon/components/widget/key-metrics.js +46 -0
- package/addon/components/widget/live-order-map.hbs +59 -0
- package/addon/components/widget/live-order-map.js +11 -0
- package/addon/components/widget/recent-orders.hbs +35 -0
- package/addon/components/widget/recent-orders.js +24 -0
- package/addon/components/widget/transaction-earnings.hbs +1 -0
- package/addon/components/widget/transactions.hbs +36 -0
- package/addon/components/widget/transactions.js +29 -0
- package/addon/components/widget/weekly-orders.hbs +1 -0
- package/addon/components/widget/weekly-orders.js +3 -0
- package/addon/controllers/application.js +40 -0
- package/addon/controllers/management/contacts/index.js +438 -0
- package/addon/controllers/management/drivers/index.js +868 -0
- package/addon/controllers/management/fleets/index.js +507 -0
- package/addon/controllers/management/fuel-reports/index.js +428 -0
- package/addon/controllers/management/issues/index.js +335 -0
- package/addon/controllers/management/places/index.js +571 -0
- package/addon/controllers/management/vehicles/index.js +616 -0
- package/addon/controllers/management/vendors/index.js +626 -0
- package/addon/controllers/management.js +5 -0
- package/addon/controllers/operations/orders/index/config/types.js +17 -0
- package/addon/controllers/operations/orders/index/config.js +13 -0
- package/addon/controllers/operations/orders/index/new.js +1213 -0
- package/addon/controllers/operations/orders/index/view.js +794 -0
- package/addon/controllers/operations/orders/index.js +674 -0
- package/addon/controllers/operations/scheduler/index.js +110 -0
- package/addon/controllers/operations/service-rates/index/edit.js +59 -0
- package/addon/controllers/operations/service-rates/index/new.js +369 -0
- package/addon/controllers/operations/service-rates/index.js +275 -0
- package/addon/controllers/operations/zones/index.js +470 -0
- package/addon/engine.js +19 -0
- package/addon/helpers/avatar-url.js +9 -0
- package/addon/helpers/extract-coordinates.js +6 -0
- package/addon/helpers/feature-group.js +14 -0
- package/addon/helpers/flow-raw-status.js +13 -0
- package/addon/helpers/format-point.js +13 -0
- package/addon/helpers/get-tip-amount.js +19 -0
- package/addon/helpers/is-active-route.js +1 -0
- package/addon/helpers/is-facilitator-supported-place.js +6 -0
- package/addon/helpers/is-not-facilitator-supported-place.js +6 -0
- package/addon/helpers/is-waypoint-record.js +6 -0
- package/addon/helpers/point-coordinates.js +10 -0
- package/addon/helpers/point-to-coordinates.js +28 -0
- package/addon/helpers/service-name.js +6 -0
- package/addon/helpers/waypoint-label.js +1 -0
- package/addon/instance-initializers/register-leaflet-draw-control-layer.js +17 -0
- package/addon/instance-initializers/register-leaflet-rotated-marker.js +17 -0
- package/addon/modifiers/translate-x.js +5 -0
- package/addon/routes/application.js +25 -0
- package/addon/routes/comms/chat.js +3 -0
- package/addon/routes/comms/intercom.js +3 -0
- package/addon/routes/comms.js +3 -0
- package/addon/routes/home.js +20 -0
- package/addon/routes/management/contacts/index.js +24 -0
- package/addon/routes/management/contacts.js +3 -0
- package/addon/routes/management/drivers/index.js +33 -0
- package/addon/routes/management/drivers.js +3 -0
- package/addon/routes/management/fleets/index.js +27 -0
- package/addon/routes/management/fleets.js +3 -0
- package/addon/routes/management/fuel-reports/index.js +23 -0
- package/addon/routes/management/fuel-reports.js +3 -0
- package/addon/routes/management/index.js +3 -0
- package/addon/routes/management/issues/index.js +24 -0
- package/addon/routes/management/issues.js +3 -0
- package/addon/routes/management/places/index.js +18 -0
- package/addon/routes/management/places.js +3 -0
- package/addon/routes/management/vehicles/index.js +35 -0
- package/addon/routes/management/vehicles.js +3 -0
- package/addon/routes/management/vendors/index.js +34 -0
- package/addon/routes/management/vendors.js +3 -0
- package/addon/routes/management.js +3 -0
- package/addon/routes/operations/dispatch.js +3 -0
- package/addon/routes/operations/orders/index/config/types.js +17 -0
- package/addon/routes/operations/orders/index/config.js +3 -0
- package/addon/routes/operations/orders/index/new.js +16 -0
- package/addon/routes/operations/orders/index/view.js +37 -0
- package/addon/routes/operations/orders/index.js +35 -0
- package/addon/routes/operations/orders.js +4 -0
- package/addon/routes/operations/scheduler/index.js +10 -0
- package/addon/routes/operations/scheduler.js +3 -0
- package/addon/routes/operations/service-rates/index/edit.js +35 -0
- package/addon/routes/operations/service-rates/index/new.js +15 -0
- package/addon/routes/operations/service-rates/index.js +49 -0
- package/addon/routes/operations/service-rates.js +10 -0
- package/addon/routes/operations/zones/index.js +25 -0
- package/addon/routes/operations/zones.js +7 -0
- package/addon/routes/operations.js +3 -0
- package/addon/routes.js +55 -0
- package/addon/services/map-manager.js +3 -0
- package/addon/services/service-areas.js +385 -0
- package/addon/templates/application.hbs +27 -0
- package/addon/templates/comms/chat.hbs +1 -0
- package/addon/templates/comms/intercom.hbs +1 -0
- package/addon/templates/comms.hbs +1 -0
- package/addon/templates/home.hbs +1 -0
- package/addon/templates/management/contacts/index.hbs +23 -0
- package/addon/templates/management/contacts.hbs +1 -0
- package/addon/templates/management/drivers/index.hbs +35 -0
- package/addon/templates/management/drivers.hbs +1 -0
- package/addon/templates/management/fleets/index.hbs +22 -0
- package/addon/templates/management/fleets.hbs +1 -0
- package/addon/templates/management/fuel-reports/index.hbs +21 -0
- package/addon/templates/management/fuel-reports.hbs +1 -0
- package/addon/templates/management/index.hbs +53 -0
- package/addon/templates/management/issues/index.hbs +21 -0
- package/addon/templates/management/issues.hbs +1 -0
- package/addon/templates/management/places/index.hbs +34 -0
- package/addon/templates/management/places.hbs +1 -0
- package/addon/templates/management/vehicles/index.hbs +22 -0
- package/addon/templates/management/vehicles.hbs +1 -0
- package/addon/templates/management/vendors/index.hbs +22 -0
- package/addon/templates/management/vendors.hbs +1 -0
- package/addon/templates/management.hbs +1 -0
- package/addon/templates/operations/dispatch.hbs +1 -0
- package/addon/templates/operations/orders/index/config/types.hbs +26 -0
- package/addon/templates/operations/orders/index/config.hbs +24 -0
- package/addon/templates/operations/orders/index/new.hbs +506 -0
- package/addon/templates/operations/orders/index/view.hbs +428 -0
- package/addon/templates/operations/orders/index.hbs +48 -0
- package/addon/templates/operations/orders.hbs +1 -0
- package/addon/templates/operations/scheduler/index.hbs +30 -0
- package/addon/templates/operations/scheduler.hbs +1 -0
- package/addon/templates/operations/service-rates/index/edit.hbs +1 -0
- package/addon/templates/operations/service-rates/index/new.hbs +308 -0
- package/addon/templates/operations/service-rates/index.hbs +23 -0
- package/addon/templates/operations/service-rates.hbs +1 -0
- package/addon/templates/operations/zones/index.hbs +72 -0
- package/addon/templates/operations/zones.hbs +1 -0
- package/addon/templates/operations.hbs +1 -0
- package/addon/utils/calculate-percentage.js +1 -0
- package/addon/utils/extract-coordinates.js +1 -0
- package/addon/utils/format-currency.js +1 -0
- package/addon/utils/geojson/geo-json.js +17 -0
- package/addon/utils/is-facilitator-supported-place.js +14 -0
- package/addon/utils/to-model.js +1 -0
- package/app/components/cell/driver-name.js +1 -0
- package/app/components/custom-field-value.js +1 -0
- package/app/components/custom-field.js +1 -0
- package/app/components/display-place.js +1 -0
- package/app/components/driver-card-mini.js +1 -0
- package/app/components/driver-card.js +1 -0
- package/app/components/event-timeline/event.js +1 -0
- package/app/components/event-timeline.js +1 -0
- package/app/components/file-icon.js +1 -0
- package/app/components/fleet-driver-listing.js +1 -0
- package/app/components/full-calendar/draggable.js +1 -0
- package/app/components/full-calendar.js +1 -0
- package/app/components/full-size.js +1 -0
- package/app/components/global-search.js +1 -0
- package/app/components/horizontal-route.js +1 -0
- package/app/components/integrated-order-details.js +1 -0
- package/app/components/leaflet-draw-control.js +1 -0
- package/app/components/leaflet-rotated-marker.js +1 -0
- package/app/components/live-map.js +1 -0
- package/app/components/map-container/toolbar/zones-panel.js +1 -0
- package/app/components/map-container/toolbar-container.js +1 -0
- package/app/components/map-container/toolbar.js +1 -0
- package/app/components/map-container/topbar.js +1 -0
- package/app/components/map-container/view-switch.js +1 -0
- package/app/components/map-container.js +1 -0
- package/app/components/modals/assign-driver.js +1 -0
- package/app/components/modals/clone-config-form.js +1 -0
- package/app/components/modals/contact-details.js +1 -0
- package/app/components/modals/contact-form.js +1 -0
- package/app/components/modals/driver-assign-order.js +1 -0
- package/app/components/modals/driver-assign-vehicle.js +1 -0
- package/app/components/modals/driver-assign-vendor.js +1 -0
- package/app/components/modals/driver-details.js +1 -0
- package/app/components/modals/driver-form.js +1 -0
- package/app/components/modals/edit-meta-form.js +1 -0
- package/app/components/modals/entity-form.js +1 -0
- package/app/components/modals/entity-meta-field-prompt.js +1 -0
- package/app/components/modals/fleet-details.js +1 -0
- package/app/components/modals/fleet-form.js +1 -0
- package/app/components/modals/fuel-report-details.js +1 -0
- package/app/components/modals/fuel-report-form.js +1 -0
- package/app/components/modals/group-details.js +1 -0
- package/app/components/modals/group-form.js +1 -0
- package/app/components/modals/install-prompt.js +1 -0
- package/app/components/modals/map-field-form.js +1 -0
- package/app/components/modals/map-field-group-form.js +1 -0
- package/app/components/modals/map-layer-form.js +1 -0
- package/app/components/modals/meta-field-form.js +1 -0
- package/app/components/modals/meta-field-group-form.js +1 -0
- package/app/components/modals/new-order-config.js +1 -0
- package/app/components/modals/option-prompt.js +1 -0
- package/app/components/modals/order-assign-driver.js +1 -0
- package/app/components/modals/order-config-new-status.js +1 -0
- package/app/components/modals/order-event.js +1 -0
- package/app/components/modals/order-form.js +1 -0
- package/app/components/modals/order-import.js +1 -0
- package/app/components/modals/order-label.js +1 -0
- package/app/components/modals/order-meta.js +1 -0
- package/app/components/modals/order-new-activity.js +1 -0
- package/app/components/modals/order-route-form.js +1 -0
- package/app/components/modals/place-assign-vendor.js +1 -0
- package/app/components/modals/place-details.js +1 -0
- package/app/components/modals/place-form.js +1 -0
- package/app/components/modals/point-map.js +1 -0
- package/app/components/modals/policy-form.js +1 -0
- package/app/components/modals/resend-verification-email.js +1 -0
- package/app/components/modals/role-form.js +1 -0
- package/app/components/modals/select-payment-method.js +1 -0
- package/app/components/modals/service-area-form.js +1 -0
- package/app/components/modals/set-password.js +1 -0
- package/app/components/modals/uninstall-prompt.js +1 -0
- package/app/components/modals/user-form.js +1 -0
- package/app/components/modals/vehicle-details.js +1 -0
- package/app/components/modals/vehicle-form.js +1 -0
- package/app/components/modals/vendor-details.js +1 -0
- package/app/components/modals/vendor-form.js +1 -0
- package/app/components/modals/view-service-area.js +1 -0
- package/app/components/modals/view-zone.js +1 -0
- package/app/components/modals/zone-form.js +1 -0
- package/app/components/operations-pane/pane.js +1 -0
- package/app/components/order/header.js +1 -0
- package/app/components/order/place-card.js +1 -0
- package/app/components/order/schedule-card.js +1 -0
- package/app/components/order/sub-header/item.js +1 -0
- package/app/components/order/sub-header.js +1 -0
- package/app/components/order-config/activity-flow-editor.js +1 -0
- package/app/components/order-config/details-editor.js +1 -0
- package/app/components/order-config/entities-editor.js +1 -0
- package/app/components/order-config/fields-editor.js +1 -0
- package/app/components/order-config/selector.js +1 -0
- package/app/components/order-config.js +1 -0
- package/app/components/order-list-overlay/driver-panel-title.js +1 -0
- package/app/components/order-list-overlay/order.js +1 -0
- package/app/components/order-list-overlay.js +1 -0
- package/app/components/route-list.js +1 -0
- package/app/components/settings-window.js +1 -0
- package/app/components/split-grid.js +1 -0
- package/app/components/widget/issues.js +1 -0
- package/app/components/widget/key-metrics.js +1 -0
- package/app/components/widget/live-order-map.js +1 -0
- package/app/components/widget/recent-orders.js +1 -0
- package/app/components/widget/recommended-todo.js +1 -0
- package/app/components/widget/transaction-earnings.js +1 -0
- package/app/components/widget/transactions.js +1 -0
- package/app/components/widget/weekly-orders.js +1 -0
- package/app/controllers/application.js +1 -0
- package/app/controllers/management/contacts/index.js +1 -0
- package/app/controllers/management/drivers/index/details.js +1 -0
- package/app/controllers/management/drivers/index.js +1 -0
- package/app/controllers/management/fleets/index/details.js +1 -0
- package/app/controllers/management/fleets/index.js +1 -0
- package/app/controllers/management/fuel-reports/index.js +1 -0
- package/app/controllers/management/issues/index.js +1 -0
- package/app/controllers/management/places/index.js +1 -0
- package/app/controllers/management/vehicles/index.js +1 -0
- package/app/controllers/management/vendors/index/details/remarks.js +1 -0
- package/app/controllers/management/vendors/index/details.js +1 -0
- package/app/controllers/management/vendors/index.js +1 -0
- package/app/controllers/management.js +1 -0
- package/app/controllers/operations/orders/index/config/types.js +1 -0
- package/app/controllers/operations/orders/index/config.js +1 -0
- package/app/controllers/operations/orders/index/new.js +1 -0
- package/app/controllers/operations/orders/index/view.js +1 -0
- package/app/controllers/operations/scheduler/index.js +1 -0
- package/app/controllers/operations/service-rates/index/edit.js +1 -0
- package/app/controllers/operations/service-rates/index/new.js +1 -0
- package/app/controllers/operations/service-rates/index.js +1 -0
- package/app/controllers/operations/zones/index.js +1 -0
- package/app/helpers/avatar-url.js +1 -0
- package/app/helpers/extract-coordinates.js +1 -0
- package/app/helpers/feature-group.js +1 -0
- package/app/helpers/flow-raw-status.js +1 -0
- package/app/helpers/format-point.js +1 -0
- package/app/helpers/get-tip-amount.js +1 -0
- package/app/helpers/is-facilitator-supported-place.js +1 -0
- package/app/helpers/is-not-facilitator-supported-place.js +1 -0
- package/app/helpers/is-waypoint-record.js +1 -0
- package/app/helpers/point-coordinates.js +1 -0
- package/app/helpers/point-to-coordinates.js +1 -0
- package/app/helpers/service-name.js +1 -0
- package/app/helpers/waypoint-label.js +1 -0
- package/app/modifiers/translate-x.js +1 -0
- package/app/routes/home.js +1 -0
- package/app/routes/management/fleets/index/details.js +1 -0
- package/app/routes/operations/orders/index/config/types.js +1 -0
- package/app/routes/operations/orders/index/config.js +1 -0
- package/app/routes/operations/orders/index/new.js +1 -0
- package/app/routes/operations/orders/index/view.js +1 -0
- package/app/routes/operations/scheduler/index.js +1 -0
- package/app/routes/operations/scheduler.js +1 -0
- package/app/routes/operations/service-rates/index/edit.js +1 -0
- package/app/routes/operations/service-rates/index/new.js +1 -0
- package/app/services/map-manager.js +1 -0
- package/app/services/service-areas.js +1 -0
- package/app/templates/home.js +1 -0
- package/app/templates/management/fleets/index/details.js +1 -0
- package/app/templates/operations/orders/index/config/types.js +1 -0
- package/app/templates/operations/orders/index/config.js +1 -0
- package/app/templates/operations/orders/index/new.js +1 -0
- package/app/templates/operations/orders/index/view.js +1 -0
- package/app/templates/operations/scheduler/index.js +1 -0
- package/app/templates/operations/scheduler.js +1 -0
- package/app/templates/operations/service-rates/index/edit.js +1 -0
- package/app/templates/operations/service-rates/index/new.js +1 -0
- package/app/utils/calculate-percentage.js +1 -0
- package/app/utils/extract-coordinates.js +1 -0
- package/app/utils/format-currency.js +1 -0
- package/app/utils/geojson/geo-json.js +1 -0
- package/app/utils/is-facilitator-supported-place.js +1 -0
- package/app/utils/is-latitude.js +1 -0
- package/app/utils/to-model.js +1 -0
- package/assets/images/drawing-controls-spritesheet-inverted.png +0 -0
- package/config/environment.js +25 -0
- package/index.js +73 -0
- package/package.json +132 -0
- package/pnpm-lock.yaml +12613 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{{#if @visible}}
|
|
2
|
+
<div class="next-map-search-bar-container {{if @visible "is-visible"}}" {{did-insert this.setupComponent}}>
|
|
3
|
+
<div class="next-map-search-bar">
|
|
4
|
+
<FaIcon @icon="search" class="ml-4" />
|
|
5
|
+
<Input @value={{@value}} {{on "input" this.search}} placeholder="Search by keyword..." />
|
|
6
|
+
<div class="pr-4 flex items-center justify-center">
|
|
7
|
+
{{#if this.isLoading}}
|
|
8
|
+
<Spinner class="text-sky-400" />
|
|
9
|
+
{{/if}}
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="next-map-search-results flex flex-col {{if this.results "has-results"}}">
|
|
13
|
+
{{#each this.results as |result|}}
|
|
14
|
+
<a href="javascript:;" class="next-map-search-result" {{on "click" (fn this.onAction "onPressOrder" result)}}>
|
|
15
|
+
<div class="px-4">
|
|
16
|
+
<div class="flex items-start justify-between mb-2">
|
|
17
|
+
<div class="flex-1 truncate">
|
|
18
|
+
<h3 class="text-base font-semibold">{{result.public_id}}</h3>
|
|
19
|
+
<div class="flex flex-row items-center space-x-2">
|
|
20
|
+
<Badge @hideStatusDot={{true}} @status="default">{{result.createdAt}}</Badge>
|
|
21
|
+
<Badge @hideStatusDot={{true}} @status={{if result.has_driver_assigned "assigned" "default"}}>
|
|
22
|
+
<div class="flex flex-row items-center {{if result.has_driver_assigned "text-indigo-900" "text-gray-900"}}">
|
|
23
|
+
<FaIcon @icon="steering-wheel" @size="xs" class="mr-1" />
|
|
24
|
+
{{if result.has_driver_assigned result.driver_name "Unassigned"}}
|
|
25
|
+
</div>
|
|
26
|
+
</Badge>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div>
|
|
30
|
+
<Badge @status={{result.status}} />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="text-xs">
|
|
34
|
+
<div class="order-route-list">
|
|
35
|
+
{{#if result.payload.pickup}}
|
|
36
|
+
<div class="{{@itemClass}} order-route-stop">
|
|
37
|
+
<div class="order-route-stop-index">
|
|
38
|
+
<div class="index-count">1</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="order-route-location dark:text-gray-100">
|
|
41
|
+
{{result.payload.pickup.address}}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
{{/if}}
|
|
45
|
+
|
|
46
|
+
{{#if result.payload.waypoints}}
|
|
47
|
+
{{#each result.payload.waypoints as |waypoint index|}}
|
|
48
|
+
<div class="{{@itemClass}} order-route-stop">
|
|
49
|
+
<div class="order-route-stop-index">
|
|
50
|
+
<div class="index-count">{{index}}</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="order-route-location dark:text-gray-100">{{waypoint.address}}</div>
|
|
53
|
+
</div>
|
|
54
|
+
{{/each}}
|
|
55
|
+
{{/if}}
|
|
56
|
+
|
|
57
|
+
{{#if result.payload.dropoff}}
|
|
58
|
+
<div class="{{@itemClass}} order-route-stop">
|
|
59
|
+
<div class="order-route-stop-index">
|
|
60
|
+
<div class="index-count">{{add result.payload.waypoints.length 2}}</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="order-route-location dark:text-gray-100">{{result.payload.dropoff.address}}</div>
|
|
63
|
+
</div>
|
|
64
|
+
{{/if}}
|
|
65
|
+
</div>
|
|
66
|
+
<div>
|
|
67
|
+
<div class="grid grid-cols-8 gap-2">
|
|
68
|
+
{{#each result.payload.entities as |entity|}}
|
|
69
|
+
<div role="listitem" title={{entity.name}}>
|
|
70
|
+
<div class="mb-1.5">
|
|
71
|
+
<img src={{entity.photo_url}} alt={{entity.name}} class="w-full" />
|
|
72
|
+
</div>
|
|
73
|
+
<div class="text-xs truncate">{{entity.name}}</div>
|
|
74
|
+
</div>
|
|
75
|
+
{{/each}}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</a>
|
|
81
|
+
{{/each}}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
{{/if}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { later } from '@ember/runloop';
|
|
6
|
+
|
|
7
|
+
export default class GlobalSearchComponent extends Component {
|
|
8
|
+
@service store;
|
|
9
|
+
@tracked results = [];
|
|
10
|
+
@tracked isLoading;
|
|
11
|
+
|
|
12
|
+
@action setupComponent(element) {
|
|
13
|
+
later(
|
|
14
|
+
this,
|
|
15
|
+
() => {
|
|
16
|
+
element.querySelector('input').focus();
|
|
17
|
+
},
|
|
18
|
+
300
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@action search(event) {
|
|
23
|
+
const { target } = event;
|
|
24
|
+
const { value } = target;
|
|
25
|
+
|
|
26
|
+
if (!value) {
|
|
27
|
+
this.results = [];
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
this.isLoading = true;
|
|
32
|
+
|
|
33
|
+
this.store
|
|
34
|
+
.query('order', { query: value })
|
|
35
|
+
.then((orders) => {
|
|
36
|
+
this.results = orders;
|
|
37
|
+
})
|
|
38
|
+
.finally(() => {
|
|
39
|
+
this.isLoading = false;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@action onAction(actionName, ...params) {
|
|
44
|
+
if (typeof this[actionName] === 'function') {
|
|
45
|
+
this[actionName](...params);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (typeof this.args[actionName] === 'function') {
|
|
49
|
+
this.args[actionName](...params);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div class="horizontal-route-scroller">
|
|
2
|
+
<div class="horizontal-route-scroller--scollbar">
|
|
3
|
+
{{#if (has-block)}}
|
|
4
|
+
{{#each this.locations as |location|}}
|
|
5
|
+
{{#let (eq location.uuid this.destination.uuid) as |isDestination|}}
|
|
6
|
+
{{yield location isDestination}}
|
|
7
|
+
{{/let}}
|
|
8
|
+
{{/each}}
|
|
9
|
+
{{else}}
|
|
10
|
+
{{#each this.locations as |location|}}
|
|
11
|
+
<div>
|
|
12
|
+
<div class="horizontal-route {{if (eq location.uuid this.destination.uuid) 'is-destination'}}">
|
|
13
|
+
<div class="notch">
|
|
14
|
+
{{#if (eq location.uuid this.destination.uuid)}}
|
|
15
|
+
<Attach::Tooltip @class="clean" @animation="scale" @placement="top" @showOn="mouseenter focus">
|
|
16
|
+
<InputInfo @text="Destination" @iconClass="text-green-400" class="flex items-center" @spanClass="flex items-start justify-start text-left ml-1" />
|
|
17
|
+
</Attach::Tooltip>
|
|
18
|
+
{{/if}}
|
|
19
|
+
</div>
|
|
20
|
+
<div class="place mx-4">
|
|
21
|
+
<div class="rounded-md shadow-sm text-xs font-semibold border border-gray-900 dark:bg-gray-900 truncate w-24 p-1 cursor-help">
|
|
22
|
+
<span>{{location.street1}}</span>
|
|
23
|
+
<Attach::Tooltip @class="clean" @animation="scale" @placement="top" @showOn="mouseenter focus">
|
|
24
|
+
<InputInfo @text={{location.address}} class="flex items-center" @spanClass="flex items-start justify-start text-left text-xs ml-1 truncate block" />
|
|
25
|
+
</Attach::Tooltip>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
{{/each}}
|
|
31
|
+
{{/if}}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { computed } from '@ember/object';
|
|
3
|
+
import { isArray } from '@ember/array';
|
|
4
|
+
|
|
5
|
+
export default class HorizontalRouteComponent extends Component {
|
|
6
|
+
@computed('args.payload') get locations() {
|
|
7
|
+
const { payload } = this.args;
|
|
8
|
+
const { pickup, dropoff, waypoints } = payload;
|
|
9
|
+
const locations = [];
|
|
10
|
+
|
|
11
|
+
if (pickup) {
|
|
12
|
+
locations.pushObject(pickup);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (isArray(waypoints) && waypoints.length) {
|
|
16
|
+
for (let i = 0; i < waypoints.length; i++) {
|
|
17
|
+
const waypoint = waypoints.objectAt(i);
|
|
18
|
+
|
|
19
|
+
locations.pushObject(waypoint);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (dropoff) {
|
|
24
|
+
locations.pushObject(dropoff);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return locations;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@computed('args.payload') get destination() {
|
|
31
|
+
const { payload } = this.args;
|
|
32
|
+
const { dropoff, waypoints } = payload;
|
|
33
|
+
|
|
34
|
+
if (isArray(waypoints) && waypoints.length) {
|
|
35
|
+
const waypoint = waypoints.find((location, index) => {
|
|
36
|
+
if (payload.current_waypoint_uuid) {
|
|
37
|
+
return payload.current_waypoint_uuid === location.uuid;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return index === 0;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return waypoint;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return dropoff;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-2">
|
|
3
|
+
{{#if this.isLalamove}}
|
|
4
|
+
<div class="field-info-container space-y-2">
|
|
5
|
+
<div class="field-name">Order ID</div>
|
|
6
|
+
<div class="field-value">
|
|
7
|
+
{{n-a @details.orderId}}
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="field-info-container space-y-2">
|
|
11
|
+
<div class="field-name">Quotation ID</div>
|
|
12
|
+
<div class="field-value">
|
|
13
|
+
{{n-a @details.quotationId}}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="field-info-container space-y-2">
|
|
18
|
+
<div class="field-name">Driver ID</div>
|
|
19
|
+
<div class="field-value">
|
|
20
|
+
{{n-a @details.driverId "No Driver Assigned"}}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="field-info-container space-y-2">
|
|
24
|
+
<div class="field-name">Status</div>
|
|
25
|
+
<div class="field-value">
|
|
26
|
+
{{smart-humanize @details.status}}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="field-info-container space-y-2">
|
|
30
|
+
<div class="field-name">Distance</div>
|
|
31
|
+
<div class="field-value">
|
|
32
|
+
{{format-meters @details.distance.value}}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="field-info-container space-y-2">
|
|
36
|
+
<div class="field-name">Shareable Link</div>
|
|
37
|
+
<div class="field-value">
|
|
38
|
+
<a href={{@details.shareLink}} class="break-words anchor-button" target="_lalamove_link">
|
|
39
|
+
<div>
|
|
40
|
+
<FaIcon @icon="link" />
|
|
41
|
+
</div>
|
|
42
|
+
<div>{{@details.shareLink}}</div>
|
|
43
|
+
</a>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="field-info-container space-y-2 lg:col-span-2">
|
|
47
|
+
<div class="field-name">Price Breakdown</div>
|
|
48
|
+
<div class="field-value">
|
|
49
|
+
<div class="next-table-wrapper">
|
|
50
|
+
<table class="table table-fixed w-full">
|
|
51
|
+
<thead>
|
|
52
|
+
<tr>
|
|
53
|
+
<th class="text-left">Item</th>
|
|
54
|
+
<th class="text-left">Amount</th>
|
|
55
|
+
</tr>
|
|
56
|
+
</thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
{{#each-in @details.priceBreakdown as |key value|}}
|
|
59
|
+
{{#if (not (includes key this.skipInPriceBreakdown))}}
|
|
60
|
+
<tr>
|
|
61
|
+
<td>{{smart-humanize key}}</td>
|
|
62
|
+
<td>{{format-currency (mult value 100) @details.priceBreakdown.currency}}</td>
|
|
63
|
+
</tr>
|
|
64
|
+
{{/if}}
|
|
65
|
+
{{/each-in}}
|
|
66
|
+
<tr>
|
|
67
|
+
<td class="font-bold">Total</td>
|
|
68
|
+
<td class="font-bold">{{format-currency (mult @details.priceBreakdown.total 100) @details.priceBreakdown.currency}}</td>
|
|
69
|
+
</tr>
|
|
70
|
+
</tbody>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="field-info-container space-y-2 lg:col-span-2">
|
|
76
|
+
<div class="field-name">Metadata</div>
|
|
77
|
+
<div class="field-value">
|
|
78
|
+
<div class="next-table-wrapper">
|
|
79
|
+
<table class="table table-fixed w-full">
|
|
80
|
+
<thead>
|
|
81
|
+
<tr>
|
|
82
|
+
<th class="text-left">Key</th>
|
|
83
|
+
<th class="text-left">Value</th>
|
|
84
|
+
</tr>
|
|
85
|
+
</thead>
|
|
86
|
+
<tbody>
|
|
87
|
+
{{#each-in @details.metadata as |key value|}}
|
|
88
|
+
<tr>
|
|
89
|
+
<td>{{smart-humanize key}}</td>
|
|
90
|
+
<td>{{value}}</td>
|
|
91
|
+
</tr>
|
|
92
|
+
{{/each-in}}
|
|
93
|
+
</tbody>
|
|
94
|
+
</table>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
{{else}}
|
|
99
|
+
{{#each-in @details as |key value|}}
|
|
100
|
+
<div class="field-info-container space-y-2">
|
|
101
|
+
<div class="field-name">{{smart-humanize key}}</div>
|
|
102
|
+
<div class="field-value">
|
|
103
|
+
{{#if (is-array value)}}
|
|
104
|
+
{{join ', ' value}}
|
|
105
|
+
{{else if (is-object value)}}
|
|
106
|
+
{{#each-in value as |k v|}}
|
|
107
|
+
<div>{{smart-humanize k}}: {{v}}</div>
|
|
108
|
+
{{/each-in}}
|
|
109
|
+
{{else}}
|
|
110
|
+
{{n-a value}}
|
|
111
|
+
{{/if}}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
{{/each-in}}
|
|
115
|
+
{{/if}}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { action, computed } from '@ember/object';
|
|
4
|
+
import { equal } from '@ember/object/computed';
|
|
5
|
+
|
|
6
|
+
export default class IntegratedOrderDetailsComponent extends Component {
|
|
7
|
+
@equal('args.integratedVendor.provider', 'lalamove') isLalamove;
|
|
8
|
+
@tracked skipInPriceBreakdown = ['currency', 'total'];
|
|
9
|
+
@action setupComponent() {}
|
|
10
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import 'leaflet-draw-src';
|
|
2
|
+
import BaseLayer from 'ember-leaflet/components/base-layer';
|
|
3
|
+
import { getProperties, computed } from '@ember/object';
|
|
4
|
+
import { run } from '@ember/runloop';
|
|
5
|
+
import { assign } from '@ember/polyfills';
|
|
6
|
+
import { scheduleOnce } from '@ember/runloop';
|
|
7
|
+
import { classify, camelize } from '@ember/string';
|
|
8
|
+
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
9
|
+
|
|
10
|
+
export default class LeafletDrawControl extends BaseLayer {
|
|
11
|
+
leafletEvents = [
|
|
12
|
+
L.Draw.Event.CREATED,
|
|
13
|
+
L.Draw.Event.EDITED,
|
|
14
|
+
L.Draw.Event.EDITMOVE,
|
|
15
|
+
L.Draw.Event.EDITRESIZE,
|
|
16
|
+
L.Draw.Event.EDITSTART,
|
|
17
|
+
L.Draw.Event.EDITSTOP,
|
|
18
|
+
L.Draw.Event.EDITVERTEX,
|
|
19
|
+
L.Draw.Event.DELETED,
|
|
20
|
+
L.Draw.Event.DELETESTART,
|
|
21
|
+
L.Draw.Event.DELETESTOP,
|
|
22
|
+
L.Draw.Event.DRAWSTART,
|
|
23
|
+
L.Draw.Event.DRAWSTOP,
|
|
24
|
+
L.Draw.Event.DRAWVERTEX,
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
leafletOptions = ['draw', 'edit', 'remove', 'poly', 'position'];
|
|
28
|
+
|
|
29
|
+
@computed('args', 'leaflefEvents.[]', 'leafletEvents') get usedLeafletEvents() {
|
|
30
|
+
return this.leafletEvents.filter((eventName) => {
|
|
31
|
+
eventName = camelize(eventName.replace(':', ' '));
|
|
32
|
+
let methodName = `_${eventName}`;
|
|
33
|
+
let actionName = `on${classify(eventName)}`;
|
|
34
|
+
|
|
35
|
+
return this[methodName] !== undefined || this.args[actionName] !== undefined;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@computed('args.draw', 'args.edit', 'args.remove', 'args.poly', 'args.position') get options() {
|
|
40
|
+
return {
|
|
41
|
+
position: getWithDefault(this.args, 'position', 'topright'),
|
|
42
|
+
draw: getWithDefault(this.args, 'draw', { marker: false, circlemarker: false, circle: false, polyline: false }),
|
|
43
|
+
edit: getWithDefault(this.args, 'edit', {}),
|
|
44
|
+
remove: getWithDefault(this.args, 'remove', {}),
|
|
45
|
+
poly: getWithDefault(this.args, 'poly', null),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@computed('args.parent._layer') get map() {
|
|
50
|
+
return this.args.parent._layer;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
addToContainer() {
|
|
54
|
+
if (this._layer) {
|
|
55
|
+
this.map.addLayer(this._layer);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
createLayer() {
|
|
60
|
+
const { onDrawFeatureGroupCreated } = this.args;
|
|
61
|
+
const drawingLayerGroup = new this.L.FeatureGroup();
|
|
62
|
+
const showDrawingLayer = getWithDefault(this.args, 'showDrawingLayer', true);
|
|
63
|
+
|
|
64
|
+
if (showDrawingLayer) {
|
|
65
|
+
if (typeof onDrawFeatureGroupCreated === 'function') {
|
|
66
|
+
onDrawFeatureGroupCreated(drawingLayerGroup, this.map);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
drawingLayerGroup.addTo(this.map);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return drawingLayerGroup;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
didCreateLayer() {
|
|
76
|
+
const { onDrawControlCreated, onDrawControlAddedToMap } = this.args;
|
|
77
|
+
const showDrawingLayer = getWithDefault(this.args, 'showDrawingLayer', true);
|
|
78
|
+
|
|
79
|
+
if (this.map && this._layer) {
|
|
80
|
+
this.options.edit = assign({ featureGroup: this._layer }, this.options.edit);
|
|
81
|
+
this.options.draw = assign({}, this.L.drawLocal.draw, this.options.draw);
|
|
82
|
+
|
|
83
|
+
// create draw control
|
|
84
|
+
const drawControl = new this.L.Control.Draw(this.options);
|
|
85
|
+
|
|
86
|
+
// trigger action/event draw control created
|
|
87
|
+
if (typeof onDrawControlCreated === 'function') {
|
|
88
|
+
onDrawControlCreated(drawControl, this.map);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Add the draw control to the map
|
|
92
|
+
this.map.addControl(drawControl);
|
|
93
|
+
|
|
94
|
+
// trigger action/event draw control added to map
|
|
95
|
+
if (typeof onDrawControlAddedToMap === 'function') {
|
|
96
|
+
onDrawControlAddedToMap(drawControl, this.map);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// If showDrawingLayer, add new layer to the layerGroup
|
|
100
|
+
if (showDrawingLayer) {
|
|
101
|
+
this.map.on(this.L.Draw.Event.CREATED, ({ layer }) => {
|
|
102
|
+
this._layer.addLayer(layer);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
_addEventListeners() {
|
|
109
|
+
this._eventHandlers = {};
|
|
110
|
+
|
|
111
|
+
for (let eventName of this.usedLeafletEvents) {
|
|
112
|
+
const originalEventName = eventName;
|
|
113
|
+
// fix event name
|
|
114
|
+
eventName = camelize(eventName.replace(':', ' '));
|
|
115
|
+
const actionName = `on${classify(eventName)}`;
|
|
116
|
+
const methodName = `_${eventName}`;
|
|
117
|
+
|
|
118
|
+
// create an event handler that runs the function inside an event loop.
|
|
119
|
+
this._eventHandlers[originalEventName] = function (e) {
|
|
120
|
+
let fn = () => {
|
|
121
|
+
// try to invoke/send an action for this event
|
|
122
|
+
if (typeof this.args[actionName] === 'function') {
|
|
123
|
+
this.args[actionName](e, this._layer, this.map);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// allow classes to add custom logic on events as well
|
|
127
|
+
if (typeof this[methodName] === 'function') {
|
|
128
|
+
this[methodName](e, this._layer, this.map);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
scheduleOnce('actions', this, fn);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
this.map.addEventListener(originalEventName, this._eventHandlers[originalEventName], this);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
_removeEventListeners() {
|
|
140
|
+
if (this._eventHandlers) {
|
|
141
|
+
for (let eventName of this.usedLeafletEvents) {
|
|
142
|
+
this.map.removeEventListener(eventName, this._eventHandlers[eventName], this);
|
|
143
|
+
delete this._eventHandlers[eventName];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import MarkerLayer from 'ember-leaflet/components/marker-layer';
|
|
2
|
+
import 'leaflet-rotatedmarker';
|
|
3
|
+
|
|
4
|
+
export default class LeafletRotatedMarkerComponent extends MarkerLayer {
|
|
5
|
+
leafletOptions = [
|
|
6
|
+
...this.leafletOptions,
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Rotation angle, in degrees, clockwise.
|
|
10
|
+
*
|
|
11
|
+
* @argument rotationAngle
|
|
12
|
+
* @type {Number}
|
|
13
|
+
*/
|
|
14
|
+
'rotationAngle',
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The rotation center, as a transform-origin CSS rule.
|
|
18
|
+
*
|
|
19
|
+
* @argument rotationOrigin
|
|
20
|
+
* @type {String}
|
|
21
|
+
*/
|
|
22
|
+
'rotationOrigin',
|
|
23
|
+
];
|
|
24
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<div class="live-map-component {{@wrapperClass}}" {{did-insert this.setupLiveMap}}>
|
|
2
|
+
<LeafletMap id={{this.mapId}} class={{@mapClass}} @lat={{this.latitude}} @lng={{this.longitude}} @zoom={{this.zoom}} @zoomControl={{@zoomControl}} @contextmenu={{true}} @contextmenuWidth={{140}} @contextmenuItems={{this.contextMenuItems}} @onLoad={{this.setMapReference}} {{will-destroy this.closeChannels}} ...attributes as |layers|>
|
|
3
|
+
<layers.tile @url={{this.tileSourceUrl}} />
|
|
4
|
+
|
|
5
|
+
{{#if this.isDriversVisible}}
|
|
6
|
+
{{#each this.drivers as |driver|}}
|
|
7
|
+
<layers.rotated-marker @icon={{icon iconUrl=driver.vehicle_avatar iconSize=(array 40 40)}} @location={{point-to-coordinates driver.location}} @onAdd={{fn this.onAction "onDriverAdded" driver}}>
|
|
8
|
+
{{!-- <marker.popup @maxWidth="500" @minWidth="225">
|
|
9
|
+
<DriverCard @driver={{driver}} @showCoordinates={{true}} @textClass="text-gray-900 dark:text-gray-100" />
|
|
10
|
+
</marker.popup> --}}
|
|
11
|
+
</layers.rotated-marker>
|
|
12
|
+
{{/each}}
|
|
13
|
+
{{/if}}
|
|
14
|
+
|
|
15
|
+
{{!-- {{#if this.isRoutesVisible}}
|
|
16
|
+
{{#each this.routes as |route|}}
|
|
17
|
+
<layers.polyline @locations={{route.details.coordinates}} />
|
|
18
|
+
|
|
19
|
+
{{#if route.payload.pickup}}
|
|
20
|
+
<layers.marker @location={{point-to-coordinates route.payload.pickup.location}} as |marker|>
|
|
21
|
+
<marker.popup>
|
|
22
|
+
<div>{{route.payload.pickup.address}}</div>
|
|
23
|
+
<div>{{format-point route.payload.pickup.location}}</div>
|
|
24
|
+
</marker.popup>
|
|
25
|
+
</layers.marker>
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#each route.payload.waypoints as |waypoint|}}
|
|
28
|
+
<layers.marker @location={{point-to-coordinates waypoint.location}} as |marker|>
|
|
29
|
+
<marker.popup>
|
|
30
|
+
<div>{{waypoint.address}}</div>
|
|
31
|
+
<div>{{format-point waypoint.location}}</div>
|
|
32
|
+
</marker.popup>
|
|
33
|
+
</layers.marker>
|
|
34
|
+
{{/each}}
|
|
35
|
+
|
|
36
|
+
{{#if route.payload.dropoff}}
|
|
37
|
+
<layers.marker @location={{point-to-coordinates route.payload.dropoff.location}} as |marker|>
|
|
38
|
+
<marker.popup>
|
|
39
|
+
<div>{{route.payload.dropoff.address}}</div>
|
|
40
|
+
<div>{{format-point route.payload.dropoff.location}}</div>
|
|
41
|
+
</marker.popup>
|
|
42
|
+
</layers.marker>
|
|
43
|
+
{{/if}}
|
|
44
|
+
{{/each}}
|
|
45
|
+
{{/if}} --}}
|
|
46
|
+
|
|
47
|
+
<layers.draw-control @position="topright" @draw={{hash marker=false circlemarker=false circle=false polyline=false}} @onDrawDrawstop={{fn this.onAction "onDrawDrawstop"}} @onDrawDeleted={{fn this.onAction "onDrawDeleted"}} @onDrawEdited={{fn this.onAction "onDrawEdited"}} @onDrawDeletestart={{fn this.onAction "onDrawDeletestart"}} @onDrawEditstop={{fn this.onAction "onDrawEditstop"}} @onDrawControlCreated={{fn this.onAction "onDrawControlCreated"}} @onDrawFeatureGroupCreated={{fn this.onAction "onDrawFeatureGroupCreated"}} />
|
|
48
|
+
|
|
49
|
+
{{#each this.activeServiceAreas as |serviceArea|}}
|
|
50
|
+
<layers.polygon @id={{serviceArea.id}} @record={{serviceArea}} @locations={{serviceArea.bounds}} @fillColor={{serviceArea.color}} @color={{serviceArea.stroke_color}} @onAdd={{fn this.onAction "onServiceAreaLayerAdded" serviceArea}} as |polygon|>
|
|
51
|
+
<polygon.tooltip @permanent={{true}} @sticky={{true}}>{{serviceArea.name}} Service Area</polygon.tooltip>
|
|
52
|
+
</layers.polygon>
|
|
53
|
+
|
|
54
|
+
{{#each serviceArea.zones as |zone|}}
|
|
55
|
+
<layers.polygon @id={{zone.id}} @record={{zone}} @locations={{zone.locations}} @fillColor={{zone.color}} @color={{zone.stroke_color}} @onAdd={{fn this.onAction "onZoneLayerAdd" zone}} as |polygon|>
|
|
56
|
+
<polygon.tooltip @permanent={{true}} @sticky={{true}}>{{zone.name}} Zone</polygon.tooltip>
|
|
57
|
+
</layers.polygon>
|
|
58
|
+
{{/each}}
|
|
59
|
+
{{/each}}
|
|
60
|
+
|
|
61
|
+
{{yield layers}}
|
|
62
|
+
</LeafletMap>
|
|
63
|
+
</div>
|