File tree Expand file tree Collapse file tree
templates/operations/orders/index Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments