@truedat/dd 4.54.9 → 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 +6 -0
- package/package.json +3 -3
- package/src/components/StructureNotes.js +1 -0
- package/src/components/__tests__/StructureNotes.spec.js +59 -0
- package/src/components/__tests__/__snapshots__/StructureNotes.spec.js.snap +137 -0
- package/src/reducers/__tests__/structureNotes.spec.js +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.54.
|
|
3
|
+
"version": "4.54.10",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@apollo/client": "^3.7.0",
|
|
91
91
|
"@truedat/auth": "4.54.9",
|
|
92
92
|
"@truedat/core": "4.54.9",
|
|
93
|
-
"@truedat/df": "4.54.
|
|
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": "
|
|
115
|
+
"gitHead": "9821d62fc45875b958908d2dcec5aea90960ab4d"
|
|
116
116
|
}
|
|
@@ -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
|
+
`;
|