@truedat/qx 7.0.7 → 7.1.0

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 (169) hide show
  1. package/package.json +13 -4
  2. package/src/api.js +29 -20
  3. package/src/components/QxRoutes.js +18 -16
  4. package/src/components/__tests__/__fixtures__/helper.js +187 -0
  5. package/src/components/common/TestFormWrapper.js +38 -0
  6. package/src/components/common/__tests__/ResourceSelector.spec.js +18 -7
  7. package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +0 -12
  8. package/src/components/common/expressions/__tests__/Condition.spec.js +4 -1
  9. package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -5
  10. package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +4 -4
  11. package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +10 -2
  12. package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +6 -3
  13. package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +0 -12
  14. package/src/components/dataViews/__tests__/DataViewEditor.spec.js +83 -53
  15. package/src/components/dataViews/__tests__/DataViews.spec.js +14 -1
  16. package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +93 -4
  17. package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +13 -6
  18. package/src/components/functions/__tests__/FunctionEditor.spec.js +2 -34
  19. package/src/components/functions/__tests__/FunctionParams.spec.js +4 -17
  20. package/src/components/functions/__tests__/Functions.spec.js +2 -34
  21. package/src/components/functions/__tests__/__snapshots__/FunctionEditor.spec.js.snap +48 -48
  22. package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +4 -4
  23. package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -4
  24. package/src/components/qualityControls/ControlProperties.js +43 -0
  25. package/src/components/qualityControls/ControlPropertiesView.js +109 -0
  26. package/src/components/qualityControls/EditQualityControl.js +5 -21
  27. package/src/components/qualityControls/IconPopup.js +28 -0
  28. package/src/components/qualityControls/NewDraftQualityControl.js +4 -13
  29. package/src/components/qualityControls/NewQualityControl.js +10 -25
  30. package/src/components/qualityControls/QualityBadge.js +33 -0
  31. package/src/components/qualityControls/QualityControl.js +11 -53
  32. package/src/components/qualityControls/QualityControlActions.js +133 -46
  33. package/src/components/qualityControls/QualityControlEditor.js +114 -135
  34. package/src/components/qualityControls/QualityControlHeader.js +29 -7
  35. package/src/components/qualityControls/QualityControlHistory.js +6 -12
  36. package/src/components/qualityControls/QualityControlQueryModal.js +8 -5
  37. package/src/components/qualityControls/QualityControlRoutes.js +51 -96
  38. package/src/components/qualityControls/QualityControlRow.js +21 -2
  39. package/src/components/qualityControls/QualityControlScores.js +140 -0
  40. package/src/components/qualityControls/QualityControlTabs.js +24 -23
  41. package/src/components/qualityControls/QualityControls.js +142 -59
  42. package/src/components/qualityControls/QualityControlsLabelResults.js +51 -0
  43. package/src/components/qualityControls/QualityControlsTable.js +69 -43
  44. package/src/components/qualityControls/ScoreCriteria.js +40 -0
  45. package/src/components/qualityControls/{ResultCriteria.js → ScoreCriteriaView.js} +26 -42
  46. package/src/components/qualityControls/__tests__/ControlProperties.spec.js +86 -0
  47. package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +86 -0
  48. package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +219 -0
  49. package/src/components/qualityControls/__tests__/IconPopup.spec.js +33 -0
  50. package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +253 -0
  51. package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +384 -0
  52. package/src/components/qualityControls/__tests__/QualityBadge.spec.js +30 -0
  53. package/src/components/qualityControls/__tests__/QualityControl.spec.js +47 -0
  54. package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +192 -0
  55. package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +18 -0
  56. package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +296 -0
  57. package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +68 -0
  58. package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +21 -0
  59. package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +77 -0
  60. package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +91 -0
  61. package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +139 -0
  62. package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +20 -0
  63. package/src/components/qualityControls/__tests__/QualityControls.spec.js +202 -0
  64. package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +83 -0
  65. package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +38 -0
  66. package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +77 -0
  67. package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +62 -0
  68. package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +281 -0
  69. package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +151 -0
  70. package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +290 -0
  71. package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +672 -0
  72. package/src/components/qualityControls/__tests__/__snapshots__/IconPopup.spec.js.snap +10 -0
  73. package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +648 -0
  74. package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +336 -0
  75. package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +11 -0
  76. package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +255 -0
  77. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +85 -0
  78. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +25 -0
  79. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +930 -0
  80. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +127 -0
  81. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +75 -0
  82. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlQueryModal.spec.js.snap +27 -0
  83. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +113 -0
  84. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +161 -0
  85. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +28 -0
  86. package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +219 -0
  87. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsLabelResults.spec.js.snap +11 -0
  88. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +121 -0
  89. package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteria.spec.js.snap +186 -0
  90. package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap +76 -0
  91. package/src/components/qualityControls/__tests__/qualityByControlMode.spec.js +248 -0
  92. package/src/components/qualityControls/controlProperties/ErrorCount.js +56 -0
  93. package/src/components/qualityControls/controlProperties/Ratio.js +79 -0
  94. package/src/components/qualityControls/controlProperties/__tests__/ErrorCount.spec.js +82 -0
  95. package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +115 -0
  96. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/ErrorCount.spec.js.snap +62 -0
  97. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +143 -0
  98. package/src/components/qualityControls/qualityByControlMode.js +62 -0
  99. package/src/components/qualityControls/qualityControlScoresColumns.js +52 -0
  100. package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Deviation.js +6 -6
  101. package/src/components/qualityControls/{resultCriterias/ErrorsNumber.js → scoreCriterias/ErrorCount.js} +7 -7
  102. package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Percentage.js +6 -6
  103. package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +75 -0
  104. package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +63 -0
  105. package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +61 -0
  106. package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Deviation.spec.js.snap +58 -0
  107. package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +58 -0
  108. package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Percentage.spec.js.snap +58 -0
  109. package/src/components/{executions/ExecutionGroupsHeader.js → scores/MyScoreGroups.js} +5 -3
  110. package/src/components/scores/QualityBar.js +73 -0
  111. package/src/components/scores/Score.js +32 -0
  112. package/src/components/scores/ScoreContext.js +3 -0
  113. package/src/components/scores/ScoreCrumbs.js +40 -0
  114. package/src/components/scores/ScoreDetails.js +67 -0
  115. package/src/components/scores/ScoreEvents.js +59 -0
  116. package/src/components/scores/ScoreGroup.js +83 -0
  117. package/src/components/scores/ScoreGroupBreadcrumbs.js +25 -0
  118. package/src/components/{qualityControls/ExecutionForm.js → scores/ScoreGroupForm.js} +11 -13
  119. package/src/components/scores/ScoreGroupLink.js +18 -0
  120. package/src/components/scores/ScoreGroupMessage.js +25 -0
  121. package/src/components/{qualityControls/ExecutionPopup.js → scores/ScoreGroupPopup.js} +13 -22
  122. package/src/components/scores/ScoreGroupsTable.js +113 -0
  123. package/src/components/scores/ScoreRoutes.js +32 -0
  124. package/src/components/{executions/ExecutionStatusDecorator.js → scores/ScoreStatusDecorator.js} +10 -8
  125. package/src/components/scores/ScoreTabs.js +32 -0
  126. package/src/components/scores/__tests__/MyScoreGroups.spec.js +31 -0
  127. package/src/components/scores/__tests__/QualityBar.spec.js +55 -0
  128. package/src/components/scores/__tests__/Score.spec.js +41 -0
  129. package/src/components/scores/__tests__/ScoreCrumbs.spec.js +39 -0
  130. package/src/components/scores/__tests__/ScoreDetails.spec.js +38 -0
  131. package/src/components/scores/__tests__/ScoreEvents.spec.js +24 -0
  132. package/src/components/scores/__tests__/ScoreGroup.spec.js +43 -0
  133. package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +16 -0
  134. package/src/components/scores/__tests__/ScoreGroupForm.spec.js +78 -0
  135. package/src/components/scores/__tests__/ScoreGroupLink.spec.js +16 -0
  136. package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +20 -0
  137. package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +59 -0
  138. package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +40 -0
  139. package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +21 -0
  140. package/src/components/scores/__tests__/ScoreTabs.spec.js +27 -0
  141. package/src/components/scores/__tests__/__fixtures__/scoreHelper.js +182 -0
  142. package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +154 -0
  143. package/src/components/scores/__tests__/__snapshots__/QualityBar.spec.js.snap +24 -0
  144. package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +92 -0
  145. package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +39 -0
  146. package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +156 -0
  147. package/src/components/scores/__tests__/__snapshots__/ScoreEvents.spec.js.snap +167 -0
  148. package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +103 -0
  149. package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +29 -0
  150. package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +145 -0
  151. package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +15 -0
  152. package/src/components/scores/__tests__/__snapshots__/ScoreGroupMessage.spec.js.snap +43 -0
  153. package/src/components/scores/__tests__/__snapshots__/ScoreGroupPopup.spec.js.snap +11 -0
  154. package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +147 -0
  155. package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +71 -0
  156. package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +43 -0
  157. package/src/components/scores/index.js +15 -0
  158. package/src/hooks/useQualityControls.js +3 -9
  159. package/src/hooks/useScoreGroups.js +23 -0
  160. package/src/hooks/useScores.js +22 -0
  161. package/src/styles/Expression.less +16 -0
  162. package/src/styles/scores.less +63 -0
  163. package/src/components/executions/ExecutionGroupBreadcrumbs.js +0 -25
  164. package/src/components/executions/ExecutionGroupContent.js +0 -42
  165. package/src/components/executions/ExecutionGroupLink.js +0 -18
  166. package/src/components/executions/ExecutionGroupMessage.js +0 -27
  167. package/src/components/executions/ExecutionGroupsTable.js +0 -101
  168. package/src/components/executions/executionGroupDetail.js +0 -87
  169. package/src/components/qualityControls/ResultType.js +0 -57
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/qx",
3
- "version": "7.0.7",
3
+ "version": "7.1.0",
4
4
  "description": "Truedat Web Quality Experience package",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -35,7 +35,7 @@
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/react-hooks": "^8.0.1",
37
37
  "@testing-library/user-event": "^13.2.1",
