@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,470 @@
|
|
|
1
|
+
import Controller from '@ember/controller';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import GeoJson from '@fleetbase/fleetops-data/utils/geojson/geo-json';
|
|
6
|
+
import FeatureCollection from '@fleetbase/fleetops-data/utils/geojson/feature-collection';
|
|
7
|
+
import last from '@fleetbase/ember-core/utils/last';
|
|
8
|
+
|
|
9
|
+
export default class OperationsZonesIndexController extends Controller {
|
|
10
|
+
/**
|
|
11
|
+
* Inject the `currentUser` service
|
|
12
|
+
*
|
|
13
|
+
* @var {Service}
|
|
14
|
+
*/
|
|
15
|
+
@service store;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Inject the `currentUser` service
|
|
19
|
+
*
|
|
20
|
+
* @var {Service}
|
|
21
|
+
*/
|
|
22
|
+
@service currentUser;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Inject the `modalsManager` service
|
|
26
|
+
*
|
|
27
|
+
* @var {Service}
|
|
28
|
+
*/
|
|
29
|
+
@service modalsManager;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Inject the `notifications` service
|
|
33
|
+
*
|
|
34
|
+
* @var {Service}
|
|
35
|
+
*/
|
|
36
|
+
@service notifications;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Inject the `hostRouter` service
|
|
40
|
+
*
|
|
41
|
+
* @var {Service}
|
|
42
|
+
*/
|
|
43
|
+
@service hostRouter;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Inject the `crud` service
|
|
47
|
+
*
|
|
48
|
+
* @var {Service}
|
|
49
|
+
*/
|
|
50
|
+
@service crud;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* True if the viewing an orders route preview.
|
|
54
|
+
*
|
|
55
|
+
* @var {L.Map}
|
|
56
|
+
*/
|
|
57
|
+
@tracked leafletMap;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The ActiveFeatureGroup
|
|
61
|
+
*
|
|
62
|
+
* @var {ActiveFeatureGroup}
|
|
63
|
+
*/
|
|
64
|
+
@tracked activeFeatureGroup;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* All active editable zone layers
|
|
68
|
+
*
|
|
69
|
+
* @var {Array}
|
|
70
|
+
*/
|
|
71
|
+
@tracked editableZones = [];
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* True to display draw controls on map.
|
|
75
|
+
*
|
|
76
|
+
* @var {Boolean}
|
|
77
|
+
*/
|
|
78
|
+
@tracked showDrawControl;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The active service area to focus.
|
|
82
|
+
*
|
|
83
|
+
* @var {ServiceAreaModel}
|
|
84
|
+
*/
|
|
85
|
+
@tracked activeServiceArea;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The users latitude based on whois lookup.
|
|
89
|
+
*
|
|
90
|
+
* @var {String}
|
|
91
|
+
*/
|
|
92
|
+
get userLatitude() {
|
|
93
|
+
const whois = this.currentUser.getOption('whois');
|
|
94
|
+
|
|
95
|
+
return whois.latitude || null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The users longitude based on whois lookup.
|
|
100
|
+
*
|
|
101
|
+
* @var {String}
|
|
102
|
+
*/
|
|
103
|
+
get userLongitude() {
|
|
104
|
+
const whois = this.currentUser.getOption('whois');
|
|
105
|
+
|
|
106
|
+
return whois.longitude || null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Sets a reference to the leaflet map onload
|
|
111
|
+
*
|
|
112
|
+
* @void
|
|
113
|
+
*/
|
|
114
|
+
@action
|
|
115
|
+
setMapReference(event) {
|
|
116
|
+
if (!event || !event.target) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
this.leafletMap = event.target;
|
|
121
|
+
|
|
122
|
+
// handle resize event now
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
this.leafletMap.invalidateSize();
|
|
125
|
+
}, 100);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Set the active feature group
|
|
130
|
+
*
|
|
131
|
+
* @param {ActiveFeatureGroup} activeFeatureGroup
|
|
132
|
+
* @param {LeafletMap} map
|
|
133
|
+
* @void
|
|
134
|
+
*/
|
|
135
|
+
@action
|
|
136
|
+
setFeatureGroup(activeFeatureGroup, map) {
|
|
137
|
+
this.activeFeatureGroup = activeFeatureGroup;
|
|
138
|
+
this.leafletMap = map;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Enable zone editing for the passed ServiceArea.
|
|
143
|
+
*
|
|
144
|
+
* @param {ServiceAreaModel} serviceArea
|
|
145
|
+
*/
|
|
146
|
+
@action
|
|
147
|
+
startZoneEditing(serviceArea) {
|
|
148
|
+
this.activeServiceArea = serviceArea;
|
|
149
|
+
this.showDrawControl = true;
|
|
150
|
+
|
|
151
|
+
let bounds = serviceArea.bounds;
|
|
152
|
+
|
|
153
|
+
this.leafletMap.setMaxBounds(bounds);
|
|
154
|
+
this.leafletMap.flyToBounds(bounds);
|
|
155
|
+
this.notifications.info('Use the draw controls to the left to define, edit, or delete zones within your service area, your zone is not limited to the bounds of your service area.');
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Adds a new layer to the ActiveFeatureGroup
|
|
160
|
+
*
|
|
161
|
+
* @param {ZoneModel} zone
|
|
162
|
+
* @void
|
|
163
|
+
*/
|
|
164
|
+
@action
|
|
165
|
+
makeZoneEditable(zone, { target }) {
|
|
166
|
+
if (this.editableZones.includes(target) || !this.activeFeatureGroup || this.activeFeatureGroup.hasLayer(target)) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
target._zone_id = zone.id || 'new_zone';
|
|
171
|
+
|
|
172
|
+
this.editableZones.pushObject(target);
|
|
173
|
+
this.activeFeatureGroup.addLayer(target);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Save changes made to zone coordinates.
|
|
178
|
+
*
|
|
179
|
+
* @param {Event} event
|
|
180
|
+
* @void
|
|
181
|
+
*/
|
|
182
|
+
@action
|
|
183
|
+
saveZoneCoordinateChanges(event, _layer) {
|
|
184
|
+
const serviceArea = this.activeServiceArea;
|
|
185
|
+
|
|
186
|
+
if (!serviceArea) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// get all layers
|
|
191
|
+
const layers = Object.values(_layer._layers);
|
|
192
|
+
|
|
193
|
+
// iterate and get zone model
|
|
194
|
+
for (let i = 0; i < layers.length; i++) {
|
|
195
|
+
const layer = layers[i];
|
|
196
|
+
|
|
197
|
+
if (!layer._boundary_id) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// peek boundary to destroy
|
|
202
|
+
const zone = this.store.peekRecord('zone', layer._zone_id);
|
|
203
|
+
|
|
204
|
+
if (zone) {
|
|
205
|
+
const geoJson = layer.toGeoJSON();
|
|
206
|
+
const border = new GeoJson(geoJson.geometry);
|
|
207
|
+
|
|
208
|
+
zone.border = border;
|
|
209
|
+
zone.save();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Delete boundaries selected in layers
|
|
216
|
+
*
|
|
217
|
+
* @param {Event} event
|
|
218
|
+
* @void
|
|
219
|
+
*/
|
|
220
|
+
@action
|
|
221
|
+
deleteZoneBorders({ layers }) {
|
|
222
|
+
const serviceArea = this.activeServiceArea;
|
|
223
|
+
|
|
224
|
+
if (!serviceArea) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// get current zones for service area
|
|
229
|
+
const zones = serviceArea.zones || [];
|
|
230
|
+
|
|
231
|
+
// get array of layers to delete
|
|
232
|
+
layers = Array.from(layers.getLayers());
|
|
233
|
+
|
|
234
|
+
// iterate and get zone model
|
|
235
|
+
for (let i = 0; i < layers.length; i++) {
|
|
236
|
+
const layer = layers[i];
|
|
237
|
+
|
|
238
|
+
if (!layer._zone_id) {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// peek zone to destroy
|
|
243
|
+
const zone = this.store.peekRecord('boundary', layer._zone_id);
|
|
244
|
+
|
|
245
|
+
if (zone) {
|
|
246
|
+
zones.removeObject(zone);
|
|
247
|
+
zone.destroyRecord();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@action
|
|
253
|
+
createZoneFromLayer(event, layer) {
|
|
254
|
+
const serviceArea = this.activeServiceArea;
|
|
255
|
+
|
|
256
|
+
if (!serviceArea) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const leafletLayerGeoJson = layer.toGeoJSON();
|
|
261
|
+
const featureCollection = new FeatureCollection(leafletLayerGeoJson);
|
|
262
|
+
const feature = last(featureCollection.features);
|
|
263
|
+
const border = new GeoJson(feature.geometry);
|
|
264
|
+
|
|
265
|
+
return this.createZone({
|
|
266
|
+
service_area_uuid: serviceArea.id,
|
|
267
|
+
border,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Create a new `zone` in modal
|
|
273
|
+
*
|
|
274
|
+
* @param {Object} options
|
|
275
|
+
* @void
|
|
276
|
+
*/
|
|
277
|
+
@action
|
|
278
|
+
createZone(attrs = {}) {
|
|
279
|
+
const zone = this.store.createRecord('zone', attrs);
|
|
280
|
+
|
|
281
|
+
return this.editZone(zone, {
|
|
282
|
+
title: 'New Zone',
|
|
283
|
+
acceptButtonText: 'Confirm & Create',
|
|
284
|
+
successNotification: (zone) => `New zone (${zone.name}) successfully created.`,
|
|
285
|
+
onConfirm: () => {
|
|
286
|
+
// make sure to push zone to serviceArea model
|
|
287
|
+
let serviceArea = this.store.peekRecord('service-area', zone.service_area_uuid);
|
|
288
|
+
|
|
289
|
+
if (serviceArea) {
|
|
290
|
+
serviceArea.zones.pushObject(zone);
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Edit a `zone` details
|
|
298
|
+
*
|
|
299
|
+
* @param {ZoneModel} zone
|
|
300
|
+
* @param {Object} options
|
|
301
|
+
* @void
|
|
302
|
+
*/
|
|
303
|
+
@action
|
|
304
|
+
editZone(zone, options = {}) {
|
|
305
|
+
this.modalsManager.show('modals/zone-form', {
|
|
306
|
+
title: 'Edit Zone',
|
|
307
|
+
acceptButtonText: 'Save Changes',
|
|
308
|
+
zone,
|
|
309
|
+
confirm: (modal) => {
|
|
310
|
+
modal.startLoading();
|
|
311
|
+
|
|
312
|
+
return zone.save().then((zone) => {
|
|
313
|
+
if (typeof options.successNotification === 'function') {
|
|
314
|
+
this.notifications.success(options.successNotification(zone));
|
|
315
|
+
} else {
|
|
316
|
+
this.notifications.success(options.successNotification || `${zone.name} details updated.`);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
},
|
|
320
|
+
...options,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Delete a `zone` via confirm prompt
|
|
326
|
+
*
|
|
327
|
+
* @param {ZoneModel} zone
|
|
328
|
+
* @param {Object} options
|
|
329
|
+
* @void
|
|
330
|
+
*/
|
|
331
|
+
@action
|
|
332
|
+
deleteZone(zone, options = {}) {
|
|
333
|
+
this.crud.delete(zone, {
|
|
334
|
+
...options,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Edit a `zone` border coordinates.
|
|
340
|
+
*
|
|
341
|
+
* @param {ZoneModel} zone
|
|
342
|
+
* @param {Object} options
|
|
343
|
+
* @void
|
|
344
|
+
*/
|
|
345
|
+
@action
|
|
346
|
+
editZoneBorder() {}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Create a new `serviceArea` in modal
|
|
350
|
+
*
|
|
351
|
+
* @param {Object} options
|
|
352
|
+
* @void
|
|
353
|
+
*/
|
|
354
|
+
@action
|
|
355
|
+
createServiceArea() {
|
|
356
|
+
const serviceArea = this.store.createRecord('service-area', {
|
|
357
|
+
status: 'active',
|
|
358
|
+
type: 'country',
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
return this.editServiceArea(serviceArea, {
|
|
362
|
+
title: 'New Service Area',
|
|
363
|
+
acceptButtonText: 'Confirm & Create',
|
|
364
|
+
successNotification: (serviceArea) => `New service area (${serviceArea.name}) created.`,
|
|
365
|
+
onConfirm: () => {
|
|
366
|
+
this.hostRouter.refresh();
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Edit a `serviceArea` details
|
|
373
|
+
*
|
|
374
|
+
* @param {ServiceAreaModel} serviceArea
|
|
375
|
+
* @param {Object} options
|
|
376
|
+
* @void
|
|
377
|
+
*/
|
|
378
|
+
@action
|
|
379
|
+
editServiceArea(serviceArea, options = {}) {
|
|
380
|
+
this.modalsManager.show('modals/service-area-form', {
|
|
381
|
+
title: 'Edit Service Area',
|
|
382
|
+
acceptButtonText: 'Save Changes',
|
|
383
|
+
serviceArea,
|
|
384
|
+
confirm: (modal) => {
|
|
385
|
+
modal.startLoading();
|
|
386
|
+
|
|
387
|
+
return serviceArea.save().then((serviceArea) => {
|
|
388
|
+
if (typeof options.successNotification === 'function') {
|
|
389
|
+
this.notifications.success(options.successNotification(serviceArea));
|
|
390
|
+
} else {
|
|
391
|
+
this.notifications.success(options.successNotification || `${serviceArea.name} details updated.`);
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
...options,
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Rename a `serviceArea` details
|
|
401
|
+
*
|
|
402
|
+
* @param {ServiceAreaModel} serviceArea
|
|
403
|
+
* @param {Object} options
|
|
404
|
+
* @void
|
|
405
|
+
*/
|
|
406
|
+
@action
|
|
407
|
+
renameServiceArea(serviceArea, options = {}) {
|
|
408
|
+
this.modalsManager.show('modals/service-area-form', {
|
|
409
|
+
title: 'Rename Service Area',
|
|
410
|
+
acceptButtonText: 'Save Changes',
|
|
411
|
+
rename: true,
|
|
412
|
+
serviceArea,
|
|
413
|
+
confirm: (modal) => {
|
|
414
|
+
modal.startLoading();
|
|
415
|
+
|
|
416
|
+
return serviceArea.save().then((serviceArea) => {
|
|
417
|
+
if (typeof options.successNotification === 'function') {
|
|
418
|
+
this.notifications.success(options.successNotification(serviceArea));
|
|
419
|
+
} else {
|
|
420
|
+
this.notifications.success(options.successNotification || `${serviceArea.name} renamed.`);
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
},
|
|
424
|
+
...options,
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Delete a `serviceArea` via confirm prompt
|
|
430
|
+
*
|
|
431
|
+
* @param {ServiceAreaModel} serviceArea
|
|
432
|
+
* @param {Object} options
|
|
433
|
+
* @void
|
|
434
|
+
*/
|
|
435
|
+
@action
|
|
436
|
+
deleteServiceArea(serviceArea, options = {}) {
|
|
437
|
+
// if the service area being deleted is active untoggle
|
|
438
|
+
if (serviceArea === this.activeServiceArea) {
|
|
439
|
+
this.activeServiceArea = null;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
this.crud.delete(serviceArea, {
|
|
443
|
+
...options,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
@action moveToCurrentLocation() {
|
|
448
|
+
// eslint-disable-next-line no-undef
|
|
449
|
+
if (window.navigator && window.navigator.geolocation) {
|
|
450
|
+
// eslint-disable-next-line no-undef
|
|
451
|
+
return navigator.geolocation.getCurrentPosition(
|
|
452
|
+
({ coords }) => {
|
|
453
|
+
const { latitude, longitude } = coords;
|
|
454
|
+
|
|
455
|
+
this.leafletMap.flyTo([latitude, longitude]);
|
|
456
|
+
},
|
|
457
|
+
() => {
|
|
458
|
+
this.notifications.error('Unable to move to current location.');
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
@action handleMapResize(options = {}, container) {
|
|
465
|
+
const element = this.leafletMap._container;
|
|
466
|
+
|
|
467
|
+
element.style.width = `${container.offsetWidth - (options.horizontalLeftPadding || 0) - (options.horizontalRightPadding || 0)}px`;
|
|
468
|
+
element.style.height = `${container.offsetHeight - (options.verticalTopPadding || 0) - (options.verticalBottomPadding || 0)}px`;
|
|
469
|
+
}
|
|
470
|
+
}
|
package/addon/engine.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Engine from '@ember/engine';
|
|
2
|
+
import loadInitializers from 'ember-load-initializers';
|
|
3
|
+
import Resolver from 'ember-resolver';
|
|
4
|
+
import config from './config/environment';
|
|
5
|
+
import services from '@fleetbase/ember-core/exports/services';
|
|
6
|
+
|
|
7
|
+
const { modulePrefix } = config;
|
|
8
|
+
const externalRoutes = ['console', 'extensions'];
|
|
9
|
+
|
|
10
|
+
export default class FleetOpsEngine extends Engine {
|
|
11
|
+
modulePrefix = modulePrefix;
|
|
12
|
+
Resolver = Resolver;
|
|
13
|
+
dependencies = {
|
|
14
|
+
services,
|
|
15
|
+
externalRoutes,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
loadInitializers(FleetOpsEngine, modulePrefix);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
|
|
3
|
+
export default helper(function avatarUrl([url, defaultUrl = 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/no-avatar.png']) {
|
|
4
|
+
if (typeof url === 'string') {
|
|
5
|
+
return url;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
return defaultUrl;
|
|
9
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import extractCoordinatesUtil from '../utils/extract-coordinates';
|
|
3
|
+
|
|
4
|
+
export default helper(function extractCoordinates([coordinates = [], format = 'latlng']) {
|
|
5
|
+
return extractCoordinatesUtil(coordinates, format);
|
|
6
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
/* global L */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Leaflet FeatureGroup
|
|
6
|
+
* More information about its possible options [here](https://leafletjs.com/SlavaUkraini/reference.html#featuregroup).
|
|
7
|
+
*
|
|
8
|
+
* @function featureGroup
|
|
9
|
+
* @param {Array} layers the layers to add
|
|
10
|
+
* @return {FeatureGroup}
|
|
11
|
+
*/
|
|
12
|
+
export default helper(function featureGroup(params) {
|
|
13
|
+
return L.featureGroup(params);
|
|
14
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
|
|
3
|
+
export default helper(function flowRawStatus([status]) {
|
|
4
|
+
if (!status || typeof status !== 'string') {
|
|
5
|
+
return '';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (status.includes('|')) {
|
|
9
|
+
return status.slice(status.indexOf('|') + 1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return status;
|
|
13
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import { isArray } from '@ember/array';
|
|
3
|
+
import extractCoordinates from '../utils/extract-coordinates';
|
|
4
|
+
|
|
5
|
+
export default helper(function formatPoint([point]) {
|
|
6
|
+
if (isArray(point)) {
|
|
7
|
+
return `(${point[0]}, ${point[1]})`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const [latitude, longitude] = extractCoordinates(point.coordinates);
|
|
11
|
+
|
|
12
|
+
return `(${latitude}, ${longitude})`;
|
|
13
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import calculatePercentage from '../utils/calculate-percentage';
|
|
3
|
+
import formatCurrency from '../utils/format-currency';
|
|
4
|
+
|
|
5
|
+
export default helper(function getTipAmount([tip, subtotal, format = false]) {
|
|
6
|
+
let tipAmount = 0;
|
|
7
|
+
|
|
8
|
+
if (typeof tip === 'string' && tip.endsWith('%')) {
|
|
9
|
+
tipAmount = calculatePercentage(parseInt(tip), subtotal);
|
|
10
|
+
} else {
|
|
11
|
+
tipAmount = tip;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (format !== false) {
|
|
15
|
+
return formatCurrency(tipAmount, format);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return tipAmount;
|
|
19
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, isActiveRoute } from '@fleetbase/console/helpers/is-active-route';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import isFacilitatorSupportedPlaceUtil from '../utils/is-facilitator-supported-place';
|
|
3
|
+
|
|
4
|
+
export default helper(function isFacilitatorSupportedPlace([facilitator, place]) {
|
|
5
|
+
return isFacilitatorSupportedPlaceUtil(facilitator, place);
|
|
6
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import isFacilitatorSupportedPlaceUtil from '../utils/is-facilitator-supported-place';
|
|
3
|
+
|
|
4
|
+
export default helper(function isNotFacilitatorSupportedPlace([facilitator, place]) {
|
|
5
|
+
return !isFacilitatorSupportedPlaceUtil(facilitator, place);
|
|
6
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import Point from '../utils/geojson/point';
|
|
3
|
+
|
|
4
|
+
export default helper(function pointCoordinates([point]) {
|
|
5
|
+
if (point instanceof Point) {
|
|
6
|
+
return `${point.coordinates[1]} ${point.coordinates[0]}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return 'Invalid coordinates';
|
|
10
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { helper } from '@ember/component/helper';
|
|
2
|
+
import extractCoordinates from '../utils/extract-coordinates';
|
|
3
|
+
|
|
4
|
+
export default helper(function pointToCoordinates([point, format = 'array']) {
|
|
5
|
+
const [latitude, longitude] = extractCoordinates(point?.coordinates);
|
|
6
|
+
|
|
7
|
+
if (format === 'array') {
|
|
8
|
+
return [latitude, longitude];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (format === 'latitudelongitude') {
|
|
12
|
+
return { latitude, longitude };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (format === 'latlng') {
|
|
16
|
+
return {
|
|
17
|
+
lat: latitude,
|
|
18
|
+
lng: longitude,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (format === 'xy') {
|
|
23
|
+
return {
|
|
24
|
+
x: latitude,
|
|
25
|
+
y: longitude,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, waypointLabel } from '@fleetbase/console/helpers/waypoint-label';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LeafletDrawControl from '../components/leaflet-draw-control';
|
|
2
|
+
|
|
3
|
+
export function initialize(owner) {
|
|
4
|
+
let emberLeafletService = owner.lookup('service:ember-leaflet');
|
|
5
|
+
|
|
6
|
+
if (emberLeafletService) {
|
|
7
|
+
// we then invoke the `registerComponent` method
|
|
8
|
+
emberLeafletService.registerComponent('leaflet-draw-control', {
|
|
9
|
+
as: 'draw-control',
|
|
10
|
+
component: LeafletDrawControl,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
initialize,
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LeafletRotatedMarkerComponent from '../components/leaflet-rotated-marker';
|
|
2
|
+
|
|
3
|
+
export function initialize(owner) {
|
|
4
|
+
let emberLeafletService = owner.lookup('service:ember-leaflet');
|
|
5
|
+
|
|
6
|
+
if (emberLeafletService) {
|
|
7
|
+
// we then invoke the `registerComponent` method
|
|
8
|
+
emberLeafletService.registerComponent('leaflet-rotated-marker', {
|
|
9
|
+
as: 'rotated-marker',
|
|
10
|
+
component: LeafletRotatedMarkerComponent,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
initialize,
|
|
17
|
+
};
|