@truedat/qx 8.10.2 → 8.10.4

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 (61) hide show
  1. package/package.json +3 -3
  2. package/src/components/QxRoutes.js +8 -7
  3. package/src/components/__tests__/QxRoutes.spec.js +2 -1
  4. package/src/components/__tests__/__fixtures__/helper.js +13 -0
  5. package/src/components/__tests__/__snapshots__/QxRoutes.spec.js.snap +1 -1
  6. package/src/components/common/ClauseViewer.js +52 -8
  7. package/src/components/common/DescriptionInput.js +9 -34
  8. package/src/components/common/TypeSelector.js +20 -10
  9. package/src/components/common/__tests__/ClauseViewer.spec.js +150 -0
  10. package/src/components/common/__tests__/DescriptionInput.spec.js +2 -5
  11. package/src/components/common/__tests__/__snapshots__/DescriptionInput.spec.js.snap +7 -10
  12. package/src/components/common/expressions/Clauses.js +22 -17
  13. package/src/components/common/expressions/Condition.js +201 -102
  14. package/src/components/common/expressions/Expression.js +17 -23
  15. package/src/components/common/expressions/FunctionSelector.js +3 -3
  16. package/src/components/common/expressions/ShapeSelector.js +1 -1
  17. package/src/components/common/expressions/__tests__/Clauses.spec.js +1 -1
  18. package/src/components/common/expressions/__tests__/Condition.spec.js +83 -26
  19. package/src/components/common/expressions/__tests__/ParamSelector.spec.js +1 -1
  20. package/src/components/common/expressions/__tests__/__snapshots__/Clauses.spec.js.snap +18 -22
  21. package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +215 -216
  22. package/src/components/common/expressions/__tests__/__snapshots__/ConstantSelector.spec.js.snap +6 -10
  23. package/src/components/common/expressions/__tests__/__snapshots__/Expression.spec.js.snap +630 -654
  24. package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +193 -201
  25. package/src/components/common/expressions/__tests__/__snapshots__/FunctionSelector.spec.js.snap +450 -466
  26. package/src/components/common/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap +34 -34
  27. package/src/components/common/expressions/constantInputs/AnySelector.js +1 -0
  28. package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/AnySelector.spec.js.snap +15 -15
  29. package/src/components/dataViews/__tests__/__snapshots__/AdvancedDataViewEditor.spec.js.snap +378 -406
  30. package/src/components/dataViews/__tests__/__snapshots__/DataViewSummary.spec.js.snap +6 -6
  31. package/src/components/dataViews/__tests__/__snapshots__/Queryable.spec.js.snap +489 -577
  32. package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +400 -476
  33. package/src/components/dataViews/advancedForm/Queryable.js +56 -64
  34. package/src/components/dataViews/advancedForm/Queryables.js +11 -2
  35. package/src/components/dataViews/queryableProperties/Join.js +16 -6
  36. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +0 -28
  37. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Select.spec.js.snap +270 -282
  38. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/SelectField.spec.js.snap +172 -180
  39. package/src/components/dataViews/simpleForm/DatasetForm.js +4 -0
  40. package/src/components/dataViews/simpleForm/FormQueryable.js +49 -53
  41. package/src/components/dataViews/summary/Where.js +3 -2
  42. package/src/components/functions/FunctionEdit.js +92 -0
  43. package/src/components/functions/FunctionEditor.js +32 -10
  44. package/src/components/functions/FunctionParams.js +54 -61
  45. package/src/components/functions/FunctionsList.js +213 -0
  46. package/src/components/functions/__tests__/FunctionEdit.spec.js +168 -0
  47. package/src/components/functions/__tests__/FunctionParams.spec.js +1 -8
  48. package/src/components/functions/__tests__/FunctionsList.spec.js +62 -0
  49. package/src/components/functions/__tests__/__snapshots__/FunctionEditor.spec.js.snap +553 -469
  50. package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +139 -161
  51. package/src/components/functions/__tests__/__snapshots__/FunctionsList.spec.js.snap +588 -0
  52. package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +4 -0
  53. package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +8 -1
  54. package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +109 -118
  55. package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +109 -118
  56. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +471 -468
  57. package/src/hooks/useFunctions.js +6 -0
  58. package/src/styles/Expression.less +39 -6
  59. package/src/components/functions/Functions.js +0 -143
  60. package/src/components/functions/__tests__/Functions.spec.js +0 -56
  61. package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +0 -85
