@fleetbase/fleetops-engine 0.1.8 → 0.2.0
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/live-map.js +4 -4
- package/addon/components/order-board.hbs +19 -0
- package/addon/components/order-board.js +81 -0
- package/addon/controllers/operations/orders/index/new.js +71 -0
- package/addon/controllers/operations/orders/index/view.js +25 -8
- package/addon/controllers/operations/orders/index.js +75 -3
- package/addon/engine.js +4 -0
- package/addon/routes/management/drivers/index.js +5 -0
- package/addon/routes/operations/orders/index.js +2 -0
- package/addon/templates/management/drivers/index.hbs +1 -1
- package/addon/templates/operations/orders/index.hbs +14 -1
- package/app/components/order-board.js +1 -0
- package/index.js +10 -0
- package/package.json +9 -8
- package/translations/en-us.yaml +9 -0
- package/addon/services/engine-context.js +0 -17
- package/app/services/engine-context.js +0 -1
|
@@ -21,7 +21,7 @@ export default class LiveMapComponent extends Component {
|
|
|
21
21
|
@service notifications;
|
|
22
22
|
@service serviceAreas;
|
|
23
23
|
@service appCache;
|
|
24
|
-
@service
|
|
24
|
+
@service universe;
|
|
25
25
|
|
|
26
26
|
@tracked routes = [];
|
|
27
27
|
@tracked drivers = [];
|
|
@@ -80,7 +80,7 @@ export default class LiveMapComponent extends Component {
|
|
|
80
80
|
*/
|
|
81
81
|
@action async setupLiveMap() {
|
|
82
82
|
// trigger that initial coordinates have been set
|
|
83
|
-
this.
|
|
83
|
+
this.universe.trigger('livemap.loaded', this);
|
|
84
84
|
|
|
85
85
|
if (this.skipSetCoordinates === false) {
|
|
86
86
|
if (this.appCache.has(['map_latitude', 'map_longitude'])) {
|
|
@@ -101,7 +101,7 @@ export default class LiveMapComponent extends Component {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
// trigger that initial coordinates have been set
|
|
104
|
-
this.
|
|
104
|
+
this.universe.trigger('livemap.has_coordinates', { latitude: this.latitude, longitude: this.longitude });
|
|
105
105
|
|
|
106
106
|
this.routes = await this.fetchActiveRoutes();
|
|
107
107
|
this.drivers = await this.fetchActiveDrivers();
|
|
@@ -115,7 +115,7 @@ export default class LiveMapComponent extends Component {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// add context event
|
|
118
|
-
this.
|
|
118
|
+
this.universe.trigger('livemap.ready', this);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
@action setMapReference(event) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<div class="order-board-container">
|
|
2
|
+
<div class="flex flex-row items-center justify-between px-6 py-3">
|
|
3
|
+
<div></div>
|
|
4
|
+
<div>
|
|
5
|
+
<DropdownButton @icon="layer-group" @text={{concat "Order Type: " this.type.name}} @type="magic" @size="sm" @contentClass="dropdown-menu" @disabled={{not this.orderTypes}} as |dd|>
|
|
6
|
+
<div class="next-dd-menu mt-2 mx-0">
|
|
7
|
+
{{#each this.orderTypes as |type|}}
|
|
8
|
+
<div class="px-1">
|
|
9
|
+
<a href="#" class=" next-dd-item" {{on "click" (dropdown-fn dd this.selectOrderType type)}}>
|
|
10
|
+
{{type.name}}
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
{{/each}}
|
|
14
|
+
</div>
|
|
15
|
+
</DropdownButton>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<Kanban @columns={{this.columns}} />
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
|
|
6
|
+
export default class OrderBoardComponent extends Component {
|
|
7
|
+
/**
|
|
8
|
+
* Inject the `fetch` service
|
|
9
|
+
*
|
|
10
|
+
* @var {Service}
|
|
11
|
+
*/
|
|
12
|
+
@service fetch;
|
|
13
|
+
|
|
14
|
+
@tracked type;
|
|
15
|
+
@tracked orderTypes = [];
|
|
16
|
+
@tracked columns = [];
|
|
17
|
+
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.loadOrderTypes();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Fetches the available order types from the server and updates the
|
|
25
|
+
* `orderTypes` property with the retrieved data. If the `type` query
|
|
26
|
+
* parameter is set (bound to `this.type`), it also finds and sets the
|
|
27
|
+
* corresponding selected order type in `selectedOrderType`.
|
|
28
|
+
*
|
|
29
|
+
* @action
|
|
30
|
+
* @returns {Promise} A promise that resolves when the order types have been loaded
|
|
31
|
+
*/
|
|
32
|
+
@action loadOrderTypes() {
|
|
33
|
+
return this.fetch.get('orders/types').then((types) => {
|
|
34
|
+
this.orderTypes = types;
|
|
35
|
+
|
|
36
|
+
if (typeof this.args.onTypesLoaded === 'function') {
|
|
37
|
+
this.args.onTypesLoaded(types);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (typeof this.args.type === 'string') {
|
|
41
|
+
const selectedType = types.find(({ key }) => key === this.args.type);
|
|
42
|
+
|
|
43
|
+
if (selectedType) {
|
|
44
|
+
this.selectOrderType(selectedType);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Selectes the order type.
|
|
52
|
+
*
|
|
53
|
+
* @action
|
|
54
|
+
* @param {Object} type
|
|
55
|
+
* @memberof OrderBoardComponent
|
|
56
|
+
*/
|
|
57
|
+
@action selectOrderType(type) {
|
|
58
|
+
this.type = type;
|
|
59
|
+
this.setColumnsFromOrderType(type);
|
|
60
|
+
|
|
61
|
+
if (typeof this.args.onOrderTypeChanged === 'function') {
|
|
62
|
+
this.args.onOrderTypeChanged(type);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@action setColumnsFromOrderType(type) {
|
|
67
|
+
const columns = [];
|
|
68
|
+
|
|
69
|
+
for (let event in type.meta.flow) {
|
|
70
|
+
if (!event.includes('|')) {
|
|
71
|
+
columns.push(event);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
columns.push('canceled');
|
|
76
|
+
columns.push('completed');
|
|
77
|
+
|
|
78
|
+
this.columns = columns;
|
|
79
|
+
return this.columns;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -31,16 +31,81 @@ export default class OperationsOrdersIndexNewController extends Controller {
|
|
|
31
31
|
@controller('management.vendors.index') vendorsController;
|
|
32
32
|
@controller('operations.orders.index') ordersController;
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Inject the `modalsManager` service
|
|
36
|
+
*
|
|
37
|
+
* @var {Service}
|
|
38
|
+
*/
|
|
34
39
|
@service modalsManager;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Inject the `notifications` service
|
|
43
|
+
*
|
|
44
|
+
* @var {Service}
|
|
45
|
+
*/
|
|
35
46
|
@service notifications;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Inject the `loader` service
|
|
50
|
+
*
|
|
51
|
+
* @var {Service}
|
|
52
|
+
*/
|
|
36
53
|
@service loader;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Inject the `currentUser` service
|
|
57
|
+
*
|
|
58
|
+
* @var {Service}
|
|
59
|
+
*/
|
|
37
60
|
@service currentUser;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Inject the `hostRouter` service
|
|
64
|
+
*
|
|
65
|
+
* @var {Service}
|
|
66
|
+
*/
|
|
38
67
|
@service hostRouter;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Inject the `fileQueue` service
|
|
71
|
+
*
|
|
72
|
+
* @var {Service}
|
|
73
|
+
*/
|
|
39
74
|
@service fileQueue;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Inject the `fetch` service
|
|
78
|
+
*
|
|
79
|
+
* @var {Service}
|
|
80
|
+
*/
|
|
40
81
|
@service fetch;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Inject the `store` service
|
|
85
|
+
*
|
|
86
|
+
* @var {Service}
|
|
87
|
+
*/
|
|
41
88
|
@service store;
|
|
42
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Inject the `universe` service
|
|
92
|
+
*
|
|
93
|
+
* @var {Service}
|
|
94
|
+
*/
|
|
95
|
+
@service universe;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Create an OrderModel instance.
|
|
99
|
+
*
|
|
100
|
+
* @var {OrderModel}
|
|
101
|
+
*/
|
|
43
102
|
@tracked order = this.store.createRecord('order', { meta: [] });
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Create an PayloadModel instance.
|
|
106
|
+
*
|
|
107
|
+
* @var {OrderModel}
|
|
108
|
+
*/
|
|
44
109
|
@tracked payload = this.store.createRecord('payload');
|
|
45
110
|
@tracked driversQuery = {};
|
|
46
111
|
@tracked meta = [];
|
|
@@ -213,12 +278,18 @@ export default class OperationsOrdersIndexNewController extends Controller {
|
|
|
213
278
|
return;
|
|
214
279
|
}
|
|
215
280
|
|
|
281
|
+
// send event that fleetops is `creating` an order
|
|
282
|
+
this.universe.trigger('fleet-ops.order.creating', order);
|
|
216
283
|
this.isCreatingOrder = true;
|
|
217
284
|
|
|
218
285
|
try {
|
|
219
286
|
return order
|
|
220
287
|
.save()
|
|
221
288
|
.then((order) => {
|
|
289
|
+
// trigger event that fleet-ops created an order
|
|
290
|
+
this.universe.trigger('fleet-ops.order.created', order);
|
|
291
|
+
|
|
292
|
+
// transition to order view
|
|
222
293
|
return this.transitionToRoute('operations.orders.index.view', order).then(() => {
|
|
223
294
|
this.notifications.success(`New Order ${order.public_id} Created`);
|
|
224
295
|
this.loader.removeLoader();
|
|
@@ -9,7 +9,6 @@ import { OSRMv1, Control as RoutingControl } from '@fleetbase/leaflet-routing-ma
|
|
|
9
9
|
import groupBy from '@fleetbase/ember-core/utils/macros/group-by';
|
|
10
10
|
import findClosestWaypoint from '@fleetbase/ember-core/utils/find-closest-waypoint';
|
|
11
11
|
import getRoutingHost from '@fleetbase/ember-core/utils/get-routing-host';
|
|
12
|
-
import extractCoordinates from '@fleetbase/ember-core/utils/extract-coordinates';
|
|
13
12
|
|
|
14
13
|
export default class OperationsOrdersIndexViewController extends Controller {
|
|
15
14
|
/**
|
|
@@ -83,11 +82,11 @@ export default class OperationsOrdersIndexViewController extends Controller {
|
|
|
83
82
|
@service hostRouter;
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
|
-
* Inject the `
|
|
85
|
+
* Inject the `universe` service
|
|
87
86
|
*
|
|
88
87
|
* @var {Service}
|
|
89
88
|
*/
|
|
90
|
-
@service
|
|
89
|
+
@service universe;
|
|
91
90
|
|
|
92
91
|
@tracked isLoadingAdditionalData = false;
|
|
93
92
|
@tracked isWaypointsCollapsed;
|
|
@@ -226,14 +225,14 @@ export default class OperationsOrdersIndexViewController extends Controller {
|
|
|
226
225
|
};
|
|
227
226
|
|
|
228
227
|
// re-display order routes when livemap has coordinates
|
|
229
|
-
this.
|
|
228
|
+
this.universe.on('livemap.has_coordinates', this, displayOrderRoute);
|
|
230
229
|
|
|
231
230
|
// when transitioning away kill event listener
|
|
232
231
|
this.hostRouter.on('routeWillChange', () => {
|
|
233
|
-
const isListening = this.
|
|
232
|
+
const isListening = this.universe.has('livemap.has_coordinates');
|
|
234
233
|
|
|
235
234
|
if (isListening) {
|
|
236
|
-
this.
|
|
235
|
+
this.universe.off('livemap.has_coordinates', this, displayOrderRoute);
|
|
237
236
|
}
|
|
238
237
|
});
|
|
239
238
|
|
|
@@ -241,10 +240,28 @@ export default class OperationsOrdersIndexViewController extends Controller {
|
|
|
241
240
|
setup();
|
|
242
241
|
}
|
|
243
242
|
|
|
243
|
+
@computed('model.payload.{dropoff,pickup,waypoints}') get routeWaypoints() {
|
|
244
|
+
const { payload } = this.model;
|
|
245
|
+
let waypoints = [];
|
|
246
|
+
let coordinates = [];
|
|
247
|
+
|
|
248
|
+
waypoints.pushObjects([payload.pickup, ...payload.waypoints.toArray(), payload.dropoff]);
|
|
249
|
+
waypoints.forEach((place) => {
|
|
250
|
+
if (place && place.get('longitude') && place.get('latitude')) {
|
|
251
|
+
if (place.hasInvalidCoordinates) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
coordinates.pushObject([place.get('latitude'), place.get('longitude')]);
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
return coordinates;
|
|
260
|
+
}
|
|
261
|
+
|
|
244
262
|
@action displayOrderRoute() {
|
|
245
|
-
// map coordinates from lng, lat -> lat, lng
|
|
246
263
|
const payload = this.model.payload;
|
|
247
|
-
const waypoints =
|
|
264
|
+
const waypoints = this.routeWaypoints;
|
|
248
265
|
const leafletMap = this.leafletMap;
|
|
249
266
|
const routingHost = getRoutingHost(payload, payload?.waypoints?.toArray());
|
|
250
267
|
|
|
@@ -74,11 +74,11 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
74
74
|
@service crud;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
* Inject the `
|
|
77
|
+
* Inject the `universe` service
|
|
78
78
|
*
|
|
79
79
|
* @var {Service}
|
|
80
80
|
*/
|
|
81
|
-
@service
|
|
81
|
+
@service universe;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Queryable parameters for this controller's model
|
|
@@ -102,6 +102,8 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
102
102
|
'created_by',
|
|
103
103
|
'updated_by',
|
|
104
104
|
'status',
|
|
105
|
+
'type',
|
|
106
|
+
'layout',
|
|
105
107
|
];
|
|
106
108
|
|
|
107
109
|
/**
|
|
@@ -209,13 +211,74 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
209
211
|
*/
|
|
210
212
|
@tracked status;
|
|
211
213
|
|
|
214
|
+
/**
|
|
215
|
+
* The filterable param `type` - Filter by order type
|
|
216
|
+
*
|
|
217
|
+
* @var {String}
|
|
218
|
+
*/
|
|
219
|
+
@tracked type;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Flag to determine if the search is visible
|
|
223
|
+
*
|
|
224
|
+
* @type {Boolean}
|
|
225
|
+
*/
|
|
212
226
|
@tracked isSearchVisible = false;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Flag to determine if the orders panel is visible
|
|
230
|
+
*
|
|
231
|
+
* @type {Boolean}
|
|
232
|
+
*/
|
|
213
233
|
@tracked isOrdersPanelVisible = false;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Count of active orders
|
|
237
|
+
*
|
|
238
|
+
* @type {Number}
|
|
239
|
+
*/
|
|
214
240
|
@tracked activeOrdersCount = 0;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Reference to the leaflet map object
|
|
244
|
+
*
|
|
245
|
+
* @type {Object}
|
|
246
|
+
*/
|
|
215
247
|
@tracked leafletMap;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Current layout type (e.g., 'map', 'table', 'kanban', 'analytics')
|
|
251
|
+
*
|
|
252
|
+
* @type {String}
|
|
253
|
+
*/
|
|
216
254
|
@tracked layout = 'map';
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Flag to determine if the layout is 'map'
|
|
258
|
+
*
|
|
259
|
+
* @type {Boolean}
|
|
260
|
+
*/
|
|
217
261
|
@equal('layout', 'map') isMapLayout;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Flag to determine if the layout is 'table'
|
|
265
|
+
*
|
|
266
|
+
* @type {Boolean}
|
|
267
|
+
*/
|
|
218
268
|
@equal('layout', 'table') isTableLayout;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Flag to determine if the view is 'kanban'
|
|
272
|
+
*
|
|
273
|
+
* @type {Boolean}
|
|
274
|
+
*/
|
|
275
|
+
@equal('layout', 'kanban') isKanbanView;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Flag to determine if the layout is 'analytics'
|
|
279
|
+
*
|
|
280
|
+
* @type {Boolean}
|
|
281
|
+
*/
|
|
219
282
|
@equal('layout', 'analytics') isAnalyticsLayout;
|
|
220
283
|
|
|
221
284
|
/**
|
|
@@ -293,8 +356,10 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
293
356
|
sortable: true,
|
|
294
357
|
filterable: true,
|
|
295
358
|
filterComponent: 'filter/model',
|
|
359
|
+
filterOptionLabel: 'address',
|
|
296
360
|
filterComponentPlaceholder: 'Select order pickup location',
|
|
297
361
|
filterParam: 'pickup',
|
|
362
|
+
modelNamePath: 'address',
|
|
298
363
|
model: 'place',
|
|
299
364
|
},
|
|
300
365
|
{
|
|
@@ -308,6 +373,7 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
308
373
|
filterComponent: 'filter/model',
|
|
309
374
|
filterComponentPlaceholder: 'Select order dropoff location',
|
|
310
375
|
filterParam: 'dropoff',
|
|
376
|
+
modelNamePath: 'address',
|
|
311
377
|
model: 'place',
|
|
312
378
|
},
|
|
313
379
|
{
|
|
@@ -369,6 +435,12 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
369
435
|
resizable: true,
|
|
370
436
|
hidden: true,
|
|
371
437
|
sortable: true,
|
|
438
|
+
filterable: true,
|
|
439
|
+
filterComponent: 'filter/select',
|
|
440
|
+
filterOptions: this.orderTypes,
|
|
441
|
+
filterOptionLabel: 'name',
|
|
442
|
+
filterOptionValue: 'key',
|
|
443
|
+
filterComponentPlaceholder: 'Filter by order type',
|
|
372
444
|
},
|
|
373
445
|
{
|
|
374
446
|
label: 'Status',
|
|
@@ -528,7 +600,7 @@ export default class OperationsOrdersIndexController extends Controller {
|
|
|
528
600
|
this.isSearchVisible = false;
|
|
529
601
|
}
|
|
530
602
|
|
|
531
|
-
this.
|
|
603
|
+
this.universe.trigger('dashboard.layout.changed', mode);
|
|
532
604
|
}
|
|
533
605
|
|
|
534
606
|
@action setMapReference({ target }) {
|
package/addon/engine.js
CHANGED
|
@@ -14,6 +14,10 @@ export default class FleetOpsEngine extends Engine {
|
|
|
14
14
|
services,
|
|
15
15
|
externalRoutes,
|
|
16
16
|
};
|
|
17
|
+
setupExtension = function (app, engine, universe) {
|
|
18
|
+
// register menu item in header
|
|
19
|
+
universe.registerHeaderMenuItem('Fleet-Ops', 'console.fleet-ops', { icon: 'route', priority: 0 });
|
|
20
|
+
};
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
loadInitializers(FleetOpsEngine, modulePrefix);
|
|
@@ -3,6 +3,7 @@ import { inject as service } from '@ember/service';
|
|
|
3
3
|
|
|
4
4
|
export default class ManagementDriversIndexRoute extends Route {
|
|
5
5
|
@service store;
|
|
6
|
+
@service intl;
|
|
6
7
|
|
|
7
8
|
queryParams = {
|
|
8
9
|
page: { refreshModel: true },
|
|
@@ -27,6 +28,10 @@ export default class ManagementDriversIndexRoute extends Route {
|
|
|
27
28
|
'within[where]': { refreshModel: true, replace: true },
|
|
28
29
|
};
|
|
29
30
|
|
|
31
|
+
beforeModel() {
|
|
32
|
+
this.intl.setLocale(['en-us']);
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
model(params) {
|
|
31
36
|
return this.store.query('driver', { ...params });
|
|
32
37
|
}
|
|
@@ -23,6 +23,8 @@ export default class OperationsOrdersIndexRoute extends Route {
|
|
|
23
23
|
dropoff: { refreshModel: true },
|
|
24
24
|
after: { refreshModel: true },
|
|
25
25
|
before: { refreshModel: true },
|
|
26
|
+
type: { refreshModel: true },
|
|
27
|
+
layout: { refreshModel: false },
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
@action willTransition(transition) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<Layout::Section::Header @title="
|
|
1
|
+
<Layout::Section::Header @title={{t "fleet-ops.management.drivers.index.title"}} @searchPlaceholder={{t "fleet-ops.management.drivers.index.fields.search.placeholder"}} @searchQuery={{this.query}} @onSearch={{perform this.search}}>
|
|
2
2
|
<Button @icon="grip-horizontal" @prefix="fas" @onClick={{fn this.changeLayout "grid"}} @disabled={{this.isGridLayout}} class="mr-2" />
|
|
3
3
|
<Button @icon="table" @prefix="fas" @onClick={{fn this.changeLayout "table"}} @disabled={{this.isTableLayout}} class="mr-2" />
|
|
4
4
|
<FiltersPicker @columns={{this.columns}} @onApply={{fn this.filters.apply this}} @onClear={{fn this.filters.reset this}} @onFilterClear={{this.filters.clear}} @onChange={{this.filters.set}} @buttonWrapperClass="mr-2" />
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
<button type="button" class="{{if this.isMapLayout 'active'}}" {{on "click" (fn this.setLayoutMode "map")}}>Map</button>
|
|
5
5
|
<button type="button" class="{{if this.isTableLayout 'active'}} flex flex-row items-center relative" {{on "click" (fn this.setLayoutMode "table")}}>
|
|
6
6
|
<div class="mr-1.5">Table</div>
|
|
7
|
-
<Badge class="flex items-center justify-center -mr-4" @spanClass="rounded-full
|
|
7
|
+
<Badge class="flex items-center justify-center -mr-4" @spanClass="rounded-full items-center justify-center h-4 w-4" @hideStatusDot={{true}} @status="info">{{@model.meta.total}}</Badge>
|
|
8
8
|
</button>
|
|
9
|
+
{{!-- <button type="button" class="{{if this.isKanbanView 'active'}}" {{on "click" (fn this.setLayoutMode "kanban")}}>Board</button> --}}
|
|
9
10
|
</MapContainer::ViewSwitch>
|
|
10
11
|
</MapContainer::Topbar>
|
|
11
12
|
|
|
@@ -45,4 +46,16 @@
|
|
|
45
46
|
</Layout::Section::Body>
|
|
46
47
|
{{/if}}
|
|
47
48
|
|
|
49
|
+
{{#if this.isKanbanView}}
|
|
50
|
+
<Layout::Section::Header @title="Orders" @onSearch={{perform this.search}}>
|
|
51
|
+
<Button @icon="cogs" @text="Config" class="mr-2" @onClick={{fn (transition-to "operations.orders.index.config")}} />
|
|
52
|
+
<FiltersPicker @columns={{this.columns}} @onApply={{fn this.filters.apply this}} @onClear={{fn this.filters.reset this}} @onFilterClear={{this.filters.clear}} @onChange={{this.filters.set}} @buttonWrapperClass="mr-2" />
|
|
53
|
+
<Button @type="primary" @icon="plus" @iconPrefix="fas" @text="New" @wrapperClass="mr-2" @onClick={{fn (transition-to "operations.orders.index.new")}} />
|
|
54
|
+
<Button @icon="long-arrow-up" @iconClass="rotate-icon-45" @text="Export" @onClick={{this.exportOrders}} />
|
|
55
|
+
</Layout::Section::Header>
|
|
56
|
+
<Layout::Section::Body>
|
|
57
|
+
<OrderBoard @type={{this.type}} />
|
|
58
|
+
</Layout::Section::Body>
|
|
59
|
+
{{/if}}
|
|
60
|
+
|
|
48
61
|
{{outlet}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/order-board';
|
package/index.js
CHANGED
|
@@ -9,6 +9,16 @@ const path = require('path');
|
|
|
9
9
|
module.exports = buildEngine({
|
|
10
10
|
name,
|
|
11
11
|
|
|
12
|
+
postprocessTree(type, tree) {
|
|
13
|
+
if (type === 'css') {
|
|
14
|
+
tree = new Funnel(tree, {
|
|
15
|
+
exclude: ['**/@fleetbase/ember-ui/**/*.css'],
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return tree;
|
|
20
|
+
},
|
|
21
|
+
|
|
12
22
|
lazyLoading: {
|
|
13
23
|
enabled: true,
|
|
14
24
|
},
|
package/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"version": "0.1.8",
|
|
6
|
-
"priority": 0,
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
|
|
7
5
|
"fleetbase": {
|
|
6
|
+
"route": "fleet-ops",
|
|
8
7
|
"dashboard": "int/v1/fleet-ops/dashboard"
|
|
9
8
|
},
|
|
10
|
-
"description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
|
|
11
9
|
"keywords": [
|
|
12
10
|
"fleetbase-extension",
|
|
13
11
|
"fleet-management",
|
|
@@ -36,11 +34,13 @@
|
|
|
36
34
|
"start": "ember serve",
|
|
37
35
|
"test": "npm-run-all lint test:*",
|
|
38
36
|
"test:ember": "ember test",
|
|
39
|
-
"test:ember-compatibility": "ember try:each"
|
|
37
|
+
"test:ember-compatibility": "ember try:each",
|
|
38
|
+
"publish:npm": "npm config set registry https://registry.npmjs.org/ && npm publish",
|
|
39
|
+
"publish:github": "npm config set '@fleetbase:registry' https://npm.pkg.github.com/ && npm publish"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@fleetbase/ember-core": "^0.
|
|
43
|
-
"@fleetbase/ember-ui":
|
|
42
|
+
"@fleetbase/ember-core": "^0.1.1",
|
|
43
|
+
"@fleetbase/ember-ui": "^0.1.4",
|
|
44
44
|
"@fleetbase/fleetops-data": "^0.0.6",
|
|
45
45
|
"@fleetbase/leaflet-routing-machine": "^3.2.16",
|
|
46
46
|
"@fortawesome/ember-fontawesome": "^0.4.1",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@zestia/ember-dragula": "^12.0.0",
|
|
51
51
|
"broccoli-funnel": "^3.0.8",
|
|
52
52
|
"broccoli-merge-trees": "^4.2.0",
|
|
53
|
+
"ember-intl": "^6.0.0-beta.6",
|
|
53
54
|
"ember-cli-babel": "^7.26.11",
|
|
54
55
|
"ember-cli-es6-transform": "^1.0.0",
|
|
55
56
|
"ember-cli-htmlbars": "^6.1.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Service from '@ember/service';
|
|
2
|
-
import Evented from '@ember/object/evented';
|
|
3
|
-
|
|
4
|
-
export default class EngineContextService extends Service.extend(Evented) {
|
|
5
|
-
options = {};
|
|
6
|
-
|
|
7
|
-
setOption(key, value) {
|
|
8
|
-
this.options = {
|
|
9
|
-
...this.options,
|
|
10
|
-
[key]: value,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getOption(key) {
|
|
15
|
-
return this.options[key];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/services/engine-context';
|