@fleetbase/fleetops-engine 0.6.45 → 0.6.46
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/map-settings.hbs +26 -0
- package/addon/components/admin/map-settings.js +46 -0
- package/addon/components/admin/routing-settings.hbs +11 -0
- package/addon/components/cell/order-route-type.hbs +46 -0
- package/addon/components/cell/order-route-type.js +90 -0
- package/addon/components/cell/place-address.hbs +1 -0
- package/addon/components/display-place.hbs +45 -56
- package/addon/components/display-place.js +21 -0
- package/addon/components/layout/fleet-ops-sidebar/driver-listing.js +5 -5
- package/addon/components/layout/fleet-ops-sidebar/fleet-listing.js +5 -5
- package/addon/components/layout/fleet-ops-sidebar.js +8 -0
- package/addon/components/maintenance-schedule/form.js +2 -1
- package/addon/components/map/drawer/driver-listing.js +5 -5
- package/addon/components/map/drawer/place-listing.js +5 -5
- package/addon/components/map/drawer/position-listing.js +102 -21
- package/addon/components/map/drawer/vehicle-listing.js +5 -5
- package/addon/components/map/google-live-map.hbs +9 -0
- package/addon/components/map/google-live-map.js +445 -0
- package/addon/components/map/leaflet-live-map.hbs +186 -142
- package/addon/components/map/leaflet-live-map.js +121 -41
- package/addon/components/map/toolbar/visibility-control-panel.js +2 -2
- package/addon/components/map/toolbar/zones-panel.hbs +9 -9
- package/addon/components/map/toolbar.hbs +3 -3
- package/addon/components/map/toolbar.js +9 -1
- package/addon/components/modals/map-layer-form.hbs +132 -63
- package/addon/components/modals/orchestrator-import.hbs +4 -11
- package/addon/components/modals/orchestrator-import.js +17 -1
- package/addon/components/modals/update-order-activity.hbs +1 -1
- package/addon/components/orchestrator/order-pool.js +3 -2
- package/addon/components/orchestrator-workbench.js +29 -41
- package/addon/components/order/details/detail.js +2 -2
- package/addon/components/order/details/payload.hbs +5 -5
- package/addon/components/order/details/payload.js +18 -1
- package/addon/components/order/details/route.hbs +2 -2
- package/addon/components/order/details/route.js +76 -3
- package/addon/components/order/form/payload.hbs +33 -0
- package/addon/components/order/form/payload.js +1 -0
- package/addon/components/order/form/route.hbs +8 -8
- package/addon/components/order/form/route.js +78 -18
- package/addon/components/order/form.js +2 -2
- package/addon/components/order/route-editor.hbs +209 -147
- package/addon/components/order/route-editor.js +143 -102
- package/addon/components/place/address.hbs +1 -0
- package/addon/components/place/address.js +12 -0
- package/addon/components/route-list.hbs +43 -55
- package/addon/components/route-list.js +47 -0
- package/addon/components/route-optimization-wizard-panel.js +3 -4
- package/addon/components/vehicle/card.hbs +4 -4
- package/addon/controllers/maintenance/schedules/index.js +2 -1
- package/addon/controllers/operations/orders/index/details.js +110 -37
- package/addon/controllers/operations/orders/index/new.js +1 -1
- package/addon/controllers/operations/orders/index.js +8 -1
- package/addon/controllers/settings/map.js +97 -0
- package/addon/controllers/settings/routing.js +47 -12
- package/addon/extension.js +11 -0
- package/addon/helpers/place-address-html.js +6 -0
- package/addon/instance-initializers/register-google-routes.js +17 -0
- package/addon/instance-initializers/register-osrm.js +5 -0
- package/addon/routes/application.js +6 -0
- package/addon/routes/operations/orchestrator.js +13 -0
- package/addon/routes/operations/orders/index/details.js +29 -22
- package/addon/routes/operations/orders/index/new.js +9 -0
- package/addon/routes/operations/orders/index.js +0 -1
- package/addon/routes/settings/map.js +3 -0
- package/addon/routes.js +1 -0
- package/addon/services/entity-actions.js +1 -1
- package/addon/services/geofence-event-bus.js +2 -1
- package/addon/services/geofence.js +204 -168
- package/addon/services/google-routes.js +300 -0
- package/addon/services/leaflet-draw-restriction.js +2 -1
- package/addon/services/leaflet-map-manager.js +17 -0
- package/addon/services/map-adapter/google.js +2205 -0
- package/addon/services/map-adapter/leaflet.js +1042 -0
- package/addon/services/map-adapter-interface.js +551 -0
- package/addon/services/map-manager.js +768 -0
- package/addon/services/map-settings.js +75 -0
- package/addon/services/movement-tracker.js +83 -32
- package/addon/services/order-actions.js +11 -1
- package/addon/services/osrm.js +79 -6
- package/addon/services/position-playback.js +135 -62
- package/addon/services/route-engine.js +83 -0
- package/addon/services/service-areas.js +8 -1
- package/addon/styles/fleetops-engine.css +555 -0
- package/addon/templates/management/vehicles/index.hbs +0 -1
- package/addon/templates/operations/orders/index/details.hbs +0 -1
- package/addon/templates/settings/map.hbs +53 -0
- package/addon/templates/settings/routing.hbs +15 -4
- package/addon/utils/fleet-ops-options.js +1 -0
- package/addon/utils/has-valid-coordinates.js +6 -0
- package/addon/utils/map-provider-options.js +6 -0
- package/addon/utils/order-route-editing.js +86 -0
- package/addon/utils/order-route-summary.js +20 -0
- package/addon/utils/place-address-html.js +41 -0
- package/addon/utils/route-colors.js +43 -12
- package/addon/utils/route-visualization.js +93 -0
- package/addon/utils/vendor-integration.js +2 -1
- package/app/components/admin/map-settings.js +1 -0
- package/app/components/admin/routing-settings.js +1 -0
- package/app/components/cell/order-route-type.js +1 -0
- package/app/components/cell/place-address.js +1 -0
- package/app/components/map/google-live-map.js +1 -0
- package/app/components/place/address.js +1 -0
- package/app/controllers/settings/map.js +1 -0
- package/app/helpers/place-address-html.js +1 -0
- package/app/routes/settings/map.js +1 -0
- package/app/services/map-adapter/google.js +1 -0
- package/app/services/map-adapter/leaflet.js +1 -0
- package/app/services/map-adapter-interface.js +1 -0
- package/app/services/map-manager.js +1 -0
- package/app/services/map-settings.js +1 -0
- package/app/templates/settings/map.js +1 -0
- package/app/utils/has-valid-coordinates.js +1 -0
- package/app/utils/order-route-editing.js +2 -0
- package/app/utils/order-route-summary.js +1 -0
- package/app/utils/place-address-html.js +1 -0
- package/app/utils/route-colors.js +1 -1
- package/app/utils/route-visualization.js +1 -0
- package/assets/images/drawing-controls-spritesheet.svg +156 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +3 -3
- package/server/src/Auth/Schemas/FleetOps.php +5 -0
- package/server/src/Http/Controllers/Api/v1/OrderController.php +31 -3
- package/server/src/Http/Controllers/Api/v1/PayloadController.php +14 -1
- package/server/src/Http/Controllers/Api/v1/ServiceAreaController.php +2 -0
- package/server/src/Http/Controllers/Api/v1/ServiceQuoteController.php +3 -2
- package/server/src/Http/Controllers/Api/v1/ZoneController.php +2 -0
- package/server/src/Http/Controllers/Internal/v1/LiveController.php +2 -1
- package/server/src/Http/Controllers/Internal/v1/OrchestrationController.php +7 -4
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +61 -34
- package/server/src/Http/Controllers/Internal/v1/ServiceQuoteController.php +3 -2
- package/server/src/Http/Controllers/Internal/v1/SettingController.php +106 -3
- package/server/src/Http/Filter/OrderFilter.php +2 -1
- package/server/src/Http/Resources/v1/Index/Payload.php +9 -7
- package/server/src/Http/Resources/v1/Order.php +20 -1
- package/server/src/Models/Order.php +42 -1
- package/server/src/Models/OrderConfig.php +15 -0
- package/server/src/Models/Payload.php +131 -27
- package/server/src/Models/Place.php +182 -48
- package/server/src/Models/ServiceRate.php +4 -3
- package/server/src/Orchestration/Engines/VroomOrchestrationEngine.php +59 -23
- package/server/src/Support/Utils.php +36 -2
- package/server/src/routes.php +4 -0
- package/translations/en-us.yaml +1937 -1916
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<ContentPanel @title="Configure Map" @open={{true}} @wrapperClass="bordered-classic">
|
|
2
|
+
<InputGroup @name="Default Map Provider" @helpText="Sets the default map provider for all organizations unless they override it in their own FleetOps map settings.">
|
|
3
|
+
<Select
|
|
4
|
+
class="w-full flex-1"
|
|
5
|
+
@value={{this.mapProvider}}
|
|
6
|
+
@options={{this.mapProviderOptions}}
|
|
7
|
+
@optionLabel="label"
|
|
8
|
+
@optionValue="value"
|
|
9
|
+
@placeholder="Select default map provider"
|
|
10
|
+
@onSelect={{this.selectMapProvider}}
|
|
11
|
+
/>
|
|
12
|
+
</InputGroup>
|
|
13
|
+
<InputGroup @name="Google Map ID" @value={{this.googleMapsMapId}} @helpText="Required for Google Advanced Markers and cloud-based map styling." />
|
|
14
|
+
</ContentPanel>
|
|
15
|
+
|
|
16
|
+
<EmberWormhole @to="next-view-section-subheader-actions">
|
|
17
|
+
<Button
|
|
18
|
+
@type="primary"
|
|
19
|
+
@size="sm"
|
|
20
|
+
@icon="save"
|
|
21
|
+
@text="Save Changes"
|
|
22
|
+
@onClick={{perform this.saveSettings}}
|
|
23
|
+
@isLoading={{or this.saveSettings.isRunning this.loadSettings.isRunning}}
|
|
24
|
+
@disabled={{this.saveSettings.isRunning}}
|
|
25
|
+
/>
|
|
26
|
+
</EmberWormhole>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
|
+
import { action } from '@ember/object';
|
|
6
|
+
import MAP_PROVIDER_OPTIONS from '../../utils/map-provider-options';
|
|
7
|
+
|
|
8
|
+
export default class AdminMapSettingsComponent extends Component {
|
|
9
|
+
@service fetch;
|
|
10
|
+
@service notifications;
|
|
11
|
+
@tracked mapProviderOptions = MAP_PROVIDER_OPTIONS;
|
|
12
|
+
@tracked mapProvider = 'leaflet';
|
|
13
|
+
@tracked googleMapsMapId = '';
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.loadSettings.perform();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@task *loadSettings() {
|
|
21
|
+
try {
|
|
22
|
+
const settings = yield this.fetch.get('fleet-ops/settings/admin-map');
|
|
23
|
+
this.mapProvider = settings?.mapProvider ?? 'leaflet';
|
|
24
|
+
this.googleMapsMapId = settings?.googleMapsMapId ?? '';
|
|
25
|
+
} catch (error) {
|
|
26
|
+
this.notifications.serverError(error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@action selectMapProvider(option) {
|
|
31
|
+
this.mapProvider = option?.value ?? option ?? 'leaflet';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@task *saveSettings() {
|
|
35
|
+
try {
|
|
36
|
+
yield this.fetch.post('fleet-ops/settings/admin-map', {
|
|
37
|
+
mapProvider: this.mapProvider,
|
|
38
|
+
googleMapsMapId: this.googleMapsMapId,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
this.notifications.success('Map settings saved.');
|
|
42
|
+
} catch (error) {
|
|
43
|
+
this.notifications.serverError(error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div class="space-y-6">
|
|
2
|
+
<InfoBlock @type="info" @icon="circle-info" class="mb-4">
|
|
3
|
+
Configure system-wide routing engine defaults here. Organizations can optionally override these values from their own routing settings.
|
|
4
|
+
</InfoBlock>
|
|
5
|
+
|
|
6
|
+
<RegistryYield @registry="fleet-ops:component:admin:routing-settings" as |RegistryComponent|>
|
|
7
|
+
<div>
|
|
8
|
+
<RegistryComponent />
|
|
9
|
+
</div>
|
|
10
|
+
</RegistryYield>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div class="orders-route-type-cell" ...attributes>
|
|
2
|
+
{{#if this.hasRoutePreview}}
|
|
3
|
+
<div class="orders-route-type-trigger" {{on "mouseenter" this.ensurePayloadLoaded}} {{on "focusin" this.ensurePayloadLoaded}}>
|
|
4
|
+
<span class="{{this.summary.badgeClass}} orders-route-type-badge">
|
|
5
|
+
<FaIcon @icon={{this.summary.icon}} class="mr-0.5" />
|
|
6
|
+
{{this.summary.label}}
|
|
7
|
+
</span>
|
|
8
|
+
<Attach::Tooltip @class="clean orders-route-type-tooltip" @animation="scale" @placement="right">
|
|
9
|
+
<InputInfo @hideIcon={{true}}>
|
|
10
|
+
<div class="orders-route-type-preview">
|
|
11
|
+
<div class="orders-route-type-preview__header">
|
|
12
|
+
<FaIcon @icon="route" class="mr-2" />
|
|
13
|
+
<span>{{t "resource.route"}}</span>
|
|
14
|
+
</div>
|
|
15
|
+
{{#if this.isLoadingPayload}}
|
|
16
|
+
<div class="orders-route-type-preview__state">
|
|
17
|
+
<Spinner class="mr-2" />
|
|
18
|
+
<span>{{t "common.loading-route"}}</span>
|
|
19
|
+
</div>
|
|
20
|
+
{{else if this.loadPayloadError}}
|
|
21
|
+
<div class="orders-route-type-preview__state orders-route-type-preview__state--error">
|
|
22
|
+
{{this.loadPayloadError}}
|
|
23
|
+
</div>
|
|
24
|
+
{{else if this.hasLoadedWaypointPayload}}
|
|
25
|
+
<RouteList
|
|
26
|
+
@order={{this.order}}
|
|
27
|
+
@isCollapsible={{false}}
|
|
28
|
+
@routeStopClass="orders-route-type-preview__stop"
|
|
29
|
+
@routeLocationClass="orders-route-type-preview__location"
|
|
30
|
+
/>
|
|
31
|
+
{{else}}
|
|
32
|
+
<div class="orders-route-type-preview__state">
|
|
33
|
+
{{t "common.hover-to-load-route"}}
|
|
34
|
+
</div>
|
|
35
|
+
{{/if}}
|
|
36
|
+
</div>
|
|
37
|
+
</InputInfo>
|
|
38
|
+
</Attach::Tooltip>
|
|
39
|
+
</div>
|
|
40
|
+
{{else}}
|
|
41
|
+
<span class="{{this.summary.badgeClass}} orders-route-type-badge">
|
|
42
|
+
<FaIcon @icon={{this.summary.icon}} class="mr-0.5" />
|
|
43
|
+
{{this.summary.label}}
|
|
44
|
+
</span>
|
|
45
|
+
{{/if}}
|
|
46
|
+
</div>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { tracked } from '@glimmer/tracking';
|
|
4
|
+
import { action } from '@ember/object';
|
|
5
|
+
import { isArray } from '@ember/array';
|
|
6
|
+
import { buildRouteTypeSummary } from '../../utils/order-route-summary';
|
|
7
|
+
|
|
8
|
+
export default class CellOrderRouteTypeComponent extends Component {
|
|
9
|
+
@service intl;
|
|
10
|
+
@tracked isLoadingPayload = false;
|
|
11
|
+
@tracked loadPayloadError = null;
|
|
12
|
+
_payloadLoadPromise = null;
|
|
13
|
+
|
|
14
|
+
get order() {
|
|
15
|
+
return this.args.row;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get payload() {
|
|
19
|
+
return this.order?.payload;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
get intermediateStopCount() {
|
|
23
|
+
const loadedWaypointCount = this.payload?.waypoints?.length;
|
|
24
|
+
const indexedWaypointCount = Number(this.payload?.waypoints_count ?? 0);
|
|
25
|
+
|
|
26
|
+
if (typeof loadedWaypointCount === 'number') {
|
|
27
|
+
return Math.max(loadedWaypointCount, indexedWaypointCount);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return indexedWaypointCount;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
get baseSummary() {
|
|
34
|
+
return buildRouteTypeSummary({
|
|
35
|
+
hasIntermediateWaypoints: this.order?.hasIntermediateWaypoints ?? this.payload?.hasIntermediateWaypoints,
|
|
36
|
+
intermediateStopCount: this.intermediateStopCount,
|
|
37
|
+
hasPickup: Boolean(this.payload?.pickup_uuid),
|
|
38
|
+
hasDropoff: Boolean(this.payload?.dropoff_uuid),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get summary() {
|
|
43
|
+
return {
|
|
44
|
+
...this.baseSummary,
|
|
45
|
+
label: this.intl.t(this.baseSummary.translationKey, this.baseSummary.translationOptions),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get hasRoutePreview() {
|
|
50
|
+
return this.baseSummary.kind === 'multi_stop' || this.baseSummary.kind === 'pickup_dropoff_stops';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get hasLoadedWaypointPayload() {
|
|
54
|
+
const waypoints = this.payload?.waypoints;
|
|
55
|
+
const loadedWaypointCount = waypoints?.length;
|
|
56
|
+
|
|
57
|
+
if (typeof loadedWaypointCount === 'number') {
|
|
58
|
+
if (loadedWaypointCount > 0) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return this.intermediateStopCount === 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (typeof waypoints?.toArray === 'function' || isArray(waypoints)) && this.intermediateStopCount === 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@action async ensurePayloadLoaded() {
|
|
69
|
+
if (!this.hasRoutePreview || this.hasLoadedWaypointPayload || this.isLoadingPayload) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (typeof this.order?.loadPayload !== 'function') {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this.isLoadingPayload = true;
|
|
78
|
+
this.loadPayloadError = null;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
this._payloadLoadPromise ??= this.order.loadPayload();
|
|
82
|
+
await this._payloadLoadPromise;
|
|
83
|
+
} catch (error) {
|
|
84
|
+
this.loadPayloadError = error?.message ?? this.intl.t('common.unable-to-load-route');
|
|
85
|
+
} finally {
|
|
86
|
+
this.isLoadingPayload = false;
|
|
87
|
+
this._payloadLoadPromise = null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<Place::Address @place={{@row}} />
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
<div {{did-insert this.setupComponent}} ...attributes>
|
|
2
|
-
{{#
|
|
3
|
-
{{
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
{{
|
|
7
|
-
|
|
8
|
-
{{
|
|
9
|
-
{{t "display-panel.no-address-message"}}
|
|
10
|
-
{{/if}}
|
|
11
|
-
</span>
|
|
12
|
-
</div>
|
|
13
|
-
{{else}}
|
|
14
|
-
<div class="flex flex-row item-center space-x-2 {{if (or place.status_code @eta) 'mb-2'}}">
|
|
15
|
-
{{#if place.status_code}}
|
|
16
|
-
<Badge @status={{place.status_code}} />
|
|
17
|
-
{{/if}}
|
|
18
|
-
{{#if @eta}}
|
|
19
|
-
<Badge @status="warning" @hideStatusDot={{true}}><span class="font-bold">{{t "common.eta"}}:</span> {{format-duration @eta}}</Badge>
|
|
2
|
+
{{#if (is-empty this.place)}}
|
|
3
|
+
<div class={{@noAddressClass}}>
|
|
4
|
+
<span class="text-red-500">
|
|
5
|
+
{{#if @type}}
|
|
6
|
+
{{t "display-panel.no-address" htmlSafe=true type=@type}}
|
|
7
|
+
{{else}}
|
|
8
|
+
{{t "display-panel.no-address-message"}}
|
|
20
9
|
{{/if}}
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
{{else}}
|
|
13
|
+
{{#if (and @waypointActions (not @hideBadges))}}
|
|
14
|
+
<div class="flex flex-row item-center space-x-2 {{if (or this.place.status_code @eta) 'mb-2'}}">
|
|
15
|
+
{{#unless @hideBadges}}
|
|
16
|
+
{{#if this.place.status_code}}
|
|
17
|
+
<Badge @status={{this.place.status_code}} />
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{#if @eta}}
|
|
20
|
+
<Badge @status="warning" @hideStatusDot={{true}}><span class="font-bold">{{t "common.eta"}}:</span> {{format-duration @eta}}</Badge>
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{/unless}}
|
|
21
23
|
{{#if @waypointActions}}
|
|
22
24
|
<DropdownButton @iconClass="icon-text-height" @size="xs" @buttonClass="fleetops-btn-xxs" @icon="ellipsis-h" @iconPrefix="fas" @contentClass="dropdown-menu" as |dd|>
|
|
23
25
|
<div class="next-dd-menu mt-1 mx-0" aria-labelledby="user-menu">
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
<div class="next-dd-menu-seperator"></div>
|
|
30
32
|
{{#each-in @waypointActions as |actionId action|}}
|
|
31
33
|
<div class="px-1">
|
|
32
|
-
<a href="javascript:;" class="next-dd-item" disabled={{cannot "fleet-ops view order"}} {{on "click" (dropdown-fn dd action.fn place)}}>
|
|
34
|
+
<a href="javascript:;" class="next-dd-item" disabled={{cannot "fleet-ops view order"}} {{on "click" (dropdown-fn dd action.fn this.place)}}>
|
|
33
35
|
{{action.label}}
|
|
34
36
|
</a>
|
|
35
37
|
</div>
|
|
@@ -38,42 +40,29 @@
|
|
|
38
40
|
</DropdownButton>
|
|
39
41
|
{{/if}}
|
|
40
42
|
</div>
|
|
41
|
-
<address class={{@addressClass}}>
|
|
42
|
-
{{#if place.name}}
|
|
43
|
-
{{place.name}}<br />
|
|
44
|
-
{{/if}}
|
|
45
|
-
{{#if place.street1}}
|
|
46
|
-
{{place.street1}}<br />
|
|
47
|
-
{{/if}}
|
|
48
|
-
{{#if place.street2}}
|
|
49
|
-
{{place.street2}}<br />
|
|
50
|
-
{{/if}}
|
|
51
|
-
<div class="comma-spans">
|
|
52
|
-
{{#if place.city}}
|
|
53
|
-
<span>{{place.city}}</span>
|
|
54
|
-
{{/if}}
|
|
55
|
-
{{#if place.province}}
|
|
56
|
-
<span>{{place.province}}</span>
|
|
57
|
-
{{/if}}
|
|
58
|
-
{{#if place.postal_code}}
|
|
59
|
-
<span>{{place.postal_code}}</span>
|
|
60
|
-
{{/if}}
|
|
61
|
-
</div>
|
|
62
|
-
<div class="comma-spans">
|
|
63
|
-
{{#if place.neighborhood}}
|
|
64
|
-
<span>{{place.neighborhood}}</span>
|
|
65
|
-
{{/if}}
|
|
66
|
-
{{#if place.district}}
|
|
67
|
-
<span>{{place.district}}</span>
|
|
68
|
-
{{/if}}
|
|
69
|
-
{{#if (and place.building (not place.street1))}}
|
|
70
|
-
<span>{{place.building}}</span>
|
|
71
|
-
{{/if}}
|
|
72
|
-
</div>
|
|
73
|
-
{{#if place.phone}}
|
|
74
|
-
<a href="tel:{{place.phone}}" class="text-blue-500 hover:text-blue-400">{{place.phone}}</a><br />
|
|
75
|
-
{{/if}}
|
|
76
|
-
</address>
|
|
77
43
|
{{/if}}
|
|
78
|
-
|
|
44
|
+
<address class={{@addressClass}}>
|
|
45
|
+
{{#if this.name}}
|
|
46
|
+
<div class="font-semibold">{{this.name}}</div>
|
|
47
|
+
<div>{{this.place.street1}}</div>
|
|
48
|
+
{{else}}
|
|
49
|
+
<div class="font-semibold">{{this.place.street1}}</div>
|
|
50
|
+
{{/if}}
|
|
51
|
+
{{#if this.place.street2}}
|
|
52
|
+
<div>{{this.place.street2}}</div>
|
|
53
|
+
{{/if}}
|
|
54
|
+
{{#if this.cityStatePostalCode}}
|
|
55
|
+
<div>{{this.cityStatePostalCode}}</div>
|
|
56
|
+
{{/if}}
|
|
57
|
+
{{#if this.neighborhoodDistrictBuilding}}
|
|
58
|
+
<div>{{this.neighborhoodDistrictBuilding}}</div>
|
|
59
|
+
{{/if}}
|
|
60
|
+
{{#if this.place.country}}
|
|
61
|
+
<div>{{this.place.country_name}}</div>
|
|
62
|
+
{{/if}}
|
|
63
|
+
{{#if this.place.phone}}
|
|
64
|
+
<a href="tel:{{this.place.phone}}" class="text-blue-500 hover:text-blue-400">{{this.place.phone}}</a><br />
|
|
65
|
+
{{/if}}
|
|
66
|
+
</address>
|
|
67
|
+
{{/if}}
|
|
79
68
|
</div>
|
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
3
|
import { action } from '@ember/object';
|
|
4
|
+
import { isBlank } from '@ember/utils';
|
|
4
5
|
|
|
5
6
|
export default class DisplayPlaceComponent extends Component {
|
|
6
7
|
@tracked ref;
|
|
7
8
|
|
|
9
|
+
get place() {
|
|
10
|
+
return this.args.place?.place ?? this.args.place ?? this.args.resource;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get name() {
|
|
14
|
+
if (this.place.name === this.place.street1) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return this.place.name;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get cityStatePostalCode() {
|
|
22
|
+
return [this.place.city, this.place.province, this.place.postal_code].filter((value) => !isBlank(value)).join(', ');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get neighborhoodDistrictBuilding() {
|
|
26
|
+
return [this.place.neighborhood, this.place.district, this.place.building].filter((value) => !isBlank(value)).join(', ');
|
|
27
|
+
}
|
|
28
|
+
|
|
8
29
|
@action setupComponent(element) {
|
|
9
30
|
this.ref = element;
|
|
10
31
|
}
|
|
@@ -6,7 +6,7 @@ import { task } from 'ember-concurrency';
|
|
|
6
6
|
|
|
7
7
|
export default class LayoutFleetOpsSidebarDriverListingComponent extends Component {
|
|
8
8
|
@service driverActions;
|
|
9
|
-
@service
|
|
9
|
+
@service mapManager;
|
|
10
10
|
@service store;
|
|
11
11
|
@service universe;
|
|
12
12
|
@service hostRouter;
|
|
@@ -133,10 +133,10 @@ export default class LayoutFleetOpsSidebarDriverListingComponent extends Compone
|
|
|
133
133
|
await this.hostRouter.transitionTo('console.fleet-ops.operations.orders.index', { queryParams: { layout: 'map' } });
|
|
134
134
|
} catch {}
|
|
135
135
|
|
|
136
|
-
if (this.
|
|
136
|
+
if (this.mapManager.livemap?.isReady?.()) {
|
|
137
137
|
this.focusDriverOnMap(driver);
|
|
138
138
|
} else {
|
|
139
|
-
this.universe.one('fleet-ops.live-map.
|
|
139
|
+
this.universe.one('fleet-ops.live-map.loaded', () => {
|
|
140
140
|
this.focusDriverOnMap(driver);
|
|
141
141
|
});
|
|
142
142
|
}
|
|
@@ -147,8 +147,8 @@ export default class LayoutFleetOpsSidebarDriverListingComponent extends Compone
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
@action async focusDriverOnMap(driver) {
|
|
150
|
-
await this.
|
|
151
|
-
this.
|
|
150
|
+
await this.mapManager.waitForMap({ timeoutMs: 8000 });
|
|
151
|
+
this.mapManager.focusResource(driver, 16, {
|
|
152
152
|
paddingBottomRight: [300, 200],
|
|
153
153
|
moveend: () => {
|
|
154
154
|
this.driverActions.panel.view(driver, { closeOnTransition: true });
|
|
@@ -8,7 +8,7 @@ export default class LayoutFleetOpsSidebarFleetListingComponent extends Componen
|
|
|
8
8
|
@service store;
|
|
9
9
|
@service universe;
|
|
10
10
|
@service vehicleActions;
|
|
11
|
-
@service
|
|
11
|
+
@service mapManager;
|
|
12
12
|
@service hostRouter;
|
|
13
13
|
@service abilities;
|
|
14
14
|
@service notifications;
|
|
@@ -86,10 +86,10 @@ export default class LayoutFleetOpsSidebarFleetListingComponent extends Componen
|
|
|
86
86
|
await this.hostRouter.transitionTo('console.fleet-ops.operations.orders.index', { queryParams: { layout: 'map' } });
|
|
87
87
|
} catch {}
|
|
88
88
|
|
|
89
|
-
if (this.
|
|
89
|
+
if (this.mapManager.livemap?.isReady?.()) {
|
|
90
90
|
this.focusVehicleOnMap(vehicle);
|
|
91
91
|
} else {
|
|
92
|
-
this.universe.one('fleet-ops.live-map.
|
|
92
|
+
this.universe.one('fleet-ops.live-map.loaded', () => {
|
|
93
93
|
this.focusVehicleOnMap(vehicle);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
@@ -100,8 +100,8 @@ export default class LayoutFleetOpsSidebarFleetListingComponent extends Componen
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
@action async focusVehicleOnMap(vehicle) {
|
|
103
|
-
await this.
|
|
104
|
-
this.
|
|
103
|
+
await this.mapManager.waitForMap({ timeoutMs: 8000 });
|
|
104
|
+
this.mapManager.focusResource(vehicle, 16, {
|
|
105
105
|
paddingBottomRight: [300, 200],
|
|
106
106
|
moveend: () => {
|
|
107
107
|
this.vehicleActions.panel.view(vehicle, { closeOnTransition: true });
|
|
@@ -311,6 +311,14 @@ export default class LayoutFleetOpsSidebarComponent extends Component {
|
|
|
311
311
|
permission: 'fleet-ops view routing-settings',
|
|
312
312
|
visible: this.abilities.can('fleet-ops see routing-settings'),
|
|
313
313
|
},
|
|
314
|
+
{
|
|
315
|
+
intl: 'menu.map',
|
|
316
|
+
title: this.intl.t('menu.map'),
|
|
317
|
+
icon: 'map',
|
|
318
|
+
route: 'settings.map',
|
|
319
|
+
permission: 'fleet-ops view map-settings',
|
|
320
|
+
visible: this.abilities.can('fleet-ops see map-settings'),
|
|
321
|
+
},
|
|
314
322
|
{
|
|
315
323
|
priority: 4,
|
|
316
324
|
intl: 'menu.orchestrator',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { isArray } from '@ember/array';
|
|
3
4
|
import { action } from '@ember/object';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -116,7 +117,7 @@ export default class MaintenanceScheduleFormComponent extends Component {
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
// Restore reminder_offsets from the resource
|
|
119
|
-
if (
|
|
120
|
+
if (isArray(resource.reminder_offsets)) {
|
|
120
121
|
this.reminderOffsets = [...resource.reminder_offsets];
|
|
121
122
|
}
|
|
122
123
|
// Restore interval method from stored interval_method field, or infer from populated fields
|
|
@@ -5,13 +5,13 @@ import { action } from '@ember/object';
|
|
|
5
5
|
|
|
6
6
|
export default class MapDrawerDriverListingComponent extends Component {
|
|
7
7
|
@service driverActions;
|
|
8
|
-
@service
|
|
8
|
+
@service mapManager;
|
|
9
9
|
@service hostRouter;
|
|
10
10
|
@service intl;
|
|
11
11
|
@tracked query = '';
|
|
12
12
|
|
|
13
13
|
get filteredDrivers() {
|
|
14
|
-
const drivers = this.
|
|
14
|
+
const drivers = this.mapManager.livemap?.drivers ?? [];
|
|
15
15
|
const query = this.query?.toLowerCase();
|
|
16
16
|
if (!query) {
|
|
17
17
|
return drivers;
|
|
@@ -119,7 +119,7 @@ export default class MapDrawerDriverListingComponent extends Component {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
@action view(driver) {
|
|
122
|
-
this.
|
|
122
|
+
this.mapManager.focusResource(driver, 16, {
|
|
123
123
|
paddingBottomRight: [300, 200],
|
|
124
124
|
moveend: () => {
|
|
125
125
|
this.driverActions.panel.view(driver);
|
|
@@ -128,7 +128,7 @@ export default class MapDrawerDriverListingComponent extends Component {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
@action edit(driver) {
|
|
131
|
-
this.
|
|
131
|
+
this.mapManager.focusResource(driver, 16, {
|
|
132
132
|
paddingBottomRight: [300, 200],
|
|
133
133
|
moveend: () => {
|
|
134
134
|
this.driverActions.panel.edit(driver);
|
|
@@ -137,7 +137,7 @@ export default class MapDrawerDriverListingComponent extends Component {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
@action locate(driver) {
|
|
140
|
-
this.
|
|
140
|
+
this.mapManager.focusResource(driver, 18, {
|
|
141
141
|
paddingBottomRight: [300, 200],
|
|
142
142
|
});
|
|
143
143
|
}
|
|
@@ -5,13 +5,13 @@ import { action } from '@ember/object';
|
|
|
5
5
|
|
|
6
6
|
export default class MapDrawerPlaceListingComponent extends Component {
|
|
7
7
|
@service placeActions;
|
|
8
|
-
@service
|
|
8
|
+
@service mapManager;
|
|
9
9
|
@service hostRouter;
|
|
10
10
|
@service intl;
|
|
11
11
|
@tracked query = '';
|
|
12
12
|
|
|
13
13
|
get filteredPlaces() {
|
|
14
|
-
const places = this.
|
|
14
|
+
const places = this.mapManager.livemap?.places ?? [];
|
|
15
15
|
const query = this.query?.toLowerCase();
|
|
16
16
|
if (!query) {
|
|
17
17
|
return places;
|
|
@@ -91,7 +91,7 @@ export default class MapDrawerPlaceListingComponent extends Component {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@action view(place) {
|
|
94
|
-
this.
|
|
94
|
+
this.mapManager.focusResource(place, 16, {
|
|
95
95
|
paddingBottomRight: [300, 200],
|
|
96
96
|
moveend: () => {
|
|
97
97
|
this.placeActions.panel.view(place);
|
|
@@ -100,7 +100,7 @@ export default class MapDrawerPlaceListingComponent extends Component {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
@action edit(place) {
|
|
103
|
-
this.
|
|
103
|
+
this.mapManager.focusResource(place, 16, {
|
|
104
104
|
paddingBottomRight: [300, 200],
|
|
105
105
|
moveend: () => {
|
|
106
106
|
this.placeActions.panel.edit(place);
|
|
@@ -109,7 +109,7 @@ export default class MapDrawerPlaceListingComponent extends Component {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@action locate(place) {
|
|
112
|
-
this.
|
|
112
|
+
this.mapManager.focusResource(place, 18, {
|
|
113
113
|
paddingBottomRight: [300, 200],
|
|
114
114
|
});
|
|
115
115
|
}
|