@fleetbase/fleetops-engine 0.6.9 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/addon/components/admin/navigator-app.js +1 -1
- package/addon/components/custom-field-form-panel.js +1 -1
- package/addon/components/driver-onboard-settings.js +1 -1
- package/addon/components/driver-panel/orders.js +1 -1
- package/addon/components/edit-order-route-panel.js +1 -1
- package/addon/components/entity-field-editing-settings.js +1 -1
- package/addon/components/fleet-driver-listing.js +1 -2
- package/addon/components/fleet-panel/driver-listing.js +1 -2
- package/addon/components/fleet-panel/vehicle-listing.js +1 -2
- package/addon/components/fleet-vehicle-listing.js +1 -2
- package/addon/components/layout/fleet-ops-sidebar/driver-listing.js +1 -1
- package/addon/components/layout/fleet-ops-sidebar/fleet-listing.js +1 -1
- package/addon/components/live-map.js +1 -1
- package/addon/components/map-container/toolbar/zones-panel.js +1 -1
- package/addon/components/order-config-manager/activity-flow.js +1 -1
- package/addon/components/order-config-manager/custom-fields.js +1 -1
- package/addon/components/order-config-manager/entities.js +1 -1
- package/addon/components/order-config-manager.js +1 -1
- package/addon/components/vendor-panel/drivers.js +1 -2
- package/addon/components/widget/fleet-ops-key-metrics.js +1 -1
- package/addon/controllers/management/contacts/index.js +1 -2
- package/addon/controllers/management/drivers/index.js +1 -2
- package/addon/controllers/management/fleets/index.js +1 -2
- package/addon/controllers/management/fuel-reports/index.js +1 -2
- package/addon/controllers/management/issues/index.js +1 -2
- package/addon/controllers/management/vehicles/index.js +1 -2
- package/addon/controllers/management/vendors/index.js +1 -2
- package/addon/controllers/operations/orders/index/new.js +40 -48
- package/addon/controllers/operations/orders/index/view.js +1 -1
- package/addon/controllers/operations/orders/index.js +1 -2
- package/addon/controllers/operations/service-rates/index.js +1 -2
- package/addon/services/order-creation.js +1 -1
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +2 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
|
-
import { task } from 'ember-concurrency
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
5
|
|
|
6
6
|
export default class NavigatorAppControlsComponent extends Component {
|
|
7
7
|
@service fetch;
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { dasherize, camelize } from '@ember/string';
|
|
6
|
-
import { task } from 'ember-concurrency
|
|
6
|
+
import { task } from 'ember-concurrency';
|
|
7
7
|
import isObject from '@fleetbase/ember-core/utils/is-object';
|
|
8
8
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
9
|
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
|
-
import { task } from 'ember-concurrency
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
6
6
|
|
|
7
7
|
export default class DriverOnboardSettingsComponent extends Component {
|
|
8
8
|
@service fetch;
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action, computed } from '@ember/object';
|
|
5
|
-
import { task } from 'ember-concurrency
|
|
5
|
+
import { task } from 'ember-concurrency';
|
|
6
6
|
|
|
7
7
|
export default class CustomerOrderHistoryComponent extends Component {
|
|
8
8
|
@service store;
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
4
|
import { inject as service } from '@ember/service';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
|
-
import { task } from 'ember-concurrency
|
|
6
|
+
import { task } from 'ember-concurrency';
|
|
7
7
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
8
8
|
import applyContextComponentArguments from '@fleetbase/ember-core/utils/apply-context-component-arguments';
|
|
9
9
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
@@ -4,7 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { isNone } from '@ember/utils';
|
|
7
|
-
import { task } from 'ember-concurrency
|
|
7
|
+
import { task } from 'ember-concurrency';
|
|
8
8
|
|
|
9
9
|
export default class EntityFieldEditingSettingsComponent extends Component {
|
|
10
10
|
@service notifications;
|
|
@@ -4,8 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action, computed } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { isBlank } from '@ember/utils';
|
|
7
|
-
import { timeout } from 'ember-concurrency';
|
|
8
|
-
import { task } from 'ember-concurrency-decorators';
|
|
7
|
+
import { timeout, task } from 'ember-concurrency';
|
|
9
8
|
|
|
10
9
|
export default class FleetDriverListingComponent extends Component {
|
|
11
10
|
@service store;
|
|
@@ -3,8 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { isBlank } from '@ember/utils';
|
|
5
5
|
import { action, set } from '@ember/object';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
8
|
|
|
10
9
|
export default class FleetPanelDriverListingComponent extends Component {
|
|
@@ -3,8 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { isBlank } from '@ember/utils';
|
|
5
5
|
import { action, set } from '@ember/object';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
8
|
|
|
10
9
|
export default class FleetPanelVehicleListingComponent extends Component {
|
|
@@ -4,8 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action, computed } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { isBlank } from '@ember/utils';
|
|
7
|
-
import { timeout } from 'ember-concurrency';
|
|
8
|
-
import { task } from 'ember-concurrency-decorators';
|
|
7
|
+
import { timeout, task } from 'ember-concurrency';
|
|
9
8
|
|
|
10
9
|
export default class FleetVehicleListingComponent extends Component {
|
|
11
10
|
@service store;
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { later } from '@ember/runloop';
|
|
6
|
-
import { task } from 'ember-concurrency
|
|
6
|
+
import { task } from 'ember-concurrency';
|
|
7
7
|
|
|
8
8
|
export default class LayoutFleetOpsSidebarDriverListingComponent extends Component {
|
|
9
9
|
@service store;
|
|
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { later } from '@ember/runloop';
|
|
6
|
-
import { task } from 'ember-concurrency
|
|
6
|
+
import { task } from 'ember-concurrency';
|
|
7
7
|
|
|
8
8
|
export default class LayoutFleetOpsSidebarFleetListingComponent extends Component {
|
|
9
9
|
@service store;
|
|
@@ -8,7 +8,7 @@ import { singularize } from 'ember-inflector';
|
|
|
8
8
|
import { later } from '@ember/runloop';
|
|
9
9
|
import { debug } from '@ember/debug';
|
|
10
10
|
import { allSettled } from 'rsvp';
|
|
11
|
-
import { task } from 'ember-concurrency
|
|
11
|
+
import { task } from 'ember-concurrency';
|
|
12
12
|
import { OSRMv1, Control as RoutingControl } from '@fleetbase/leaflet-routing-machine';
|
|
13
13
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
14
14
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
@@ -5,7 +5,7 @@ import { action } from '@ember/object';
|
|
|
5
5
|
import { later } from '@ember/runloop';
|
|
6
6
|
import { classify } from '@ember/string';
|
|
7
7
|
import { calculateInPlacePosition } from 'ember-basic-dropdown/utils/calculate-position';
|
|
8
|
-
import { task } from 'ember-concurrency
|
|
8
|
+
import { task } from 'ember-concurrency';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @class MapContainerToolbarZonesPanelComponent
|
|
@@ -7,7 +7,7 @@ import { action } from '@ember/object';
|
|
|
7
7
|
import { isArray } from '@ember/array';
|
|
8
8
|
import { later } from '@ember/runloop';
|
|
9
9
|
import { debug } from '@ember/debug';
|
|
10
|
-
import { task } from 'ember-concurrency
|
|
10
|
+
import { task } from 'ember-concurrency';
|
|
11
11
|
import generateUUID from '@fleetbase/ember-core/utils/generate-uuid';
|
|
12
12
|
import createFlowActivity from '../../utils/create-flow-activity';
|
|
13
13
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
@@ -4,7 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { later } from '@ember/runloop';
|
|
7
|
-
import { task } from 'ember-concurrency
|
|
7
|
+
import { task } from 'ember-concurrency';
|
|
8
8
|
import isObject from '@fleetbase/ember-core/utils/is-object';
|
|
9
9
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { inject as service } from '@ember/service';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isArray } from '@ember/array';
|
|
6
6
|
import { later } from '@ember/runloop';
|
|
7
|
-
import { task } from 'ember-concurrency
|
|
7
|
+
import { task } from 'ember-concurrency';
|
|
8
8
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
9
9
|
import ObjectProxy from '@ember/object/proxy';
|
|
10
10
|
import createCustomEntity from '../../utils/create-custom-entity';
|
|
@@ -6,7 +6,7 @@ import { inject as service } from '@ember/service';
|
|
|
6
6
|
import { action } from '@ember/object';
|
|
7
7
|
import { isArray } from '@ember/array';
|
|
8
8
|
import { dasherize } from '@ember/string';
|
|
9
|
-
import { task } from 'ember-concurrency
|
|
9
|
+
import { task } from 'ember-concurrency';
|
|
10
10
|
import isModel from '@fleetbase/ember-core/utils/is-model';
|
|
11
11
|
import getModelName from '@fleetbase/ember-core/utils/get-model-name';
|
|
12
12
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
@@ -3,8 +3,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
4
|
import { isBlank } from '@ember/utils';
|
|
5
5
|
import { action, set } from '@ember/object';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
import contextComponentCallback from '@fleetbase/ember-core/utils/context-component-callback';
|
|
9
8
|
|
|
10
9
|
export default class VendorPanelDriversComponent extends Component {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { inject as service } from '@ember/service';
|
|
4
|
-
import { task } from 'ember-concurrency
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
5
|
|
|
6
6
|
export default class WidgetFleetOpsKeyMetricsComponent extends Component {
|
|
7
7
|
/**
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
|
|
9
8
|
export default class ManagementContactsIndexController extends BaseController {
|
|
10
9
|
@service store;
|
|
@@ -4,8 +4,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
6
|
import { equal } from '@ember/object/computed';
|
|
7
|
-
import { timeout } from 'ember-concurrency';
|
|
8
|
-
import { task } from 'ember-concurrency-decorators';
|
|
7
|
+
import { timeout, task } from 'ember-concurrency';
|
|
9
8
|
|
|
10
9
|
export default class ManagementDriversIndexController extends BaseController {
|
|
11
10
|
@service notifications;
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
|
|
9
8
|
export default class ManagementFleetsIndexController extends BaseController {
|
|
10
9
|
@service notifications;
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
|
|
9
8
|
export default class ManagementFuelReportsIndexController extends BaseController {
|
|
10
9
|
@service notifications;
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/object';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
import getIssueTypes from '../../../utils/get-issue-types';
|
|
9
8
|
import getIssueCategories from '../../../utils/get-issue-categories';
|
|
10
9
|
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
|
|
9
8
|
export default class ManagementVehiclesIndexController extends BaseController {
|
|
10
9
|
@service contextPanel;
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
import getVendorStatusOptions from '../../../utils/get-vendor-status-options';
|
|
9
8
|
|
|
10
9
|
export default class ManagementVendorsIndexController extends BaseController {
|
|
@@ -8,11 +8,10 @@ import { isArray } from '@ember/array';
|
|
|
8
8
|
import { isBlank } from '@ember/utils';
|
|
9
9
|
import { dasherize } from '@ember/string';
|
|
10
10
|
import { next } from '@ember/runloop';
|
|
11
|
-
import { task } from 'ember-concurrency
|
|
11
|
+
import { task } from 'ember-concurrency';
|
|
12
12
|
import { OSRMv1, Control as RoutingControl } from '@fleetbase/leaflet-routing-machine';
|
|
13
13
|
import { debug } from '@ember/debug';
|
|
14
14
|
import polyline from '@fleetbase/ember-core/utils/polyline';
|
|
15
|
-
import findClosestWaypoint from '@fleetbase/ember-core/utils/find-closest-waypoint';
|
|
16
15
|
import isNotEmpty from '@fleetbase/ember-core/utils/is-not-empty';
|
|
17
16
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
18
17
|
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
@@ -939,66 +938,59 @@ export default class OperationsOrdersIndexNewController extends BaseController {
|
|
|
939
938
|
@task *optimizeRoute() {
|
|
940
939
|
this.isOptimizingRoute = true;
|
|
941
940
|
|
|
941
|
+
// Build the coordinate list we’ll send to OSRM
|
|
942
942
|
const driverAssigned = this.order.driver_assigned;
|
|
943
|
-
const driverPosition = driverAssigned
|
|
944
|
-
const
|
|
943
|
+
const driverPosition = driverAssigned?.location?.coordinates; // [lon,lat] | undefined
|
|
944
|
+
const originalCoords = this.getCoordinatesFromPayload(); // [[lon,lat], …]
|
|
945
|
+
const coordinates = driverPosition ? [driverPosition, ...originalCoords] : [...originalCoords];
|
|
946
|
+
const hasDriverStart = Boolean(driverPosition);
|
|
947
|
+
const source = hasDriverStart ? 'first' : 'any';
|
|
948
|
+
const destination = 'any';
|
|
949
|
+
const roundtrip = false; // don’t loop back
|
|
945
950
|
const routingHost = getRoutingHost(this.payload, this.waypoints);
|
|
946
951
|
|
|
947
|
-
|
|
948
|
-
let coordinates = [...originalCoordinates]; // clone
|
|
949
|
-
|
|
950
|
-
let source = 'any';
|
|
951
|
-
let destination = 'any';
|
|
952
|
-
let hasDriverStart = false;
|
|
953
|
-
|
|
954
|
-
// Inject driver location as starting point if available
|
|
955
|
-
if (driverPosition && Array.isArray(driverPosition) && driverPosition.length === 2) {
|
|
956
|
-
coordinates.unshift([driverPosition[0], driverPosition[1]]);
|
|
957
|
-
source = 'first';
|
|
958
|
-
hasDriverStart = true;
|
|
959
|
-
}
|
|
960
|
-
|
|
952
|
+
// Call the OSRM /trip service
|
|
961
953
|
try {
|
|
962
|
-
const response = yield this.fetch.routing(coordinates, { source, destination, annotations: true }, { host: routingHost });
|
|
954
|
+
const response = yield this.fetch.routing(coordinates, { source, destination, roundtrip, annotations: true }, { host: routingHost });
|
|
963
955
|
|
|
964
|
-
if (response?.code
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
this.clearLayers();
|
|
956
|
+
if (response?.code !== 'Ok') {
|
|
957
|
+
throw new Error(`OSRM error: ${response?.code}`);
|
|
958
|
+
}
|
|
968
959
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
const responseWaypoints = response.waypoints || [];
|
|
960
|
+
// Pair each OSRM waypoint with its Waypoint model
|
|
961
|
+
const modelsByInputIndex = hasDriverStart ? [null, ...this.waypoints] : this.waypoints;
|
|
972
962
|
|
|
973
|
-
|
|
963
|
+
const pairs = response.waypoints.map((wp, idx) => ({
|
|
964
|
+
model: modelsByInputIndex[idx], // Ember model or null (driver)
|
|
965
|
+
wp,
|
|
966
|
+
}));
|
|
974
967
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
if (hasDriverStart && i === 0) {
|
|
978
|
-
continue;
|
|
979
|
-
}
|
|
968
|
+
// Drop the driver start if present
|
|
969
|
+
const payloadPairs = hasDriverStart ? pairs.slice(1) : pairs;
|
|
980
970
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
const lng = wp.location[0];
|
|
971
|
+
// Sort by the optimised order
|
|
972
|
+
payloadPairs.sort((a, b) => a.wp.waypoint_index - b.wp.waypoint_index);
|
|
984
973
|
|
|
985
|
-
|
|
974
|
+
// Extract the Ember models (null-safe)
|
|
975
|
+
const sortedWaypoints = payloadPairs.map((p) => p.model).filter(Boolean);
|
|
986
976
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
977
|
+
// Update map layers & UI
|
|
978
|
+
this.removeRoutingControlPreview();
|
|
979
|
+
this.removeOptimizedRoute(this.leafletMap);
|
|
980
|
+
this.clearLayers();
|
|
991
981
|
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
this.previewDraftOrderRoute(this.payload, this.waypoints, this.isMultipleDropoffOrder);
|
|
995
|
-
this.updatePayloadCoordinates();
|
|
982
|
+
const trip = response.trips?.[0];
|
|
983
|
+
const route = polyline.decode(trip.geometry); // [[lat,lon], …]
|
|
996
984
|
|
|
997
|
-
|
|
985
|
+
this.waypoints = sortedWaypoints;
|
|
986
|
+
this.setOptimizedRoute(route, trip, response.waypoints);
|
|
987
|
+
this.previewDraftOrderRoute(this.payload, this.waypoints, this.isMultipleDropoffOrder);
|
|
988
|
+
this.updatePayloadCoordinates();
|
|
998
989
|
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
990
|
+
this.order.set('is_route_optimized', true);
|
|
991
|
+
|
|
992
|
+
if (this.isUsingIntegratedVendor) {
|
|
993
|
+
this.getQuotes();
|
|
1002
994
|
}
|
|
1003
995
|
} catch (err) {
|
|
1004
996
|
debug('Error optimizing route', err);
|
|
@@ -5,7 +5,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
5
5
|
import { action, computed } from '@ember/object';
|
|
6
6
|
import { later } from '@ember/runloop';
|
|
7
7
|
import { not, notEmpty, alias } from '@ember/object/computed';
|
|
8
|
-
import { task } from 'ember-concurrency
|
|
8
|
+
import { task } from 'ember-concurrency';
|
|
9
9
|
import { OSRMv1, Control as RoutingControl } from '@fleetbase/leaflet-routing-machine';
|
|
10
10
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
11
11
|
|
|
@@ -6,8 +6,7 @@ import { equal } from '@ember/object/computed';
|
|
|
6
6
|
import { debug } from '@ember/debug';
|
|
7
7
|
import { isArray } from '@ember/array';
|
|
8
8
|
import { isBlank } from '@ember/utils';
|
|
9
|
-
import { timeout } from 'ember-concurrency';
|
|
10
|
-
import { task } from 'ember-concurrency-decorators';
|
|
9
|
+
import { timeout, task } from 'ember-concurrency';
|
|
11
10
|
|
|
12
11
|
export default class OperationsOrdersIndexController extends BaseController {
|
|
13
12
|
@service currentUser;
|
|
@@ -3,8 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { isBlank } from '@ember/utils';
|
|
6
|
-
import { timeout } from 'ember-concurrency';
|
|
7
|
-
import { task } from 'ember-concurrency-decorators';
|
|
6
|
+
import { timeout, task } from 'ember-concurrency';
|
|
8
7
|
|
|
9
8
|
export default class OperationsServiceRatesIndexController extends BaseController {
|
|
10
9
|
@service store;
|
|
@@ -6,7 +6,7 @@ import { tracked } from '@glimmer/tracking';
|
|
|
6
6
|
// import { isBlank } from '@ember/utils';
|
|
7
7
|
// import { dasherize } from '@ember/string';
|
|
8
8
|
// import { later, next } from '@ember/runloop';
|
|
9
|
-
// import { task } from 'ember-concurrency
|
|
9
|
+
// import { task } from 'ember-concurrency';
|
|
10
10
|
// import { OSRMv1, Control as RoutingControl } from '@fleetbase/leaflet-routing-machine';
|
|
11
11
|
// import polyline from '@fleetbase/ember-core/utils/polyline';
|
|
12
12
|
// import findClosestWaypoint from '@fleetbase/ember-core/utils/find-closest-waypoint';
|
package/composer.json
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -87,8 +87,7 @@
|
|
|
87
87
|
"ember-cli-sri": "^2.1.1",
|
|
88
88
|
"ember-cli-terser": "^4.0.2",
|
|
89
89
|
"ember-composable-helpers": "^5.0.0",
|
|
90
|
-
"ember-concurrency": "^
|
|
91
|
-
"ember-concurrency-decorators": "^2.0.3",
|
|
90
|
+
"ember-concurrency": "^4.0.4",
|
|
92
91
|
"ember-data": "^4.12.5",
|
|
93
92
|
"ember-engines": "^0.9.0",
|
|
94
93
|
"ember-load-initializers": "^2.1.2",
|