@fleetbase/ember-core 0.2.21 → 0.2.23

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.
@@ -13,7 +13,7 @@ import getUserOptions from '../utils/get-user-options';
13
13
  import config from 'ember-get-config';
14
14
 
15
15
  if (isBlank(config.API.host)) {
16
- config.API.host = `${window.location.protocol}//${window.location.hostname}:8000`;
16
+ config.API.host = `${window.location.protocol}//${window.location.hostname}`;
17
17
  }
18
18
  const DEFAULT_ERROR_MESSAGE = 'Oops! Something went wrong. Please try again or contact support if the issue persists.';
19
19
  export default class ApplicationAdapter extends RESTAdapter {
@@ -19,7 +19,7 @@ import isEmptyObject from '../utils/is-empty-object';
19
19
  import fetch from 'fetch';
20
20
 
21
21
  if (isBlank(config.API.host)) {
22
- config.API.host = `${window.location.protocol}//${window.location.hostname}:8000`;
22
+ config.API.host = `${window.location.protocol}//${window.location.hostname}`;
23
23
  }
24
24
 
25
25
  export default class FetchService extends Service {
@@ -1,12 +1,14 @@
1
1
  import Service from '@ember/service';
2
+ import Evented from '@ember/object/evented';
2
3
  import { tracked } from '@glimmer/tracking';
3
4
  import { inject as service } from '@ember/service';
4
5
  import { computed } from '@ember/object';
5
6
  import { dasherize } from '@ember/string';
6
7
  import { isArray } from '@ember/array';
7
8
  import { getOwner } from '@ember/application';
9
+ import { debug } from '@ember/debug';
8
10
 
9
- export default class ThemeService extends Service {
11
+ export default class ThemeService extends Service.extend(Evented) {
10
12
  /**
11
13
  * Lookup the correct router for the engine and or console.
12
14
  *
@@ -201,10 +203,12 @@ export default class ThemeService extends Service {
201
203
  * @void
202
204
  */
203
205
  setTheme(theme = 'light') {
206
+ debug(`Theme was changed to: ${theme}`);
204
207
  document.body.classList.remove(`${this.currentTheme}-theme`);
205
208
  document.body.classList.add(`${theme}-theme`);
206
209
  this.currentUser.setOption('theme', theme);
207
210
  this.activeTheme = theme;
211
+ this.trigger('theme.changed', theme);
208
212
  }
209
213
 
210
214
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/ember-core",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "Provides all the core services, decorators and utilities for building a Fleetbase extension for the Console.",
5
5
  "keywords": [
6
6
  "fleetbase-core",