@fleetbase/ember-core 0.3.21 → 0.3.22

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.
@@ -18,6 +18,7 @@ export const hostServices = [
18
18
  'fileQueue',
19
19
  'sidebar',
20
20
  'dashboard',
21
+ 'docs-panel',
21
22
  'universe',
22
23
  'universe/menu-service',
23
24
  'universe/registry-service',
@@ -20,6 +20,7 @@ export const services = [
20
20
  'fileQueue',
21
21
  'sidebar',
22
22
  'dashboard',
23
+ 'docs-panel',
23
24
  'universe',
24
25
  'universe/menu-service',
25
26
  'universe/registry-service',
@@ -135,7 +135,7 @@ export default class SubjectCustomFields {
135
135
 
136
136
  // If `fieldFor` is provided then we are fetching custom fields for resource and not an instance of something
137
137
  // this means custom fields can be tied to individual resource instances OR tied to the schema of a resource kind
138
- const fieldsQp = fieldFor ? { for: fieldFor } : { subject_uuid: subjectId };
138
+ const fieldsQp = fieldFor ? { for: fieldFor, limit: -1 } : { subject_uuid: subjectId, limit: -1 };
139
139
  const fields = await this.store.query('custom-field', fieldsQp);
140
140
 
141
141
  // retain on instance for getGroups/getFields()
@@ -4,6 +4,8 @@ import { underscore } from '@ember/string';
4
4
  import normalizePolymorphicTypeWithinHash from '../utils/serialize/normalize-polymorphic-type-within-hash';
5
5
 
6
6
  export default class ApplicationSerializer extends RESTSerializer {
7
+ readOnlyAttributes = ['slug'];
8
+
7
9
  /**
8
10
  * Default primary keys to uuid
9
11
  *
@@ -32,6 +34,8 @@ export default class ApplicationSerializer extends RESTSerializer {
32
34
  serialize(snapshot) {
33
35
  const json = super.serialize(...arguments);
34
36
 
37
+ this.removeReadOnlyAttributes(json);
38
+
35
39
  // for each relationship make sure the id is set
36
40
  snapshot.eachRelationship((key, relationship) => {
37
41
  const { kind } = relationship.meta;
@@ -52,6 +56,14 @@ export default class ApplicationSerializer extends RESTSerializer {
52
56
  return json;
53
57
  }
54
58
 
59
+ removeReadOnlyAttributes(json = {}) {
60
+ this.readOnlyAttributes.forEach((attribute) => {
61
+ delete json[attribute];
62
+ });
63
+
64
+ return json;
65
+ }
66
+
55
67
  /**
56
68
  * Normalizes a part of the JSON payload returned by the server.
57
69
  *
@@ -85,7 +85,7 @@ export default class ChatService extends Service.extend(Evented) {
85
85
  },
86
86
  {
87
87
  normalizeToEmberData: true,
88
- normalizeModelType: 'chatChannel',
88
+ normalizeModelType: 'chat_channel',
89
89
  }
90
90
  )
91
91
  .then((chatChannelRecord) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/ember-core",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
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",