Skip to content

Commit df5f78b

Browse files
authored
Merge pull request #213 from fleetbase/dev-v0.6.39
v0.6.39 ~ added engine registry yield + use correct default asset url…
2 parents 4c46b3b + d3cab24 commit df5f78b

430 files changed

Lines changed: 26177 additions & 2724 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

addon/components/activity/form.hbs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,8 @@
1313
@disabled={{cannot "fleet-ops update order-config"}}
1414
{{on "input" this.setActivityCode}}
1515
/>
16-
<InputGroup
17-
@name={{t "activity.form.status"}}
18-
@value={{@resource.status}}
19-
@disabled={{cannot "fleet-ops update order-config"}}
20-
@helpText={{t "activity.form.status-help-text"}}
21-
/>
22-
<InputGroup
23-
@name={{t "activity.form.details"}}
24-
@value={{@resource.details}}
25-
@disabled={{cannot "fleet-ops update order-config"}}
26-
@helpText={{t "activity.form.details-help-text"}}
27-
/>
16+
<InputGroup @name={{t "activity.form.status"}} @value={{@resource.status}} @disabled={{cannot "fleet-ops update order-config"}} @helpText={{t "activity.form.status-help-text"}} />
17+
<InputGroup @name={{t "activity.form.details"}} @value={{@resource.details}} @disabled={{cannot "fleet-ops update order-config"}} @helpText={{t "activity.form.details-help-text"}} />
2818
<InputGroup>
2919
<Toggle @isToggled={{@resource.complete}} @onToggle={{fn (mut @resource.complete)}} @disabled={{cannot "fleet-ops update order-config"}}>
3020
<span class="dark:text-gray-100 text-sm ml-2">{{t "activity.form.completes-order"}}</span>

addon/components/activity/logic-builder.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
{{else}}
127127
<div class="min-h-24 p-4">
128128
<div class="flex items-center justify-center border border-dashed border-gray-300 dark:border-gray-600 p-6 rounded-xl bg-gray-50 dark:bg-gray-800">
129-
<div class="flex flex-col items-center justify-center ">
129+
<div class="flex flex-col items-center justify-center">
130130
<FaIcon @icon="layer-group" @size="2x" class="text-gray-400 mb-2" />
131131
<div class="text-sm text-gray-600 dark:text-gray-400 font-medium">
132132
No activity logic

addon/components/custom-entity/form.hbs

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,16 @@
2121
</ContentPanel>
2222
<ContentPanel @title={{t "custom-entity.fields.measurements"}} @open={{true}} @wrapperClass="bordered-top">
2323
<div class="grid grid-cols-2 gap-2">
24-
<InputGroup
25-
@name={{t "custom-entity.fields.length"}}
26-
@helpText={{t "custom-entity.fields.length-text"}}
27-
@wrapperClass="mb-2"
28-
>
24+
<InputGroup @name={{t "custom-entity.fields.length"}} @helpText={{t "custom-entity.fields.length-text"}} @wrapperClass="mb-2">
2925
<UnitInput class="w-full" @value={{@resource.length}} @unit={{@resource.dimensions_unit}} @canSelectUnit={{true}} @onUnitChange={{this.updateCustomEntityDimensionsUnit}} />
3026
</InputGroup>
31-
<InputGroup
32-
@name={{t "custom-entity.fields.width"}}
33-
@helpText={{t "custom-entity.fields.width-text"}}
34-
@wrapperClass="mb-2"
35-
>
27+
<InputGroup @name={{t "custom-entity.fields.width"}} @helpText={{t "custom-entity.fields.width-text"}} @wrapperClass="mb-2">
3628
<UnitInput class="w-full" @value={{@resource.width}} @unit={{@resource.dimensions_unit}} @canSelectUnit={{true}} @onUnitChange={{this.updateCustomEntityDimensionsUnit}} />
3729
</InputGroup>
38-
<InputGroup
39-
@name={{t "custom-entity.fields.height"}}
40-
@helpText={{t "custom-entity.fields.height-text"}}
41-
@wrapperClass="mb-2"
42-
>
30+
<InputGroup @name={{t "custom-entity.fields.height"}} @helpText={{t "custom-entity.fields.height-text"}} @wrapperClass="mb-2">
4331
<UnitInput class="w-full" @value={{@resource.height}} @unit={{@resource.dimensions_unit}} @canSelectUnit={{true}} @onUnitChange={{this.updateCustomEntityDimensionsUnit}} />
4432
</InputGroup>
45-
<InputGroup
46-
@name={{t "custom-entity.fields.weight"}}
47-
@helpText={{t "custom-entity.fields.weight-text"}}
48-
@wrapperClass="mb-2"
49-
>
33+
<InputGroup @name={{t "custom-entity.fields.weight"}} @helpText={{t "custom-entity.fields.weight-text"}} @wrapperClass="mb-2">
5034
<UnitInput
5135
class="w-full"
5236
@value={{@resource.weight}}

