@truedat/dd 4.54.8 → 4.54.10

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/CHANGELOG.md CHANGED
@@ -1,10 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.54.10]
4
+
5
+ ### Added
6
+
7
+ - [TD-5037] Highlights fields changes in structure notes
8
+
3
9
  ## [4.54.8] 2022-10-28
4
10
 
5
11
  ### Changed
6
12
 
7
- - [TD-3646] StructuresBulkUpdate uses GraphQL to render preprocessed template with domain if only one is selected
13
+ - [TD-3646] StructuresBulkUpdate uses GraphQL to render preprocessed
14
+ template with domain if only one is selected
8
15
 
9
16
  ## [4.54.0] 2022-10-21
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.54.8",
3
+ "version": "4.54.10",
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.4",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "4.54.8",
37
+ "@truedat/test": "4.54.9",
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",
@@ -88,9 +88,9 @@
88
88
  },
89
89
  "dependencies": {
90
90
  "@apollo/client": "^3.7.0",
91
- "@truedat/auth": "4.54.8",
92
- "@truedat/core": "4.54.8",
93
- "@truedat/df": "4.54.8",
91
+ "@truedat/auth": "4.54.9",
92
+ "@truedat/core": "4.54.9",
93
+ "@truedat/df": "4.54.10",
94
94
  "lodash": "^4.17.21",
95
95
  "path-to-regexp": "^1.7.0",
96
96
  "prop-types": "^15.8.1",
@@ -112,5 +112,5 @@
112
112
  "react-dom": ">= 16.8.6 < 17",
113
113
  "semantic-ui-react": ">= 0.88.2 < 2.1"
114
114
  },
115
- "gitHead": "f2274cf8a260efe11653e9e9132962cf0162c4c2"
115
+ "gitHead": "9821d62fc45875b958908d2dcec5aea90960ab4d"
116
116
  }
@@ -77,6 +77,7 @@ const StructureNote = ({ structureNote, template, structure, notesSize }) => {
77
77
  <DynamicFormViewer
78
78
  template={template}
79
79
  content={structureNote.df_content}
80
+ diff={structureNote._diff}
80
81
  />
81
82
  )}
82
83
  </Segment>
@@ -47,4 +47,63 @@ describe("<StructureNotes />", () => {
47
47
 
48
48
  expect(container).toMatchSnapshot();
49
49
  });
50
+
51
+ it("matches the latest snapshot with draft structure note", async () => {
52
+ const props = {
53
+ structure: { id: 1 },
54
+ structureNotes: { _actions: { foo: "bar" }, loading: false },
55
+ activeStructureNotes: [
56
+ {
57
+ id: 3,
58
+ status: "draft",
59
+ df_content: { foo: "xyz" },
60
+ version: "3",
61
+ _diff: ["foo"],
62
+ },
63
+ {
64
+ id: 2,
65
+ status: "published",
66
+ df_content: { foo: "bar" },
67
+ version: "2",
68
+ },
69
+ ],
70
+ versionedStructureNotes: [
71
+ {
72
+ id: 1,
73
+ status: "versioned",
74
+ df_content: { foo: "bar1" },
75
+ version: "1",
76
+ },
77
+ ],
78
+ template: {
79
+ id: 2,
80
+ content: [
81
+ {
82
+ fields: [
83
+ {
84
+ cardinality: "?",
85
+ default: "",
86
+ label: "foo",
87
+ name: "foo",
88
+ type: "string",
89
+ values: null,
90
+ widget: "text",
91
+ value: "foo value",
92
+ required: false,
93
+ },
94
+ ],
95
+ name: "foo group",
96
+ },
97
+ ],
98
+ scope: "dd",
99
+ },
100
+ doStructureNoteAction: () => {},
101
+ };
102
+ const { findByText, container } = render(<StructureNotes {...props} />);
103
+ expect(container).toMatchSnapshot();
104
+
105
+ userEvent.click(await findByText("Show content"));
106
+
107
+ expect(container).toMatchSnapshot();
108
+ });
50
109
  });
@@ -143,3 +143,140 @@ exports[`<StructureNotes /> matches the latest snapshot 3`] = `
143
143
  </div>
144
144
  </div>
145
145
  `;
146
+
147
+ exports[`<StructureNotes /> matches the latest snapshot with draft structure note 1`] = `
148
+ <div>
149
+ <div
150
+ class="ui bottom attached segment"
151
+ >
152
+ <div
153
+ class="ui segment"
154
+ >
155
+ <div
156
+ style="display: flex; justify-content: space-between; align-items: center;"
157
+ >
158
+ <div>
159
+ <div
160
+ class="ui label basic"
161
+ >
162
+ Draft
163
+ </div>
164
+ <div
165
+ class="ui label basic"
166
+ >
167
+ Version: 3
168
+ </div>
169
+ </div>
170
+ <div>
171
+ <button
172
+ class="ui button"
173
+ >
174
+ Show content
175
+ </button>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <div
180
+ class="ui segment"
181
+ >
182
+ <div
183
+ style="display: flex; justify-content: space-between; align-items: center;"
184
+ >
185
+ <div>
186
+ <div
187
+ class="ui label basic"
188
+ >
189
+ Published
190
+ </div>
191
+ <div
192
+ class="ui label basic"
193
+ >
194
+ Version: 2
195
+ </div>
196
+ </div>
197
+ <div />
198
+ </div>
199
+ <div>
200
+ DynamicFormViewer
201
+ </div>
202
+ </div>
203
+ <div>
204
+ <button
205
+ class="ui button"
206
+ >
207
+ Show previous versions
208
+ </button>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ `;
213
+
214
+ exports[`<StructureNotes /> matches the latest snapshot with draft structure note 2`] = `
215
+ <div>
216
+ <div
217
+ class="ui bottom attached segment"
218
+ >
219
+ <div
220
+ class="ui segment"
221
+ >
222
+ <div
223
+ style="display: flex; justify-content: space-between; align-items: center;"
224
+ >
225
+ <div>
226
+ <div
227
+ class="ui label basic"
228
+ >
229
+ Draft
230
+ </div>
231
+ <div
232
+ class="ui label basic"
233
+ >
234
+ Version: 3
235
+ </div>
236
+ </div>
237
+ <div>
238
+ <button
239
+ class="ui button"
240
+ >
241
+ Hide content
242
+ </button>
243
+ </div>
244
+ </div>
245
+ <div>
246
+ DynamicFormViewer
247
+ </div>
248
+ </div>
249
+ <div
250
+ class="ui segment"
251
+ >
252
+ <div
253
+ style="display: flex; justify-content: space-between; align-items: center;"
254
+ >
255
+ <div>
256
+ <div
257
+ class="ui label basic"
258
+ >
259
+ Published
260
+ </div>
261
+ <div
262
+ class="ui label basic"
263
+ >
264
+ Version: 2
265
+ </div>
266
+ </div>
267
+ <div />
268
+ </div>
269
+ <div>
270
+ DynamicFormViewer
271
+ </div>
272
+ </div>
273
+ <div>
274
+ <button
275
+ class="ui button"
276
+ >
277
+ Show previous versions
278
+ </button>
279
+ </div>
280
+ </div>
281
+ </div>
282
+ `;
@@ -7,7 +7,7 @@ describe("reducers: structureNotes", () => {
7
7
  const initialState = {
8
8
  structureNotes: [],
9
9
  _actions: {},
10
- loading: false
10
+ loading: false,
11
11
  };
12
12
 
13
13
  it("should provide the initial state", () => {