38
- "@truedat/test": "7.0.7",
38
+ "@truedat/test": "7.1.0",
39
39
  "babel-jest": "^28.1.0",
40
40
  "babel-plugin-dynamic-import-node": "^2.3.3",
41
41
  "babel-plugin-lodash": "^3.3.4",
@@ -44,6 +44,7 @@
44
44
  "identity-obj-proxy": "^3.0.0",
45
45
  "jest": "^29.0.0",
46
46
  "jest-environment-jsdom": "^29.0.0",
47
+ "jsdom": "^26.0.0",
47
48
  "react": "^16.14.0",
48
49
  "react-dom": "^16.14.0",
49
50
  "rimraf": "^3.0.2",
@@ -68,6 +69,11 @@
68
69
  "enzyme-to-json/serializer"
69
70
  ],
70
71
  "testEnvironment": "jsdom",
72
+ "testMatch": [
73
+ "**/__tests__/**/*.[jt]s?(x)",
74
+ "**/?(*.)+(spec|test).[jt]s?(x)",
75
+ "!**/__fixtures__/**"
76
+ ],
71
77
  "testPathIgnorePatterns": [
72
78
  "<rootDir>/node_modules/"
73
79
  ],
@@ -84,7 +90,7 @@
84
90
  ]
85
91
  },