addon/components/device/form.hbs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
>
1616
<div class="space-x-2 text-sm">
1717
<div class="inline-block align-top">
18-
<div class="hide-from-trigger h-1.5 w-full" />
18+
<div class="hide-from-trigger h-1.5 w-full"></div>
1919
<Image src={{model.provider_descriptor.icon}} class="w-5 h-5" />
2020
</div>
2121
<div class="inline-block">
@@ -82,13 +82,7 @@
8282
</div>
8383
<div class="grid grid-cols-1 gap-2 lg:grid-cols-2 lg:gap-2 no-input-group-padding text-xs">
8484
<InputGroup @name={{t "device.fields.device-name"}}>
85-
<Input
86-
@value={{@resource.name}}
87-
@type="text"
88-
class="w-full form-input"
89-
placeholder={{t "device.fields.device-name-placeholder"}}
90-
disabled={{cannot-write @resource}}
91-
/>
85+
<Input @value={{@resource.name}} @type="text" class="w-full form-input" placeholder={{t "device.fields.device-name-placeholder"}} disabled={{cannot-write @resource}} />
9286
</InputGroup>
9387

9488
<InputGroup @name={{t "device.fields.device-id"}}>
@@ -112,13 +106,7 @@
112106
</InputGroup>
113107

114108
<InputGroup @name={{t "device.fields.device-model"}}>
115-
<Input
116-
@value={{@resource.model}}
117-
@type="text"
118-
class="w-full form-input"
119-
placeholder={{t "device.fields.device-model-placeholder"}}
120-
disabled={{cannot-write @resource}}
121-
/>
109+
<Input @value={{@resource.model}} @type="text" class="w-full form-input" placeholder={{t "device.fields.device-model-placeholder"}} disabled={{cannot-write @resource}} />
122110
</InputGroup>
123111

124112
<InputGroup @name={{t "device.fields.manufacturer"}}>

addon/components/device/panel-header.hbs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,26 @@
22
<div class="flex flex-1 flex-row items-start justify-between">
33
<div class="flex flex-row space-x-3">
44
<div class="flex items-start justify-start rounded-full">
5-
<Image src={{@resource.photo_url}} @fallbackSrc={{config "defaultValues.placeholderImage"}} alt={{@resource.displayName}} height="48" width="48" class="h-14 w-14 rounded-full shadow-sm" />
5+
<Image
6+
src={{@resource.photo_url}}
7+
@fallbackSrc={{config "defaultValues.placeholderImage"}}
8+
alt={{@resource.displayName}}
9+
height="48"
10+
width="48"
11+
class="h-14 w-14 rounded-full shadow-sm"
12+
/>
613
<Attach::Tooltip @class="clean" @animation="scale" @placement="top">
714
<InputInfo @text={{@resource.displayName}} />
815
</Attach::Tooltip>
916
</div>
1017
<div class="flex flex-col">
1118
<h1 class="text-gray-900 dark:text-white font-semibold text-lg">{{@resource.displayName}}</h1>
1219
<div>
13-
<div class="text-xs text-gray-400 dark:text-gray-500">{{concat (n-a (titleize @resource.provider)) " " (n-a (get-fleet-ops-option-label "deviceTypes" @resource.type))}}</div>
20+
<div class="text-xs text-gray-400 dark:text-gray-500">{{concat
21+
(n-a (titleize @resource.provider))
22+
" "
23+
(n-a (get-fleet-ops-option-label "deviceTypes" @resource.type))
24+
}}</div>
1425
<div class="text-xs text-gray-400 dark:text-gray-500">{{n-a @resource.serial_number}}</div>
1526
</div>
1627
<Badge @status={{if @resource.online "online" "offline"}}>{{if @resource.online (t "common.online") (t "common.offline")}}</Badge>

