@truedat/dd 5.6.5 → 5.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "5.6.5",
3
+ "version": "5.6.6",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.5",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "5.6.5",
37
+ "@truedat/test": "5.6.6",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -87,9 +87,9 @@
87
87
  },
88
88
  "dependencies": {
89
89
  "@apollo/client": "^3.7.1",
90
- "@truedat/auth": "5.6.5",
91
- "@truedat/core": "5.6.5",
92
- "@truedat/df": "5.6.5",
90
+ "@truedat/auth": "5.6.6",
91
+ "@truedat/core": "5.6.6",
92
+ "@truedat/df": "5.6.6",
93
93
  "lodash": "^4.17.21",
94
94
  "moment": "^2.29.4",
95
95
  "path-to-regexp": "^1.7.0",
@@ -114,5 +114,5 @@
114
114
  "react-dom": ">= 16.8.6 < 17",
115
115
  "semantic-ui-react": ">= 2.0.3 < 2.2"
116
116
  },
117
- "gitHead": "6e3f4ba8d3ade3c5dee25dc5834101b525332d21"
117
+ "gitHead": "2f9e356d743886f505c5e2406e2dd04569ad81f7"
118
118
  }
@@ -173,6 +173,20 @@ describe("selectors: getParsedEvents", () => {
173
173
  service: "My invented service 14",
174
174
  };
175
175
 
176
+ const r15 = {
177
+ event: "structure_note_updated",
178
+ id: 15,
179
+ payload: [
180
+ {
181
+ action: "note_updated",
182
+ field: "",
183
+ value: "",
184
+ },
185
+ ],
186
+ resource_id: 15,
187
+ service: "My invented service 15",
188
+ };
189
+
176
190
  const events = [
177
191
  {
178
192
  id: 1,
@@ -261,7 +275,7 @@ describe("selectors: getParsedEvents", () => {
261
275
  service: "My invented service 13",
262
276
  event: "structure_note_updated",
263
277
  resource_id: 13,
264
- payload: { content: { changed: { field_1: { id: 1, name: "foo" } } } },
278
+ payload: { content: { added: { field_1: { id: 1, name: "foo" } } } },
265
279
  },
266
280
  {
267
281
  id: 14,
@@ -270,11 +284,18 @@ describe("selectors: getParsedEvents", () => {
270
284
  resource_id: 14,
271
285
  payload: { content: { changed: { field_1: { id: 1, name: "foo" } } } },
272
286
  },
287
+ {
288
+ id: 15,
289
+ service: "My invented service 15",
290
+ event: "structure_note_updated",
291
+ resource_id: 15,
292
+ payload: {},
293
+ },
273
294
  ];
274
295
 
275
296
  it("should return all the events with the new payload", () => {
276
297
  const res = getParsedEvents({ events, templates, structure });
277
- expect(res).toHaveLength(14);
298
+ expect(res).toHaveLength(15);
278
299
  expect(res).toEqual(
279
300
  expect.arrayContaining([
280
301
  r1,
@@ -291,6 +312,7 @@ describe("selectors: getParsedEvents", () => {
291
312
  r12,
292
313
  r13,
293
314
  r14,
315
+ r15,
294
316
  ])
295
317
  );
296
318
  });
@@ -12,6 +12,8 @@ const transformFieldFormat = (field) =>
12
12
  _.isBoolean(field) ? _.toString(field) : field;
13
13
 
14
14
  const transformNotesPayloadFormat = (payload) => {
15
+ if (_.isEmpty(payload.content)) return "";
16
+
15
17
  const addedFields = payload.content.added
16
18
  ? payload.content.added
17
19
  : payload.content.changed;