@truedat/qx 8.0.4 → 8.1.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 (51) hide show
  1. package/package.json +3 -3
  2. package/src/components/common/ClauseViewer.js +4 -4
  3. package/src/components/common/ResourceSelector.js +1 -0
  4. package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +13 -9
  5. package/src/components/common/expressions/Expression.js +1 -1
  6. package/src/components/dataViews/DataViewSummary.js +19 -29
  7. package/src/components/dataViews/__tests__/__snapshots__/AdvancedDataViewEditor.spec.js.snap +154 -120
  8. package/src/components/dataViews/__tests__/__snapshots__/DataViewSummary.spec.js.snap +1197 -996
  9. package/src/components/dataViews/__tests__/__snapshots__/Queryable.spec.js.snap +16 -12
  10. package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +12 -9
  11. package/src/components/dataViews/queryableFunctions.js +37 -35
  12. package/src/components/dataViews/queryableProperties/SelectField.js +4 -4
  13. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/From.spec.js.snap +4 -3
  14. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +4 -3
  15. package/src/components/dataViews/simpleForm/InformationForm.js +1 -1
  16. package/src/components/dataViews/summary/From.js +35 -27
  17. package/src/components/dataViews/summary/GroupBy.js +72 -60
  18. package/src/components/dataViews/summary/Join.js +51 -45
  19. package/src/components/dataViews/summary/Select.js +33 -20
  20. package/src/components/dataViews/summary/Where.js +47 -22
  21. package/src/components/qualityControls/ContentSummary.js +36 -0
  22. package/src/components/qualityControls/ControlProperties.js +35 -7
  23. package/src/components/qualityControls/ControlPropertiesForm.js +35 -0
  24. package/src/components/qualityControls/ControlPropertiesSummary.js +130 -0
  25. package/src/components/qualityControls/ControlPropertiesView.js +1 -1
  26. package/src/components/qualityControls/EditQualityControl.js +3 -3
  27. package/src/components/qualityControls/InformationForm.js +202 -0
  28. package/src/components/qualityControls/NewDraftQualityControl.js +3 -3
  29. package/src/components/qualityControls/NewQualityControl.js +3 -3
  30. package/src/components/qualityControls/QualityControl.js +13 -23
  31. package/src/components/qualityControls/QualityControlEditor.js +247 -223
  32. package/src/components/qualityControls/QualityControlSummary.js +28 -0
  33. package/src/components/qualityControls/ScoreCriteriaView.js +18 -2
  34. package/src/components/qualityControls/SegmentationForm.js +118 -0
  35. package/src/components/qualityControls/SegmentationSummary.js +122 -0
  36. package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +36 -4
  37. package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +51 -7
  38. package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +85 -26
  39. package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +116 -15
  40. package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +16 -0
  41. package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +15 -15
  42. package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +892 -552
  43. package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +876 -543
  44. package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +339 -264
  45. package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +170 -166
  46. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +1208 -802
  47. package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap +2 -2
  48. package/src/components/qualityControls/controlProperties/Ratio.js +1 -6
  49. package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +0 -2
  50. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Count.spec.js.snap +4 -3
  51. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/qx",
3
- "version": "8.0.4",
3
+ "version": "8.1.1",
4
4
  "description": "Truedat Web Quality Experience package",
5
5
  "sideEffects": false,
6
6
  "module": "src/index.js",
@@ -53,7 +53,7 @@
53
53
  "@testing-library/jest-dom": "^6.6.3",
54
54
  "@testing-library/react": "^16.3.0",
55
55
  "@testing-library/user-event": "^14.6.1",
56
- "@truedat/test": "8.0.4",
56
+ "@truedat/test": "8.1.1",
57
57
  "identity-obj-proxy": "^3.0.0",
58
58
  "jest": "^29.7.0",
59
59
  "redux-saga-test-plan": "^4.0.6"
@@ -86,5 +86,5 @@
86
86
  "semantic-ui-react": "^3.0.0-beta.2",
87
87
  "swr": "^2.3.3"
88
88
  },
