Skip to content

Commit c9d6877

Browse files
committed
minor tweaks
1 parent 29c6666 commit c9d6877

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

addon/components/order-progress-card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class OrderProgressCardComponent extends Component {
3434
}
3535

3636
@task *loadTrackerData() {
37-
if (!isBlank(this.order.tracker_data)) {
37+
if (!isBlank(this.order.tracker_data) || !this.order || !this.order.isNew) {
3838
return;
3939
}
4040

addon/templates/operations/orders/index/new.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@onOverlayReady={{fn (mut this.overlay)}}
1010
@width="530px"
1111
@onOpen={{this.setup}}
12+
class="new-order-panel"
1213
>
1314
<Order::Form @resource={{this.order}} @controller={{this}} />
1415
<Spacer @height="300px" />

server/src/Expansions/UserFilterExpansion.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,37 @@ public static function target()
1616
return \Fleetbase\Http\Filter\UserFilter::class;
1717
}
1818

19+
/**
20+
* Filter where user is a driver type or has a driver profile.
21+
*
22+
* @return void
23+
*/
24+
public static function isDriver()
25+
{
26+
return function () {
27+
/** @var \Fleetbase\Http\Filter\UserFilter|\Fleetbase\Http\Filter\Filter $this */
28+
$this->builder->where(function ($query) {
29+
$query->where('type', 'driver');
30+
$query->orwhereHas('driverProfiles', function ($query) {
31+
$query->where('company_uuid', session('company'));
32+
});
33+
});
34+
};
35+
}
36+
37+
/**
38+
* Filter where a user is a customer.
39+
*
40+
* @return void
41+
*/
42+
public static function isCustomer()
43+
{
44+
return function () {
45+
/** @var \Fleetbase\Http\Filter\UserFilter|\Fleetbase\Http\Filter\Filter $this */
46+
$this->builder->where('type', 'customer');
47+
};
48+
}
49+
1950
/**
2051
* Filter where doesnt have driver within the CURRENT organizations.
2152
*

0 commit comments

Comments
 (0)