@fleetbase/fleetops-engine 0.0.8 → 0.0.9

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.
@@ -3,7 +3,7 @@ import { tracked } from '@glimmer/tracking';
3
3
  import { inject as service } from '@ember/service';
4
4
  import { action, computed, set } from '@ember/object';
5
5
  import { isArray } from '@ember/array';
6
- import { isEmpty } from '@ember/utils';
6
+ import { isBlank } from '@ember/utils';
7
7
  import { dasherize } from '@ember/string';
8
8
  import { alias } from '@ember/object/computed';
9
9
  import { guidFor } from '@ember/object/internals';
@@ -146,7 +146,7 @@ export default class LiveMapComponent extends Component {
146
146
  if (index > 0) {
147
147
  const options = this.currentContextMenuItems.objectAt(index);
148
148
 
149
- if (!isEmpty(options)) {
149
+ if (!isBlank(options)) {
150
150
  options.text = this.isDrawControlsVisible ? 'Hide draw controls...' : 'Enable draw controls...';
151
151
  }
152
152
 
@@ -322,7 +322,7 @@ export default class LiveMapComponent extends Component {
322
322
  */
323
323
 
324
324
  @action removeDrawingControl() {
325
- if (isEmpty(this.drawControl)) {
325
+ if (isBlank(this.drawControl)) {
326
326
  return;
327
327
  }
328
328
 
@@ -682,9 +682,19 @@ export default class LiveMapComponent extends Component {
682
682
  *
683
683
  */
684
684
 
685
+ createSocketClusterClient() {
686
+ const socketConfig = { ...config.socket };
687
+
688
+ if (isBlank(socketConfig.hostname)) {
689
+ socketConfig.hostname = window.location.hostname;
690
+ }
691
+
692
+ return socketClusterClient.create(socketConfig);
693
+ }
694
+
685
695
  @action watchDrivers(drivers = []) {
686
696
  // setup socket
687
- const socket = socketClusterClient.create(config.socket);
697
+ const socket = this.createSocketClusterClient();
688
698
 
689
699
  // listen for stivers
690
700
  for (let i = 0; i < drivers.length; i++) {
@@ -3,6 +3,7 @@ import { tracked } from '@glimmer/tracking';
3
3
  import { inject as service } from '@ember/service';
4
4
  import { action, computed, set } from '@ember/object';
5
5
  import { equal } from '@ember/object/computed';
6
+ import { isBlank } from '@ember/utils';
6
7
  import isModel from '@fleetbase/ember-core/utils/is-model';
7
8
  import config from 'ember-get-config';
8
9
 
@@ -254,12 +255,22 @@ export default class OrderConfigComponent extends Component {
254
255
  });
255
256
  }
256
257
 
258
+ createSocketClusterClient() {
259
+ const socketConfig = { ...config.socket };
260
+
261
+ if (isBlank(socketConfig.hostname)) {
262
+ socketConfig.hostname = window.location.hostname;
263
+ }
264
+
265
+ return socketClusterClient.create(socketConfig);
266
+ }
267
+
257
268
  async listenForUninstallProgress(extension) {
258
269
  // get channel identifier
259
270
  const channelId = `${extension.id}:${this.currentUser.id}`;
260
271
 
261
272
  // setup socket
262
- const socket = socketClusterClient.create(config.socket);
273
+ const socket = this.createSocketClusterClient();
263
274
 
264
275
  // get channel
265
276
  const channel = socket.subscribe(channelId);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fleetbase/fleetops-engine",
3
3
  "extension": "Fleet Ops",
4
4
  "icon": "route",
5
- "version": "0.0.8",
5
+ "version": "0.0.9",
6
6
  "priority": 0,
7
7
  "description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
8
8
  "keywords": [
@@ -36,7 +36,7 @@
36
36
  "test:ember-compatibility": "ember try:each"
37
37
  },
38
38
  "dependencies": {
39
- "@fleetbase/ember-core": "^0.0.2",
39
+ "@fleetbase/ember-core": "^0.0.3",
40
40
  "@fleetbase/ember-ui": "^0.0.6",
41
41
  "@fleetbase/fleetops-data": "^0.0.2",
42
42
  "@fleetbase/leaflet-routing-machine": "^3.2.15",