89
- "gitHead": "e68d85fa6cb7c44974235cfb0e0301ed5a3dba98"
89
+ "gitHead": "26ff4767ae2a60605d4958208ca73d91cfe7f81a"
90
90
  }
@@ -57,14 +57,14 @@ export default function ClauseViewer({ clause, parentResource }) {
57
57
  _.map((group) => ({
58
58
  ...group,
59
59
  expressions: _.filter((expr) => isExpressionValid(expr, functions))(
60
- group.expressions || []
60
+ group.expressions || [],
61
61
  ),
62
62
  })),
63
- _.filter((group) => _.size(group.expressions) > 0)
63
+ _.filter((group) => _.size(group.expressions) > 0),
64
64
  )(clause || []);
65
65
 
66
66
  return (
67
- <Segment loading={loading} compact basic className="text-break-word">
67
+ <Segment loading={loading} basic className="text-break-word">
68
68
  {loading
69
69
  ? null
70
70
  : _map(({ expressions }, idx) => (
@@ -192,7 +192,7 @@ function GenericExpressionFunctionViewer({ alias, value }) {
192
192
  <div key={key} className="display-flex">
193
193
  <ExpressionViewer expression={expression} />
194
194
  </div>
195
- ))
195
+ )),
196
196
  )(value)}
197
197
  </div>
198
198
  )
