@truedat/qx 7.5.9 → 7.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +45 -64
- package/src/components/QxRoutes.js +38 -19
- package/src/components/__tests__/QxRoutes.spec.js +73 -0
- package/src/components/__tests__/__snapshots__/QxRoutes.spec.js.snap +60 -0
- package/src/components/common/ClauseViewer.js +6 -6
- package/src/components/common/DescriptionInput.js +0 -1
- package/src/components/common/ResourceSelector.js +2 -3
- package/src/components/common/TestFormWrapper.js +2 -13
- package/src/components/common/TypeSelector.js +0 -1
- package/src/components/common/__tests__/DescriptionInput.spec.js +12 -21
- package/src/components/common/__tests__/ResourceSelector.spec.js +42 -87
- package/src/components/common/__tests__/TypeSelector.spec.js +0 -1
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +32 -22
- package/src/components/common/expressions/Clauses.js +5 -6
- package/src/components/common/expressions/Condition.js +8 -9
- package/src/components/common/expressions/ConstantSelector.js +2 -2
- package/src/components/common/expressions/Expression.js +2 -2
- package/src/components/common/expressions/FieldSelector.js +2 -2
- package/src/components/common/expressions/FunctionArgs.js +5 -6
- package/src/components/common/expressions/FunctionSelector.js +2 -2
- package/src/components/common/expressions/ParamSelector.js +2 -2
- package/src/components/common/expressions/ShapeSelector.js +7 -16
- package/src/components/common/expressions/__tests__/Clauses.spec.js +10 -9
- package/src/components/common/expressions/__tests__/Condition.spec.js +6 -26
- package/src/components/common/expressions/__tests__/ConstantSelector.spec.js +14 -30
- package/src/components/common/expressions/__tests__/Expression.spec.js +44 -51
- package/src/components/common/expressions/__tests__/FieldSelector.spec.js +2 -7
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -44
- package/src/components/common/expressions/__tests__/FunctionSelector.spec.js +19 -27
- package/src/components/common/expressions/__tests__/ParamSelector.spec.js +28 -58
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +42 -43
- package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +6 -6
- package/src/components/common/expressions/__tests__/__snapshots__/ConstantSelector.spec.js.snap +6 -7
- package/src/components/common/expressions/__tests__/__snapshots__/Expression.spec.js.snap +20 -20
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +8 -9
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionSelector.spec.js.snap +670 -8
- package/src/components/common/expressions/__tests__/__snapshots__/ParamSelector.spec.js.snap +5 -5
- package/src/components/common/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap +9 -9
- package/src/components/common/expressions/__tests__/useWatchParams.spec.js +1 -4
- package/src/components/common/expressions/constantInputs/AnySelector.js +5 -6
- package/src/components/common/expressions/constantInputs/BooleanSelector.js +2 -2
- package/src/components/common/expressions/constantInputs/DefaultSelector.js +2 -2
- package/src/components/common/expressions/constantInputs/__tests__/AnySelector.spec.js +16 -37
- package/src/components/common/expressions/constantInputs/__tests__/BooleanSelector.spec.js +14 -17
- package/src/components/common/expressions/constantInputs/__tests__/DefaultSelector.spec.js +12 -27
- package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/AnySelector.spec.js.snap +11 -11
- package/src/components/common/expressions/constantInputs/__tests__/__snapshots__/DefaultSelector.spec.js.snap +0 -1
- package/src/components/common/resourceSelectors/DataStructureSelector.js +2 -2
- package/src/components/common/resourceSelectors/DataViewSelector.js +2 -2
- package/src/components/common/resourceSelectors/ReferenceDatasetSelector.js +2 -2
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +5 -29
- package/src/components/common/resourceSelectors/__tests__/DataViewSelector.spec.js +23 -25
- package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +21 -32
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +3 -4
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataViewSelector.spec.js.snap +1 -1
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/ReferenceDatasetSelector.spec.js.snap +1 -1
- package/src/components/dataViews/DataViewEditor.js +5 -6
- package/src/components/dataViews/DataViewSelect.js +4 -5
- package/src/components/dataViews/DataViews.js +1 -2
- package/src/components/dataViews/Queryable.js +4 -4
- package/src/components/dataViews/Queryables.js +0 -1
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +36 -111
- package/src/components/dataViews/__tests__/DataViewSelect.spec.js +0 -1
- package/src/components/dataViews/__tests__/DataViews.spec.js +15 -16
- package/src/components/dataViews/__tests__/Queryable.spec.js +0 -1
- package/src/components/dataViews/__tests__/Queryables.spec.js +35 -74
- package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +61 -55
- package/src/components/dataViews/__tests__/__snapshots__/DataViews.spec.js.snap +5 -5
- package/src/components/dataViews/__tests__/__snapshots__/Queryables.spec.js.snap +59 -59
- package/src/components/dataViews/queryableProperties/From.js +4 -4
- package/src/components/dataViews/queryableProperties/GroupBy.js +6 -6
- package/src/components/dataViews/queryableProperties/Join.js +6 -6
- package/src/components/dataViews/queryableProperties/JoinTypeIcon.js +8 -9
- package/src/components/dataViews/queryableProperties/Select.js +4 -5
- package/src/components/dataViews/queryableProperties/SelectField.js +4 -4
- package/src/components/dataViews/queryableProperties/Where.js +4 -4
- package/src/components/dataViews/queryableProperties/__tests__/From.spec.js +0 -1
- package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +16 -42
- package/src/components/dataViews/queryableProperties/__tests__/Join.spec.js +6 -29
- package/src/components/dataViews/queryableProperties/__tests__/JoinTypeIcon.spec.js +0 -1
- package/src/components/dataViews/queryableProperties/__tests__/Select.spec.js +26 -50
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +22 -42
- package/src/components/dataViews/queryableProperties/__tests__/Where.spec.js +6 -17
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/GroupBy.spec.js.snap +309 -9
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Join.spec.js.snap +12 -12
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Select.spec.js.snap +192 -18
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/SelectField.spec.js.snap +6 -8
- package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/Where.spec.js.snap +2 -2
- package/src/components/functions/FunctionEditor.js +3 -5
- package/src/components/functions/FunctionParams.js +2 -3
- package/src/components/functions/Functions.js +3 -4
- package/src/components/functions/__tests__/FunctionEditor.spec.js +61 -57
- package/src/components/functions/__tests__/FunctionParams.spec.js +50 -47
- package/src/components/functions/__tests__/Functions.spec.js +5 -12
- package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +11 -11
- package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -5
- package/src/components/qualityControls/ControlProperties.js +4 -4
- package/src/components/qualityControls/ControlPropertiesView.js +0 -1
- package/src/components/qualityControls/EditQualityControl.js +5 -5
- package/src/components/qualityControls/IconPopup.js +0 -1
- package/src/components/qualityControls/NewDraftQualityControl.js +8 -6
- package/src/components/qualityControls/NewQualityControl.js +5 -6
- package/src/components/qualityControls/QualityBadge.js +29 -30
- package/src/components/qualityControls/QualityControl.js +4 -7
- package/src/components/qualityControls/QualityControlActions.js +7 -7
- package/src/components/qualityControls/QualityControlCrumbs.js +1 -3
- package/src/components/qualityControls/QualityControlEditor.js +5 -11
- package/src/components/qualityControls/QualityControlHeader.js +4 -6
- package/src/components/qualityControls/QualityControlHistory.js +3 -3
- package/src/components/qualityControls/QualityControlManageDomain.js +2 -2
- package/src/components/qualityControls/QualityControlQueryModal.js +1 -1
- package/src/components/qualityControls/QualityControlRoutes.js +27 -54
- package/src/components/qualityControls/QualityControlRow.js +0 -2
- package/src/components/qualityControls/QualityControlScores.js +7 -5
- package/src/components/qualityControls/QualityControlTabs.js +2 -2
- package/src/components/qualityControls/QualityControls.js +10 -8
- package/src/components/qualityControls/QualityControlsLabelResults.js +0 -2
- package/src/components/qualityControls/QualityControlsPagination.js +0 -1
- package/src/components/qualityControls/QualityControlsTable.js +1 -2
- package/src/components/qualityControls/ScoreCriteria.js +4 -4
- package/src/components/qualityControls/ScoreCriteriaView.js +0 -1
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +10 -15
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +0 -1
- package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +28 -70
- package/src/components/qualityControls/__tests__/IconPopup.spec.js +10 -11
- package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +33 -70
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +81 -113
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +50 -58
- package/src/components/qualityControls/__tests__/QualityControl.spec.js +19 -31
- package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +49 -46
- package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +68 -107
- package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +22 -25
- package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +6 -6
- package/src/components/qualityControls/__tests__/QualityControlManageDomain.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +12 -11
- package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +4 -8
- package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +23 -19
- package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +2 -3
- package/src/components/qualityControls/__tests__/QualityControls.spec.js +69 -53
- package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlsPagination.spec.js +0 -1
- package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +2 -3
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +0 -1
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +0 -1
- package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +1 -1
- package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +32 -34
- package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +31 -33
- package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +17 -19
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +9 -15
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +5 -4
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +1 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +0 -3
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +16 -11
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +2 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +2 -1
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +3 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +3 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +11 -21
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +2 -0
- package/src/components/qualityControls/controlProperties/Count.js +5 -5
- package/src/components/qualityControls/controlProperties/Ratio.js +6 -8
- package/src/components/qualityControls/controlProperties/__tests__/Count.spec.js +6 -11
- package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +9 -27
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +10 -10
- package/src/components/qualityControls/qualityByControlMode.js +14 -14
- package/src/components/qualityControls/qualityControlScoresColumns.js +1 -2
- package/src/components/qualityControls/scoreCriterias/Deviation.js +2 -2
- package/src/components/qualityControls/scoreCriterias/ErrorCount.js +3 -4
- package/src/components/qualityControls/scoreCriterias/Percentage.js +2 -2
- package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +0 -1
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +39 -43
- package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +23 -19
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +4 -7
- package/src/components/scores/MyScoreGroups.js +0 -1
- package/src/components/scores/QualityBar.js +24 -22
- package/src/components/scores/Score.js +4 -5
- package/src/components/scores/ScoreCrumbs.js +3 -5
- package/src/components/scores/ScoreDetails.js +2 -2
- package/src/components/scores/ScoreEvents.js +2 -2
- package/src/components/scores/ScoreGroup.js +5 -4
- package/src/components/scores/ScoreGroupBreadcrumbs.js +1 -2
- package/src/components/scores/ScoreGroupForm.js +2 -4
- package/src/components/scores/ScoreGroupLink.js +1 -2
- package/src/components/scores/ScoreGroupMessage.js +0 -1
- package/src/components/scores/ScoreGroupPopup.js +1 -1
- package/src/components/scores/ScoreGroupsRoutes.js +19 -0
- package/src/components/scores/ScoreGroupsTable.js +15 -48
- package/src/components/scores/ScoreRoutes.js +9 -24
- package/src/components/scores/ScoreStatusDecorator.js +1 -2
- package/src/components/scores/ScoreTabs.js +2 -2
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +0 -1
- package/src/components/scores/__tests__/QualityBar.spec.js +19 -26
- package/src/components/scores/__tests__/Score.spec.js +2 -3
- package/src/components/scores/__tests__/ScoreCrumbs.spec.js +4 -5
- package/src/components/scores/__tests__/ScoreDetails.spec.js +4 -5
- package/src/components/scores/__tests__/ScoreEvents.spec.js +2 -3
- package/src/components/scores/__tests__/ScoreGroup.spec.js +15 -14
- package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupForm.spec.js +18 -34
- package/src/components/scores/__tests__/ScoreGroupLink.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +0 -2
- package/src/components/scores/__tests__/ScoreGroupsRoutes.spec.js +32 -0
- package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +0 -1
- package/src/components/scores/__tests__/ScoreTabs.spec.js +3 -4
- package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +4 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +39 -10
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +10 -10
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +1 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsRoutes.spec.js.snap +19 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +2 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +5 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +4 -0
- package/src/hooks/__tests__/useDataViews.spec.js +1 -1
- package/src/hooks/__tests__/useFunctions.spec.js +5 -5
- package/src/hooks/useDataViews.js +2 -2
- package/src/hooks/useExecutionGroups.js +1 -1
- package/src/hooks/useFunctions.js +4 -4
- package/src/hooks/useQualityControls.js +13 -7
- package/src/hooks/useScoreGroups.js +1 -1
- package/src/hooks/useScores.js +2 -2
- package/src/styles/scores.less +21 -21
- package/src/types.js +1 -4
package/src/components/common/expressions/__tests__/__snapshots__/ParamSelector.spec.js.snap
CHANGED
|
@@ -13,13 +13,13 @@ exports[`<ParamSelector /> deleting param will clean field 1`] = `
|
|
|
13
13
|
<button
|
|
14
14
|
class="ui button"
|
|
15
15
|
>
|
|
16
|
-
add_param
|
|
16
|
+
functions.form.add_param
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
<div
|
|
21
21
|
aria-expanded="false"
|
|
22
|
-
class="ui
|
|
22
|
+
class="ui fluid selection dropdown"
|
|
23
23
|
role="listbox"
|
|
24
24
|
tabindex="0"
|
|
25
25
|
>
|
|
@@ -56,8 +56,8 @@ exports[`<ParamSelector /> matches the latest snapshot 1`] = `
|
|
|
56
56
|
exports[`<ParamSelector /> user interaction 1`] = `
|
|
57
57
|
<div>
|
|
58
58
|
<div
|
|
59
|
-
aria-expanded="
|
|
60
|
-
class="ui
|
|
59
|
+
aria-expanded="false"
|
|
60
|
+
class="ui fluid selection dropdown"
|
|
61
61
|
role="listbox"
|
|
62
62
|
tabindex="0"
|
|
63
63
|
>
|
|
@@ -74,7 +74,7 @@ exports[`<ParamSelector /> user interaction 1`] = `
|
|
|
74
74
|
class="dropdown icon"
|
|
75
75
|
/>
|
|
76
76
|
<div
|
|
77
|
-
class="
|
|
77
|
+
class="menu transition"
|
|
78
78
|
>
|
|
79
79
|
<div
|
|
80
80
|
aria-checked="true"
|
package/src/components/common/expressions/__tests__/__snapshots__/ShapeSelector.spec.js.snap
CHANGED
|
@@ -33,7 +33,7 @@ exports[`<ShapeSelector /> matches the latest snapshot 1`] = `
|
|
|
33
33
|
</code>
|
|
34
34
|
</b>
|
|
35
35
|
</small>
|
|
36
|
-
constant
|
|
36
|
+
functions.expression.shape.constant
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
<div
|
|
@@ -55,7 +55,7 @@ exports[`<ShapeSelector /> matches the latest snapshot 1`] = `
|
|
|
55
55
|
</code>
|
|
56
56
|
</b>
|
|
57
57
|
</small>
|
|
58
|
-
function
|
|
58
|
+
functions.expression.shape.function
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
@@ -98,7 +98,7 @@ exports[`<ShapeSelector /> user interaction select constant 1`] = `
|
|
|
98
98
|
</code>
|
|
99
99
|
</b>
|
|
100
100
|
</small>
|
|
101
|
-
constant
|
|
101
|
+
functions.expression.shape.constant
|
|
102
102
|
</div>
|
|
103
103
|
</div>
|
|
104
104
|
<div
|
|
@@ -120,7 +120,7 @@ exports[`<ShapeSelector /> user interaction select constant 1`] = `
|
|
|
120
120
|
</code>
|
|
121
121
|
</b>
|
|
122
122
|
</small>
|
|
123
|
-
function
|
|
123
|
+
functions.expression.shape.function
|
|
124
124
|
</div>
|
|
125
125
|
</div>
|
|
126
126
|
</div>
|
|
@@ -163,7 +163,7 @@ exports[`<ShapeSelector /> user interaction select function 1`] = `
|
|
|
163
163
|
</code>
|
|
164
164
|
</b>
|
|
165
165
|
</small>
|
|
166
|
-
constant
|
|
166
|
+
functions.expression.shape.constant
|
|
167
167
|
</div>
|
|
168
168
|
</div>
|
|
169
169
|
<div
|
|
@@ -185,7 +185,7 @@ exports[`<ShapeSelector /> user interaction select function 1`] = `
|
|
|
185
185
|
</code>
|
|
186
186
|
</b>
|
|
187
187
|
</small>
|
|
188
|
-
function
|
|
188
|
+
functions.expression.shape.function
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
191
191
|
</div>
|
|
@@ -228,7 +228,7 @@ exports[`<ShapeSelector /> user interaction select param 1`] = `
|
|
|
228
228
|
</code>
|
|
229
229
|
</b>
|
|
230
230
|
</small>
|
|
231
|
-
constant
|
|
231
|
+
functions.expression.shape.constant
|
|
232
232
|
</div>
|
|
233
233
|
</div>
|
|
234
234
|
<div
|
|
@@ -250,7 +250,7 @@ exports[`<ShapeSelector /> user interaction select param 1`] = `
|
|
|
250
250
|
</code>
|
|
251
251
|
</b>
|
|
252
252
|
</small>
|
|
253
|
-
function
|
|
253
|
+
functions.expression.shape.function
|
|
254
254
|
</div>
|
|
255
255
|
</div>
|
|
256
256
|
<div
|
|
@@ -272,7 +272,7 @@ exports[`<ShapeSelector /> user interaction select param 1`] = `
|
|
|
272
272
|
</code>
|
|
273
273
|
</b>
|
|
274
274
|
</small>
|
|
275
|
-
param
|
|
275
|
+
functions.expression.shape.param
|
|
276
276
|
</div>
|
|
277
277
|
</div>
|
|
278
278
|
</div>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { render } from "@truedat/test/render";
|
|
3
2
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
4
3
|
import useWatchParams from "../useWatchParams";
|
|
@@ -15,9 +14,7 @@ describe("useWatchParams", () => {
|
|
|
15
14
|
return null;
|
|
16
15
|
};
|
|
17
16
|
render(
|
|
18
|
-
<TestFormWrapper defaultValues={defaultValues}>
|
|
19
|
-
<ParamHook />
|
|
20
|
-
</TestFormWrapper>
|
|
17
|
+
<TestFormWrapper defaultValues={defaultValues}><ParamHook /></TestFormWrapper>
|
|
21
18
|
);
|
|
22
19
|
});
|
|
23
20
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { lazy, use } from "react";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { useFormContext, Controller } from "react-hook-form";
|
|
4
4
|
import { TypeSelector } from "@truedat/qx/components/common";
|
|
5
5
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
6
|
-
const ConstantSelector =
|
|
6
|
+
const ConstantSelector = lazy(() => import("../ConstantSelector"));
|
|
7
7
|
|
|
8
8
|
export default function AnySelector() {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
|
-
const context =
|
|
10
|
+
const context = use(QxContext);
|
|
11
11
|
const { field } = context;
|
|
12
12
|
const { watch, control, setValue } = useFormContext();
|
|
13
13
|
const type = watch(`${field}.value.type`);
|
|
@@ -33,11 +33,10 @@ export default function AnySelector() {
|
|
|
33
33
|
/>
|
|
34
34
|
)}
|
|
35
35
|
/>
|
|
36
|
-
|
|
37
36
|
{type ? (
|
|
38
|
-
<QxContext
|
|
37
|
+
<QxContext value={{ ...context, type }}>
|
|
39
38
|
<ConstantSelector />
|
|
40
|
-
</QxContext
|
|
39
|
+
</QxContext>
|
|
41
40
|
) : null}
|
|
42
41
|
</>
|
|
43
42
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { use } from "react";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { Controller, useFormContext } from "react-hook-form";
|
|
4
4
|
import { Dropdown } from "semantic-ui-react";
|
|
@@ -6,7 +6,7 @@ import QxContext from "@truedat/qx/components/QxContext";
|
|
|
6
6
|
|
|
7
7
|
export default function BooleanSelector() {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
|
-
const { field } =
|
|
9
|
+
const { field } = use(QxContext);
|
|
10
10
|
const { control } = useFormContext();
|
|
11
11
|
|
|
12
12
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { use } from "react";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { Form } from "semantic-ui-react";
|
|
4
4
|
import { Controller, useFormContext } from "react-hook-form";
|
|
@@ -6,7 +6,7 @@ import QxContext from "@truedat/qx/components/QxContext";
|
|
|
6
6
|
|
|
7
7
|
export default function DefaultSelector() {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
|
-
const { field } =
|
|
9
|
+
const { field } = use(QxContext);
|
|
10
10
|
const { control } = useFormContext();
|
|
11
11
|
|
|
12
12
|
return (
|
|
@@ -1,49 +1,28 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
4
|
import AnySelector from "../AnySelector";
|
|
6
5
|
|
|
7
|
-
const renderOpts = {
|
|
8
|
-
messages: {
|
|
9
|
-
en: {
|
|
10
|
-
"functions.expression.constant.false": "false",
|
|
11
|
-
"functions.expression.constant.true": "true",
|
|
12
|
-
"functions.form.required": "required",
|
|
13
|
-
"expressions.data_type.timestamp": "timestamp",
|
|
14
|
-
"expressions.data_type.date": "date",
|
|
15
|
-
"expressions.data_type.number": "number",
|
|
16
|
-
"expressions.data_type.string": "string",
|
|
17
|
-
"expressions.data_type.boolean": "boolean",
|
|
18
|
-
"expressions.data_type.any": "any",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
fallback: "lazy",
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const watcher = jest.fn();
|
|
25
|
-
|
|
26
6
|
describe("<AnySelector />", () => {
|
|
27
|
-
it("matches the latest snapshot", () => {
|
|
28
|
-
const
|
|
29
|
-
<TestFormWrapper>
|
|
30
|
-
<AnySelector />
|
|
31
|
-
</TestFormWrapper>,
|
|
32
|
-
renderOpts
|
|
7
|
+
it("matches the latest snapshot", async () => {
|
|
8
|
+
const rendered = render(
|
|
9
|
+
<TestFormWrapper><AnySelector /></TestFormWrapper>
|
|
33
10
|
);
|
|
34
|
-
|
|
11
|
+
await waitForLoad(rendered);
|
|
12
|
+
expect(rendered.container).toMatchSnapshot();
|
|
35
13
|
});
|
|
36
14
|
|
|
37
15
|
it("user interaction", async () => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
const user = userEvent.setup({ delay: null });
|
|
17
|
+
const watcher = jest.fn();
|
|
18
|
+
|
|
19
|
+
const rendered = render(
|
|
20
|
+
<TestFormWrapper watcher={watcher}><AnySelector /></TestFormWrapper>
|
|
43
21
|
);
|
|
22
|
+
await waitForLoad(rendered);
|
|
44
23
|
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
await user.click(await rendered.findByText(/boolean/i));
|
|
25
|
+
await user.click(await rendered.findByText(/true/i));
|
|
47
26
|
|
|
48
27
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
49
28
|
test: {
|
|
@@ -54,7 +33,7 @@ describe("<AnySelector />", () => {
|
|
|
54
33
|
},
|
|
55
34
|
});
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
await user.click(await rendered.findByText(/string/i));
|
|
58
37
|
|
|
59
38
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
60
39
|
test: {
|
|
@@ -65,6 +44,6 @@ describe("<AnySelector />", () => {
|
|
|
65
44
|
},
|
|
66
45
|
});
|
|
67
46
|
|
|
68
|
-
expect(container).toMatchSnapshot();
|
|
47
|
+
expect(rendered.container).toMatchSnapshot();
|
|
69
48
|
});
|
|
70
49
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
5
4
|
import BooleanSelector from "../BooleanSelector";
|
|
6
5
|
|
|
@@ -13,30 +12,28 @@ describe("<BooleanSelector />", () => {
|
|
|
13
12
|
"functions.form.required": "required",
|
|
14
13
|
},
|
|
15
14
|
},
|
|
16
|
-
fallback: "lazy",
|
|
17
15
|
};
|
|
18
16
|
|
|
19
|
-
it("matches the latest snapshot", () => {
|
|
20
|
-
const
|
|
21
|
-
<TestFormWrapper
|
|
22
|
-
<BooleanSelector />
|
|
23
|
-
</TestFormWrapper>,
|
|
17
|
+
it("matches the latest snapshot", async () => {
|
|
18
|
+
const rendered = render(
|
|
19
|
+
<TestFormWrapper><BooleanSelector /></TestFormWrapper>,
|
|
24
20
|
renderOpts
|
|
25
21
|
);
|
|
26
|
-
|
|
22
|
+
await waitForLoad(rendered);
|
|
23
|
+
expect(rendered.container).toMatchSnapshot();
|
|
27
24
|
});
|
|
28
25
|
|
|
29
|
-
it("user interaction", () => {
|
|
26
|
+
it("user interaction", async () => {
|
|
27
|
+
const user = userEvent.setup({ delay: null });
|
|
30
28
|
const watcher = jest.fn();
|
|
31
|
-
const
|
|
32
|
-
<TestFormWrapper watcher={watcher}
|
|
33
|
-
<BooleanSelector />
|
|
34
|
-
</TestFormWrapper>,
|
|
29
|
+
const rendered = render(
|
|
30
|
+
<TestFormWrapper watcher={watcher}><BooleanSelector /></TestFormWrapper>,
|
|
35
31
|
renderOpts
|
|
36
32
|
);
|
|
33
|
+
await waitForLoad(rendered);
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
await user.click(rendered.getByRole("listbox"));
|
|
36
|
+
await user.click(rendered.getByRole("option", { name: /true/i }));
|
|
40
37
|
|
|
41
38
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
42
39
|
test: {
|
|
@@ -46,6 +43,6 @@ describe("<BooleanSelector />", () => {
|
|
|
46
43
|
},
|
|
47
44
|
});
|
|
48
45
|
|
|
49
|
-
expect(container).toMatchSnapshot();
|
|
46
|
+
expect(rendered.container).toMatchSnapshot();
|
|
50
47
|
});
|
|
51
48
|
});
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
3
|
-
import { act } from "react-dom/test-utils";
|
|
4
1
|
import userEvent from "@testing-library/user-event";
|
|
2
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
3
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
4
|
import DefaultSelector from "../DefaultSelector";
|
|
7
5
|
|
|
8
6
|
describe("<DefaultSelector />", () => {
|
|
9
|
-
const renderOpts = {
|
|
10
|
-
messages: {
|
|
11
|
-
en: {
|
|
12
|
-
"functions.form.required": "required",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
fallback: "lazy",
|
|
16
|
-
};
|
|
17
7
|
|
|
18
|
-
it("matches the latest snapshot", () => {
|
|
19
|
-
const
|
|
20
|
-
<TestFormWrapper>
|
|
21
|
-
<DefaultSelector />
|
|
22
|
-
</TestFormWrapper>,
|
|
23
|
-
renderOpts
|
|
8
|
+
it("matches the latest snapshot", async () => {
|
|
9
|
+
const rendered = render(
|
|
10
|
+
<TestFormWrapper><DefaultSelector /></TestFormWrapper>
|
|
24
11
|
);
|
|
25
|
-
|
|
12
|
+
await waitForLoad(rendered);
|
|
13
|
+
expect(rendered.container).toMatchSnapshot();
|
|
26
14
|
});
|
|
27
15
|
|
|
28
16
|
it("user interaction", async () => {
|
|
17
|
+
const user = userEvent.setup({ delay: null });
|
|
29
18
|
const watcher = jest.fn();
|
|
30
19
|
const field = "test";
|
|
31
20
|
const defaultValues = {
|
|
32
21
|
[field]: { value: { value: "" } },
|
|
33
22
|
};
|
|
34
|
-
const
|
|
23
|
+
const rendered = render(
|
|
35
24
|
<TestFormWrapper
|
|
36
25
|
watcher={watcher}
|
|
37
26
|
defaultValues={defaultValues}
|
|
38
27
|
context={{ field }}
|
|
39
|
-
>
|
|
40
|
-
<DefaultSelector />
|
|
41
|
-
</TestFormWrapper>,
|
|
42
|
-
renderOpts
|
|
28
|
+
><DefaultSelector /></TestFormWrapper>
|
|
43
29
|
);
|
|
30
|
+
await waitForLoad(rendered);
|
|
44
31
|
|
|
45
|
-
await
|
|
46
|
-
userEvent.type(await findByRole("textbox"), "text");
|
|
47
|
-
});
|
|
32
|
+
await user.type(rendered.getByRole("textbox"), "text");
|
|
48
33
|
|
|
49
34
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
50
35
|
test: {
|
|
@@ -54,6 +39,6 @@ describe("<DefaultSelector />", () => {
|
|
|
54
39
|
},
|
|
55
40
|
});
|
|
56
41
|
|
|
57
|
-
expect(container).toMatchSnapshot();
|
|
42
|
+
expect(rendered.container).toMatchSnapshot();
|
|
58
43
|
});
|
|
59
44
|
});
|
|
@@ -30,7 +30,7 @@ exports[`<AnySelector /> matches the latest snapshot 1`] = `
|
|
|
30
30
|
<span
|
|
31
31
|
class="text"
|
|
32
32
|
>
|
|
33
|
-
boolean
|
|
33
|
+
expressions.data_type.boolean
|
|
34
34
|
</span>
|
|
35
35
|
</div>
|
|
36
36
|
<div
|
|
@@ -47,7 +47,7 @@ exports[`<AnySelector /> matches the latest snapshot 1`] = `
|
|
|
47
47
|
<span
|
|
48
48
|
class="text"
|
|
49
49
|
>
|
|
50
|
-
string
|
|
50
|
+
expressions.data_type.string
|
|
51
51
|
</span>
|
|
52
52
|
</div>
|
|
53
53
|
<div
|
|
@@ -64,7 +64,7 @@ exports[`<AnySelector /> matches the latest snapshot 1`] = `
|
|
|
64
64
|
<span
|
|
65
65
|
class="text"
|
|
66
66
|
>
|
|
67
|
-
number
|
|
67
|
+
expressions.data_type.number
|
|
68
68
|
</span>
|
|
69
69
|
</div>
|
|
70
70
|
<div
|
|
@@ -81,7 +81,7 @@ exports[`<AnySelector /> matches the latest snapshot 1`] = `
|
|
|
81
81
|
<span
|
|
82
82
|
class="text"
|
|
83
83
|
>
|
|
84
|
-
date
|
|
84
|
+
expressions.data_type.date
|
|
85
85
|
</span>
|
|
86
86
|
</div>
|
|
87
87
|
<div
|
|
@@ -98,7 +98,7 @@ exports[`<AnySelector /> matches the latest snapshot 1`] = `
|
|
|
98
98
|
<span
|
|
99
99
|
class="text"
|
|
100
100
|
>
|
|
101
|
-
timestamp
|
|
101
|
+
expressions.data_type.timestamp
|
|
102
102
|
</span>
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
@@ -122,7 +122,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
122
122
|
class="divider text"
|
|
123
123
|
role="alert"
|
|
124
124
|
>
|
|
125
|
-
string
|
|
125
|
+
expressions.data_type.string
|
|
126
126
|
</div>
|
|
127
127
|
<i
|
|
128
128
|
aria-hidden="true"
|
|
@@ -145,7 +145,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
145
145
|
<span
|
|
146
146
|
class="text"
|
|
147
147
|
>
|
|
148
|
-
boolean
|
|
148
|
+
expressions.data_type.boolean
|
|
149
149
|
</span>
|
|
150
150
|
</div>
|
|
151
151
|
<div
|
|
@@ -162,7 +162,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
162
162
|
<span
|
|
163
163
|
class="text"
|
|
164
164
|
>
|
|
165
|
-
string
|
|
165
|
+
expressions.data_type.string
|
|
166
166
|
</span>
|
|
167
167
|
</div>
|
|
168
168
|
<div
|
|
@@ -179,7 +179,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
179
179
|
<span
|
|
180
180
|
class="text"
|
|
181
181
|
>
|
|
182
|
-
number
|
|
182
|
+
expressions.data_type.number
|
|
183
183
|
</span>
|
|
184
184
|
</div>
|
|
185
185
|
<div
|
|
@@ -196,7 +196,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
196
196
|
<span
|
|
197
197
|
class="text"
|
|
198
198
|
>
|
|
199
|
-
date
|
|
199
|
+
expressions.data_type.date
|
|
200
200
|
</span>
|
|
201
201
|
</div>
|
|
202
202
|
<div
|
|
@@ -213,7 +213,7 @@ exports[`<AnySelector /> user interaction 1`] = `
|
|
|
213
213
|
<span
|
|
214
214
|
class="text"
|
|
215
215
|
>
|
|
216
|
-
timestamp
|
|
216
|
+
expressions.data_type.timestamp
|
|
217
217
|
</span>
|
|
218
218
|
</div>
|
|
219
219
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use, useState } from "react";
|
|
3
3
|
import { useFormContext } from "react-hook-form";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { Icon, Form } from "semantic-ui-react";
|
|
@@ -8,7 +8,7 @@ import StructureSelector from "@truedat/dd/components/StructureSelector";
|
|
|
8
8
|
|
|
9
9
|
export default function DataStructureSelector({ onChange }) {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
-
const { field, sourceId } =
|
|
11
|
+
const { field, sourceId } = use(QxContext);
|
|
12
12
|
const { watch } = useFormContext();
|
|
13
13
|
const selectedStructure = watch(`${field}.embedded`);
|
|
14
14
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use, useState } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { Dropdown } from "semantic-ui-react";
|
|
5
5
|
import { matchSorter } from "match-sorter";
|
|
@@ -8,7 +8,7 @@ import QxContext from "@truedat/qx/components/QxContext";
|
|
|
8
8
|
export default function DataViewSelector({ onChange, onBlur, value }) {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
10
|
const [searchTerm, setSearchTerm] = useState("");
|
|
11
|
-
const { dataViews, sourceId, currentDataViewId } =
|
|
11
|
+
const { dataViews, sourceId, currentDataViewId } = use(QxContext);
|
|
12
12
|
|
|
13
13
|
const matchSorterFp = (items) =>
|
|
14
14
|
matchSorter(items, searchTerm, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use, useState } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
4
|
import { Dropdown } from "semantic-ui-react";
|
|
5
5
|
import { matchSorter } from "match-sorter";
|
|
@@ -8,7 +8,7 @@ import QxContext from "@truedat/qx/components/QxContext";
|
|
|
8
8
|
export default function ReferenceDatasetSelector({ onChange, onBlur, value }) {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
10
|
const [searchTerm, setSearchTerm] = useState("");
|
|
11
|
-
const { referenceDatasets } =
|
|
11
|
+
const { referenceDatasets } = use(QxContext);
|
|
12
12
|
|
|
13
13
|
const matchSorterFp = (items) =>
|
|
14
14
|
matchSorter(items, searchTerm, {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { waitFor } from "@testing-library/react";
|
|
3
|
-
import { act } from "react-dom/test-utils";
|
|
4
|
-
import { render } from "@truedat/test/render";
|
|
1
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
2
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
3
|
import DataStructureSelector from "../DataStructureSelector";
|
|
7
4
|
|
|
@@ -31,35 +28,14 @@ jest.mock("@truedat/dd/hooks/useStructures", () => {
|
|
|
31
28
|
};
|
|
32
29
|
});
|
|
33
30
|
|
|
34
|
-
const renderOpts = {
|
|
35
|
-
messages: {
|
|
36
|
-
en: {
|
|
37
|
-
"queryables.resource.selector.data_structure": "data_structure",
|
|
38
|
-
"search.placeholder": "search placeholder",
|
|
39
|
-
"structures.not_found.body": "body",
|
|
40
|
-
"structures.loading.header": "loading",
|
|
41
|
-
"structures.search.placeholder": "placeholder",
|
|
42
|
-
"structures.not_found.header": "header",
|
|
43
|
-
"structures.loading.header": "loading",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
fallback: "loading",
|
|
47
|
-
};
|
|
48
|
-
|
|
49
31
|
describe("<DataStructureSelector />", () => {
|
|
50
32
|
it("matches the latest snapshot", async () => {
|
|
51
|
-
const
|
|
33
|
+
const rendered = render(
|
|
52
34
|
<TestFormWrapper>
|
|
53
35
|
<DataStructureSelector />
|
|
54
|
-
</TestFormWrapper
|
|
55
|
-
renderOpts
|
|
56
|
-
);
|
|
57
|
-
await waitFor(() =>
|
|
58
|
-
expect(container.querySelector(".loader")).not.toBeInTheDocument()
|
|
36
|
+
</TestFormWrapper>
|
|
59
37
|
);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
expect(container).toMatchSnapshot();
|
|
63
|
-
});
|
|
38
|
+
await waitForLoad(rendered);
|
|
39
|
+
expect(rendered.container).toMatchSnapshot();
|
|
64
40
|
});
|
|
65
41
|
});
|