Skip to content

Commit 2bebe8e

Browse files
authored
Merge pull request #198 from fleetbase/dev-v0.3.32
feat: Remove usage of `window.Fleetbase`, improve several order relat…
2 parents 66edd91 + ea5564e commit 2bebe8e

File tree

13 files changed

+139
-558
lines changed

13 files changed

+139
-558
lines changed

addon/components/customer/orders.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class CustomerOrdersComponent extends Component {
4242

4343
get modalsManager() {
4444
const owner = getOwner(this);
45-
const application = typeof this.universe.getApplicationInstance === 'function' ? this.universe.getApplicationInstance() : window.Fleetbase;
45+
const application = this.universe.getApplicationInstance();
4646
const modalsManager = application ? application.lookup('service:modals-manager') : owner.lookup('service:modals-manager');
4747
return modalsManager;
4848
}

addon/services/leaflet-routing-control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default class LeafletRoutingControlService extends Service {
6767

6868
#initializeRegistry() {
6969
const registry = 'registry:routing-controls';
70-
const application = typeof this.universe?.getApplicationInstance === 'function' ? this.universe.getApplicationInstance() : window.Fleetbase;
70+
const application = this.universe.getApplicationInstance();
7171
if (!application.hasRegistration(registry)) {
7272
application.register(registry, new RoutingControlRegistry(), { instantiate: false });
7373
}

addon/services/movement-tracker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export class EventBuffer {
122122

123123
export default class MovementTrackerService extends Service {
124124
@service socket;
125+
@service universe;
125126
@tracked channels = [];
126127
@tracked buffers = new Map();
127128

@@ -131,7 +132,7 @@ export default class MovementTrackerService extends Service {
131132
}
132133

133134
#getOwner(owner = null) {
134-
return owner ?? window.Fleetbase ?? getOwner(this);
135+
return owner ?? this.universe.getApplicationInstance() ?? getOwner(this);
135136
}
136137

137138
#getBuffer(key, model, opts = {}) {

addon/services/route-optimization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class RouteOptimizationService extends Service {
5757

5858
#initializeRegistry() {
5959
const registry = 'registry:route-optimization-engines';
60-
const application = typeof this.universe?.getApplicationInstance === 'function' ? this.universe.getApplicationInstance() : window.Fleetbase;
60+
const application = this.universe.getApplicationInstance();
6161
if (!application.hasRegistration(registry)) {
6262
application.register(registry, new RouteOptimizationRegistry(), { instantiate: false });
6363
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fleetbase/fleetops-api",
3-
"version": "0.6.31",
3+
"version": "0.6.32",
44
"description": "Fleet & Transport Management Extension for Fleetbase",
55
"keywords": [
66
"fleetbase-extension",

extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Fleet-Ops",
3-
"version": "0.6.31",
3+
"version": "0.6.32",
44
"description": "Fleet & Transport Management Extension for Fleetbase",
55
"repository": "https://github.com/fleetbase/fleetops",
66
"license": "AGPL-3.0-or-later",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleetbase/fleetops-engine",
3-
"version": "0.6.31",
3+
"version": "0.6.32",
44
"description": "Fleet & Transport Management Extension for Fleetbase",
55
"fleetbase": {
66
"route": "fleet-ops"
@@ -42,8 +42,8 @@
4242
},
4343
"dependencies": {
4444
"@babel/core": "^7.23.2",
45-
"@fleetbase/ember-core": "^0.3.9",
46-
"@fleetbase/ember-ui": "^0.3.15",
45+
"@fleetbase/ember-core": "^0.3.10",
46+
"@fleetbase/ember-ui": "^0.3.17",
4747
"@fleetbase/fleetops-data": "^0.1.24",
4848
"@fleetbase/leaflet-routing-machine": "^3.2.17",
4949
"@fortawesome/ember-fontawesome": "^2.0.0",

pnpm-lock.yaml

Lines changed: 73 additions & 545 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/src/Http/Controllers/Internal/v1/LiveController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ function ($q) {
139139

140140
if ($active) {
141141
$query->whereHas('driverAssigned');
142+
$query->whereNotIn('status', ['created', 'completed', 'expired', 'order_canceled', 'canceled', 'pending']);
142143
}
143144

144145
if ($unassigned) {
@@ -166,7 +167,7 @@ public function drivers(Request $request)
166167

167168
return LiveCacheService::remember('drivers', $cacheParams, function () use ($bounds) {
168169
$query = Driver::where(['company_uuid' => session('company')])
169-
->with(['user', 'vehicle', 'currentJob'])
170+
->with(['user', 'vehicle'])
170171
->applyDirectivesForPermissions('fleet-ops list driver');
171172

172173
// Filter out drivers with invalid coordinates

server/src/Http/Filter/OrderFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function active(bool $active = false)
116116
$this->builder->where(
117117
function ($q) {
118118
$q->whereHas('driverAssigned');
119-
$q->whereNotIn('status', ['created', 'canceled', 'order_canceled', 'completed']);
119+
$q->whereNotIn('status', ['created', 'completed', 'expired', 'order_canceled', 'canceled', 'pending']);
120120
}
121121
);
122122
}

0 commit comments

Comments
 (0)