@@ -57,6 +57,7 @@ export default function ResourceSelector({ required, labelId }) {
57
57
  <Form.Dropdown
58
58
  selection
59
59
  error={error?.message}
60
+ disabled={!sourceId}
60
61
  placeholder={formatMessage({ id: "queryables.resource.type" })}
61
62
  onBlur={onBlur}
62
63
  options={resourceTypeOptions}
@@ -9,13 +9,14 @@ exports[`<ResourceSelector /> matches the latest snapshot 1`] = `
9
9
  queryables.form.resource
10
10
  </label>
11
11
  <div
12
- class="field"
12
+ class="disabled field"
13
13
  >
14
14
  <div
15
+ aria-disabled="true"
15
16
  aria-expanded="false"
16
- class="ui selection dropdown"
17
+ class="ui disabled selection dropdown"
17
18
  role="listbox"
18
- tabindex="0"
19
+ tabindex="-1"
19
20
  >
20
21
  <div
21
22
  aria-atomic="true"
@@ -61,13 +62,14 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
61
62
  queryables.form.resource
62
63
  </label>
63
64
  <div
64
- class="field"
65
+ class="disabled field"
65
66
  >
66
67
  <div
68
+ aria-disabled="true"
67
69
  aria-expanded="false"
68
- class="ui selection dropdown"
70
+ class="ui disabled selection dropdown"
69
71
  role="listbox"
70
- tabindex="0"
72
+ tabindex="-1"
71
73
  >
72
74
  <div
73
75
  aria-atomic="true"
@@ -220,6 +222,7 @@ exports[`<ResourceSelector /> select data_view 1`] = `
220
222
  class="field"
221
223
  >
222
224
  <div
225
+ aria-disabled="false"
223
226
  aria-expanded="false"
224
227
  class="ui selection dropdown"
225
228
  role="listbox"
@@ -330,13 +333,14 @@ exports[`<ResourceSelector /> select reference_dataset 1`] = `
330
333
  queryables.form.resource
331
334
  </label>
332
335
  <div
333
- class="field"
336
+ class="disabled field"
334
337
  >
335
338
  <div
339
+ aria-disabled="true"
336
340
  aria-expanded="false"
337
- class="ui selection dropdown"
341
+ class="ui disabled selection dropdown"
338
342
  role="listbox"
339
- tabindex="0"
343
+ tabindex="-1"
340
344
  >
341
345
  <div
342
346
  aria-atomic="true"
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
2
2
  import { use } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { useFormContext } from "react-hook-form";
5
- import { Button, Grid, Icon } from "semantic-ui-react";
5
+ import { Button, Grid } from "semantic-ui-react";
6
6
  import QxContext from "@truedat/qx/components/QxContext";
7
7
  import ShapeSelector from "./ShapeSelector";
8
8
  import FunctionSelector from "./FunctionSelector";
@@ -1,7 +1,7 @@
1
1
  import _ from "lodash/fp";
2
2
  import { Fragment } from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Segment, List, Divider } from "semantic-ui-react";
4
+ import { Segment } from "semantic-ui-react";
5
5
  import From from "./summary/From";
6
6
  import Join from "./summary/Join";
7
7
  import Where from "./summary/Where";
@@ -35,34 +35,24 @@ export default function DataViewSummary({ dataView }) {
35
35
 
36
36
  return (
37
37
  <QxContext value={{ parentResourceMap }}>
38
- <Segment>
39
- <List>
40
- {queryables.map((queryable, index) => (
41
- <Fragment key={index}>
42
- {queryable.type === "from" && <From queryable={queryable} />}
43
- {queryable.type === "join" && <Join queryable={queryable} />}
44
- {queryable.type === "where" && (
45
- <Where
46
- queryable={queryable}
47
- clauseType={clauseTypeForWhere(index, queryables)}
48
- />
49
- )}
50
- {queryable.type === "group_by" && (
51
- <GroupBy queryable={queryable} />
52
- )}
53
- {queryable.type === "select" && <Select queryable={queryable} />}
54
- {index < queryables.length - 1 && (
55
- <Divider key={`divider-${index}`} />
56
- )}
57
- </Fragment>
58
- ))}
59
- {!_.isEmpty(dataView.select?.properties?.fields) && (
60
- <>
61
- <Divider />
62
- <Select queryable={dataView.select} />
63
- </>
64
- )}
65
- </List>
38
+ <Segment compact basic>
39
+ {queryables.map((queryable, index) => (
40
+ <Fragment key={index}>
41
+ {queryable.type === "from" && <From queryable={queryable} />}
42
+ {queryable.type === "join" && <Join queryable={queryable} />}
43
+ {queryable.type === "where" && (
44
+ <Where
45
+ queryable={queryable}
46
+ clauseType={clauseTypeForWhere(index, queryables)}
47
+ />
48
+ )}
49
+ {queryable.type === "group_by" && <GroupBy queryable={queryable} />}
50
+ {queryable.type === "select" && <Select queryable={queryable} />}
51
+ </Fragment>
52
+ ))}
53
+ {!_.isEmpty(dataView.select?.properties?.fields) && (
54
+ <Select queryable={dataView.select} />
55
+ )}
66
56
  </Segment>
67
57
  </QxContext>
68
58
  );
@@ -184,6 +184,7 @@ exports[`<AdvancedDataViewEditor /> handles user interaction 1`] = `
184
184
  class="field"
185
185
  >
186
186
  <div
187
+ aria-disabled="false"
187
188
  aria-expanded="false"
188
189
  class="ui selection dropdown"
189
190
  role="listbox"
@@ -575,97 +576,113 @@ exports[`<AdvancedDataViewEditor /> handles user interaction 1`] = `
575
576
  class="five wide column"
576
577
  >
577
578
  <div
578
- class="ui segment"
579
+ class="ui basic compact segment"
579
580
  >
581
+ <h5
582
+ class="ui header"
583
+ >
584
+ <i
585
+ aria-hidden="true"
586
+ class="database small icon"
587
+ />
588
+ <div
589
+ class="content"
590
+ >
591
+ dataViews.form.queryable.from
592
+ </div>
593
+ </h5>
580
594
  <div
581
- class="ui list"
582
- role="list"
595
+ class="ui segment"
583
596
  >
584
597
  <div
585
- class="item"
586
- role="listitem"
598
+ class="ui list"
599
+ role="list"
587
600
  >
588
601
  <div
589
- class="header"
590
- style="margin-bottom: 8px;"
591
- >
592
- <i
593
- aria-hidden="true"
594
- class="database icon"
595
- />
596
- dataViews.form.queryable.from
597
- </div>
598
- <div
599
- class="content"
602
+ class="item"
603
+ role="listitem"
600
604
  >
601
605
  <div
602
- class="description-flex-wrap text-break-word description"
606
+ class="content"
603
607
  >
604
608
  <div
605
- class="ui horizontal label"
609
+ class="description-flex-wrap text-break-word description"
606
610
  >
607
- queryables.resource.selector.data_view
608
- </div>
609
- <div
610
- class="ui blue label text-break-word"
611
- >
612
- AnotherDataView
613
- </div>
614
- <b
615
- style="margin-right: 4px; margin-left: 4px;"
616
- >
617
- as
618
- </b>
619
- <div
620
- class="ui blue label text-break-word"
621
- >
622
- from_alias
611
+ <div
612
+ class="ui horizontal label"
613
+ >
614
+ queryables.resource.selector.data_view
615
+ </div>
616
+ <div
617
+ class="ui blue label text-break-word"
618
+ >
619
+ AnotherDataView
620
+ </div>
621
+ <b
622
+ style="margin-right: 4px; margin-left: 4px;"
623
+ >
624
+ as
625
+ </b>
626
+ <div
627
+ class="ui blue label text-break-word"
628
+ >
629
+ from_alias
630
+ </div>
623
631
  </div>
624
632
  </div>
625
633
  </div>
626
634
  </div>
627
- <div
628
- class="ui divider"
635
+ </div>
636
+ <h5
637
+ class="ui header"
638
+ >
639
+ <i
640
+ aria-hidden="true"
641
+ class="columns small icon"
629
642
  />
630
643
  <div
631
- class="item"
632
- role="listitem"
644
+ class="content"
645
+ >
646
+ dataViews.form.queryable.select
647
+ </div>
648
+ </h5>
649
+ <div
650
+ class="ui segment"
651
+ >
652
+ <div
653
+ class="ui list"
654
+ role="list"
633
655
  >
634
656
  <div
635
- class="header"
636
- style="margin-bottom: 8px;"
637
- >
638
- <i
639
- aria-hidden="true"
640
- class="columns icon"
641
- />
642
- dataViews.form.queryable.select
643
- </div>
644
- <div
645
- class="content"
657
+ class="item"
658
+ role="listitem"
646
659
  >
647
660
  <div
648
- class="list"
661
+ class="content"
649
662
  >
650
663
  <div
651
- class="item"
652
- role="listitem"
664
+ class="list"
653
665
  >
654
666
  <div
655
- class="ui blue label text-break-word"
656
- title="from_alias.Column1"
657
- >
658
- from_alias.Column1
659
- </div>
660
- <b
661
- style="margin-right: 4px; margin-left: 4px;"
662
- >
663
- as
664
- </b>
665
- <div
666
- class="ui blue label text-break-word"
667
+ class="item"
668
+ role="listitem"
667
669
  >
668
- Column1
670
+ <div
671
+ class="ui blue label text-break-word"
672
+ title="from_alias.Column1"
673
+ >
674
+ from_alias.Column1
675
+ </div>
676
+ <b
677
+ style="margin-right: 4px; margin-left: 4px;"
678
+ >
679
+ as
680
+ </b>
681
+ <div
682
+ class="ui blue label text-break-word"
683
+ >
684
+ Column1
685
+ </div>
669
686
  </div>
670
687
  </div>
671
688
  </div>
@@ -863,6 +880,7 @@ exports[`<AdvancedDataViewEditor /> matches the latest snapshot with content 1`]
863
880
  class="field"
864
881
  >
865
882
  <div
883
+ aria-disabled="false"
866
884
  aria-expanded="false"
867
885
  class="ui selection dropdown"
868
886
  role="listbox"
@@ -1214,87 +1232,103 @@ exports[`<AdvancedDataViewEditor /> matches the latest snapshot with content 1`]
1214
1232
  class="five wide column"
1215
1233
  >
1216
1234
  <div
1217
- class="ui segment"
1235
+ class="ui basic compact segment"
1218
1236
  >
1237
+ <h5
1238
+ class="ui header"
1239
+ >
1240
+ <i
1241
+ aria-hidden="true"
1242
+ class="database small icon"
1243
+ />
1244
+ <div
1245
+ class="content"
1246
+ >
1247
+ dataViews.form.queryable.from
1248
+ </div>
1249
+ </h5>
1219
1250
  <div
1220
- class="ui list"
1221
- role="list"
1251
+ class="ui segment"
1222
1252
  >
1223
1253
  <div
1224
- class="item"
1225
- role="listitem"
1254
+ class="ui list"
1255
+ role="list"
1226
1256
  >
1227
1257
  <div
1228
- class="header"
1229
- style="margin-bottom: 8px;"
1230
- >
1231
- <i
1232
- aria-hidden="true"
1233
- class="database icon"
1234
- />
1235
- dataViews.form.queryable.from
1236
- </div>
1237
- <div
1238
- class="content"
1258
+ class="item"
1259
+ role="listitem"
1239
1260
  >
1240
1261
  <div
1241
- class="description-flex-wrap text-break-word description"
1262
+ class="content"
1242
1263
  >
1243
1264
  <div
1244
- class="ui horizontal label"
1245
- >
1246
- queryables.resource.selector.data_structure
1247
- </div>
1248
- <div
1249
- class="ui blue label text-break-word"
1265
+ class="description-flex-wrap text-break-word description"
1250
1266
  >
1251
- ParentTable
1267
+ <div
1268
+ class="ui horizontal label"
1269
+ >
1270
+ queryables.resource.selector.data_structure
1271
+ </div>
1272
+ <div
1273
+ class="ui blue label text-break-word"
1274
+ >
1275
+ ParentTable
1276
+ </div>
1252
1277
  </div>
1253
1278
  </div>
1254
1279
  </div>
1255
1280
  </div>
1256
- <div
1257
- class="ui divider"
1281
+ </div>
1282
+ <h5
1283
+ class="ui header"
1284
+ >
1285
+ <i
1286
+ aria-hidden="true"
1287
+ class="columns small icon"
1258
1288
  />
1259
1289
  <div
1260
- class="item"
1261
- role="listitem"
1290
+ class="content"
1291
+ >
1292
+ dataViews.form.queryable.select
1293
+ </div>
1294
+ </h5>
1295
+ <div
1296
+ class="ui segment"
1297
+ >
1298
+ <div
1299
+ class="ui list"
1300
+ role="list"
1262
1301
  >
1263
1302
  <div
1264
- class="header"
1265
- style="margin-bottom: 8px;"
1266
- >
1267
- <i
1268
- aria-hidden="true"
1269
- class="columns icon"
1270
- />
1271
- dataViews.form.queryable.select
1272
- </div>
1273
- <div
1274
- class="content"
1303
+ class="item"
1304
+ role="listitem"
1275
1305
  >
1276
1306
  <div
1277
- class="list"
1307
+ class="content"
1278
1308
  >
1279
1309
  <div
1280
- class="item"
1281
- role="listitem"
1310
+ class="list"
1282
1311
  >
1283
1312
  <div
1284
- class="ui blue label text-break-word"
1285
- title="ParentTable.Column1"
1286
- >
1287
- ParentTable.Column1
1288
- </div>
1289
- <b
1290
- style="margin-right: 4px; margin-left: 4px;"
1291
- >
1292
- as
1293
- </b>
1294
- <div
1295
- class="ui blue label text-break-word"
1313
+ class="item"
1314
+ role="listitem"
1296
1315
  >
1297
- Column1
1316
+ <div
1317
+ class="ui blue label text-break-word"
1318
+ title="ParentTable.Column1"
1319
+ >
1320
+ ParentTable.Column1
1321
+ </div>
1322
+ <b
1323
+ style="margin-right: 4px; margin-left: 4px;"
1324
+ >
1325
+ as
1326
+ </b>
1327
+ <div
1328
+ class="ui blue label text-break-word"
1329
+ >
1330
+ Column1
1331
+ </div>
1298
1332
  </div>
1299
1333
  </div>
1300
1334
  </div>