@fleetbase/ember-core 0.0.4 → 0.0.6

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.
@@ -1,7 +1,6 @@
1
1
  import RESTSerializer from '@ember-data/serializer/rest';
2
2
  import { isNone } from '@ember/utils';
3
3
  import { underscore } from '@ember/string';
4
- import { isArray } from '@ember/array';
5
4
  import normalizePolymorphicTypeWithinHash from '../utils/serialize/normalize-polymorphic-type-within-hash';
6
5
 
7
6
  export default class ApplicationSerializer extends RESTSerializer {
@@ -67,20 +66,4 @@ export default class ApplicationSerializer extends RESTSerializer {
67
66
 
68
67
  return super.normalize(model, hash, prop);
69
68
  }
70
-
71
- /**
72
- * We only want to save dirty/changed model attributes
73
- *
74
- * @param {Snapshot} snapshot
75
- * @param {Object} json
76
- * @param {String} key
77
- * @param {Array} attributes
78
- */
79
- serializeAttribute(snapshot, json, key, attributes) {
80
- const excludedKeys = ['name', 'meta', 'options', 'config', 'excluded_addons', 'translations', 'tags'];
81
-
82
- if (snapshot.record?.get('isNew') || snapshot.changedAttributes()[key] || isArray(snapshot.attr(key)) || excludedKeys.includes(key)) {
83
- return super.serializeAttribute(snapshot, json, key, attributes);
84
- }
85
- }
86
69
  }
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ const path = require('path');
2
3
 
3
4
  module.exports = {
4
5
  name: require('./package').name,
@@ -19,8 +20,14 @@ module.exports = {
19
20
  };
20
21
  }
21
22
 
23
+ const importJs = (module, file, options) => {
24
+ const modulePath = path.dirname(require.resolve(module));
25
+ this.import(`${modulePath}/${file}`, options);
26
+ };
27
+
22
28
  // import socketcluster for use in all fleetbase engines
23
29
  // this will become globally available as socketClusterClient
24
- app.import('node_modules/socketcluster-client/socketcluster-client.min.js');
30
+ importJs('socketcluster-client', 'socketcluster-client.min.js');
31
+ // app.import('node_modules/socketcluster-client/socketcluster-client.min.js');
25
32
  },
26
33
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/ember-core",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
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-extension",