@truedat/dd 4.48.12 → 4.49.1

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +5 -5
  3. package/src/api/fragments.js +2 -2
  4. package/src/api/mutations.js +33 -11
  5. package/src/api/queries.js +37 -10
  6. package/src/api.js +0 -4
  7. package/src/components/DictionaryRoutes.js +4 -4
  8. package/src/components/StructureSummary.js +12 -22
  9. package/src/components/StructureTag.js +83 -54
  10. package/src/components/StructureTagForm.js +149 -89
  11. package/src/components/StructureTags.js +57 -27
  12. package/src/components/Tag.js +62 -0
  13. package/src/components/TagCards.js +85 -0
  14. package/src/components/TagCrumbs.js +25 -0
  15. package/src/components/TagForm.js +102 -0
  16. package/src/components/TagStructureButton.js +58 -0
  17. package/src/components/Tags.js +33 -0
  18. package/src/components/TagsRoutes.js +39 -0
  19. package/src/components/__tests__/StructureSummary.spec.js +0 -7
  20. package/src/components/__tests__/StructureTag.spec.js +79 -5
  21. package/src/components/__tests__/StructureTagForm.spec.js +99 -50
  22. package/src/components/__tests__/Tag.spec.js +11 -0
  23. package/src/components/__tests__/{StructureTagsCards.spec.js → TagCards.spec.js} +10 -10
  24. package/src/components/__tests__/TagCrumbs.spec.js +10 -0
  25. package/src/components/__tests__/TagForm.spec.js +72 -0
  26. package/src/components/__tests__/Tags.spec.js +10 -0
  27. package/src/components/__tests__/__snapshots__/StructureSummary.spec.js.snap +18 -42
  28. package/src/components/__tests__/__snapshots__/StructureTag.spec.js.snap +10 -30
  29. package/src/components/__tests__/__snapshots__/StructureTagForm.spec.js.snap +255 -51
  30. package/src/components/__tests__/__snapshots__/Tag.spec.js.snap +36 -0
  31. package/src/components/__tests__/__snapshots__/{StructureTagsCards.spec.js.snap → TagCards.spec.js.snap} +1 -1
  32. package/src/components/__tests__/__snapshots__/TagCrumbs.spec.js.snap +102 -0
  33. package/src/components/__tests__/__snapshots__/TagForm.spec.js.snap +70 -0
  34. package/src/components/__tests__/__snapshots__/{StructureTags.spec.js.snap → Tags.spec.js.snap} +1 -1
  35. package/src/messages/en.js +25 -30
  36. package/src/messages/es.js +25 -30
  37. package/src/reducers/__tests__/{editableStructureTags.spec.js → availableTags.spec.js} +7 -11
  38. package/src/reducers/__tests__/structureTagSaving.spec.js +36 -0
  39. package/src/reducers/__tests__/tagSaving.spec.js +32 -0
  40. package/src/reducers/{editableStructureTags.js → availableTags.js} +2 -2
  41. package/src/reducers/index.js +6 -12
  42. package/src/reducers/structureRedirect.js +7 -7
  43. package/src/reducers/structureTagSaving.js +12 -10
  44. package/src/reducers/tagSaving.js +18 -0
  45. package/src/routines.js +5 -6
  46. package/src/sagas/__tests__/createTag.spec.js +81 -0
  47. package/src/sagas/__tests__/deleteStructureTag.spec.js +11 -12
  48. package/src/sagas/__tests__/deleteTag.spec.js +76 -0
  49. package/src/sagas/__tests__/tagStructure.spec.js +86 -0
  50. package/src/sagas/__tests__/updateTag.spec.js +81 -0
  51. package/src/sagas/createTag.js +29 -0
  52. package/src/sagas/deleteStructureTag.js +12 -9
  53. package/src/sagas/deleteTag.js +34 -0
  54. package/src/sagas/index.js +15 -18
  55. package/src/sagas/tagStructure.js +37 -0
  56. package/src/sagas/updateTag.js +23 -0
  57. package/src/components/LinkStructureTagForm.js +0 -163
  58. package/src/components/LinkedStructureTag.js +0 -124
  59. package/src/components/StructureLinkTagButton.js +0 -47
  60. package/src/components/StructureTagsCards.js +0 -92
  61. package/src/components/StructureTagsCrumbs.js +0 -44
  62. package/src/components/StructureTagsRoutes.js +0 -45
  63. package/src/components/TagsHeader.js +0 -32
  64. package/src/components/__tests__/LinkStructureTagForm.spec.js +0 -184
  65. package/src/components/__tests__/LinkedStructureTag.spec.js +0 -133
  66. package/src/components/__tests__/StructureTags.spec.js +0 -14
  67. package/src/components/__tests__/StructureTagsCrumbs.spec.js +0 -13
  68. package/src/components/__tests__/__snapshots__/LinkStructureTagForm.spec.js.snap +0 -456
  69. package/src/components/__tests__/__snapshots__/LinkedStructureTag.spec.js.snap +0 -16
  70. package/src/components/__tests__/__snapshots__/StructureTagsCrumbs.spec.js.snap +0 -36
  71. package/src/reducers/__tests__/deletingStructureTags.spec.js +0 -30
  72. package/src/reducers/__tests__/linkedStructureTags.spec.js +0 -69
  73. package/src/reducers/__tests__/linkedStructureTagsLoading.spec.js +0 -32
  74. package/src/reducers/__tests__/linkingStructureTags.spec.js +0 -30
  75. package/src/reducers/__tests__/structureTagsSaving.spec.js +0 -40
  76. package/src/reducers/deletingStructureTags.js +0 -16
  77. package/src/reducers/linkedStructureTags.js +0 -28
  78. package/src/reducers/linkedStructureTagsLoading.js +0 -16
  79. package/src/reducers/linkingStructureTags.js +0 -16
  80. package/src/sagas/__tests__/createStructureTag.spec.js +0 -85
  81. package/src/sagas/__tests__/deleteLinkStructureTag.spec.js +0 -96
  82. package/src/sagas/__tests__/fetchLinksStructureTags.spec.js +0 -105
  83. package/src/sagas/__tests__/linkStructureTag.spec.js +0 -102
  84. package/src/sagas/__tests__/updateStructureTag.spec.js +0 -84
  85. package/src/sagas/createStructureTag.js +0 -29
  86. package/src/sagas/deleteLinkStructureTag.js +0 -29
  87. package/src/sagas/fetchLinksStructureTags.js +0 -31
  88. package/src/sagas/linkStructureTag.js +0 -30
  89. package/src/sagas/updateStructureTag.js +0 -23