addon/components/driver-onboard-settings.hbs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
</div>
1212
</InputGroup>
1313
{{#if this.driverOnboardSettings.enableDriverOnboardFromApp}}
14-
<InputGroup
15-
@name={{t "driver-onboard-settings.select-onboard-method"}}
16-
@helpText={{t "driver-onboard-settings.select-onboard-method-help-text"}}
17-
>
14+
<InputGroup @name={{t "driver-onboard-settings.select-onboard-method"}} @helpText={{t "driver-onboard-settings.select-onboard-method-help-text"}}>
1815
<Select
1916
class="w-full flex-1"
2017
@value={{this.driverOnboardSettings.driverOnboardAppMethod}}
@@ -41,10 +38,7 @@
4138
@onDataChanged={{this.onOnboardDocumentsChanged}}
4239
@addButtonText={{t "driver-onboard-settings.add-onboard-document"}}
4340
>
44-
<InputLabel
45-
@labelText={{t "driver-onboard-settings.required-onboard-documents"}}
46-
@helpText={{t "driver-onboard-settings.required-onboard-documents-help-text"}}
47-
/>
41+
<InputLabel @labelText={{t "driver-onboard-settings.required-onboard-documents"}} @helpText={{t "driver-onboard-settings.required-onboard-documents-help-text"}} />
4842
</ArrayInput>
4943
</InputGroup>
5044
{{/if}}

addon/components/driver/details.hbs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,45 @@
5151
</div>
5252
</div>
5353
</ContentPanel>
54-
5554
<CustomField::Yield @subject={{@resource}} @viewMode={{true}} @wrapperClass="bordered-top" />
5655

5756
<RegistryYield @registry="fleet-ops:component:driver:details" as |RegistryComponent|>
5857
<RegistryComponent @resource={{@resource}} @controller={{@controller}} @permission={{get-write-permission @resource}} />
5958
</RegistryYield>
6059

61-
<ContentPanel @title={{t "common.metadata"}} @open={{true}} @actionButtons={{this.metadataButtons}} @wrapperClass="bordered-top" @panelBodyWrapperClass={{unless (is-object-empty @resource.meta) "px-0i" ""}}>
60+
{{! ORCHESTRATOR CONSTRAINTS (read-only view) }}
61+
{{#if (or @resource.skills.length @resource.max_distance @resource.max_travel_time)}}
62+
<ContentPanel @title="Orchestrator Constraints" @open={{true}} @wrapperClass="bordered-top">
63+
<div class="grid grid-cols-2 gap-2 text-xs dark:text-gray-100">
64+
{{#if @resource.skills.length}}
65+
<div class="field-info-container col-span-2">
66+
<div class="field-name">Skills & Certifications</div>
67+
<div class="field-value">{{join @resource.skills ", "}}</div>
68+
</div>
69+
{{/if}}
70+
{{#if @resource.max_travel_time}}
71+
<div class="field-info-container">
72+
<div class="field-name">Max Driving Time</div>
73+
<div class="field-value">{{@resource.max_travel_time}} s</div>
74+
</div>
75+
{{/if}}
76+
{{#if @resource.max_distance}}
77+
<div class="field-info-container">
78+
<div class="field-name">Max Distance</div>
79+
<div class="field-value">{{@resource.max_distance}} m</div>
80+
</div>
81+
{{/if}}
82+
</div>
83+
</ContentPanel>
84+
{{/if}}
85+
86+
<ContentPanel
87+
@title={{t "common.metadata"}}
88+
@open={{true}}
89+
@actionButtons={{this.metadataButtons}}
90+
@wrapperClass="bordered-top"
91+
@panelBodyWrapperClass={{unless (is-object-empty @resource.meta) "px-0i" ""}}
92+
>
6293
<MetadataViewer @metadata={{@resource.meta}} />
6394
</ContentPanel>
6495
</div>

addon/components/driver/form.hbs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,48 @@
166166
</RegistryYield>
167167
</ContentPanel>
168168

169+
{{! ORCHESTRATOR CONSTRAINTS }}
170+
<ContentPanel @title="Orchestrator Constraints" @open={{true}} @wrapperClass="bordered-top">
171+
<div class="grid grid-cols-1 gap-2 lg:grid-cols-2 lg:gap-2 no-input-group-padding text-xs">
172+
<div class="col-span-1 lg:col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-1">
173+
Skills & Certifications
174+
</div>
175+
<div class="col-span-1 lg:col-span-2">
176+
<InputGroup @name="Driver Skills" @helpText="Skills and certifications this driver holds (e.g. refrigerated, hazmat, forklift). Used by the Orchestrator for order matching.">
177+
<MultiSelect
178+
@options={{get-fleet-ops-options "driverSkills"}}
179+
@selected={{@resource.skills}}
180+
@onChange={{fn (mut @resource.skills)}}
181+
@placeholder="Select skills…"
182+
@triggerClass="form-select form-input"
183+
@disabled={{cannot-write @resource}}
184+
as |option|
185+
>
186+
{{option.label}}
187+
</MultiSelect>
188+
</InputGroup>
189+
</div>
190+
<div class="col-span-1 lg:col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-3">
191+
Route Limits
192+
</div>
193+
<div class="col-span-1 lg:col-span-2 text-xs text-gray-500 dark:text-gray-400 -mt-1">
194+
Hard caps applied by the Orchestrator when building a single route. These are separate from the driver's shift schedule, which controls availability windows.
195+
</div>
196+
<InputGroup
197+
@name="Max Driving Time (seconds)"
198+
@helpText="Maximum total driving time in seconds the Orchestrator may assign to this driver in a single route. Leave blank for no limit. Example: 28800 = 8 hours."
199+
>
200+
<Input @value={{@resource.max_travel_time}} @type="number" class="form-input w-full" placeholder="e.g. 28800 (8 h)" disabled={{cannot-write @resource}} />
201+
</InputGroup>
202+
<InputGroup
203+
@name="Max Distance (metres)"
204+
@helpText="Maximum total route distance in metres the Orchestrator may assign to this driver in a single route. Leave blank for no limit."
205+
>
206+
<Input @value={{@resource.max_distance}} @type="number" class="form-input w-full" placeholder="e.g. 150000 (150 km)" disabled={{cannot-write @resource}} />
207+
</InputGroup>
208+
</div>
209+
</ContentPanel>
210+
169211
<CustomField::Yield @subject={{@resource}} @wrapperClass="bordered-top" />
170212

171213
<RegistryYield @registry="fleet-ops:component:driver:form" as |RegistryComponent|>

addon/components/driver/panel-header.hbs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
<div class="flex flex-1 flex-row items-start justify-between">
33
<div class="flex flex-row space-x-3">
44
<div class="flex items-start justify-start rounded-full">
5-
<Image src={{@resource.photo_url}} @fallbackSrc={{config "defaultValues.driverImage"}} alt={{@resource.name}} height="48" width="48" class="h-14 w-14 rounded-full shadow-sm" />
5+
<Image
6+
src={{@resource.photo_url}}
7+
@fallbackSrc={{config "defaultValues.driverImage"}}
8+
alt={{@resource.name}}
9+
height="48"
10+
width="48"
11+
class="h-14 w-14 rounded-full shadow-sm"
12+
/>
613
<Attach::Tooltip @class="clean" @animation="scale" @placement="top">
714
<InputInfo @text={{@resource.name}} />
815
</Attach::Tooltip>

0 commit comments

Comments
 (0)