@@ -0,0 +1,588 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<FunctionsList /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui segment"
7
+ >
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ <i
12
+ aria-hidden="true"
13
+ class="archive circular icon"
14
+ />
15
+ <div
16
+ class="content"
17
+ >
18
+ Quality Functions
19
+ <div
20
+ class="sub header"
21
+ >
22
+ List and edit quality functions
23
+ </div>
24
+ </div>
25
+ </h2>
26
+ <a
27
+ class="ui primary right floated button"
28
+ data-discover="true"
29
+ href="/functions/new"
30
+ role="button"
31
+ >
32
+ New function
33
+ </a>
34
+ <div
35
+ class="ui hidden divider"
36
+ />
37
+ <div>
38
+ <div
39
+ class="ui icon input"
40
+ >
41
+ <input
42
+ placeholder="Search..."
43
+ type="text"
44
+ />
45
+ <i
46
+ aria-hidden="true"
47
+ class="search icon"
48
+ />
49
+ </div>
50
+ </div>
51
+ <div
52
+ class="ui label"
53
+ style="float: right;"
54
+ >
55
+ 15 functions
56
+ </div>
57
+ <div
58
+ class="ui hidden divider"
59
+ />
60
+ <table
61
+ class="ui sortable table"
62
+ >
63
+ <thead
64
+ class=""
65
+ >
66
+ <tr
67
+ class=""
68
+ >
69
+ <th
70
+ class="two wide"
71
+ >
72
+ Type
73
+ </th>
74
+ <th
75
+ class=""
76
+ >
77
+ Name
78
+ </th>
79
+ <th
80
+ class=""
81
+ >
82
+ label
83
+ </th>
84
+ <th
85
+ class="three wide"
86
+ >
87
+ Class
88
+ </th>
89
+ <th
90
+ class=""
91
+ >
92
+ Description
93
+ </th>
94
+ <th
95
+ class="center aligned two wide disabled"
96
+ >
97
+ Parameters
98
+ </th>
99
+ </tr>
100
+ </thead>
101
+ <tbody
102
+ class=""
103
+ >
104
+ <tr
105
+ class=""
106
+ >
107
+ <td
108
+ class=""
109
+ >
110
+ <div
111
+ class="ui teal tiny circular label"
112
+ width="100px"
113
+ >
114
+ b
115
+ </div>
116
+ </td>
117
+ <td
118
+ class=""
119
+ >
120
+ <a
121
+ data-discover="true"
122
+ href="/functions/1"
123
+ >
124
+ func_1
125
+ </a>
126
+ </td>
127
+ <td
128
+ class=""
129
+ />
130
+ <td
131
+ class=""
132
+ >
133
+ aggregator
134
+ </td>
135
+ <td
136
+ class=""
137
+ >
138
+ Description 1
139
+ </td>
140
+ <td
141
+ class="center aligned"
142
+ >
143
+ 0
144
+ </td>
145
+ </tr>
146
+ <tr
147
+ class=""
148
+ >
149
+ <td
150
+ class=""
151
+ >
152
+ <div
153
+ class="ui teal tiny circular label"
154
+ width="100px"
155
+ >
156
+ b
157
+ </div>
158
+ </td>
159
+ <td
160
+ class=""
161
+ >
162
+ <a
163
+ data-discover="true"
164
+ href="/functions/2"
165
+ >
166
+ func_2
167
+ </a>
168
+ </td>
169
+ <td
170
+ class=""
171
+ />
172
+ <td
173
+ class=""
174
+ />
175
+ <td
176
+ class=""
177
+ >
178
+ Description 2
179
+ </td>
180
+ <td
181
+ class="center aligned"
182
+ >
183
+ 0
184
+ </td>
185
+ </tr>
186
+ <tr
187
+ class=""
188
+ >
189
+ <td
190
+ class=""
191
+ >
192
+ <div
193
+ class="ui teal tiny circular label"
194
+ width="100px"
195
+ >
196
+ b
197
+ </div>
198
+ </td>
199
+ <td
200
+ class=""
201
+ >
202
+ <a
203
+ data-discover="true"
204
+ href="/functions/3"
205
+ >
206
+ func_3
207
+ </a>
208
+ </td>
209
+ <td
210
+ class=""
211
+ />
212
+ <td
213
+ class=""
214
+ >
215
+ aggregator
216
+ </td>
217
+ <td
218
+ class=""
219
+ >
220
+ Description 3
221
+ </td>
222
+ <td
223
+ class="center aligned"
224
+ >
225
+ 0
226
+ </td>
227
+ </tr>
228
+ <tr
229
+ class=""
230
+ >
231
+ <td
232
+ class=""
233
+ >
234
+ <div
235
+ class="ui teal tiny circular label"
236
+ width="100px"
237
+ >
238
+ b
239
+ </div>
240
+ </td>
241
+ <td
242
+ class=""
243
+ >
244
+ <a
245
+ data-discover="true"
246
+ href="/functions/4"
247
+ >
248
+ func_4
249
+ </a>
250
+ </td>
251
+ <td
252
+ class=""
253
+ />
254
+ <td
255
+ class=""
256
+ />
257
+ <td
258
+ class=""
259
+ >
260
+ Description 4
261
+ </td>
262
+ <td
263
+ class="center aligned"
264
+ >
265
+ 0
266
+ </td>
267
+ </tr>
268
+ <tr
269
+ class=""
270
+ >
271
+ <td
272
+ class=""
273
+ >
274
+ <div
275
+ class="ui teal tiny circular label"
276
+ width="100px"
277
+ >
278
+ b
279
+ </div>
280
+ </td>
281
+ <td
282
+ class=""
283
+ >
284
+ <a
285
+ data-discover="true"
286
+ href="/functions/5"
287
+ >
288
+ func_5
289
+ </a>
290
+ </td>
291
+ <td
292
+ class=""
293
+ />
294
+ <td
295
+ class=""
296
+ >
297
+ aggregator
298
+ </td>
299
+ <td
300
+ class=""
301
+ >
302
+ Description 5
303
+ </td>
304
+ <td
305
+ class="center aligned"
306
+ >
307
+ 0
308
+ </td>
309
+ </tr>
310
+ <tr
311
+ class=""
312
+ >
313
+ <td
314
+ class=""
315
+ >
316
+ <div
317
+ class="ui teal tiny circular label"
318
+ width="100px"
319
+ >
320
+ b
321
+ </div>
322
+ </td>
323
+ <td
324
+ class=""
325
+ >
326
+ <a
327
+ data-discover="true"
328
+ href="/functions/6"
329
+ >
330
+ func_6
331
+ </a>
332
+ </td>
333
+ <td
334
+ class=""
335
+ />
336
+ <td
337
+ class=""
338
+ />
339
+ <td
340
+ class=""
341
+ >
342
+ Description 6
343
+ </td>
344
+ <td
345
+ class="center aligned"
346
+ >
347
+ 0
348
+ </td>
349
+ </tr>
350
+ <tr
351
+ class=""
352
+ >
353
+ <td
354
+ class=""
355
+ >
356
+ <div
357
+ class="ui teal tiny circular label"
358
+ width="100px"
359
+ >
360
+ b
361
+ </div>
362
+ </td>
363
+ <td
364
+ class=""
365
+ >
366
+ <a
367
+ data-discover="true"
368
+ href="/functions/7"
369
+ >
370
+ func_7
371
+ </a>
372
+ </td>
373
+ <td
374
+ class=""
375
+ />
376
+ <td
377
+ class=""
378
+ >
379
+ aggregator
380
+ </td>
381
+ <td
382
+ class=""
383
+ >
384
+ Description 7
385
+ </td>
386
+ <td
387
+ class="center aligned"
388
+ >
389
+ 0
390
+ </td>
391
+ </tr>
392
+ <tr
393
+ class=""
394
+ >
395
+ <td
396
+ class=""
397
+ >
398
+ <div
399
+ class="ui teal tiny circular label"
400
+ width="100px"
401
+ >
402
+ b
403
+ </div>
404
+ </td>
405
+ <td
406
+ class=""
407
+ >
408
+ <a
409
+ data-discover="true"
410
+ href="/functions/8"
411
+ >
412
+ func_8
413
+ </a>
414
+ </td>
415
+ <td
416
+ class=""
417
+ />
418
+ <td
419
+ class=""
420
+ />
421
+ <td
422
+ class=""
423
+ >
424
+ Description 8
425
+ </td>
426
+ <td
427
+ class="center aligned"
428
+ >
429
+ 0
430
+ </td>
431
+ </tr>
432
+ <tr
433
+ class=""
434
+ >
435
+ <td
436
+ class=""
437
+ >
438
+ <div
439
+ class="ui teal tiny circular label"
440
+ width="100px"
441
+ >
442
+ b
443
+ </div>
444
+ </td>
445
+ <td
446
+ class=""
447
+ >
448
+ <a
449
+ data-discover="true"
450
+ href="/functions/9"
451
+ >
452
+ func_9
453
+ </a>
454
+ </td>
455
+ <td
456
+ class=""
457
+ />
458
+ <td
459
+ class=""
460
+ >
461
+ aggregator
462
+ </td>
463
+ <td
464
+ class=""
465
+ >
466
+ Description 9
467
+ </td>
468
+ <td
469
+ class="center aligned"
470
+ >
471
+ 0
472
+ </td>
473
+ </tr>
474
+ <tr
475
+ class=""
476
+ >
477
+ <td
478
+ class=""
479
+ >
480
+ <div
481
+ class="ui teal tiny circular label"
482
+ width="100px"
483
+ >
484
+ b
485
+ </div>
486
+ </td>
487
+ <td
488
+ class=""
489
+ >
490
+ <a
491
+ data-discover="true"
492
+ href="/functions/10"
493
+ >
494
+ func_10
495
+ </a>
496
+ </td>
497
+ <td
498
+ class=""
499
+ />
500
+ <td
501
+ class=""
502
+ />
503
+ <td
504
+ class=""
505
+ >
506
+ Description 10
507
+ </td>
508
+ <td
509
+ class="center aligned"
510
+ >
511
+ 0
512
+ </td>
513
+ </tr>
514
+ </tbody>
515
+ </table>
516
+ <div
517
+ aria-label="Pagination Navigation"
518
+ class="ui pagination menu"
519
+ role="navigation"
520
+ >
521
+ <a
522
+ aria-current="false"
523
+ aria-disabled="false"
524
+ aria-label="First item"
525
+ class="item"
526
+ tabindex="0"
527
+ type="firstItem"
528
+ value="1"
529
+ >
530
+ «
531
+ </a>
532
+ <a
533
+ aria-current="false"
534
+ aria-disabled="false"
535
+ aria-label="Previous item"
536
+ class="item"
537
+ tabindex="0"
538
+ type="prevItem"
539
+ value="1"
540
+ >
541
+
542
+ </a>
543
+ <a
544
+ aria-current="true"
545
+ aria-disabled="false"
546
+ class="active item"
547
+ tabindex="0"
548
+ type="pageItem"
549
+ value="1"
550
+ >
551
+ 1
552
+ </a>
553
+ <a
554
+ aria-current="false"
555
+ aria-disabled="false"
556
+ class="item"
557
+ tabindex="0"
558
+ type="pageItem"
559
+ value="2"
560
+ >
561
+ 2
562
+ </a>
563
+ <a
564
+ aria-current="false"
565
+ aria-disabled="false"
566
+ aria-label="Next item"
567
+ class="item"
568
+ tabindex="0"
569
+ type="nextItem"
570
+ value="2"
571
+ >
572
+
573
+ </a>
574
+ <a
575
+ aria-current="false"
576
+ aria-disabled="false"
577
+ aria-label="Last item"
578
+ class="item"
579
+ tabindex="0"
580
+ type="lastItem"
581
+ value="2"
582
+ >
583
+ »
584
+ </a>
585
+ </div>
586
+ </div>
587
+ </div>
588
+ `;
@@ -31,6 +31,7 @@ jest.mock("@truedat/qx/hooks/useFunctions", () => ({
31
31
  {
32
32
  name: "eq",
33
33
  type: "boolean",
34
+ class: "comparison",
34
35
  params: [
35
36
  { name: "arg1", type: "any" },
36
37
  { name: "arg2", type: "any" },
@@ -207,6 +208,9 @@ describe("<NewQualityControl />", () => {
207
208
 
208
209
  await act(async () => {
209
210
  await user.click(rendered.getAllByRole("option", { name: /campo1/ })[0]);
211
+ await user.click(
212
+ rendered.getByText("expression.condition.selectFunction"),
213
+ );
210
214
  await user.click(rendered.getByRole("option", { name: "eq" }));
211
215
  await user.click(rendered.getAllByRole("option", { name: /campo2/ })[1]);
212
216
  });
@@ -22,6 +22,7 @@ jest.mock("@truedat/qx/hooks/useFunctions", () => ({
22
22
  {
23
23
  name: "eq",
24
24
  type: "boolean",
25
+ class: "comparison",
25
26
  params: [
26
27
  { name: "arg1", type: "any" },
27
28
  { name: "arg2", type: "any" },
@@ -374,7 +375,13 @@ describe("<QualityControlEditor />", () => {
374
375
 
375
376
  await act(async () => {
376
377
  await user.click(rendered.getAllByRole("option", { name: /campo1/ })[0]);
377
- await user.click(rendered.getByRole("option", { name: /eq/i }));
378
+ });
379
+ await waitFor(() =>
380
+ expect(rendered.getByText(/select function/i)).toBeInTheDocument(),
381
+ );
382
+ await act(async () => {
383
+ await user.click(rendered.getByText(/select function/i));
384
+ await user.click(rendered.getByText(/eq/i));
378
385
  await user.click(rendered.getAllByRole("option", { name: /campo2/ })[1]);
379
386
  });
380
387