@fleetbase/fleetops-engine 0.4.3 → 0.4.5
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/contact-form-panel.hbs +1 -0
- package/addon/components/driver-panel.hbs +1 -0
- package/addon/components/edit-order-route-panel.hbs +183 -0
- package/addon/components/edit-order-route-panel.js +265 -0
- package/addon/components/fleet-form-panel.hbs +1 -0
- package/addon/components/fleet-panel.hbs +1 -0
- package/addon/components/fleet-panel.js +3 -3
- package/addon/components/fuel-report-form-panel.hbs +1 -0
- package/addon/components/fuel-report-panel.hbs +1 -0
- package/addon/components/issue-form-panel.hbs +1 -0
- package/addon/components/issue-panel.hbs +1 -0
- package/addon/components/map-container/toolbar.hbs +2 -2
- package/addon/components/modals/order-route-form.hbs +1 -1
- package/addon/components/place-form-panel.hbs +1 -0
- package/addon/components/place-panel.hbs +1 -0
- package/addon/components/vehicle-form-panel.hbs +1 -0
- package/addon/components/vehicle-panel.hbs +1 -0
- package/addon/components/vendor-form-panel.hbs +1 -0
- package/addon/components/vendor-panel.hbs +1 -0
- package/addon/components/widget/fleet-ops-key-metrics.hbs +19 -0
- package/addon/components/widget/fleet-ops-key-metrics.js +85 -0
- package/addon/controllers/operations/orders/index/new.js +66 -22
- package/addon/controllers/operations/orders/index/view.js +131 -126
- package/addon/controllers/operations/orders/index.js +1 -1
- package/addon/engine.js +18 -12
- package/addon/routes/operations/orders/index/view.js +1 -1
- package/addon/services/context-panel.js +6 -0
- package/addon/styles/fleetops-engine.css +7 -2
- package/addon/templates/operations/orders/index/new.hbs +390 -58
- package/addon/templates/operations/orders/index/view.hbs +135 -105
- package/addon/templates/operations/service-rates/index/new.hbs +3 -1
- package/app/components/widget/{issues.js → fleet-ops-key-metrics.js} +1 -1
- package/composer.json +6 -6
- package/extension.json +1 -1
- package/package.json +5 -6
- package/server/src/Casts/MultiPolygon.php +3 -3
- package/server/src/Casts/Point.php +2 -2
- package/server/src/Casts/Polygon.php +3 -3
- package/server/src/Console/Commands/DispatchAdhocOrders.php +1 -1
- package/server/src/Events/DriverSimulatedLocationChanged.php +1 -1
- package/server/src/Flow/Activity.php +12 -0
- package/server/src/Flow/Config.php +7 -0
- package/server/src/Flow/Logic.php +7 -0
- package/server/src/Http/Controllers/Api/v1/DriverController.php +61 -21
- package/server/src/Http/Controllers/Api/v1/OrderController.php +5 -3
- package/server/src/Http/Controllers/Api/v1/PlaceController.php +1 -1
- package/server/src/Http/Controllers/Api/v1/ServiceAreaController.php +1 -1
- package/server/src/Http/Controllers/Api/v1/TrackingStatusController.php +1 -1
- package/server/src/Http/Controllers/Api/v1/ZoneController.php +1 -1
- package/server/src/Http/Controllers/Internal/v1/DriverController.php +17 -4
- package/server/src/Http/Controllers/Internal/v1/GeocoderController.php +2 -2
- package/server/src/Http/Controllers/Internal/v1/MetricsController.php +6 -50
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +13 -2
- package/server/src/Http/Controllers/Internal/v1/PlaceController.php +1 -1
- package/server/src/Http/Filter/PlaceFilter.php +1 -1
- package/server/src/Http/Resources/v1/Driver.php +1 -1
- package/server/src/Http/Resources/v1/FuelReport.php +1 -1
- package/server/src/Http/Resources/v1/Issue.php +1 -1
- package/server/src/Http/Resources/v1/Order.php +3 -0
- package/server/src/Http/Resources/v1/Payload.php +1 -0
- package/server/src/Http/Resources/v1/Place.php +1 -1
- package/server/src/Http/Resources/v1/PurchaseRate.php +2 -1
- package/server/src/Http/Resources/v1/ServiceQuote.php +1 -0
- package/server/src/Http/Resources/v1/ServiceQuoteItem.php +29 -0
- package/server/src/Http/Resources/v1/TrackingStatus.php +1 -1
- package/server/src/Http/Resources/v1/Vehicle.php +1 -1
- package/server/src/Http/Resources/v1/VehicleWithoutDriver.php +1 -1
- package/server/src/Http/Resources/v1/Waypoint.php +2 -4
- package/server/src/Integrations/Lalamove/LalamoveDeliveryStop.php +2 -2
- package/server/src/Jobs/SimulateWaypointReached.php +2 -2
- package/server/src/Models/Contact.php +6 -18
- package/server/src/Models/Driver.php +8 -20
- package/server/src/Models/Fleet.php +6 -25
- package/server/src/Models/FuelReport.php +1 -1
- package/server/src/Models/Issue.php +1 -1
- package/server/src/Models/Order.php +31 -19
- package/server/src/Models/Payload.php +7 -7
- package/server/src/Models/Place.php +16 -16
- package/server/src/Models/Position.php +1 -1
- package/server/src/Models/ServiceArea.php +14 -14
- package/server/src/Models/TrackingNumber.php +1 -1
- package/server/src/Models/TrackingStatus.php +1 -1
- package/server/src/Models/Vehicle.php +7 -19
- package/server/src/Models/VehicleDeviceEvent.php +1 -1
- package/server/src/Models/Vendor.php +8 -25
- package/server/src/Models/Waypoint.php +6 -6
- package/server/src/Models/Zone.php +8 -8
- package/server/src/Observers/DriverObserver.php +7 -2
- package/server/src/Observers/TrackingNumberObserver.php +1 -1
- package/server/src/Rules/ResolvablePoint.php +1 -1
- package/server/src/Support/Encoding/Polyline.php +1 -1
- package/server/src/Support/OSRM.php +1 -1
- package/server/src/Support/Utils.php +60 -60
- package/server/src/Traits/HasTrackingNumber.php +3 -3
- package/server/src/routes.php +2 -4
- package/translations/en-us.yaml +10 -2
- package/addon/components/widget/fleet-ops-quickstart.hbs +0 -40
- package/addon/components/widget/fleet-ops-quickstart.js +0 -59
- package/addon/components/widget/issues.hbs +0 -1
- package/addon/components/widget/key-metrics.hbs +0 -121
- package/addon/components/widget/key-metrics.js +0 -46
- package/addon/components/widget/live-order-map.hbs +0 -59
- package/addon/components/widget/live-order-map.js +0 -11
- package/addon/components/widget/recent-orders.hbs +0 -35
- package/addon/components/widget/recent-orders.js +0 -24
- package/addon/components/widget/transaction-earnings.hbs +0 -1
- package/addon/components/widget/transactions.hbs +0 -36
- package/addon/components/widget/transactions.js +0 -29
- package/addon/components/widget/weekly-orders.hbs +0 -1
- package/addon/components/widget/weekly-orders.js +0 -3
- package/app/components/widget/key-metrics.js +0 -1
- package/app/components/widget/live-order-map.js +0 -1
- package/app/components/widget/recent-orders.js +0 -1
- package/app/components/widget/transaction-earnings.js +0 -1
- package/app/components/widget/transactions.js +0 -1
- package/app/components/widget/weekly-orders.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<Overlay @position="right" @noBackdrop={{true}} @isResizable={{true}} @width="
|
|
1
|
+
<Overlay @position="right" @noBackdrop={{true}} @isResizable={{true}} @width="550px" @fullHeight={{true}} @onLoad={{this.setupInterface}} as |overlay|>
|
|
2
2
|
<Overlay::Header @overlay={{overlay}} @title="New Order" @onPressCancel={{this.transitionBack}}>
|
|
3
3
|
<DropdownButton @icon="ellipsis-h" @size="sm" @iconPrefix="fas" @triggerClass="mr-2 hidden md:flex" as |dd|>
|
|
4
4
|
<div class="next-dd-menu mt-1 mx-0" aria-labelledby="user-menu">
|
|
@@ -42,30 +42,59 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</DropdownButton>
|
|
45
|
-
<Button @icon="upload" @type="magic" @text={{if (media
|
|
46
|
-
<Button @icon="check" @type="primary" @text={{if (media
|
|
45
|
+
<Button @icon="upload" @type="magic" @text={{if (media "isMobile") "" "Import"}} @onClick={{this.importOrder}} @disabled={{this.isCreatingOrder}} class="mr-2" />
|
|
46
|
+
<Button @icon="check" @type="primary" @text={{if (media "isMobile") "" "Submit"}} @onClick={{this.createOrder}} @isLoading={{this.isCreatingOrder}} @disabled={{not this.isValid}} />
|
|
47
47
|
</Overlay::Header>
|
|
48
48
|
|
|
49
|
-
<Overlay::Body @wrapperClass="new-order-overlay-body"
|
|
49
|
+
<Overlay::Body @wrapperClass="new-order-overlay-body">
|
|
50
50
|
<ContentPanel @title="Details" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
51
51
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-2">
|
|
52
52
|
<div class="input-group">
|
|
53
53
|
<InputLabel @labelText={{t "fleet-ops.operations.orders.index.new.order-type"}} @helpText={{t "fleet-ops.operations.orders.index.new.order-type-help-text"}} />
|
|
54
|
-
<Select
|
|
54
|
+
<Select
|
|
55
|
+
class="w-full"
|
|
56
|
+
@options={{this.types}}
|
|
57
|
+
@value={{this.order.type}}
|
|
58
|
+
@optionLabel="name"
|
|
59
|
+
@optionValue="key"
|
|
60
|
+
@onSelect={{this.setConfig}}
|
|
61
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.order-type-placeholder"}}
|
|
62
|
+
/>
|
|
55
63
|
</div>
|
|
56
64
|
|
|
57
|
-
<InputGroup
|
|
65
|
+
<InputGroup
|
|
66
|
+
@name={{t "fleet-ops.operations.orders.index.new.internal-id"}}
|
|
67
|
+
@value={{this.order.internal_id}}
|
|
68
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.internal-id-help-text"}}
|
|
69
|
+
/>
|
|
58
70
|
|
|
59
71
|
<InputGroup>
|
|
60
72
|
<InputLabel @labelText={{t "fleet-ops.operations.orders.index.new.schedule"}} @helpText={{t "fleet-ops.operations.orders.index.new.schedule-help-text"}} />
|
|
61
|
-
<DateTimeInput
|
|
73
|
+
<DateTimeInput
|
|
74
|
+
class="form-input"
|
|
75
|
+
@value={{this.order.scheduled_at}}
|
|
76
|
+
@minDate={{format-date (now) "yyyy-MM-dd"}}
|
|
77
|
+
@minTime={{format-date (now) "HH:mm"}}
|
|
78
|
+
@onUpdate={{this.scheduleOrder}}
|
|
79
|
+
@disabled={{this.order.dispatched}}
|
|
80
|
+
/>
|
|
62
81
|
</InputGroup>
|
|
63
82
|
|
|
64
83
|
<InputGroup @name={{t "fleet-ops.operations.orders.index.new.customer"}} @helpText={{t "fleet-ops.operations.orders.index.new.customer-help-text"}}>
|
|
65
|
-
<ModelSelect
|
|
84
|
+
<ModelSelect
|
|
85
|
+
@modelName="customer"
|
|
86
|
+
@selectedModel={{this.order.customer}}
|
|
87
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.customer-placeholder"}}
|
|
88
|
+
@triggerClass="form-select form-input"
|
|
89
|
+
@infiniteScroll={{false}}
|
|
90
|
+
@renderInPlace={{true}}
|
|
91
|
+
@allowClear={{true}}
|
|
92
|
+
@onChange={{this.setOrderCustomer}}
|
|
93
|
+
as |model|
|
|
94
|
+
>
|
|
66
95
|
<div class="flex items-center">
|
|
67
96
|
<div class="w-7">
|
|
68
|
-
<FaIcon @icon={{if model.isVendor "warehouse" "user"
|
|
97
|
+
<FaIcon @icon={{if model.isVendor "warehouse" "user"}} />
|
|
69
98
|
</div>
|
|
70
99
|
<span class="uppercase">
|
|
71
100
|
{{model.name}}
|
|
@@ -75,13 +104,23 @@
|
|
|
75
104
|
</InputGroup>
|
|
76
105
|
|
|
77
106
|
<InputGroup @name={{t "fleet-ops.operations.orders.index.new.facilitator"}} @helpText={{t "fleet-ops.operations.orders.index.new.facilitator-help-text"}}>
|
|
78
|
-
<ModelSelect
|
|
107
|
+
<ModelSelect
|
|
108
|
+
@modelName="facilitator"
|
|
109
|
+
@selectedModel={{this.order.facilitator}}
|
|
110
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.facilitator-placeholder"}}
|
|
111
|
+
@triggerClass="form-select form-input"
|
|
112
|
+
@allowClear={{true}}
|
|
113
|
+
@infiniteScroll={{false}}
|
|
114
|
+
@renderInPlace={{true}}
|
|
115
|
+
@onChange={{this.setOrderFacilitator}}
|
|
116
|
+
as |model|
|
|
117
|
+
>
|
|
79
118
|
<div class="flex items-center">
|
|
80
119
|
<div class="w-7">
|
|
81
120
|
{{#if model.isIntegratedVendor}}
|
|
82
121
|
<Image src={{model.photo_url}} alt={{model.name}} class="w-4 h-4" width="16" height="16" />
|
|
83
122
|
{{else}}
|
|
84
|
-
<FaIcon @icon={{if model.isVendor "warehouse" "user"
|
|
123
|
+
<FaIcon @icon={{if model.isVendor "warehouse" "user"}} />
|
|
85
124
|
{{/if}}
|
|
86
125
|
</div>
|
|
87
126
|
<span class="uppercase">
|
|
@@ -92,13 +131,36 @@
|
|
|
92
131
|
</InputGroup>
|
|
93
132
|
|
|
94
133
|
{{#if (and this.order.facilitator.isIntegratedVendor this.order.facilitator.service_types.length)}}
|
|
95
|
-
<InputGroup
|
|
96
|
-
|
|
134
|
+
<InputGroup
|
|
135
|
+
@name={{t "fleet-ops.operations.orders.index.new.service-type"}}
|
|
136
|
+
@helpText={{concat (t "fleet-ops.operations.orders.index.new.service-type-help-text") this.order.facilitator.name "."}}
|
|
137
|
+
>
|
|
138
|
+
<Select
|
|
139
|
+
class="w-full"
|
|
140
|
+
@options={{this.order.facilitator.service_types}}
|
|
141
|
+
@value={{this.integratedVendorServiceType}}
|
|
142
|
+
@optionLabel="description"
|
|
143
|
+
@optionValue="key"
|
|
144
|
+
@onSelect={{this.selectIntegratedServiceType}}
|
|
145
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.service-type-placeholder"}}
|
|
146
|
+
/>
|
|
97
147
|
</InputGroup>
|
|
98
148
|
{{/if}}
|
|
99
149
|
|
|
100
150
|
<InputGroup @name={{t "fleet-ops.operations.orders.index.new.assign-driver"}} @helpText={{t "fleet-ops.operations.orders.index.new.assign-driver-help-text"}}>
|
|
101
|
-
<ModelSelect
|
|
151
|
+
<ModelSelect
|
|
152
|
+
@modelName="driver"
|
|
153
|
+
@selectedModel={{this.order.driver_assigned}}
|
|
154
|
+
@query={{@options.driversQuery}}
|
|
155
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.assign-driver-placeholder"}}
|
|
156
|
+
@triggerClass="form-select form-input"
|
|
157
|
+
@infiniteScroll={{false}}
|
|
158
|
+
@renderInPlace={{true}}
|
|
159
|
+
@allowClear={{true}}
|
|
160
|
+
@disabled={{this.isUsingIntegratedVendor}}
|
|
161
|
+
@onChange={{fn (mut this.order.driver_assigned)}}
|
|
162
|
+
as |model|
|
|
163
|
+
>
|
|
102
164
|
<div class="flex items-center">
|
|
103
165
|
<div class="w-7">
|
|
104
166
|
<FaIcon @icon="id-card-alt" />
|
|
@@ -120,14 +182,29 @@
|
|
|
120
182
|
|
|
121
183
|
{{#if (and this.order.pod_required (not this.isUsingIntegratedVendor))}}
|
|
122
184
|
<InputGroup>
|
|
123
|
-
<InputLabel
|
|
124
|
-
|
|
185
|
+
<InputLabel
|
|
186
|
+
@labelText={{t "fleet-ops.operations.orders.index.new.proof-delivery"}}
|
|
187
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.proof-delivery-help-text"}}
|
|
188
|
+
/>
|
|
189
|
+
<Select
|
|
190
|
+
class="w-full"
|
|
191
|
+
@options={{this.podOptions}}
|
|
192
|
+
@value={{this.order.pod_method}}
|
|
193
|
+
@onSelect={{fn (mut this.order.pod_method)}}
|
|
194
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.proof-delivery-placeholder"}}
|
|
195
|
+
/>
|
|
125
196
|
</InputGroup>
|
|
126
197
|
{{/if}}
|
|
127
198
|
|
|
128
199
|
{{#if this.order.adhoc}}
|
|
129
200
|
<div>
|
|
130
|
-
<InputGroup
|
|
201
|
+
<InputGroup
|
|
202
|
+
@name={{t "fleet-ops.operations.orders.index.new.adhoc-ping"}}
|
|
203
|
+
@type="number"
|
|
204
|
+
@value={{this.order.adhoc_distance}}
|
|
205
|
+
@wrapperClass="mb-0"
|
|
206
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.adhoc-ping-help-text"}}
|
|
207
|
+
/>
|
|
131
208
|
<div class="mt-2 px-3 py-1 rounded-lg border border-blue-600 bg-blue-100 flex items-center">
|
|
132
209
|
<FaIcon @icon="triangle-exclamation" class="text-blue-900 mr-1.5" />
|
|
133
210
|
<span class="text-blue-900 text-xs">{{t "fleet-ops.operations.orders.index.new.adhoc-ping-message"}}</span>
|
|
@@ -137,19 +214,39 @@
|
|
|
137
214
|
|
|
138
215
|
<div class="lg:col-span-2">
|
|
139
216
|
<InputGroup @wrapperClass="pt-2">
|
|
140
|
-
<Toggle
|
|
217
|
+
<Toggle
|
|
218
|
+
@label={{t "fleet-ops.operations.orders.index.new.ad-hoc"}}
|
|
219
|
+
@wrapperClass="justify-start-i"
|
|
220
|
+
@isToggled={{this.order.adhoc}}
|
|
221
|
+
@onToggle={{this.toggleAdhoc}}
|
|
222
|
+
@disabled={{this.isUsingIntegratedVendor}}
|
|
223
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.ad-hoc-help-text"}}
|
|
224
|
+
/>
|
|
141
225
|
</InputGroup>
|
|
142
226
|
</div>
|
|
143
227
|
|
|
144
228
|
<div class="lg:col-span-2">
|
|
145
229
|
<InputGroup @wrapperClass="pt-1">
|
|
146
|
-
<Toggle
|
|
230
|
+
<Toggle
|
|
231
|
+
@label={{t "fleet-ops.operations.orders.index.new.dispatch"}}
|
|
232
|
+
@wrapperClass="justify-start-i"
|
|
233
|
+
@isToggled={{this.order.dispatched}}
|
|
234
|
+
@onToggle={{fn (mut this.order.dispatched)}}
|
|
235
|
+
@disabled={{this.isUsingIntegratedVendor}}
|
|
236
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.dispatch-help-text"}}
|
|
237
|
+
/>
|
|
147
238
|
</InputGroup>
|
|
148
239
|
</div>
|
|
149
240
|
|
|
150
241
|
<div class="lg:col-span-2">
|
|
151
242
|
<InputGroup @wrapperClass="pt-1">
|
|
152
|
-
<Toggle
|
|
243
|
+
<Toggle
|
|
244
|
+
@label={{t "fleet-ops.operations.orders.index.new.require-proof"}}
|
|
245
|
+
@wrapperClass="justify-start-i"
|
|
246
|
+
@isToggled={{this.order.pod_required}}
|
|
247
|
+
@onToggle={{this.toggleProofOfDelivery}}
|
|
248
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.require-proof-help-text"}}
|
|
249
|
+
/>
|
|
153
250
|
</InputGroup>
|
|
154
251
|
</div>
|
|
155
252
|
</div>
|
|
@@ -157,10 +254,15 @@
|
|
|
157
254
|
|
|
158
255
|
{{#if this.typeConfig}}
|
|
159
256
|
{{#each this.groupedMetaFields as |group|}}
|
|
160
|
-
<ContentPanel
|
|
257
|
+
<ContentPanel
|
|
258
|
+
@title={{if group.value (humanize group.value) (t "fleet-ops.operations.orders.index.new.additional-details")}}
|
|
259
|
+
@open={{true}}
|
|
260
|
+
@pad={{true}}
|
|
261
|
+
@panelBodyClass="bg-white dark:bg-gray-800"
|
|
262
|
+
>
|
|
161
263
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-2">
|
|
162
264
|
{{#each group.items as |metaField|}}
|
|
163
|
-
<div class="input-group {{if (eq metaField.type
|
|
265
|
+
<div class="input-group {{if (eq metaField.type 'boolean') 'col-span-2 items-center' ''}}">
|
|
164
266
|
<div class="flex items-center justify-between">
|
|
165
267
|
{{#if (not-eq metaField.type "boolean")}}
|
|
166
268
|
<InputLabel @labelText={{metaField.label}} @required={{metaField.required}} />
|
|
@@ -175,7 +277,13 @@
|
|
|
175
277
|
{{/if}}
|
|
176
278
|
</div>
|
|
177
279
|
|
|
178
|
-
<CustomField
|
|
280
|
+
<CustomField
|
|
281
|
+
@metaField={{metaField}}
|
|
282
|
+
@value={{metaField.value}}
|
|
283
|
+
@placeholder={{metaField.label}}
|
|
284
|
+
@onChange={{fn (mut metaField.value)}}
|
|
285
|
+
class="{{if (eq metaField.type 'boolean') 'h-10 flex flex-row items-center' ''}}"
|
|
286
|
+
/>
|
|
179
287
|
</div>
|
|
180
288
|
{{/each}}
|
|
181
289
|
</div>
|
|
@@ -183,14 +291,21 @@
|
|
|
183
291
|
{{/each}}
|
|
184
292
|
{{/if}}
|
|
185
293
|
|
|
186
|
-
<ContentPanel
|
|
294
|
+
<ContentPanel
|
|
295
|
+
@title={{t "fleet-ops.operations.orders.index.new.metadata"}}
|
|
296
|
+
@open={{this.order.meta.length}}
|
|
297
|
+
@pad={{true}}
|
|
298
|
+
@panelBodyClass="bg-white dark:bg-gray-800"
|
|
299
|
+
@actionButtons={{this.metadataButtons}}
|
|
300
|
+
>
|
|
187
301
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-2">
|
|
188
302
|
{{#each this.order.meta as |metaField index|}}
|
|
189
303
|
<InputGroup>
|
|
190
304
|
<div class="flex justify-between items-center mb-0.5">
|
|
191
305
|
<label>{{metaField.label}}</label>
|
|
192
306
|
<a href="javascript:;" class="text-xs" {{on "click" (fn this.editCustomField index)}}>
|
|
193
|
-
<FaIcon @icon="edit" @size="sm" class="mr-1" />
|
|
307
|
+
<FaIcon @icon="edit" @size="sm" class="mr-1" />
|
|
308
|
+
Edit
|
|
194
309
|
</a>
|
|
195
310
|
</div>
|
|
196
311
|
<Input class="w-full form-input" @value={{metaField.value}} placeholder={{metaField.label}} />
|
|
@@ -206,8 +321,23 @@
|
|
|
206
321
|
</div>
|
|
207
322
|
<div class="flex flex-1 justify-end space-x-2">
|
|
208
323
|
{{#if this.isMultipleDropoffOrder}}
|
|
209
|
-
<Button
|
|
210
|
-
|
|
324
|
+
<Button
|
|
325
|
+
@type="magic"
|
|
326
|
+
@icon="magic"
|
|
327
|
+
@text={{t "fleet-ops.operations.orders.index.new.optimize-route"}}
|
|
328
|
+
@size="sm"
|
|
329
|
+
@onClick={{this.optimizeRoute}}
|
|
330
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.optimize-route-help-text"}}
|
|
331
|
+
@disabled={{lt this.waypoints.length 3}}
|
|
332
|
+
@isLoading={{this.isOptimizingRoute}}
|
|
333
|
+
/>
|
|
334
|
+
<Button
|
|
335
|
+
@icon="map-marked-alt"
|
|
336
|
+
@text={{t "fleet-ops.operations.orders.index.new.add-waypoint"}}
|
|
337
|
+
@size="sm"
|
|
338
|
+
@onClick={{this.addWaypoint}}
|
|
339
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.add-waypoint-help-text"}}
|
|
340
|
+
/>
|
|
211
341
|
{{/if}}
|
|
212
342
|
</div>
|
|
213
343
|
</div>
|
|
@@ -224,17 +354,33 @@
|
|
|
224
354
|
</div>
|
|
225
355
|
|
|
226
356
|
<div class="flex-1 px-3">
|
|
227
|
-
<ModelSelect
|
|
357
|
+
<ModelSelect
|
|
358
|
+
@modelName="place"
|
|
359
|
+
@selectedModel={{waypoint.place}}
|
|
360
|
+
@placeholder={{concat (t "fleet-ops.operations.orders.index.new.select-waypoint-placeholder") " " (add index 1)}}
|
|
361
|
+
@triggerClass="form-select form-input truncate max-w-300px"
|
|
362
|
+
@infiniteScroll={{false}}
|
|
363
|
+
@customSearchEndpoint="places/search"
|
|
364
|
+
@query={{hash geo=true latitude=this.userLatitude longitude=this.userLongitude}}
|
|
365
|
+
@renderInPlace={{true}}
|
|
366
|
+
@onChange={{fn this.setWaypointPlace index}}
|
|
367
|
+
as |model|
|
|
368
|
+
>
|
|
228
369
|
{{model.address}}
|
|
229
370
|
</ModelSelect>
|
|
230
371
|
|
|
231
372
|
{{#if (and this.isUsingIntegratedVendor (is-not-facilitator-supported-place this.order.facilitator waypoint.place))}}
|
|
232
|
-
<InfoBlock
|
|
373
|
+
<InfoBlock
|
|
374
|
+
class="my-2 px-4 py-1.5 danger"
|
|
375
|
+
@blockClass="flex flex-row items-center"
|
|
376
|
+
@text={{concat this.order.facilitator.name (t "fleet-ops.operations.orders.index.new.infoblock-text")}}
|
|
377
|
+
/>
|
|
233
378
|
{{/if}}
|
|
234
379
|
|
|
235
380
|
{{#if waypoint.place.hasInvalidCoordinates}}
|
|
236
381
|
<div class="leading-5 text-sm text-red-400 mt-2">
|
|
237
|
-
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
382
|
+
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
383
|
+
{{t "fleet-ops.operations.orders.index.new.invalid-coordinates"}}
|
|
238
384
|
</div>
|
|
239
385
|
{{/if}}
|
|
240
386
|
</div>
|
|
@@ -266,17 +412,33 @@
|
|
|
266
412
|
</div>
|
|
267
413
|
</div>
|
|
268
414
|
|
|
269
|
-
<ModelSelect
|
|
415
|
+
<ModelSelect
|
|
416
|
+
@modelName="place"
|
|
417
|
+
@selectedModel={{this.payload.pickup}}
|
|
418
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.select-pickup"}}
|
|
419
|
+
@triggerClass="form-select form-input"
|
|
420
|
+
@infiniteScroll={{false}}
|
|
421
|
+
@customSearchEndpoint="places/search"
|
|
422
|
+
@query={{hash geo=true latitude=this.userLatitude longitude=this.userLongitude}}
|
|
423
|
+
@renderInPlace={{true}}
|
|
424
|
+
@onChange={{fn this.setPayloadPlace "pickup"}}
|
|
425
|
+
as |model|
|
|
426
|
+
>
|
|
270
427
|
{{model.address}}
|
|
271
428
|
</ModelSelect>
|
|
272
429
|
|
|
273
430
|
{{#if (and this.isUsingIntegratedVendor (is-not-facilitator-supported-place this.order.facilitator this.payload.pickup))}}
|
|
274
|
-
<InfoBlock
|
|
431
|
+
<InfoBlock
|
|
432
|
+
class="my-2 px-4 py-1.5 danger"
|
|
433
|
+
@blockClass="flex flex-row items-center"
|
|
434
|
+
@text={{concat this.order.facilitator.name (t "fleet-ops.operations.orders.index.new.infoblock-text")}}
|
|
435
|
+
/>
|
|
275
436
|
{{/if}}
|
|
276
437
|
|
|
277
438
|
{{#if this.payload.pickup.hasInvalidCoordinates}}
|
|
278
439
|
<div class="leading-5 text-sm text-red-400 mt-2">
|
|
279
|
-
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
440
|
+
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
441
|
+
{{t "fleet-ops.operations.orders.index.new.invalid-coordinates"}}
|
|
280
442
|
</div>
|
|
281
443
|
{{/if}}
|
|
282
444
|
</InputGroup>
|
|
@@ -297,17 +459,33 @@
|
|
|
297
459
|
</div>
|
|
298
460
|
</div>
|
|
299
461
|
|
|
300
|
-
<ModelSelect
|
|
462
|
+
<ModelSelect
|
|
463
|
+
@modelName="place"
|
|
464
|
+
@selectedModel={{this.payload.dropoff}}
|
|
465
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.select-dropoff"}}
|
|
466
|
+
@triggerClass="form-select form-input"
|
|
467
|
+
@infiniteScroll={{false}}
|
|
468
|
+
@customSearchEndpoint="places/search"
|
|
469
|
+
@query={{hash geo=true latitude=this.userLatitude longitude=this.userLongitude}}
|
|
470
|
+
@renderInPlace={{true}}
|
|
471
|
+
@onChange={{fn this.setPayloadPlace "dropoff"}}
|
|
472
|
+
as |model|
|
|
473
|
+
>
|
|
301
474
|
{{model.address}}
|
|
302
475
|
</ModelSelect>
|
|
303
476
|
|
|
304
477
|
{{#if (and this.isUsingIntegratedVendor (is-not-facilitator-supported-place this.order.facilitator this.payload.dropoff))}}
|
|
305
|
-
<InfoBlock
|
|
478
|
+
<InfoBlock
|
|
479
|
+
class="my-2 px-4 py-1.5 danger"
|
|
480
|
+
@blockClass="flex flex-row items-center"
|
|
481
|
+
@text={{concat this.order.facilitator.name (t "fleet-ops.operations.orders.index.new.infoblock-text")}}
|
|
482
|
+
/>
|
|
306
483
|
{{/if}}
|
|
307
484
|
|
|
308
485
|
{{#if this.payload.dropoff.hasInvalidCoordinates}}
|
|
309
486
|
<div class="leading-5 text-sm text-red-400 mt-2">
|
|
310
|
-
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
487
|
+
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
488
|
+
{{t "fleet-ops.operations.orders.index.new.invalid-coordinates"}}
|
|
311
489
|
</div>
|
|
312
490
|
{{/if}}
|
|
313
491
|
</InputGroup>
|
|
@@ -321,17 +499,33 @@
|
|
|
321
499
|
{{/if}}
|
|
322
500
|
</div>
|
|
323
501
|
|
|
324
|
-
<ModelSelect
|
|
502
|
+
<ModelSelect
|
|
503
|
+
@modelName="place"
|
|
504
|
+
@selectedModel={{this.payload.return}}
|
|
505
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.select-return"}}
|
|
506
|
+
@triggerClass="form-select form-input"
|
|
507
|
+
@infiniteScroll={{false}}
|
|
508
|
+
@customSearchEndpoint="places/search"
|
|
509
|
+
@query={{hash geo=true latitude=this.userLatitude longitude=this.userLongitude}}
|
|
510
|
+
@renderInPlace={{true}}
|
|
511
|
+
@onChange={{fn this.setPayloadPlace "return"}}
|
|
512
|
+
as |model|
|
|
513
|
+
>
|
|
325
514
|
{{model.address}}
|
|
326
515
|
</ModelSelect>
|
|
327
516
|
|
|
328
517
|
{{#if (and this.isUsingIntegratedVendor (is-not-facilitator-supported-place this.order.facilitator this.payload.return))}}
|
|
329
|
-
<InfoBlock
|
|
518
|
+
<InfoBlock
|
|
519
|
+
class="my-2 px-4 py-1.5 danger"
|
|
520
|
+
@blockClass="flex flex-row items-center"
|
|
521
|
+
@text={{concat this.order.facilitator.name (t "fleet-ops.operations.orders.index.new.infoblock-text")}}
|
|
522
|
+
/>
|
|
330
523
|
{{/if}}
|
|
331
524
|
|
|
332
525
|
{{#if this.payload.return.hasInvalidCoordinates}}
|
|
333
526
|
<div class="leading-5 text-sm text-red-400 mt-2">
|
|
334
|
-
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
527
|
+
<FaIcon @icon="exclamation-triangle" class="mr-1" />
|
|
528
|
+
{{t "fleet-ops.operations.orders.index.new.invalid-coordinates"}}
|
|
335
529
|
</div>
|
|
336
530
|
{{/if}}
|
|
337
531
|
</InputGroup>
|
|
@@ -353,7 +547,13 @@
|
|
|
353
547
|
<h4 class="font-bold dark:text-gray-100">{{group.waypoint.place.address}}</h4>
|
|
354
548
|
</div>
|
|
355
549
|
<div>
|
|
356
|
-
<Button
|
|
550
|
+
<Button
|
|
551
|
+
@icon="plus"
|
|
552
|
+
@iconPrefix="fas"
|
|
553
|
+
@text={{t "fleet-ops.operations.orders.index.new.add-item-button"}}
|
|
554
|
+
@size="sm"
|
|
555
|
+
@onClick={{fn this.addEntity group.importId}}
|
|
556
|
+
/>
|
|
357
557
|
</div>
|
|
358
558
|
</div>
|
|
359
559
|
<div class="grid grid-cols-2 lg:grid-cols-3 gap-4 lg:gap-2">
|
|
@@ -365,15 +565,27 @@
|
|
|
365
565
|
</div>
|
|
366
566
|
<div class="space-y-2">
|
|
367
567
|
<div>
|
|
368
|
-
<Input @value={{entity.name}}
|
|
568
|
+
<Input @value={{entity.name}} @type="text" class="w-full form-input form-input-sm" placeholder={{t "fleet-ops.common.name"}} />
|
|
369
569
|
</div>
|
|
370
570
|
<div>
|
|
371
|
-
<Input
|
|
571
|
+
<Input
|
|
572
|
+
@value={{entity.sku}}
|
|
573
|
+
@type="text"
|
|
574
|
+
class="w-full form-input form-input-sm"
|
|
575
|
+
placeholder={{t "fleet-ops.operations.orders.index.new.sku"}}
|
|
576
|
+
/>
|
|
372
577
|
</div>
|
|
373
578
|
<Button @icon="pencil" @text={{t "fleet-ops.operations.orders.index.new.edit-item"}} @size="sm" @onClick={{fn this.editEntity entity}} />
|
|
374
579
|
</div>
|
|
375
580
|
<div class="absolute top-0 right-0 p-2">
|
|
376
|
-
<Button
|
|
581
|
+
<Button
|
|
582
|
+
@icon="times"
|
|
583
|
+
@iconPrefix="fas"
|
|
584
|
+
@type="danger"
|
|
585
|
+
@size="xs"
|
|
586
|
+
@onClick={{fn this.removeEntity entity}}
|
|
587
|
+
@wrapperClass={{if (eq index 0) "invisible"}}
|
|
588
|
+
/>
|
|
377
589
|
</div>
|
|
378
590
|
</div>
|
|
379
591
|
</div>
|
|
@@ -392,21 +604,19 @@
|
|
|
392
604
|
</div>
|
|
393
605
|
<div class="space-y-2">
|
|
394
606
|
<div>
|
|
395
|
-
<Input @value={{entity.name}}
|
|
607
|
+
<Input @value={{entity.name}} @type="text" class="w-full form-input form-input-sm" placeholder={{t "fleet-ops.common.name"}} />
|
|
396
608
|
</div>
|
|
397
609
|
<div>
|
|
398
|
-
<Input @value={{entity.sku}}
|
|
610
|
+
<Input @value={{entity.sku}} @type="text" class="w-full form-input form-input-sm" placeholder={{t "fleet-ops.operations.orders.index.new.sku"}} />
|
|
399
611
|
</div>
|
|
400
612
|
{{#if this.waypoints.length}}
|
|
401
|
-
<select class="form-select w-full form-input-sm" {{on "change" (fn
|
|
402
|
-
this.setEntityDestionation index)}}>
|
|
613
|
+
<select class="form-select w-full form-input-sm" {{on "change" (fn this.setEntityDestionation index)}}>
|
|
403
614
|
<option selected disabled>
|
|
404
615
|
{{t "fleet-ops.operations.orders.index.new.select-destination"}}
|
|
405
616
|
</option>
|
|
406
617
|
{{#each this.waypoints as |waypoint|}}
|
|
407
618
|
{{#if waypoint.place}}
|
|
408
|
-
<option value={{waypoint.place.id}} selected={{eq entity.destionation_uuid
|
|
409
|
-
waypoint.place.id}}>
|
|
619
|
+
<option value={{waypoint.place.id}} selected={{eq entity.destionation_uuid waypoint.place.id}}>
|
|
410
620
|
{{waypoint.place.address}}
|
|
411
621
|
</option>
|
|
412
622
|
{{/if}}
|
|
@@ -416,7 +626,14 @@
|
|
|
416
626
|
<Button @icon="pencil" @text={{t "fleet-ops.operations.orders.index.new.edit-item"}} @size="sm" @onClick={{fn this.editEntity entity}} />
|
|
417
627
|
</div>
|
|
418
628
|
<div class="absolute top-0 right-0 p-2">
|
|
419
|
-
<Button
|
|
629
|
+
<Button
|
|
630
|
+
@icon="times"
|
|
631
|
+
@iconPrefix="fas"
|
|
632
|
+
@type="danger"
|
|
633
|
+
@size="xs"
|
|
634
|
+
@onClick={{fn this.removeEntity entity}}
|
|
635
|
+
@wrapperClass={{if (eq index 0) "invisible"}}
|
|
636
|
+
/>
|
|
420
637
|
</div>
|
|
421
638
|
</div>
|
|
422
639
|
</div>
|
|
@@ -426,15 +643,39 @@
|
|
|
426
643
|
</ContentPanel>
|
|
427
644
|
|
|
428
645
|
<ContentPanel @title={{t "fleet-ops.common.service"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
429
|
-
<Toggle
|
|
646
|
+
<Toggle
|
|
647
|
+
@label={{t "fleet-ops.operations.orders.index.new.apply-service-rate"}}
|
|
648
|
+
@wrapperClass="justify-start-i mb-4"
|
|
649
|
+
@isToggled={{this.servicable}}
|
|
650
|
+
@onToggle={{this.checkServiceRates}}
|
|
651
|
+
@disabled={{this.isNotServicable}}
|
|
652
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.service-help-text"}}
|
|
653
|
+
/>
|
|
430
654
|
|
|
431
655
|
{{#if this.servicable}}
|
|
432
|
-
<ContentPanel
|
|
656
|
+
<ContentPanel
|
|
657
|
+
@title={{t "fleet-ops.operations.orders.index.new.service-quotes"}}
|
|
658
|
+
@open={{true}}
|
|
659
|
+
@pad={{true}}
|
|
660
|
+
@wrapperClass="mt-6"
|
|
661
|
+
@panelBodyClass="bg-white dark:bg-gray-800"
|
|
662
|
+
>
|
|
433
663
|
{{#unless this.isUsingIntegratedVendor}}
|
|
434
664
|
<div class="input-group mb-2i">
|
|
435
|
-
<InputLabel
|
|
436
|
-
|
|
437
|
-
|
|
665
|
+
<InputLabel
|
|
666
|
+
@labelText={{t "fleet-ops.operations.orders.index.new.select-service-rate"}}
|
|
667
|
+
@helpText={{t "fleet-ops.operations.orders.index.new.service-quotes-help-text"}}
|
|
668
|
+
/>
|
|
669
|
+
|
|
670
|
+
<Select
|
|
671
|
+
class="w-full"
|
|
672
|
+
@options={{this.serviceRates}}
|
|
673
|
+
@value={{this.selectedServiceRate}}
|
|
674
|
+
@optionLabel="service_name"
|
|
675
|
+
@optionValue="uuid"
|
|
676
|
+
@onSelect={{this.getQuotes}}
|
|
677
|
+
@placeholder={{t "fleet-ops.operations.orders.index.new.select-service-rate"}}
|
|
678
|
+
/>
|
|
438
679
|
</div>
|
|
439
680
|
{{/unless}}
|
|
440
681
|
|
|
@@ -444,7 +685,11 @@
|
|
|
444
685
|
|
|
445
686
|
{{#if this.isFetchingQuotes}}
|
|
446
687
|
<div class="flex items-center justify-center py-5">
|
|
447
|
-
<Spinner
|
|
688
|
+
<Spinner
|
|
689
|
+
class="text-sm dark:text-gray-100 flex flex-row items-center"
|
|
690
|
+
@iconClass="mr-2"
|
|
691
|
+
@loadingMessage={{t "fleet-ops.operations.orders.index.new.loading-message"}}
|
|
692
|
+
/>
|
|
448
693
|
</div>
|
|
449
694
|
{{else}}
|
|
450
695
|
<InfoBlock class="my-3" @text={{t "fleet-ops.operations.orders.index.new.info-text"}} />
|
|
@@ -453,7 +698,14 @@
|
|
|
453
698
|
{{#each this.serviceQuotes as |serviceQuote index|}}
|
|
454
699
|
<div class="radio-group-item shadow-sm flex-col pl-0i pr-0i {{if (eq @options.selected index) 'is-checked'}}">
|
|
455
700
|
<div class="flex flex-row items-center mb-2.5 px-4">
|
|
456
|
-
<RadioButton
|
|
701
|
+
<RadioButton
|
|
702
|
+
@radioClass="focus:ring-blue-500 h-6 w-6 text-blue-500"
|
|
703
|
+
@radioId={{serviceQuote.uuid}}
|
|
704
|
+
@value={{serviceQuote.uuid}}
|
|
705
|
+
@groupValue={{this.selectedServiceQuote}}
|
|
706
|
+
@name="serviceQuote"
|
|
707
|
+
@changed={{fn (mut this.selectedServiceQuote)}}
|
|
708
|
+
/>
|
|
457
709
|
<label for={{serviceQuote.uuid}} class="ml-3 flex-1">{{serviceQuote.public_id}}</label>
|
|
458
710
|
<Badge @hideStatusDot={{true}} @status="info">
|
|
459
711
|
{{serviceQuote.request_id}}
|
|
@@ -491,7 +743,15 @@
|
|
|
491
743
|
</div>
|
|
492
744
|
</div>
|
|
493
745
|
{{else}}
|
|
494
|
-
<InfoBlock
|
|
746
|
+
<InfoBlock
|
|
747
|
+
class="my-2 px-4 py-1.5 warning"
|
|
748
|
+
@blockClass="flex flex-row items-center"
|
|
749
|
+
@text={{if
|
|
750
|
+
this.payloadCoordinates.length
|
|
751
|
+
(t "fleet-ops.operations.orders.index.new.no-service-info-text")
|
|
752
|
+
(t "fleet-ops.operations.orders.index.new.input-order-info-text")
|
|
753
|
+
}}
|
|
754
|
+
/>
|
|
495
755
|
{{/each}}
|
|
496
756
|
</div>
|
|
497
757
|
{{/if}}
|
|
@@ -502,5 +762,77 @@
|
|
|
502
762
|
<ContentPanel @title={{t "fleet-ops.operations.orders.index.new.notes-title"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
503
763
|
<Textarea @value={{this.order.notes}} class="form-input w-full" placeholder={{t "fleet-ops.operations.orders.index.new.notes-placeholder"}} rows={{4}} />
|
|
504
764
|
</ContentPanel>
|
|
765
|
+
|
|
766
|
+
<ContentPanel @title={{t "fleet-ops.operations.orders.index.view.documents-panel-title"}} @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800">
|
|
767
|
+
<div class="space-y-4">
|
|
768
|
+
{{#if this.isUploading}}
|
|
769
|
+
<div
|
|
770
|
+
class="dropzone w-full rounded-lg px-4 py-8 bg-gray-50 dark:bg-gray-900 bg-opacity-25 text-gray-900 dark:text-white text-center flex flex-col items-center justify-center border-2 border-dashed border-gray-200 dark:border-indigo-500"
|
|
771
|
+
>
|
|
772
|
+
<div class="flex items-center justify-center py-5">
|
|
773
|
+
<Spinner class="text-sm dar:text-gray-100" @loadingMessage={{t "fleet-ops.common.uploading"}} />
|
|
774
|
+
</div>
|
|
775
|
+
</div>
|
|
776
|
+
{{else}}
|
|
777
|
+
{{#let (file-queue name="files" onFileAdded=this.queueFile accept=(join "," this.acceptedFileTypes)) as |queue|}}
|
|
778
|
+
<FileDropzone @queue={{queue}} class="dropzone file-dropzone" as |dropzone|>
|
|
779
|
+
{{#if dropzone.active}}
|
|
780
|
+
{{#if dropzone.valid}}
|
|
781
|
+
{{t "component.dropzone.drop-to-upload"}}
|
|
782
|
+
{{else}}
|
|
783
|
+
{{t "component.dropzone.invalid"}}
|
|
784
|
+
{{/if}}
|
|
785
|
+
{{else if queue.files.length}}
|
|
786
|
+
<div class="my-2">
|
|
787
|
+
<FaIcon @icon="folder-open" class="text-indigo-500 mr-2" />
|
|
788
|
+
{{t "component.dropzone.files-ready-for-upload" numOfFiles=(pluralize queue.files.length (t "component.dropzone.file"))}}
|
|
789
|
+
</div>
|
|
790
|
+
<div class="my-2">({{queue.progress}}%)</div>
|
|
791
|
+
{{else}}
|
|
792
|
+
<h4 class="font-semibold">
|
|
793
|
+
<FaIcon @icon="folder-open" @size="lg" class="text-indigo-500 mr-2" />
|
|
794
|
+
{{t "component.dropzone.upload-documents-files"}}
|
|
795
|
+
</h4>
|
|
796
|
+
<div>
|
|
797
|
+
{{#if dropzone.supported}}
|
|
798
|
+
<p class="text-sm my-5">{{t "component.dropzone.dropzone-supported-files"}}</p>
|
|
799
|
+
{{/if}}
|
|
800
|
+
<FileUpload @name="files" @for="files" @accept={{join "," this.acceptedFileTypes}} @multiple={{true}} @onFileAdded={{this.queueFile}}>
|
|
801
|
+
<a tabindex={{0}} class="btn btn-magic cursor-pointer ml-1">{{t "component.dropzone.or-select-button-text"}}</a>
|
|
802
|
+
</FileUpload>
|
|
803
|
+
</div>
|
|
804
|
+
{{/if}}
|
|
805
|
+
</FileDropzone>
|
|
806
|
+
{{/let}}
|
|
807
|
+
{{#if this.uploadQueue}}
|
|
808
|
+
<div class="mx-4">
|
|
809
|
+
<div class="flex items-center justify-between mb-4">
|
|
810
|
+
<span class="leading-6 dark:text-gray-100">{{t "component.dropzone.upload-queue"}}</span>
|
|
811
|
+
</div>
|
|
812
|
+
<div class="space-y-2 mb-4">
|
|
813
|
+
{{#each this.uploadQueue as |file|}}
|
|
814
|
+
<div class="flex items-center justify-between bg-blue-100 border border-blue-800 dark:border-blue-800 py-1.5 shadow-sm rounded-lg px-4">
|
|
815
|
+
<div class="text-xs text-blue-900 truncate">{{truncate-filename file.name 50}}</div>
|
|
816
|
+
<div class="flex items-center text-sm">
|
|
817
|
+
<Spinner class="text-blue-900 mr-2" />
|
|
818
|
+
<span class="font-bold text-blue-900">{{round file.progress}}%</span>
|
|
819
|
+
</div>
|
|
820
|
+
</div>
|
|
821
|
+
{{/each}}
|
|
822
|
+
</div>
|
|
823
|
+
</div>
|
|
824
|
+
{{/if}}
|
|
825
|
+
<div>
|
|
826
|
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-2 md:gap-4">
|
|
827
|
+
{{#each this.order.files as |file|}}
|
|
828
|
+
<File @file={{file}} @onDelete={{this.removeFile}} />
|
|
829
|
+
{{/each}}
|
|
830
|
+
</div>
|
|
831
|
+
</div>
|
|
832
|
+
{{/if}}
|
|
833
|
+
</div>
|
|
834
|
+
</ContentPanel>
|
|
835
|
+
|
|
836
|
+
<Spacer @height="300px" />
|
|
505
837
|
</Overlay::Body>
|
|
506
838
|
</Overlay>
|