86
92
  "dependencies": {
87
- "@truedat/core": "7.0.7",
93
+ "@truedat/core": "7.1.0",
88
94
  "prop-types": "^15.8.1",
89
95
  "react-hook-form": "^7.45.4",
90
96
  "react-intl": "^5.20.10",
@@ -97,5 +103,8 @@
97
103
  "react-dom": ">= 16.8.6 < 17",
98
104
  "semantic-ui-react": ">= 2.0.3 < 2.2"
99
105
  },
100
- "gitHead": "f780d02b3356b69c61023b14b61400ffb779e33d"
106
+ "overrides": {
107
+ "jsdom": "26.0.0"
108
+ },
109
+ "gitHead": "cb08380da04c7286e694540bc24d32f01a728dfc"
101
110
  }
package/src/api.js CHANGED
@@ -1,37 +1,46 @@
1
- const API_DATA_VIEWS = "/api/data_views";
2
1
  const API_DATA_VIEW = "/api/data_views/:id";
3
- const API_FUNCTIONS = "/api/quality_functions";
2
+ const API_DATA_VIEWS = "/api/data_views";
4
3
  const API_FUNCTION = "/api/quality_functions/:id";
5
- const API_QUALITY_CONTROLS = "/api/quality_controls";
4
+ const API_FUNCTIONS = "/api/quality_functions";
6
5
  const API_QUALITY_CONTROL = "/api/quality_controls/:id";
7
- const API_QUALITY_CONTROL_VERSIONS = "/api/quality_controls/:id/versions";
8
- const API_QUALITY_CONTROL_PUBLISHED = "/api/quality_controls/:id/published";
9
6
  const API_QUALITY_CONTROL_DRAFT = "/api/quality_controls/:id/draft";
10
- const API_QUALITY_CONTROL_STATUS = "/api/quality_controls/:id/status";
11
- const API_QUALITY_CONTROL_DOMAINS = "/api/quality_controls/:id/domains";
7
+ const API_QUALITY_CONTROL_FILTERS = "/api/quality_controls/filters";
8
+ const API_QUALITY_CONTROL_MAIN = "/api/quality_controls/:id/main";
9
+ const API_QUALITY_CONTROL_PUBLISHED = "/api/quality_controls/:id/published";
12
10
  const API_QUALITY_CONTROL_QUERIES = "/api/quality_controls/:id/queries";
13
11
  const API_QUALITY_CONTROL_SEARCH = "/api/quality_controls/search";
14
- const API_QUALITY_CONTROL_FILTERS = "/api/quality_controls/filters";
15
- const API_QUALITY_CONTROL_EXECUTION_GROUPS =
16
- "/api/quality_controls/execution_groups";
12
+ const API_QUALITY_CONTROL_STATUS = "/api/quality_controls/:id/status";
13
+ const API_QUALITY_CONTROL_VERSIONS = "/api/quality_controls/:id/versions";
14
+ const API_QUALITY_CONTROLS = "/api/quality_controls";
15
+ const API_SCORE_GROUPS = "/api/score_groups";
16
+ const API_SCORE_GROUP = "/api/score_groups/:id";
17
+ const API_SCORE = "/api/scores/:id";
18
+
17
19
  const API_QUALITY_CONTROL_EXECUTION_GROUP =
18
20
  "/api/quality_controls/execution_groups/:id";
21
+ const API_QUALITY_CONTROL_EXECUTION_GROUPS =
22
+ "/api/quality_controls/execution_groups";
23
+ const API_QUALITY_CONTROL_SCORES = "/api/quality_controls/:id/scores";
19
24
 
