@truedat/qx 8.7.0 → 8.7.2
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 +3 -3
- package/src/components/__tests__/QxRoutes.spec.js +1 -1
- package/src/components/common/ClauseViewer.js +1 -1
- package/src/components/common/ResourceSelector.js +1 -1
- package/src/components/common/TypeSelector.js +7 -3
- package/src/components/common/__tests__/ResourceSelector.spec.js +6 -6
- package/src/components/common/expressions/FieldSelector.js +2 -2
- package/src/components/common/expressions/FunctionSelector.js +3 -3
- package/src/components/common/expressions/ParamSelector.js +1 -1
- package/src/components/common/expressions/ShapeSelector.js +4 -5
- package/src/components/common/expressions/__tests__/Clauses.spec.js +11 -11
- package/src/components/common/expressions/__tests__/Condition.spec.js +15 -13
- package/src/components/common/expressions/__tests__/ConstantSelector.spec.js +2 -2
- package/src/components/common/expressions/__tests__/Expression.spec.js +5 -5
- package/src/components/common/expressions/__tests__/FieldSelector.spec.js +6 -2
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +3 -3
- package/src/components/common/expressions/__tests__/FunctionSelector.spec.js +3 -3
- package/src/components/common/expressions/__tests__/ParamSelector.spec.js +3 -3
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +7 -7
- package/src/components/common/expressions/__tests__/useWatchParams.spec.js +3 -1
- package/src/components/common/expressions/constantInputs/AnySelector.js +0 -1
- package/src/components/common/expressions/constantInputs/BooleanSelector.js +5 -1
- package/src/components/common/expressions/constantInputs/__tests__/AnySelector.spec.js +6 -2
- package/src/components/common/expressions/constantInputs/__tests__/BooleanSelector.spec.js +8 -4
- package/src/components/common/expressions/constantInputs/__tests__/DefaultSelector.spec.js +6 -3
- package/src/components/common/resourceSelectors/DataStructureSelector.js +5 -1
- package/src/components/common/resourceSelectors/DataViewSelector.js +3 -3
- package/src/components/common/resourceSelectors/ReferenceDatasetSelector.js +7 -2
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +1 -1
- package/src/components/common/resourceSelectors/__tests__/DataViewSelector.spec.js +7 -7
- package/src/components/common/resourceSelectors/__tests__/ReferenceDatasetSelector.spec.js +6 -6
- package/src/components/dataViews/DataViewEditor.js +3 -2
- package/src/components/dataViews/DataViewSummary.js +1 -1
- package/src/components/dataViews/DataViews.js +2 -2
- package/src/components/dataViews/__tests__/AdvancedDataViewEditor.spec.js +3 -3
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +7 -7
- package/src/components/dataViews/__tests__/DataViewSelect.spec.js +1 -1
- package/src/components/dataViews/__tests__/DataViewSummary.spec.js +15 -15
- package/src/components/dataViews/__tests__/DataViews.spec.js +6 -6
- package/src/components/dataViews/__tests__/Queryable.spec.js +6 -6
- package/src/components/dataViews/__tests__/Queryables.spec.js +6 -6
- package/src/components/dataViews/__tests__/SimpleDataViewEditor.spec.js +17 -17
- package/src/components/dataViews/__tests__/queryableFunctions.spec.js +4 -4
- package/src/components/dataViews/advancedForm/AdvancedDataViewEditor.js +3 -3
- package/src/components/dataViews/advancedForm/DataViewSelect.js +1 -1
- package/src/components/dataViews/advancedForm/Queryable.js +3 -3
- package/src/components/dataViews/queryableFunctions.js +35 -35
- package/src/components/dataViews/queryableProperties/Select.js +1 -1
- package/src/components/dataViews/queryableProperties/SelectField.js +5 -5
- package/src/components/dataViews/queryableProperties/__tests__/From.spec.js +1 -1
- package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +19 -19
- package/src/components/dataViews/queryableProperties/__tests__/Join.spec.js +1 -1
- package/src/components/dataViews/queryableProperties/__tests__/JoinTypeIcon.spec.js +1 -1
- package/src/components/dataViews/queryableProperties/__tests__/Select.spec.js +5 -5
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +3 -3
- package/src/components/dataViews/queryableProperties/__tests__/Where.spec.js +1 -1
- package/src/components/dataViews/queryableSummaryHelpers.js +1 -1
- package/src/components/dataViews/simpleForm/AggregationForm.js +2 -2
- package/src/components/dataViews/simpleForm/DatasetForm.js +1 -1
- package/src/components/dataViews/simpleForm/FormQueryable.js +3 -3
- package/src/components/dataViews/simpleForm/InformationForm.js +2 -2
- package/src/components/dataViews/simpleForm/SelectionForm.js +1 -1
- package/src/components/dataViews/simpleForm/SimpleDataViewEditor.js +3 -3
- package/src/components/dataViews/summary/GroupBy.js +1 -1
- package/src/components/dataViews/summary/Join.js +50 -48
- package/src/components/dataViews/summary/Select.js +1 -1
- package/src/components/dataViews/summary/Where.js +6 -1
- package/src/components/functions/FunctionEditor.js +1 -1
- package/src/components/functions/Functions.js +1 -1
- package/src/components/functions/__tests__/FunctionEditor.spec.js +7 -7
- package/src/components/functions/__tests__/FunctionParams.spec.js +4 -4
- package/src/components/qualityControls/ConceptLinkNew.js +2 -2
- package/src/components/qualityControls/ConceptLinks.js +1 -1
- package/src/components/qualityControls/ContentSummary.js +23 -21
- package/src/components/qualityControls/ControlProperties.js +1 -1
- package/src/components/qualityControls/ControlPropertiesView.js +1 -1
- package/src/components/qualityControls/EditQualityControl.js +1 -1
- package/src/components/qualityControls/NewDraftQualityControl.js +1 -1
- package/src/components/qualityControls/QualityControlActions.js +4 -4
- package/src/components/qualityControls/QualityControlEditor.js +11 -20
- package/src/components/qualityControls/QualityControlEvents.js +2 -2
- package/src/components/qualityControls/QualityControlHeader.js +2 -2
- package/src/components/qualityControls/QualityControlRoutes.js +1 -1
- package/src/components/qualityControls/QualityControlScores.js +3 -3
- package/src/components/qualityControls/QualityControlSelector.js +1 -1
- package/src/components/qualityControls/QualityControlSummary.js +17 -15
- package/src/components/qualityControls/QualityControls.js +9 -11
- package/src/components/qualityControls/QualityControlsTable.js +1 -1
- package/src/components/qualityControls/SegmentationForm.js +99 -100
- package/src/components/qualityControls/SegmentationSummary.js +113 -104
- package/src/components/qualityControls/StructureLinkNew.js +2 -2
- package/src/components/qualityControls/StructureLinks.js +1 -1
- package/src/components/qualityControls/__tests__/ConceptLinkNew.spec.js +5 -5
- package/src/components/qualityControls/__tests__/ConceptLinks.spec.js +3 -3
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +6 -2
- package/src/components/qualityControls/__tests__/ControlPropertiesForm.spec.js +6 -6
- package/src/components/qualityControls/__tests__/ControlPropertiesSummary.spec.js +7 -7
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +7 -2
- package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +12 -12
- package/src/components/qualityControls/__tests__/InformationForm.spec.js +29 -11
- package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +23 -21
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +38 -38
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +7 -7
- package/src/components/qualityControls/__tests__/QualityControl.spec.js +7 -7
- package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +16 -16
- package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +1 -1
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +6 -2
- package/src/components/qualityControls/__tests__/QualityControlEvents.spec.js +3 -3
- package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +3 -3
- package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +2 -2
- package/src/components/qualityControls/__tests__/QualityControlManageDomain.spec.js +4 -4
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +2 -2
- package/src/components/qualityControls/__tests__/QualityControlRoutes.spec.js +2 -2
- package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +4 -4
- package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +9 -9
- package/src/components/qualityControls/__tests__/QualityControlSelector.spec.js +21 -17
- package/src/components/qualityControls/__tests__/QualityControls.spec.js +21 -21
- package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +5 -5
- package/src/components/qualityControls/__tests__/QualityControlsPagination.spec.js +1 -1
- package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +1 -1
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +6 -6
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +6 -6
- package/src/components/qualityControls/__tests__/StructureLinkNew.spec.js +9 -9
- package/src/components/qualityControls/__tests__/StructureLinks.spec.js +6 -6
- package/src/components/qualityControls/controlProperties/__tests__/ResourceWithValidation.spec.js +9 -9
- package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +5 -5
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +10 -10
- package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +6 -6
- package/src/components/scores/QualityBar.js +1 -1
- package/src/components/scores/ScoreDetails.js +1 -1
- package/src/components/scores/ScoreGroup.js +2 -2
- package/src/components/scores/ScoreGroupForm.js +1 -1
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +1 -1
- package/src/components/scores/__tests__/QualityBar.spec.js +3 -3
- package/src/components/scores/__tests__/Score.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreContext.spec.js +2 -2
- package/src/components/scores/__tests__/ScoreCrumbs.spec.js +2 -2
- package/src/components/scores/__tests__/ScoreDetails.spec.js +2 -2
- package/src/components/scores/__tests__/ScoreEvents.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroup.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroupForm.spec.js +3 -3
- package/src/components/scores/__tests__/ScoreGroupLink.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +2 -2
- package/src/components/scores/__tests__/ScoreGroupsRoutes.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +2 -2
- package/src/components/scores/__tests__/ScorePagination.spec.js +1 -1
- package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +2 -2
- package/src/components/selectors/__tests__/getMyScoreGroupsColumns.spec.js +5 -5
- package/src/components/selectors/__tests__/getQualityControlScoresColumns.spec.js +3 -3
- package/src/components/selectors/getMyScoreGroupsColumns.js +1 -1
- package/src/components/selectors/getQualityControlScoresColumns.js +1 -1
- package/src/hooks/useDataViews.js +1 -1
- package/src/hooks/useExecutionGroups.js +2 -2
- package/src/hooks/useFunctions.js +1 -1
- package/src/hooks/useQualityControls.js +3 -3
- package/src/hooks/useScoreGroups.js +3 -3
- package/src/hooks/useScores.js +1 -1
- package/src/types.js +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/qx",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.2",
|
|
4
4
|
"description": "Truedat Web Quality Experience package",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@testing-library/jest-dom": "^6.6.3",
|
|
57
57
|
"@testing-library/react": "^16.3.0",
|
|
58
58
|
"@testing-library/user-event": "^14.6.1",
|
|
59
|
-
"@truedat/test": "8.7.
|
|
59
|
+
"@truedat/test": "8.7.2",
|
|
60
60
|
"identity-obj-proxy": "^3.0.0",
|
|
61
61
|
"jest": "^29.7.0",
|
|
62
62
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"semantic-ui-react": "^3.0.0-beta.2",
|
|
90
90
|
"swr": "^2.3.3"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "e971cd8773dc15ad949f260abbfe4d3236473af7"
|
|
93
93
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
-
import QxRoutes from "../QxRoutes";
|
|
4
3
|
import { useAuthorized } from "@truedat/core/hooks/useAuthorized";
|
|
5
4
|
import {
|
|
6
5
|
DATA_VIEWS,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
SCORE_GROUPS,
|
|
11
10
|
SCORES,
|
|
12
11
|
} from "@truedat/core/routes";
|
|
12
|
+
import QxRoutes from "../QxRoutes";
|
|
13
13
|
|
|
14
14
|
jest.mock("@truedat/core/hooks/useAuthorized", () => ({
|
|
15
15
|
useAuthorized: jest.fn(() => true),
|
|
@@ -5,8 +5,8 @@ import { useIntl } from "react-intl";
|
|
|
5
5
|
import { Divider, Label, Segment } from "semantic-ui-react";
|
|
6
6
|
import { useFunctions } from "@truedat/qx/hooks/useFunctions";
|
|
7
7
|
import { isConditionFunction } from "@truedat/qx/components/common/expressions/Condition";
|
|
8
|
-
import { getColorById } from "../dataViews/queryableFunctions";
|
|
9
8
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
9
|
+
import { getColorById } from "../dataViews/queryableFunctions";
|
|
10
10
|
import "@truedat/qx/styles/Expression.less";
|
|
11
11
|
|
|
12
12
|
const isExpressionValid = (expression, functions = []) => {
|
|
@@ -17,7 +17,7 @@ export default function ResourceSelector({ required, labelId }) {
|
|
|
17
17
|
const { control, setValue, watch } = useFormContext();
|
|
18
18
|
|
|
19
19
|
const sourceDataViews = _.filter({ source_id: parseInt(sourceId) })(
|
|
20
|
-
dataViews
|
|
20
|
+
dataViews,
|
|
21
21
|
);
|
|
22
22
|
const resourceTypes = [
|
|
23
23
|
"data_structure",
|
|
@@ -2,7 +2,7 @@ import _ from "lodash/fp";
|
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { Dropdown } from "semantic-ui-react";
|
|
4
4
|
import { typeToIcon, types } from "@truedat/qx/types";
|
|
5
|
-
import { Form, Label } from "semantic-ui-react"
|
|
5
|
+
import { Form, Label } from "semantic-ui-react";
|
|
6
6
|
|
|
7
7
|
export default function TypeSelector({
|
|
8
8
|
value,
|
|
@@ -20,7 +20,7 @@ export default function TypeSelector({
|
|
|
20
20
|
text: formatMessage({ id: `expressions.data_type.${value}` }),
|
|
21
21
|
value,
|
|
22
22
|
icon: typeToIcon(value),
|
|
23
|
-
}))
|
|
23
|
+
})),
|
|
24
24
|
)(types);
|
|
25
25
|
return (
|
|
26
26
|
<Form.Field error={!!error?.message}>
|
|
@@ -33,7 +33,11 @@ export default function TypeSelector({
|
|
|
33
33
|
value={value}
|
|
34
34
|
onChange={onChange}
|
|
35
35
|
/>
|
|
36
|
-
{error?.message &&
|
|
36
|
+
{error?.message && (
|
|
37
|
+
<Label basic prompt pointing>
|
|
38
|
+
{error?.message}
|
|
39
|
+
</Label>
|
|
40
|
+
)}
|
|
37
41
|
</Form.Field>
|
|
38
42
|
);
|
|
39
43
|
}
|
|
@@ -45,7 +45,7 @@ describe("<ResourceSelector />", () => {
|
|
|
45
45
|
<SearchContext value={searchProps}>
|
|
46
46
|
<ResourceSelector />
|
|
47
47
|
</SearchContext>
|
|
48
|
-
</TestFormWrapper
|
|
48
|
+
</TestFormWrapper>,
|
|
49
49
|
);
|
|
50
50
|
await waitForLoad(rendered);
|
|
51
51
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -64,7 +64,7 @@ describe("<ResourceSelector />", () => {
|
|
|
64
64
|
<SearchContext value={searchProps}>
|
|
65
65
|
<ResourceSelector />
|
|
66
66
|
</SearchContext>
|
|
67
|
-
</TestFormWrapper
|
|
67
|
+
</TestFormWrapper>,
|
|
68
68
|
);
|
|
69
69
|
await waitForLoad(rendered);
|
|
70
70
|
|
|
@@ -96,7 +96,7 @@ describe("<ResourceSelector />", () => {
|
|
|
96
96
|
<SearchContext value={searchProps}>
|
|
97
97
|
<ResourceSelector />
|
|
98
98
|
</SearchContext>
|
|
99
|
-
</TestFormWrapper
|
|
99
|
+
</TestFormWrapper>,
|
|
100
100
|
);
|
|
101
101
|
await waitForLoad(rendered);
|
|
102
102
|
|
|
@@ -119,16 +119,16 @@ describe("<ResourceSelector />", () => {
|
|
|
119
119
|
<SearchContext value={searchProps}>
|
|
120
120
|
<ResourceSelector />
|
|
121
121
|
</SearchContext>
|
|
122
|
-
</TestFormWrapper
|
|
122
|
+
</TestFormWrapper>,
|
|
123
123
|
);
|
|
124
124
|
await waitForLoad(rendered);
|
|
125
125
|
|
|
126
126
|
const user = userEvent.setup({ delay: null });
|
|
127
127
|
await user.click(
|
|
128
|
-
rendered.getByRole("option", { name: /reference_dataset/i })
|
|
128
|
+
rendered.getByRole("option", { name: /reference_dataset/i }),
|
|
129
129
|
);
|
|
130
130
|
await user.click(
|
|
131
|
-
rendered.getByRole("option", { name: /userreferenceDataset/i })
|
|
131
|
+
rendered.getByRole("option", { name: /userreferenceDataset/i }),
|
|
132
132
|
);
|
|
133
133
|
|
|
134
134
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
@@ -4,8 +4,8 @@ import { Controller, useFormContext } from "react-hook-form";
|
|
|
4
4
|
import { Dropdown, Form, Label } from "semantic-ui-react";
|
|
5
5
|
|
|
6
6
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
7
|
-
import { getColorById } from "../../dataViews/queryableFunctions";
|
|
8
7
|
import { useIntl } from "react-intl";
|
|
8
|
+
import { getColorById } from "../../dataViews/queryableFunctions";
|
|
9
9
|
|
|
10
10
|
const fieldToKey = ({ parent_id, id }) => `${parent_id}:${id}`;
|
|
11
11
|
const keyToField = (key) => {
|
|
@@ -31,7 +31,7 @@ export default function FieldSelector() {
|
|
|
31
31
|
const { control, watch, setValue } = useFormContext();
|
|
32
32
|
const fieldOptions = _.flow(
|
|
33
33
|
_.filter((field) => type === "any" || field.type == type),
|
|
34
|
-
fieldsToOptions
|
|
34
|
+
fieldsToOptions,
|
|
35
35
|
)(fields);
|
|
36
36
|
|
|
37
37
|
const selectedField = watch(`${field}.value`);
|
|
@@ -41,7 +41,7 @@ export default function FunctionSelector() {
|
|
|
41
41
|
(func) =>
|
|
42
42
|
validFunctionType(func) &&
|
|
43
43
|
validLogicOperator(func) &&
|
|
44
|
-
validAggregate(func)
|
|
44
|
+
validAggregate(func),
|
|
45
45
|
)(functions);
|
|
46
46
|
|
|
47
47
|
const funcOpts = _.flow(
|
|
@@ -68,7 +68,7 @@ export default function FunctionSelector() {
|
|
|
68
68
|
<Header.Subheader>{description}</Header.Subheader>
|
|
69
69
|
</>
|
|
70
70
|
),
|
|
71
|
-
}))
|
|
71
|
+
})),
|
|
72
72
|
)(funcs);
|
|
73
73
|
|
|
74
74
|
return (
|
|
@@ -105,7 +105,7 @@ export default function FunctionSelector() {
|
|
|
105
105
|
}}
|
|
106
106
|
placeholder={formatMessage(
|
|
107
107
|
{ id: "functions.form.expression.function.placeholder" },
|
|
108
|
-
{ type }
|
|
108
|
+
{ type },
|
|
109
109
|
)}
|
|
110
110
|
search
|
|
111
111
|
fluid
|
|
@@ -23,21 +23,21 @@ export default function ShapeSelector() {
|
|
|
23
23
|
const setTargetValue = (field, value) => {
|
|
24
24
|
const targetValue = value === "function" ? undefined : { isCondition };
|
|
25
25
|
setValue(field, targetValue);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
|
|
28
28
|
const emptyTypeParams = _.flow(
|
|
29
29
|
_.filter((param) => type === "any" || param.type == type),
|
|
30
|
-
_.isEmpty
|
|
30
|
+
_.isEmpty,
|
|
31
31
|
)(params);
|
|
32
32
|
const emptyTypeFields = _.flow(
|
|
33
33
|
_.filter((field) => type === "any" || field.type == type),
|
|
34
|
-
_.isEmpty
|
|
34
|
+
_.isEmpty,
|
|
35
35
|
)(fields);
|
|
36
36
|
|
|
37
37
|
const shapes = _.reject(
|
|
38
38
|
(shape) =>
|
|
39
39
|
(shape === "param" && emptyTypeParams) ||
|
|
40
|
-
(shape === "field" && emptyTypeFields)
|
|
40
|
+
(shape === "field" && emptyTypeFields),
|
|
41
41
|
)(["constant", "function", "param", "field"]);
|
|
42
42
|
|
|
43
43
|
const shape = watch(`${field}.shape`);
|
|
@@ -77,7 +77,6 @@ export default function ShapeSelector() {
|
|
|
77
77
|
onChange={(_e, { value }) => {
|
|
78
78
|
onChange(value);
|
|
79
79
|
setTargetValue(`${field}.value`, value);
|
|
80
|
-
|
|
81
80
|
}}
|
|
82
81
|
trigger={
|
|
83
82
|
<div className="shape-selector-trigger">{shapeToSymbol[shape]}</div>
|
|
@@ -28,7 +28,7 @@ describe("<Clauses />", () => {
|
|
|
28
28
|
<TestFormWrapper>
|
|
29
29
|
<Clauses />
|
|
30
30
|
</TestFormWrapper>,
|
|
31
|
-
renderOpts
|
|
31
|
+
renderOpts,
|
|
32
32
|
);
|
|
33
33
|
await waitForLoad(rendered);
|
|
34
34
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -56,7 +56,7 @@ describe("<Clauses />", () => {
|
|
|
56
56
|
>
|
|
57
57
|
<Clauses />
|
|
58
58
|
</TestFormWrapper>,
|
|
59
|
-
renderOpts
|
|
59
|
+
renderOpts,
|
|
60
60
|
);
|
|
61
61
|
await waitForLoad(rendered);
|
|
62
62
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -79,7 +79,7 @@ describe("<Clauses />", () => {
|
|
|
79
79
|
>
|
|
80
80
|
<Clauses />
|
|
81
81
|
</TestFormWrapper>,
|
|
82
|
-
renderOpts
|
|
82
|
+
renderOpts,
|
|
83
83
|
);
|
|
84
84
|
await waitForLoad(rendered);
|
|
85
85
|
|
|
@@ -88,15 +88,15 @@ describe("<Clauses />", () => {
|
|
|
88
88
|
});
|
|
89
89
|
await waitFor(() => expect(formValuesRef.current.test).toHaveLength(2));
|
|
90
90
|
await waitFor(() =>
|
|
91
|
-
expect(formValuesRef.current.test[1].expressions).toHaveLength(1)
|
|
91
|
+
expect(formValuesRef.current.test[1].expressions).toHaveLength(1),
|
|
92
92
|
);
|
|
93
93
|
await waitFor(() =>
|
|
94
94
|
expect(formValuesRef.current.test[1].expressions[0]).toEqual(
|
|
95
|
-
expect.objectContaining({ shape: "function" })
|
|
96
|
-
)
|
|
95
|
+
expect.objectContaining({ shape: "function" }),
|
|
96
|
+
),
|
|
97
97
|
);
|
|
98
98
|
await waitFor(() =>
|
|
99
|
-
expect(rendered.getAllByLabelText(/delete/i)).toHaveLength(2)
|
|
99
|
+
expect(rendered.getAllByLabelText(/delete/i)).toHaveLength(2),
|
|
100
100
|
);
|
|
101
101
|
|
|
102
102
|
await act(async () => {
|
|
@@ -122,7 +122,7 @@ describe("<Clauses />", () => {
|
|
|
122
122
|
>
|
|
123
123
|
<Clauses />
|
|
124
124
|
</TestFormWrapper>,
|
|
125
|
-
renderOpts
|
|
125
|
+
renderOpts,
|
|
126
126
|
);
|
|
127
127
|
await waitForLoad(rendered);
|
|
128
128
|
|
|
@@ -130,12 +130,12 @@ describe("<Clauses />", () => {
|
|
|
130
130
|
await user.click(rendered.getByText(/addexpression/i));
|
|
131
131
|
});
|
|
132
132
|
await waitFor(() =>
|
|
133
|
-
expect(formValuesRef.current.test[0].expressions).toHaveLength(2)
|
|
133
|
+
expect(formValuesRef.current.test[0].expressions).toHaveLength(2),
|
|
134
134
|
);
|
|
135
135
|
await waitFor(() =>
|
|
136
136
|
expect(formValuesRef.current.test[0].expressions[1]).toEqual(
|
|
137
|
-
expect.objectContaining({ shape: "function" })
|
|
138
|
-
)
|
|
137
|
+
expect.objectContaining({ shape: "function" }),
|
|
138
|
+
),
|
|
139
139
|
);
|
|
140
140
|
});
|
|
141
141
|
});
|
|
@@ -23,7 +23,7 @@ describe("<Condition />", () => {
|
|
|
23
23
|
const rendered = render(
|
|
24
24
|
<TestFormWrapper>
|
|
25
25
|
<Condition />
|
|
26
|
-
</TestFormWrapper
|
|
26
|
+
</TestFormWrapper>,
|
|
27
27
|
);
|
|
28
28
|
await waitForLoad(rendered);
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@ describe("<Condition />", () => {
|
|
|
38
38
|
{ name: "arg1", type: "any" },
|
|
39
39
|
{ name: "arg2", type: "any" },
|
|
40
40
|
],
|
|
41
|
-
})
|
|
41
|
+
}),
|
|
42
42
|
).toBe(true);
|
|
43
43
|
|
|
44
44
|
expect(
|
|
@@ -48,7 +48,7 @@ describe("<Condition />", () => {
|
|
|
48
48
|
{ name: "arg1", type: "any" },
|
|
49
49
|
{ name: "arg2", type: "any" },
|
|
50
50
|
],
|
|
51
|
-
})
|
|
51
|
+
}),
|
|
52
52
|
).toBe(false);
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -82,7 +82,7 @@ describe("<Condition />", () => {
|
|
|
82
82
|
}}
|
|
83
83
|
>
|
|
84
84
|
<Condition onDelete={onDelete} />
|
|
85
|
-
</TestFormWrapper
|
|
85
|
+
</TestFormWrapper>,
|
|
86
86
|
);
|
|
87
87
|
await waitForLoad(rendered);
|
|
88
88
|
|
|
@@ -121,13 +121,15 @@ describe("<Condition />", () => {
|
|
|
121
121
|
>
|
|
122
122
|
<Condition />
|
|
123
123
|
<ValidationTrigger name="test.value.name" />
|
|
124
|
-
</TestFormWrapper
|
|
124
|
+
</TestFormWrapper>,
|
|
125
125
|
);
|
|
126
126
|
await waitForLoad(rendered);
|
|
127
127
|
|
|
128
128
|
await user.click(rendered.getByText(/validate/i));
|
|
129
129
|
await waitFor(() =>
|
|
130
|
-
expect(
|
|
130
|
+
expect(
|
|
131
|
+
rendered.getByText(/functions.form.required/i),
|
|
132
|
+
).toBeInTheDocument(),
|
|
131
133
|
);
|
|
132
134
|
});
|
|
133
135
|
|
|
@@ -165,17 +167,17 @@ describe("<Condition />", () => {
|
|
|
165
167
|
}}
|
|
166
168
|
>
|
|
167
169
|
<Condition />
|
|
168
|
-
</TestFormWrapper
|
|
170
|
+
</TestFormWrapper>,
|
|
169
171
|
);
|
|
170
172
|
await waitForLoad(rendered);
|
|
171
173
|
|
|
172
174
|
await user.click(rendered.getAllByRole("listbox")[1]);
|
|
173
175
|
await user.click(
|
|
174
|
-
rendered.getByText(/expression.condition.customexpression/i)
|
|
176
|
+
rendered.getByText(/expression.condition.customexpression/i),
|
|
175
177
|
);
|
|
176
178
|
|
|
177
179
|
await waitFor(() =>
|
|
178
|
-
expect(formValuesRef.current.test.value).toEqual({ isCondition: false })
|
|
180
|
+
expect(formValuesRef.current.test.value).toEqual({ isCondition: false }),
|
|
179
181
|
);
|
|
180
182
|
});
|
|
181
183
|
|
|
@@ -213,12 +215,12 @@ describe("<Condition />", () => {
|
|
|
213
215
|
}}
|
|
214
216
|
>
|
|
215
217
|
<Condition />
|
|
216
|
-
</TestFormWrapper
|
|
218
|
+
</TestFormWrapper>,
|
|
217
219
|
);
|
|
218
220
|
await waitForLoad(rendered);
|
|
219
221
|
|
|
220
222
|
await user.click(
|
|
221
|
-
rendered.getByText(/expression.condition.selectfunction/i)
|
|
223
|
+
rendered.getByText(/expression.condition.selectfunction/i),
|
|
222
224
|
);
|
|
223
225
|
await user.click(rendered.getByText(/eq/i));
|
|
224
226
|
|
|
@@ -228,8 +230,8 @@ describe("<Condition />", () => {
|
|
|
228
230
|
name: "eq",
|
|
229
231
|
type: "boolean",
|
|
230
232
|
isCondition: true,
|
|
231
|
-
})
|
|
232
|
-
)
|
|
233
|
+
}),
|
|
234
|
+
),
|
|
233
235
|
);
|
|
234
236
|
});
|
|
235
237
|
});
|
|
@@ -8,7 +8,7 @@ describe("<ConstantSelector />", () => {
|
|
|
8
8
|
const rendered = render(
|
|
9
9
|
<TestFormWrapper>
|
|
10
10
|
<ConstantSelector />
|
|
11
|
-
</TestFormWrapper
|
|
11
|
+
</TestFormWrapper>,
|
|
12
12
|
);
|
|
13
13
|
await waitForLoad(rendered);
|
|
14
14
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -21,7 +21,7 @@ describe("<ConstantSelector />", () => {
|
|
|
21
21
|
const rendered = render(
|
|
22
22
|
<TestFormWrapper watcher={watcher} context={{ type: "any" }}>
|
|
23
23
|
<ConstantSelector />
|
|
24
|
-
</TestFormWrapper
|
|
24
|
+
</TestFormWrapper>,
|
|
25
25
|
);
|
|
26
26
|
await waitForLoad(rendered);
|
|
27
27
|
|
|
@@ -8,7 +8,7 @@ describe("<Expression />", () => {
|
|
|
8
8
|
const rendered = render(
|
|
9
9
|
<TestFormWrapper>
|
|
10
10
|
<Expression />
|
|
11
|
-
</TestFormWrapper
|
|
11
|
+
</TestFormWrapper>,
|
|
12
12
|
);
|
|
13
13
|
await waitForLoad(rendered);
|
|
14
14
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -39,12 +39,12 @@ describe("<Expression />", () => {
|
|
|
39
39
|
defaultValues={defaultValues}
|
|
40
40
|
>
|
|
41
41
|
<Expression />
|
|
42
|
-
</TestFormWrapper
|
|
42
|
+
</TestFormWrapper>,
|
|
43
43
|
);
|
|
44
44
|
await waitForLoad(rendered);
|
|
45
45
|
|
|
46
46
|
await user.click(
|
|
47
|
-
await rendered.findByRole("option", { name: /shape.function/i })
|
|
47
|
+
await rendered.findByRole("option", { name: /shape.function/i }),
|
|
48
48
|
);
|
|
49
49
|
await user.click(await rendered.findByRole("option", { name: /eq/i }));
|
|
50
50
|
|
|
@@ -72,7 +72,7 @@ describe("<Expression />", () => {
|
|
|
72
72
|
const rendered = render(
|
|
73
73
|
<TestFormWrapper watcher={watcher} context={{ type: "boolean" }}>
|
|
74
74
|
<Expression />
|
|
75
|
-
</TestFormWrapper
|
|
75
|
+
</TestFormWrapper>,
|
|
76
76
|
);
|
|
77
77
|
await waitForLoad(rendered);
|
|
78
78
|
|
|
@@ -103,7 +103,7 @@ describe("<Expression />", () => {
|
|
|
103
103
|
defaultValues={defaultValues}
|
|
104
104
|
>
|
|
105
105
|
<Expression />
|
|
106
|
-
</TestFormWrapper
|
|
106
|
+
</TestFormWrapper>,
|
|
107
107
|
);
|
|
108
108
|
await waitForLoad(rendered);
|
|
109
109
|
|
|
@@ -6,13 +6,17 @@ describe("<FieldSelector />", () => {
|
|
|
6
6
|
it("matches the latest snapshot", () => {
|
|
7
7
|
const fields = [{ id: 1, parent_id: 2, name: "name" }];
|
|
8
8
|
const { container } = render(
|
|
9
|
-
<TestFormWrapper context={{ fields }}
|
|
9
|
+
<TestFormWrapper context={{ fields }}>
|
|
10
|
+
<FieldSelector />
|
|
11
|
+
</TestFormWrapper>,
|
|
10
12
|
);
|
|
11
13
|
expect(container).toMatchSnapshot();
|
|
12
14
|
});
|
|
13
15
|
it("matches the latest snapshot empty", () => {
|
|
14
16
|
const { container } = render(
|
|
15
|
-
<TestFormWrapper
|
|
17
|
+
<TestFormWrapper>
|
|
18
|
+
<FieldSelector />
|
|
19
|
+
</TestFormWrapper>,
|
|
16
20
|
);
|
|
17
21
|
expect(container).toMatchSnapshot();
|
|
18
22
|
});
|
|
@@ -35,7 +35,7 @@ describe("<FunctionArgs />", () => {
|
|
|
35
35
|
const rendered = render(
|
|
36
36
|
<TestFormWrapper>
|
|
37
37
|
<FunctionArgs />
|
|
38
|
-
</TestFormWrapper
|
|
38
|
+
</TestFormWrapper>,
|
|
39
39
|
);
|
|
40
40
|
await waitForLoad(rendered);
|
|
41
41
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -73,7 +73,7 @@ describe("<FunctionArgs />", () => {
|
|
|
73
73
|
defaultValues={defaultValues}
|
|
74
74
|
>
|
|
75
75
|
<FunctionArgs />
|
|
76
|
-
</TestFormWrapper
|
|
76
|
+
</TestFormWrapper>,
|
|
77
77
|
);
|
|
78
78
|
await waitForLoad(rendered);
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ describe("<FunctionArgs />", () => {
|
|
|
82
82
|
|
|
83
83
|
await waitFor(() => {
|
|
84
84
|
expect(
|
|
85
|
-
rendered.getByRole("option", { name: /true/i })
|
|
85
|
+
rendered.getByRole("option", { name: /true/i }),
|
|
86
86
|
).toBeInTheDocument();
|
|
87
87
|
});
|
|
88
88
|
|
|
@@ -8,7 +8,7 @@ describe("<FunctionSelector />", () => {
|
|
|
8
8
|
const rendered = render(
|
|
9
9
|
<TestFormWrapper>
|
|
10
10
|
<FunctionSelector />
|
|
11
|
-
</TestFormWrapper
|
|
11
|
+
</TestFormWrapper>,
|
|
12
12
|
);
|
|
13
13
|
await waitForLoad(rendered);
|
|
14
14
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -32,7 +32,7 @@ describe("<FunctionSelector />", () => {
|
|
|
32
32
|
const rendered = render(
|
|
33
33
|
<TestFormWrapper watcher={watcher} context={{ type: "any", functions }}>
|
|
34
34
|
<FunctionSelector />
|
|
35
|
-
</TestFormWrapper
|
|
35
|
+
</TestFormWrapper>,
|
|
36
36
|
);
|
|
37
37
|
await waitForLoad(rendered);
|
|
38
38
|
|
|
@@ -52,7 +52,7 @@ describe("<FunctionSelector />", () => {
|
|
|
52
52
|
expect(rendered.container).toMatchSnapshot();
|
|
53
53
|
|
|
54
54
|
await user.click(
|
|
55
|
-
rendered.container.getElementsByClassName("no-padding")[0]
|
|
55
|
+
rendered.container.getElementsByClassName("no-padding")[0],
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
await waitForLoad(rendered);
|
|
@@ -12,7 +12,7 @@ describe("<ParamSelector />", () => {
|
|
|
12
12
|
const rendered = render(
|
|
13
13
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
14
14
|
<ParamSelector />
|
|
15
|
-
</TestFormWrapper
|
|
15
|
+
</TestFormWrapper>,
|
|
16
16
|
);
|
|
17
17
|
await waitForLoad(rendered);
|
|
18
18
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -32,7 +32,7 @@ describe("<ParamSelector />", () => {
|
|
|
32
32
|
defaultValues={defaultValues}
|
|
33
33
|
>
|
|
34
34
|
<ParamSelector />
|
|
35
|
-
</TestFormWrapper
|
|
35
|
+
</TestFormWrapper>,
|
|
36
36
|
);
|
|
37
37
|
await waitForLoad(rendered);
|
|
38
38
|
|
|
@@ -67,7 +67,7 @@ describe("<ParamSelector />", () => {
|
|
|
67
67
|
>
|
|
68
68
|
<FunctionParams />
|
|
69
69
|
<ParamSelector />
|
|
70
|
-
</TestFormWrapper
|
|
70
|
+
</TestFormWrapper>,
|
|
71
71
|
);
|
|
72
72
|
await waitForLoad(rendered);
|
|
73
73
|
|
|
@@ -11,7 +11,7 @@ describe("<ShapeSelector />", () => {
|
|
|
11
11
|
const rendered = render(
|
|
12
12
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
13
13
|
<ShapeSelector />
|
|
14
|
-
</TestFormWrapper
|
|
14
|
+
</TestFormWrapper>,
|
|
15
15
|
);
|
|
16
16
|
await waitForLoad(rendered);
|
|
17
17
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -30,12 +30,12 @@ describe("<ShapeSelector />", () => {
|
|
|
30
30
|
defaultValues={defaultValues}
|
|
31
31
|
>
|
|
32
32
|
<ShapeSelector />
|
|
33
|
-
</TestFormWrapper
|
|
33
|
+
</TestFormWrapper>,
|
|
34
34
|
);
|
|
35
35
|
await waitForLoad(rendered);
|
|
36
36
|
|
|
37
37
|
await user.click(
|
|
38
|
-
await rendered.findByRole("option", { name: /expression.shape.param/i })
|
|
38
|
+
await rendered.findByRole("option", { name: /expression.shape.param/i }),
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
@@ -58,14 +58,14 @@ describe("<ShapeSelector />", () => {
|
|
|
58
58
|
const rendered = render(
|
|
59
59
|
<TestFormWrapper watcher={watcher} context={{ type: "boolean" }}>
|
|
60
60
|
<ShapeSelector />
|
|
61
|
-
</TestFormWrapper
|
|
61
|
+
</TestFormWrapper>,
|
|
62
62
|
);
|
|
63
63
|
await waitForLoad(rendered);
|
|
64
64
|
|
|
65
65
|
await user.click(
|
|
66
66
|
await rendered.findByRole("option", {
|
|
67
67
|
name: /expression.shape.constant/i,
|
|
68
|
-
})
|
|
68
|
+
}),
|
|
69
69
|
);
|
|
70
70
|
|
|
71
71
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
@@ -84,14 +84,14 @@ describe("<ShapeSelector />", () => {
|
|
|
84
84
|
context={{ type: "boolean", defaultShape: "constant" }}
|
|
85
85
|
>
|
|
86
86
|
<ShapeSelector />
|
|
87
|
-
</TestFormWrapper
|
|
87
|
+
</TestFormWrapper>,
|
|
88
88
|
);
|
|
89
89
|
await waitForLoad(rendered);
|
|
90
90
|
|
|
91
91
|
await user.click(
|
|
92
92
|
await rendered.findByRole("option", {
|
|
93
93
|
name: /expression.shape.function/i,
|
|
94
|
-
})
|
|
94
|
+
}),
|
|
95
95
|
);
|
|
96
96
|
|
|
97
97
|
expect(watcher).toHaveBeenLastCalledWith({
|
|
@@ -14,7 +14,9 @@ describe("useWatchParams", () => {
|
|
|
14
14
|
return null;
|
|
15
15
|
};
|
|
16
16
|
render(
|
|
17
|
-
<TestFormWrapper defaultValues={defaultValues}
|
|
17
|
+
<TestFormWrapper defaultValues={defaultValues}>
|
|
18
|
+
<ParamHook />
|
|
19
|
+
</TestFormWrapper>,
|
|
18
20
|
);
|
|
19
21
|
});
|
|
20
22
|
});
|
|
@@ -34,7 +34,11 @@ export default function BooleanSelector() {
|
|
|
34
34
|
value={value}
|
|
35
35
|
onChange={(_e, { value }) => onChange(value)}
|
|
36
36
|
/>
|
|
37
|
-
{error?.message &&
|
|
37
|
+
{error?.message && (
|
|
38
|
+
<Label prompt pointing>
|
|
39
|
+
{error?.message}
|
|
40
|
+
</Label>
|
|
41
|
+
)}
|
|
38
42
|
</Form.Field>
|
|
39
43
|
)}
|
|
40
44
|
/>
|