@@ -1,456 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`<LinkStructureTagForm /> create button enabled if there is only one tag available 1`] = `
4
- <div>
5
- <div
6
- class="ui container link-structure-tag-form"
7
- >
8
- <form
9
- class="ui form"
10
- >
11
- <div
12
- class="field"
13
- >
14
- <label>
15
- structure.tag.dropdown.label
16
- </label>
17
- <div
18
- aria-disabled="false"
19
- aria-expanded="false"
20
- class="ui search selection dropdown"
21
- name="tag"
22
- role="combobox"
23
- >
24
- <input
25
- aria-autocomplete="list"
26
- autocomplete="off"
27
- class="search"
28
- tabindex="0"
29
- type="text"
30
- value=""
31
- />
32
- <div
33
- aria-atomic="true"
34
- aria-live="polite"
35
- class="divider text"
36
- role="alert"
37
- >
38
- Tag2
39
- </div>
40
- <i
41
- aria-hidden="true"
42
- class="dropdown icon clear"
43
- />
44
- <div
45
- class="menu transition"
46
- role="listbox"
47
- >
48
- <div
49
- aria-checked="true"
50
- aria-selected="true"
51
- class="active selected item"
52
- role="option"
53
- style="pointer-events: all;"
54
- >
55
- <span
56
- class="description"
57
- >
58
- large desclarge desclarge desclarge desclarge desc
59
- </span>
60
- <span
61
- class="text"
62
- >
63
- Tag2
64
- </span>
65
- </div>
66
- </div>
67
- </div>
68
- </div>
69
- <div
70
- class="field"
71
- >
72
- <label>
73
- structure.tag.textArea.label
74
- </label>
75
- <textarea
76
- data-testid="comment-id"
77
- name="comment"
78
- placeholder="structure.tag.textArea.placeholder"
79
- rows="3"
80
- />
81
- </div>
82
- <div
83
- class="actions"
84
- >
85
- <button
86
- class="ui primary button"
87
- type="submit"
88
- >
89
- structure.tag.add
90
- </button>
91
- </div>
92
- </form>
93
- </div>
94
- </div>
95
- `;
96
-
97
- exports[`<LinkStructureTagForm /> matches the latest snapshot create 1`] = `
98
- <div>
99
- <div
100
- class="ui container link-structure-tag-form"
101
- >
102
- <form
103
- class="ui form"
104
- >
105
- <div
106
- class="field"
107
- >
108
- <label>
109
- structure.tag.dropdown.label
110
- </label>
111
- <div
112
- aria-disabled="false"
113
- aria-expanded="false"
114
- class="ui search selection dropdown"
115
- name="tag"
116
- role="combobox"
117
- >
118
- <input
119
- aria-autocomplete="list"
120
- autocomplete="off"
121
- class="search"
122
- tabindex="0"
123
- type="text"
124
- value=""
125
- />
126
- <div
127
- aria-atomic="true"
128
- aria-live="polite"
129
- class="divider default text"
130
- role="alert"
131
- >
132
- structure.tag.dropdown.placeholder
133
- </div>
134
- <i
135
- aria-hidden="true"
136
- class="dropdown icon"
137
- />
138
- <div
139
- class="menu transition"
140
- role="listbox"
141
- >
142
- <div
143
- aria-checked="false"
144
- aria-selected="true"
145
- class="selected item"
146
- role="option"
147
- style="pointer-events: all;"
148
- >
149
- <span
150
- class="description"
151
- >
152
- description test
153
- </span>
154
- <span
155
- class="text"
156
- >
157
- Tag1
158
- </span>
159
- </div>
160
- <div
161
- aria-checked="false"
162
- aria-selected="false"
163
- class="item"
164
- role="option"
165
- style="pointer-events: all;"
166
- >
167
- <span
168
- class="description"
169
- >
170
- large desclarge desclarge desclarge desclarge desc
171
- </span>
172
- <span
173
- class="text"
174
- >
175
- Tag2
176
- </span>
177
- </div>
178
- </div>
179
- </div>
180
- </div>
181
- <div
182
- class="field"
183
- >
184
- <label>
185
- structure.tag.textArea.label
186
- </label>
187
- <textarea
188
- data-testid="comment-id"
189
- name="comment"
190
- placeholder="structure.tag.textArea.placeholder"
191
- rows="3"
192
- />
193
- </div>
194
- <div
195
- class="actions"
196
- >
197
- <button
198
- class="ui primary disabled button"
199
- disabled=""
200
- tabindex="-1"
201
- type="submit"
202
- >
203
- structure.tag.add
204
- </button>
205
- </div>
206
- </form>
207
- </div>
208
- </div>
209
- `;
210
-
211
- exports[`<LinkStructureTagForm /> matches the latest snapshot create without comment 1`] = `
212
- <div>
213
- <div
214
- class="ui container link-structure-tag-form"
215
- >
216
- <form
217
- class="ui form"
218
- >
219
- <div
220
- class="field"
221
- >
222
- <label>
223
- structure.tag.dropdown.label
224
- </label>
225
- <div
226
- aria-disabled="false"
227
- aria-expanded="true"
228
- class="ui active visible search selection dropdown"
229
- name="tag"
230
- role="combobox"
231
- >
232
- <input
233
- aria-autocomplete="list"
234
- autocomplete="off"
235
- class="search"
236
- tabindex="0"
237
- type="text"
238
- value=""
239
- />
240
- <div
241
- aria-atomic="true"
242
- aria-live="polite"
243
- class="divider text"
244
- role="alert"
245
- >
246
- Tag2
247
- </div>
248
- <i
249
- aria-hidden="true"
250
- class="dropdown icon clear"
251
- />
252
- <div
253
- class="visible menu transition"
254
- role="listbox"
255
- >
256
- <div
257
- aria-checked="false"
258
- aria-selected="false"
259
- class="item"
260
- role="option"
261
- style="pointer-events: all;"
262
- >
263
- <span
264
- class="description"
265
- >
266
- description test
267
- </span>
268
- <span
269
- class="text"
270
- >
271
- Tag1
272
- </span>
273
- </div>
274
- <div
275
- aria-checked="true"
276
- aria-selected="true"
277
- class="active selected item"
278
- role="option"
279
- style="pointer-events: all;"
280
- >
281
- <span
282
- class="description"
283
- >
284
- large desclarge desclarge desclarge desclarge desc
285
- </span>
286
- <span
287
- class="text"
288
- >
289
- Tag2
290
- </span>
291
- </div>
292
- </div>
293
- </div>
294
- </div>
295
- <div
296
- class="field"
297
- >
298
- <label>
299
- structure.tag.textArea.label
300
- </label>
301
- <textarea
302
- data-testid="comment-id"
303
- name="comment"
304
- placeholder="structure.tag.textArea.placeholder"
305
- rows="3"
306
- />
307
- </div>
308
- <div
309
- class="actions"
310
- >
311
- <button
312
- class="ui primary button"
313
- type="submit"
314
- >
315
- structure.tag.add
316
- </button>
317
- </div>
318
- </form>
319
- </div>
320
- </div>
321
- `;
322
-
323
- exports[`<LinkStructureTagForm /> matches the latest snapshot edit 1`] = `
324
- <div>
325
- <div
326
- class="ui container link-structure-tag-form"
327
- >
328
- <form
329
- class="ui form"
330
- >
331
- <div
332
- class="disabled field"
333
- >
334
- <label>
335
- structure.tag.dropdown.label
336
- </label>
337
- <div
338
- aria-disabled="true"
339
- aria-expanded="false"
340
- class="ui disabled search selection dropdown"
341
- name="tag"
342
- role="combobox"
343
- >
344
- <input
345
- aria-autocomplete="list"
346
- autocomplete="off"
347
- class="search"
348
- tabindex="-1"
349
- type="text"
350
- value=""
351
- />
352
- <div
353
- aria-atomic="true"
354
- aria-live="polite"
355
- class="divider text"
356
- role="alert"
357
- >
358
- Tag without description
359
- </div>
360
- <i
361
- aria-hidden="true"
362
- class="dropdown icon clear"
363
- />
364
- <div
365
- class="menu transition"
366
- role="listbox"
367
- >
368
- <div
369
- aria-checked="true"
370
- aria-selected="true"
371
- class="active selected item"
372
- role="option"
373
- style="pointer-events: all;"
374
- >
375
- <span
376
- class="text"
377
- >
378
- Tag without description
379
- </span>
380
- </div>
381
- <div
382
- aria-checked="false"
383
- aria-selected="false"
384
- class="item"
385
- role="option"
386
- style="pointer-events: all;"
387
- >
388
- <span
389
- class="description"
390
- >
391
- description test
392
- </span>
393
- <span
394
- class="text"
395
- >
396
- Tag1
397
- </span>
398
- </div>
399
- <div
400
- aria-checked="false"
401
- aria-selected="false"
402
- class="item"
403
- role="option"
404
- style="pointer-events: all;"
405
- >
406
- <span
407
- class="description"
408
- >
409
- large desclarge desclarge desclarge desclarge desc
410
- </span>
411
- <span
412
- class="text"
413
- >
414
- Tag2
415
- </span>
416
- </div>
417
- </div>
418
- </div>
419
- </div>
420
- <div
421
- class="field"
422
- >
423
- <label>
424
- structure.tag.textArea.label
425
- </label>
426
- <textarea
427
- data-testid="comment-id"
428
- name="comment"
429
- placeholder="structure.tag.textArea.placeholder"
430
- rows="3"
431
- >
432
- foo
433
- </textarea>
434
- </div>
435
- <div
436
- class="actions"
437
- >
438
- <button
439
- class="ui primary disabled button"
440
- disabled=""
441
- tabindex="-1"
442
- type="submit"
443
- >
444
- structure.tag.edit
445
- </button>
446
- <button
447
- class="ui secondary button"
448
- type="button"
449
- >
450
- structure.tag.delete
451
- </button>
452
- </div>
453
- </form>
454
- </div>
455
- </div>
456
- `;
@@ -1,16 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`<LinkedStructureTag /> matches the latest snapshot 1`] = `
4
- <div>
5
- <div
6
- class="ui tag label"
7
- style="margin-left: 1.5em;"
8
- >
9
- <i
10
- aria-hidden="true"
11
- class="edit link icon"
12
- />
13
- Tag without description
14
- </div>
15
- </div>
16
- `;
@@ -1,36 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`<StructureTagsCrumbs /> matches the latest snapshot 1`] = `
4
- <Breadcrumb>
5
- <BreadcrumbSection
6
- active={false}
7
- as={
8
- Object {
9
- "$$typeof": Symbol(react.forward_ref),
10
- "displayName": "Link",
11
- "propTypes": Object {
12
- "innerRef": [Function],
13
- "onClick": [Function],
14
- "replace": [Function],
15
- "target": [Function],
16
- "to": [Function],
17
- },
18
- "render": [Function],
19
- }
20
- }
21
- to="/structureTags"
22
- >
23
- <MemoizedFormattedMessage
24
- id="structureTags.crumbs.root"
25
- />
26
- </BreadcrumbSection>
27
- <BreadcrumbDivider
28
- icon="right angle"
29
- />
30
- <BreadcrumbSection
31
- active={true}
32
- >
33
- doc
34
- </BreadcrumbSection>
35
- </Breadcrumb>
36
- `;
@@ -1,30 +0,0 @@
1
- import { deleteLinkStructureTag } from "../../routines";
2
- import { deletingStructureTags } from "..";
3
-
4
- const fooState = { foo: "bar" };
5
-
6
- describe("reducers: deletingStructureTags", () => {
7
- it("should provide the initial state", () => {
8
- expect(deletingStructureTags(undefined, {})).toBe(false);
9
- });
10
-
11
- it("should be true after receiving the deleteLinkStructureTag.TRIGGER action", () => {
12
- expect(
13
- deletingStructureTags(fooState, {
14
- type: deleteLinkStructureTag.TRIGGER
15
- })
16
- ).toBe(true);
17
- });
18
-
19
- it("should be false after receiving the deleteLinkStructureTag.FULFILL action", () => {
20
- expect(
21
- deletingStructureTags(fooState, {
22
- type: deleteLinkStructureTag.FULFILL
23
- })
24
- ).toBe(false);
25
- });
26
-
27
- it("should ignore unhandled actions", () => {
28
- expect(deletingStructureTags(fooState, { type: "FOO" })).toBe(fooState);
29
- });
30
- });
@@ -1,69 +0,0 @@
1
- import {
2
- clearStructure,
3
- fetchStructure,
4
- fetchLinksStructureTags,
5
- updateStructure,
6
- } from "../../routines";
7
- import { linkedStructureTags } from "..";
8
-
9
- const fooState = { foo: "bar" };
10
- const tags = [
11
- {
12
- id: 1,
13
- description: "foo",
14
- inserted_at: "foo",
15
- updated_at: "foo",
16
- _embedded: {
17
- data_structure: { id: 1, external_id: "baz" },
18
- data_structure_tag: { id: 1, name: "bar", description: "qux" },
19
- },
20
- },
21
- ];
22
- const data = { tags };
23
-
24
- describe("reducers: linkedStructureTags", () => {
25
- const initialState = [];
26
-
27
- it("should provide the initial state", () => {
28
- expect(linkedStructureTags(undefined, {})).toEqual(initialState);
29
- });
30
-
31
- it("should handle the clearStructure.TRIGGER action", () => {
32
- expect(
33
- linkedStructureTags(fooState, {
34
- type: clearStructure.TRIGGER,
35
- })
36
- ).toMatchObject(initialState);
37
- });
38
-
39
- it("should handle the fetchLinksStructureTags.SUCCESS action", () => {
40
- expect(
41
- linkedStructureTags(fooState, {
42
- type: fetchLinksStructureTags.SUCCESS,
43
- payload: { data: tags },
44
- })
45
- ).toMatchObject(tags);
46
- });
47
-
48
- it("should handle the fetchStructure.SUCCESS action", () => {
49
- expect(
50
- linkedStructureTags(fooState, {
51
- type: fetchStructure.SUCCESS,
52
- payload: { data },
53
- })
54
- ).toMatchObject(tags);
55
- });
56
-
57
- it("should handle the updateStructure.SUCCESS action", () => {
58
- expect(
59
- linkedStructureTags(fooState, {
60
- type: updateStructure.SUCCESS,
61
- payload: { data },
62
- })
63
- ).toMatchObject(tags);
64
- });
65
-
66
- it("should ignore unknown actions", () => {
67
- expect(linkedStructureTags(fooState, { type: "FOO" })).toBe(fooState);
68
- });
69
- });
@@ -1,32 +0,0 @@
1
- import { fetchLinksStructureTags } from "../../routines";
2
- import { linkedStructureTagsLoading } from "..";
3
-
4
- const fooState = { foo: "bar" };
5
-
6
- describe("reducers: linkedStructureTagsLoading", () => {
7
- it("should provide the initial state", () => {
8
- expect(linkedStructureTagsLoading(undefined, {})).toBe(false);
9
- });
10
-
11
- it("should be true after receiving the fetchLinksStructureTags.TRIGGER action", () => {
12
- expect(
13
- linkedStructureTagsLoading(fooState, {
14
- type: fetchLinksStructureTags.TRIGGER
15
- })
16
- ).toBe(true);
17
- });
18
-
19
- it("should be false after receiving the fetchLinksStructureTags.FULFILL action", () => {
20
- expect(
21
- linkedStructureTagsLoading(fooState, {
22
- type: fetchLinksStructureTags.FULFILL
23
- })
24
- ).toBe(false);
25
- });
26
-
27
- it("should ignore unhandled actions", () => {
28
- expect(linkedStructureTagsLoading(fooState, { type: "FOO" })).toBe(
29
- fooState
30
- );
31
- });
32
- });
@@ -1,30 +0,0 @@
1
- import { linkStructureTag } from "../../routines";
2
- import { linkingStructureTags } from "..";
3
-
4
- const fooState = { foo: "bar" };
5
-
6
- describe("reducers: linkingStructureTags", () => {
7
- it("should provide the initial state", () => {
8
- expect(linkingStructureTags(undefined, {})).toBe(false);
9
- });
10
-
11
- it("should be true after receiving the fetchLinksStructureTags.TRIGGER action", () => {
12
- expect(
13
- linkingStructureTags(fooState, {
14
- type: linkStructureTag.TRIGGER
15
- })
16
- ).toBe(true);
17
- });
18
-
19
- it("should be false after receiving the fetchLinksStructureTags.FULFILL action", () => {
20
- expect(
21
- linkingStructureTags(fooState, {
22
- type: linkStructureTag.FULFILL
23
- })
24
- ).toBe(false);
25
- });
26
-
27
- it("should ignore unhandled actions", () => {
28
- expect(linkingStructureTags(fooState, { type: "FOO" })).toBe(fooState);
29
- });
30
- });