20
25
  export {
21
- API_DATA_VIEWS,
22
26
  API_DATA_VIEW,
23
- API_FUNCTIONS,
27
+ API_DATA_VIEWS,
24
28
  API_FUNCTION,
25
- API_QUALITY_CONTROLS,
26
- API_QUALITY_CONTROL,
27
- API_QUALITY_CONTROL_VERSIONS,
28
- API_QUALITY_CONTROL_PUBLISHED,
29
+ API_FUNCTIONS,
29
30
  API_QUALITY_CONTROL_DRAFT,
30
- API_QUALITY_CONTROL_STATUS,
31
- API_QUALITY_CONTROL_DOMAINS,
31
+ API_QUALITY_CONTROL_FILTERS,
32
+ API_QUALITY_CONTROL_MAIN,
33
+ API_QUALITY_CONTROL_PUBLISHED,
32
34
  API_QUALITY_CONTROL_QUERIES,
33
35
  API_QUALITY_CONTROL_SEARCH,
34
- API_QUALITY_CONTROL_FILTERS,
35
- API_QUALITY_CONTROL_EXECUTION_GROUPS,
36
+ API_QUALITY_CONTROL_STATUS,
37
+ API_QUALITY_CONTROL_VERSIONS,
38
+ API_QUALITY_CONTROL,
39
+ API_QUALITY_CONTROLS,
40
+ API_SCORE_GROUPS,
41
+ API_SCORE_GROUP,
42
+ API_SCORE,
36
43
  API_QUALITY_CONTROL_EXECUTION_GROUP,
44
+ API_QUALITY_CONTROL_EXECUTION_GROUPS,
45
+ API_QUALITY_CONTROL_SCORES,
37
46
  };
@@ -2,30 +2,32 @@ import React from "react";
2
2
  import { Route, Switch } from "react-router-dom";
3
3
  import { Unauthorized } from "@truedat/core/components";
4
4
  import { useAuthorized } from "@truedat/core/hooks";
5
- import { DATA_VIEWS, FUNCTIONS, QUALITY_CONTROLS } from "@truedat/core/routes";
5
+ import {
6
+ DATA_VIEWS,
7
+ FUNCTIONS,
8
+ QUALITY_CONTROLS,
9
+ MY_SCORE_GROUPS,
10
+ SCORE_GROUPS,
11
+ SCORES,
12
+ } from "@truedat/core/routes";
6
13
  import DataViews from "./dataViews/DataViews";
7
14
  import Functions from "./functions/Functions";
8
15
  import QualityControlRoutes from "./qualityControls/QualityControlRoutes";
16
+ import ScoreRoutes from "./scores/ScoreRoutes";
9
17
 
10
18
  export default function QxRoutes() {
11
19
  const authorized = useAuthorized("quality_control");
12
20
 
13
- return (
21
+ return authorized ? (
14
22
  <Switch>
15
- <Route
16
- path={DATA_VIEWS}
17
- render={() => (authorized ? <DataViews /> : <Unauthorized />)}
18
- />
19
- <Route
20
- path={FUNCTIONS}
21
- render={() => (authorized ? <Functions /> : <Unauthorized />)}
22
- />
23
- <Route
24
- path={QUALITY_CONTROLS}
25
- render={() =>
26
- authorized ? <QualityControlRoutes /> : <Unauthorized />
27
- }
28
- />
23
+ <Route path={DATA_VIEWS} render={() => <DataViews />} />
24
+ <Route path={FUNCTIONS} render={() => <Functions />} />
25
+ <Route path={QUALITY_CONTROLS} render={() => <QualityControlRoutes />} />
26
+ <Route path={SCORES} render={() => <ScoreRoutes />} />
27
+ <Route path={SCORE_GROUPS} render={() => <ScoreRoutes />} />
28
+ <Route path={MY_SCORE_GROUPS} render={() => <ScoreRoutes />} />
29
29
  </Switch>
30
+ ) : (
31
+ <Unauthorized />
30
32
  );
31
33
  }
@@ -0,0 +1,187 @@
1
+ export const messages = {
2
+ en: {
3
+ "actions.cancel": "Cancel",
4
+ "actions.create": "Create",
5
+ "actions.delete": "Delete",
6
+ "actions.discard.confirmation.content": "confirmation_content",
7
+ "actions.discard.confirmation.header": "confirmation_header",
8
+ "actions.publish": "Publish",
9
+ "actions.save": "Save",
10
+ "confirmation.no": "confirm_no",
11
+ "confirmation.yes": "confirm_yes",
12
+ "dataViews.form.name": "Name",
13
+ "dataViews.form.source": "Source",
14
+ "domain.multiple.placeholder": "Select domains",
15
+ "domain.selector.placeholder": "Select a domain...",
16
+ "expression.clause.action.addExpression": "Add expression",
17
+ "expression.clause.action.addGroup": "Add group",
18
+ "expression.condition.customExpression": "Custom expression",
19
+ "expression.condition.selectFunction": "Select function",
20
+ "expressions.data_type.any": "any",
21
+ "expressions.data_type.boolean": "boolean",
22
+ "expressions.data_type.date": "date",
23
+ "expressions.data_type.number": "number",
24
+ "expressions.data_type.string": "string",
25
+ "expressions.data_type.timestamp": "timestamp",
26
+ "form.validation.empty_required": "Required field is empty",
27
+ "form.validation.must_be_a_number": "Must be a number",
28
+ "form.validation.must_be_greater_than_or_equal":
29
+ "Must be greater than {value}",
30
+ "form.validation.must_be_less_than_or_equal": "Must be less than {value}",
31
+ "form.validation.required": "required",
32
+ "functions.action.delete.content": "delete_content",
33
+ "functions.action.delete.header": "delete_header",
34
+ "functions.action.new": "New function",
35
+ "functions.empty_list": "No functions found",
36
+ "functions.expression.constant.false": "False",
37
+ "functions.expression.constant.true": "True",
38
+ "functions.expression.shape.constant": "Constant",
39
+ "functions.expression.shape.function": "Function",
40
+ "functions.expression.shape.field": "Field",
41
+ "expression.condition.selectFunction": "Select function",
42
+ "functions.expression.shape.param": "Parameter",
43
+ "functions.form.add_description": "Add description",
44
+ "functions.form.add_param": "Add parameter",
45
+ "functions.form.description": "Description",
46
+ "functions.form.expression.function.placeholder":
47
+ "Select a function of type {type}",
48
+ "functions.form.name": "Name",
49
+ "functions.form.output": "Expression",
50
+ "functions.form.params": "Parameters",
51
+ "functions.form.required": "Required field",
52
+ "functions.header": "Quality Functions",
53
+ "functions.no_selection": "No function selected",
54
+ "functions.subheader": "List and edit quality functions",
55
+ "group.props.name": "Name",
56
+ "quality_control.actions.do_execution": "Execute quality control",
57
+ "quality_control.actions.execution.confirmation.content":
58
+ "This quality control will be executed. Are you sure?",
59
+ "quality_control.control_properties.empty": "Empty control properties",
60
+ "quality_control.error_count.errors_resource.empty": "Empty Dataset",
61
+ "quality_control.control_mode.deviation": "Deviation",
62
+ "quality_control.control_mode.error_count": "Error count",
63
+ "quality_control.control_mode.percentage": "Percentage",
64
+ "quality_control.control_mode": "Control mode",
65
+ "quality_control.error_count.errors_resource": "Dataset",
66
+ "quality_control.form.active": "Enable",
67
+ "quality_control.form.control_properties.ratio.resource": "Dataset",
68
+ "quality_control.form.control_properties.ratio.validation": "Validation",
69
+ "quality_control.form.control_properties.error_count.errors_resource":
70
+ "Dataset",
71
+ "quality_control.form.control_properties": "Implementation",
72
+ "quality_control.form.domain_ids": "Domains",
73
+ "quality_control.form.information": "Information",
74
+ "quality_control.form.name": "Name",
75
+ "quality_control.props.active.false": "Disabled",
76
+ "quality_control.props.active.true": "Enabled",
77
+ "quality_control.props.version": "Version",
78
+ "quality_control.queries.loading": "Loading queries",
79
+ "quality_control.ratio.resource": "Dataset",
80
+ "quality_control.ratio.validation": "Validation",
81
+ "quality_control.score_criteria.deviation.goal": "Goal",
82
+ "quality_control.score_criteria.deviation.maximum": "Threshold",
83
+ "quality_control.score_criteria.empty": "No result criteria defined",
84
+ "quality_control.score_criteria.error_count.goal": "Goal",
85
+ "quality_control.score_criteria.error_count.maximum": "Threshold",
86
+ "quality_control.score_criteria.percentage.goal": "Goal",
87
+ "quality_control.score_criteria.percentage.minimum": "Threshold",
88
+ "quality_control.score_criteria": "Result criteria",
89
+ "quality_control.status.draft": "Draft",
90
+ "quality_control.status.published": "Published",
91
+ "quality_control.status.versioned": "Versioned",
92
+ "quality_control.tabs.history": "History",
93
+ "quality_control.tabs.quality_control": "Detail",
94
+ "quality_control.tabs.scores": "Scores",
95
+ "quality_controls.actions.create_draft": "Create Draft",
96
+ "quality_controls.actions.deprecate": "Deprecate",
97
+ "quality_controls.actions.disable.confirmation.content":
98
+ "Quality control {name} will be disabled. Are you sure?",
99
+ "quality_controls.actions.disable.confirmation.header":
100
+ "Disable quality control",
101
+ "quality_controls.actions.disable": "Disable",
102
+ "quality_controls.actions.do_execution": "Execute quality controls",
103
+ "quality_controls.actions.edit": "Edit",
104
+ "quality_controls.actions.enable.confirmation.content":
105
+ "Quality control {name} will be enabled. Are you sure?",
106
+ "quality_controls.actions.enable.confirmation.header":
107
+ "Enable quality control",
108
+ "quality_controls.actions.enable": "Enable",
109
+ "quality_controls.actions.execution.confirmation.header":
110
+ "Quality controls execution",
111
+ "quality_controls.actions.execution.confirmation.legend": "Template fields",
112
+ "quality_controls.actions.create": "Create control",
113
+ "quality_controls.actions.publish": "Publish",
114
+ "quality_controls.actions.reject": "Reject",
115
+ "quality_controls.actions.restore": "Restore",
116
+ "quality_controls.actions.send_to_approval": "Send to approval",
117
+ "quality_controls.actions.send_to_draft": "Send to draft",
118
+ "quality_controls.actions.execution.confirmation.content": "{count} quality controls will be executed. Are you sure?",
119
+ "quality_controls.edit.subheader": "Edit quality control",
120
+ "quality_controls.execute.filtered": "{count} quality controls to execute",
121
+ "quality_controls.subheader": "List and edit quality controls",
122
+ "quality_controls.header": "Quality Controls",
123
+ "quality_controls.new.header": "Quality control",
124
+ "quality_controls.new.subheader": "Create new quality control",
125
+ "quality_controls.retrieved.results": "{count} quality controls found",
126
+ "quality_controls.search.results.empty": "No quality controls found",
127
+ "quality_controls.searching": "Searching",
128
+ "quality_control.props.name": "Name",
129
+ "quality_control.ratio.validation.empty": "Empty validation",
130
+ "quality_control.ratio.resource.empty": "Empty resource",
131
+
132
+ "quality.goal": "Goal",
133
+ "quality.threshold": "Threshold",
134
+ "queryables.resource.selector.data_structure": "Data Structure",
135
+ "queryables.resource.type.data_structure": "Data structures",
136
+ "queryables.resource.type.reference_dataset": "Reference datasets",
137
+ "queryables.resource.type": "Resource type",
138
+ "queryables.resource.selector.reference_dataset": "Reference dataset",
139
+ "search.placeholder": "Search...",
140
+ "score.actions.delete.confirmation.header": "Delete result",
141
+ "score.actions.delete.confirmation.content":
142
+ "This result will be deleted. Are you sure?",
143
+ "score.details": "Details",
144
+ "score.event.type.FAILED": "Failed",
145
+ "score.event.type.INFO": "Info",
146
+ "score.event.type.PENDING": "Pending",
147
+ "score.event.type.QUEUED": "Queued",
148
+ "score.event.type.STARTED": "Started",
149
+ "score.event.type.SUCCEEDED": "Succeeded",
150
+ "score.event.type.WARNING": "Warning",
151
+ "score.information": "Information",
152
+ "score.no_results": "No results",
153
+ "score.not_executed": "Not executed",
154
+ "score.props.status": "Status",
155
+ "score.status.failed": "Failed",
156
+ "score.status.FAILED": "Failed",
157
+ "score.status.PENDING": "Pending",
158
+ "score.status.QUEUED": "Queued",
159
+ "score.status.SUCCEEDED": "Succeeded",
160
+ "score.status.STARTED": "Started",
161
+ "sidemenu.executions": "My Executions",
162
+ "score_groups.header": "My score Groups",
163
+ "score_groups.table.header.created": "Created",
164
+ "score_groups.search.results.empty": "No execution groups found",
165
+ "scores.completed.header": "Scores completed",
166
+ "scores.completed.content": "{count} scores completed",
167
+ "scores.pending.header": "Scores scheduled",
168
+ "scores.pending.content": "There are {pending} scores pending, please check again later",
169
+ "scores.detail.header": "Score view",
170
+ "scores.empty": "No scores found",
171
+ "scores.event.props.inserted_at": "Date",
172
+ "scores.event.props.message": "Message",
173
+ "scores.event.props.type": "Type",
174
+ "scores.props.control_mode": "Control Mode",
175
+ "scores.props.execution_timestamp": "Date",
176
+ "scores.props.quality_control_status": "Control status",
177
+ "scores.props.quality": "Quality",
178
+ "scores.props.status": "Status",
179
+ "source.search.placeholder": "Select source",
180
+ "tabs.qx.score.details": "Details",
181
+ "tabs.qx.score.score_events": "Events",
182
+ "template.form.validation.empty_required": "Empty required field",
183
+ "template.selector.label": "Template",
184
+ "template.selector.placeholder": "Select a template...",
185
+ loading: "loading...",
186
+ },
187
+ };
@@ -2,6 +2,37 @@ import React from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { FormProvider, useForm } from "react-hook-form";
4
4
  import QxContext from "@truedat/qx/components/QxContext";
5
+ import { useFunctions } from "@truedat/qx/hooks/useFunctions";
6
+
7
+ jest.mock("@truedat/core/hooks/useUserFilters", () => {
8
+ const originalModule = jest.requireActual(
9
+ "@truedat/core/hooks/useUserFilters"
10
+ );
11
+
12
+ return {
13
+ __esModule: true,
14
+ ...originalModule,
15
+ useUserFilters: jest.fn(() => ({})),
16
+ };
17
+ });
18
+ jest.mock("@truedat/qx/hooks/useFunctions", () => {
19
+ const originalModule = jest.requireActual("@truedat/qx/hooks/useFunctions");
20
+
21
+ return {
22
+ __esModule: true,
23
+ ...originalModule,
24
+ useFunctions: jest.fn(() => ({})),
25
+ };
26
+ });
27
+ jest.mock("@truedat/qx/hooks/useDataViews", () => {
28
+ const originalModule = jest.requireActual("@truedat/qx/hooks/useDataViews");
29
+
30
+ return {
31
+ __esModule: true,
32
+ ...originalModule,
33
+ useDataViews: jest.fn(() => ({})),
34
+ };
35
+ });
5
36
 
6
37
  export default function TestFormWrapper({
7
38
  context,
@@ -19,6 +50,13 @@ export default function TestFormWrapper({
19
50
  ...context,
20
51
  };
21
52
 
53
+ useFunctions.mockImplementationOnce(() => ({
54
+ data: {
55
+ data: qxContext.functions,
56
+ },
57
+ loading: false,
58
+ }));
59
+
22
60
  return (
23
61
  <FormProvider {...form}>
24
62
  <QxContext.Provider value={qxContext}>{children}</QxContext.Provider>
@@ -50,6 +50,7 @@ const renderOpts = {
50
50
  "structures.loading.header": "loading",
51
51
  },
52
52
  },
53
+ fallback: "loading",
53
54
  };
54
55
 
55
56
  const searchProps = {
@@ -61,7 +62,7 @@ const searchProps = {
61
62
  };
62
63
 
63
64
  describe("<ResourceSelector />", () => {
64
- it("matches the latest snapshot", () => {
65
+ it("matches the latest snapshot", async () => {
65
66
  const { container } = render(
66
67
  <TestFormWrapper>
67
68
  <SearchContext.Provider value={searchProps}>
@@ -70,6 +71,9 @@ describe("<ResourceSelector />", () => {
70
71
  </TestFormWrapper>,
71
72
  renderOpts
72
73
  );
74
+ await waitFor(() =>
75
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
76
+ );
73
77
  expect(container).toMatchSnapshot();
74
78
  });
75
79
 
@@ -90,7 +94,8 @@ describe("<ResourceSelector />", () => {
90
94
  </TestFormWrapper>,
91
95
  renderOpts
92
96
  );
93
-
97
+ const loader = container.querySelector(".loader");
98
+ await waitFor(() => expect(loader).not.toBeInTheDocument());
94
99
  await act(async () => {
95
100
  userEvent.click(getByRole("option", { name: /data_view/i }));
96
101
  });
@@ -125,14 +130,18 @@ describe("<ResourceSelector />", () => {
125
130
  </TestFormWrapper>,
126
131
  renderOpts
127
132
  );
128
-
133
+ await waitFor(() =>
134
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
135
+ );
129
136
  await act(async () => {
130
137
  userEvent.click(await getByRole("option", { name: /data_structure/i }));
131
138
  });
132
-
133
- await waitFor(() => {
134
- expect(container.querySelector(".loading")).toBeNull();
135
- });
139
+ await waitFor(() =>
140
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
141
+ );
142
+ await waitFor(() =>
143
+ expect(container.querySelector(".loading")).not.toBeInTheDocument()
144
+ );
136
145
  await findByText(/header/);
137
146
  expect(container).toMatchSnapshot();
138
147
  });
@@ -152,6 +161,8 @@ describe("<ResourceSelector />", () => {
152
161
  </TestFormWrapper>,
153
162
  renderOpts
154
163
  );
164
+ const loader = container.querySelector(".loader");
165
+ await waitFor(() => expect(loader).not.toBeInTheDocument());
155
166
 
156
167
  await act(async () => {
157
168
  userEvent.click(
@@ -163,18 +163,6 @@ exports[`<ResourceSelector /> select data_structure 1`] = `
163
163
  <div
164
164
  class="dimmable structure-table-overflow"
165
165
  >
166
- <div
167
- class="ui inverted dimmer"
168
- style=""
169
- >
170
- <div
171
- class="content"
172
- >
173
- <div
174
- class="ui large loader"
175
- />
176
- </div>
177
- </div>
178
166
  <div
179
167
  class="ui icon info message"
180
168
  >
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { act } from "react-dom/test-utils";
3
3
  import { render } from "@truedat/test/render";
4
+ import { waitFor } from "@testing-library/react";
4
5
  import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
5
6
  import Condition from "../Condition";
6
7
 
@@ -25,7 +26,9 @@ describe("<Condition />", () => {
25
26
  </TestFormWrapper>,
26
27
  renderOpts
27
28
  );
28
-
29
+ await waitFor(() =>
30
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
31
+ );
29
32
  await act(async () => {
30
33
  expect(container).toMatchSnapshot();
31
34
  });
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { waitFor } from "@testing-library/react";
3
+ import { act } from "react-dom/test-utils";
3
4
  import { render } from "@truedat/test/render";
4
5
  import userEvent from "@testing-library/user-event";
5
6
  import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
@@ -86,7 +87,7 @@ describe("<FunctionArgs />", () => {
86
87
  },
87
88
  };
88
89
 
89
- const { container, getAllByRole, queryByText } = render(
90
+ const { container, getAllByRole, queryByText, getByRole } = render(
90
91
  <TestFormWrapper
91
92
  watcher={watcher}
92
93
  context={{ type: "boolean", functions }}
@@ -96,10 +97,22 @@ describe("<FunctionArgs />", () => {
96
97
  </TestFormWrapper>,
97
98
  renderOpts
98
99
  );
99
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
100
+ await waitFor(() => {
101
+ expect(queryByText(/lazy/i)).not.toBeInTheDocument();
102
+ expect(container.querySelector(".loader")).not.toBeInTheDocument();
103
+ });
104
+
105
+ userEvent.click(getAllByRole("listbox")[0]);
106
+
107
+ act(() =>
108
+ userEvent.click(getAllByRole("option", { name: /constant/i })[0])
109
+ );
110
+
111
+ await waitFor(() => {
112
+ expect(getByRole("option", { name: /true/i })).toBeInTheDocument();
113
+ });
100
114
 
101
- userEvent.click(await getAllByRole("listbox")[0]);
102
- userEvent.click(await getAllByRole("option", { name: /constant/i })[0]);
115
+ userEvent.click(getByRole("option", { name: /true/i }));
103
116
 
104
117
  expect(watcher).toHaveBeenLastCalledWith({
105
118
  test: {
@@ -108,7 +121,7 @@ describe("<FunctionArgs />", () => {
108
121
  args: {
109
122
  arg1: {
110
123
  shape: "constant",
111
- value: { type: "boolean", value: undefined },
124
+ value: { type: "boolean", value: "true" },
112
125
  },
113
126
  arg2: {
114
127
  shape: "function",
@@ -13,7 +13,7 @@ const renderOpts = {
13
13
  "functions.expression.shape.param": "param",
14
14
  },
15
15
  },
16
- fallback: "lazy",
16
+ fallback: "loading",
17
17
  };
18
18
 
19
19
  describe("<ShapeSelector />", () => {
@@ -47,7 +47,7 @@ describe("<ShapeSelector />", () => {
47
47
  </TestFormWrapper>,
48
48
  renderOpts
49
49
  );
50
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
50
+ await waitFor(() => expect(queryByText(/loading/i)).not.toBeInTheDocument());
51
51
 
52
52
  userEvent.click(await getByRole("option", { name: /param/i }));
53
53
 
@@ -74,7 +74,7 @@ describe("<ShapeSelector />", () => {
74
74
  </TestFormWrapper>,
75
75
  renderOpts
76
76
  );
77
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
77
+ await waitFor(() => expect(queryByText(/loading/i)).not.toBeInTheDocument());
78
78
 
79
79
  userEvent.click(await getByRole("option", { name: /constant/i }));
80
80
 
@@ -94,7 +94,7 @@ describe("<ShapeSelector />", () => {
94
94
  </TestFormWrapper>,
95
95
  renderOpts
96
96
  );
97
- await waitFor(() => expect(queryByText(/lazy/i)).not.toBeInTheDocument());
97
+ await waitFor(() => expect(queryByText(/loading/i)).not.toBeInTheDocument());
98
98
 
99
99
  userEvent.click(await getByRole("option", { name: /function/i }));
100
100
 
@@ -107,6 +107,14 @@ exports[`<FunctionArgs /> user interaction 1`] = `
107
107
  role="listbox"
108
108
  tabindex="0"
109
109
  >
110
+ <div
111
+ aria-atomic="true"
112
+ aria-live="polite"
113
+ class="divider text"
114
+ role="alert"
115
+ >
116
+ true
117
+ </div>
110
118
  <i
111
119
  aria-hidden="true"
112
120
  class="dropdown icon"
@@ -115,9 +123,9 @@ exports[`<FunctionArgs /> user interaction 1`] = `
115
123
  class="menu transition"
116
124
  >
117
125
  <div
118
- aria-checked="false"
126
+ aria-checked="true"
119
127
  aria-selected="true"
120
- class="selected item"
128
+ class="active selected item"
121
129
  role="option"
122
130
  style="pointer-events: all;"
123
131
  >
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { waitFor } from "@testing-library/react";
2
3
  import { act } from "react-dom/test-utils";
3
4
  import { render } from "@truedat/test/render";
4
5
  import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
@@ -42,18 +43,20 @@ const renderOpts = {
42
43
  "structures.loading.header": "loading",
43
44
  },
44
45
  },
45
- fallback: "lazy",
46
+ fallback: "loading",
46
47
  };
47
48
 
48
49
  describe("<DataStructureSelector />", () => {
49
50
  it("matches the latest snapshot", async () => {
50
- const { container, findByText } = render(
51
+ const { container } = render(
51
52
  <TestFormWrapper>
52
53
  <DataStructureSelector />
53
54
  </TestFormWrapper>,
54
55
  renderOpts
55
56
  );
56
- await findByText(/header/);
57
+ await waitFor(() =>
58
+ expect(container.querySelector(".loader")).not.toBeInTheDocument()
59
+ );
57
60
 
58
61
  await act(async () => {
59
62
  expect(container).toMatchSnapshot();