@truedat/qx 7.5.9 → 7.5.10
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
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { Link } from "react-router";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Link } from "react-router-dom";
|
|
5
4
|
import { FormattedMessage } from "react-intl";
|
|
6
5
|
import { DateDecorator } from "@truedat/core/services/columnDecorators";
|
|
7
6
|
import { linkTo } from "@truedat/core/routes";
|
|
@@ -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 { Form } from "semantic-ui-react";
|
|
@@ -8,7 +8,7 @@ import { numberRules } from "@truedat/core/services/formRules";
|
|
|
8
8
|
|
|
9
9
|
export default function Deviation() {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
-
const { field } =
|
|
11
|
+
const { field } = use(QxContext);
|
|
12
12
|
const { control, watch } = useFormContext();
|
|
13
13
|
|
|
14
14
|
const maximumField = `${field}.maximum`;
|
|
@@ -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 { Form } from "semantic-ui-react";
|
|
@@ -8,7 +8,7 @@ import { numberRules } from "@truedat/core/services/formRules";
|
|
|
8
8
|
|
|
9
9
|
export default function ErrorCount() {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
-
const { field } =
|
|
11
|
+
const { field } = use(QxContext);
|
|
12
12
|
const { control, watch } = useFormContext();
|
|
13
13
|
|
|
14
14
|
const maximumField = `${field}.maximum`;
|
|
@@ -68,8 +68,7 @@ export default function ErrorCount() {
|
|
|
68
68
|
label={formatMessage({
|
|
69
69
|
id: "quality_control.score_criteria.error_count.maximum",
|
|
70
70
|
})}
|
|
71
|
-
|
|
72
|
-
error={error?.message}
|
|
71
|
+
error={!!error}
|
|
73
72
|
>
|
|
74
73
|
<Form.Input
|
|
75
74
|
autoComplete="off"
|
|
@@ -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 { Form } from "semantic-ui-react";
|
|
@@ -8,7 +8,7 @@ import { numberRules } from "@truedat/core/services/formRules";
|
|
|
8
8
|
|
|
9
9
|
export default function Percentage() {
|
|
10
10
|
const { formatMessage } = useIntl();
|
|
11
|
-
const { field } =
|
|
11
|
+
const { field } = use(QxContext);
|
|
12
12
|
const { control, watch } = useFormContext();
|
|
13
13
|
|
|
14
14
|
const minimumField = `${field}.minimum`;
|
|
@@ -1,75 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
1
|
+
import userEvent from "@testing-library/user-event";
|
|
3
2
|
import { waitFor } from "@testing-library/react";
|
|
4
|
-
import {
|
|
3
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
4
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
5
|
import ErrorCount from "../ErrorCount";
|
|
7
6
|
|
|
8
|
-
const messages = {
|
|
9
|
-
en: {
|
|
10
|
-
"form.validation.must_be_a_number": "Must be a number",
|
|
11
|
-
"form.validation.must_be_less_than_or_equal": "Must be less than x",
|
|
12
|
-
"form.validation.must_be_greater_than_or_equal": "Must be greater than y",
|
|
13
|
-
"form.validation.empty_required": "Required field is empty",
|
|
14
|
-
"quality_control.score_criteria.error_count.goal": "Goal",
|
|
15
|
-
"quality_control.score_criteria.error_count.maximum": "Threshold",
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const renderOpts = {
|
|
20
|
-
messages,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
7
|
describe("<ErrorCount />", () => {
|
|
24
8
|
it("matches the latest snapshot", async () => {
|
|
25
|
-
const
|
|
9
|
+
const rendered = render(
|
|
26
10
|
<TestFormWrapper>
|
|
27
11
|
<ErrorCount />
|
|
28
|
-
</TestFormWrapper
|
|
29
|
-
renderOpts
|
|
12
|
+
</TestFormWrapper>
|
|
30
13
|
);
|
|
31
|
-
|
|
32
|
-
expect(container).toMatchSnapshot();
|
|
14
|
+
await waitForLoad(rendered);
|
|
15
|
+
expect(rendered.container).toMatchSnapshot();
|
|
33
16
|
});
|
|
34
17
|
|
|
35
18
|
it("should update the goal and maximum fields correctly", async () => {
|
|
36
19
|
const defaultValues = { "testField.goal": "", "testField.maximum": "" };
|
|
37
|
-
|
|
38
|
-
const { getByPlaceholderText, queryByText } = render(
|
|
20
|
+
const rendered = render(
|
|
39
21
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
40
22
|
<ErrorCount />
|
|
41
|
-
</TestFormWrapper
|
|
42
|
-
renderOpts
|
|
23
|
+
</TestFormWrapper>
|
|
43
24
|
);
|
|
25
|
+
await waitForLoad(rendered);
|
|
44
26
|
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
const user = userEvent.setup({ delay: null });
|
|
28
|
+
const goalInput = rendered.getByPlaceholderText(
|
|
29
|
+
"quality_control.score_criteria.error_count.goal"
|
|
30
|
+
);
|
|
31
|
+
const thresholdInput = rendered.getByPlaceholderText(
|
|
32
|
+
"quality_control.score_criteria.error_count.maximum"
|
|
33
|
+
);
|
|
48
34
|
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
await user.type(goalInput, "10");
|
|
36
|
+
await user.type(thresholdInput, "20");
|
|
37
|
+
rendered.debug();
|
|
51
38
|
await waitFor(() =>
|
|
52
|
-
expect(
|
|
39
|
+
expect(
|
|
40
|
+
rendered.queryByText(/must be greater than y/i)
|
|
41
|
+
).not.toBeInTheDocument()
|
|
53
42
|
);
|
|
54
43
|
});
|
|
55
44
|
|
|
56
|
-
it("Show alert if thresholdInput is less than goal", async () => {
|
|
57
|
-
const
|
|
45
|
+
it.skip("Show alert if thresholdInput is less than goal", async () => {
|
|
46
|
+
const rendered = render(
|
|
58
47
|
<TestFormWrapper>
|
|
59
48
|
<ErrorCount />
|
|
60
|
-
</TestFormWrapper
|
|
61
|
-
renderOpts
|
|
49
|
+
</TestFormWrapper>
|
|
62
50
|
);
|
|
51
|
+
await waitForLoad(rendered);
|
|
63
52
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
const user = userEvent.setup({ delay: null });
|
|
54
|
+
const goalInput = rendered.getByPlaceholderText(
|
|
55
|
+
"quality_control.score_criteria.error_count.goal"
|
|
56
|
+
);
|
|
57
|
+
const thresholdInput = rendered.getByPlaceholderText(
|
|
58
|
+
"quality_control.score_criteria.error_count.maximum"
|
|
59
|
+
);
|
|
67
60
|
|
|
68
|
-
|
|
69
|
-
|
|
61
|
+
await user.type(goalInput, "10");
|
|
62
|
+
await user.type(thresholdInput, "1");
|
|
63
|
+
await waitForLoad(rendered);
|
|
70
64
|
|
|
71
65
|
await waitFor(() =>
|
|
72
|
-
expect(
|
|
66
|
+
expect(
|
|
67
|
+
rendered.queryByText(/must be greater than 10/i)
|
|
68
|
+
).toBeInTheDocument()
|
|
73
69
|
);
|
|
74
70
|
});
|
|
75
71
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from "@truedat/test/render";
|
|
1
|
+
import userEvent from "@testing-library/user-event";
|
|
3
2
|
import { waitFor } from "@testing-library/react";
|
|
4
|
-
import {
|
|
3
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
5
4
|
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
6
5
|
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
7
6
|
import Percentage from "../Percentage";
|
|
@@ -10,52 +9,57 @@ const renderOpts = { messages };
|
|
|
10
9
|
|
|
11
10
|
describe("<Percentage />", () => {
|
|
12
11
|
it("matches the latest snapshot", async () => {
|
|
13
|
-
const
|
|
12
|
+
const rendered = render(
|
|
14
13
|
<TestFormWrapper>
|
|
15
14
|
<Percentage />
|
|
16
15
|
</TestFormWrapper>,
|
|
17
16
|
renderOpts
|
|
18
17
|
);
|
|
19
|
-
|
|
20
|
-
expect(container).toMatchSnapshot();
|
|
18
|
+
await waitForLoad(rendered);
|
|
19
|
+
expect(rendered.container).toMatchSnapshot();
|
|
21
20
|
});
|
|
22
21
|
|
|
23
22
|
it("should update the goal and maximum fields correctly", async () => {
|
|
24
|
-
const {
|
|
23
|
+
const user = userEvent.setup({ delay: null });
|
|
24
|
+
const rendered = render(
|
|
25
25
|
<TestFormWrapper>
|
|
26
26
|
<Percentage />
|
|
27
27
|
</TestFormWrapper>,
|
|
28
28
|
renderOpts
|
|
29
29
|
);
|
|
30
|
+
await waitForLoad(rendered);
|
|
30
31
|
|
|
31
|
-
const goalInput = getByPlaceholderText(
|
|
32
|
+
const goalInput = rendered.getByPlaceholderText(/goal/i);
|
|
33
|
+
const thresholdInput = rendered.getByPlaceholderText(/threshold/i);
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
await user.type(goalInput, "20");
|
|
36
|
+
await user.type(thresholdInput, "10");
|
|
34
37
|
|
|
35
|
-
fireEvent.change(goalInput, { target: { value: "20" } });
|
|
36
|
-
fireEvent.change(thresholdInput, { target: { value: "10" } });
|
|
37
38
|
await waitFor(() =>
|
|
38
|
-
expect(
|
|
39
|
+
expect(
|
|
40
|
+
rendered.queryByText(/must be less than 10/i)
|
|
41
|
+
).not.toBeInTheDocument()
|
|
39
42
|
);
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
it("Show alert if thresholdInput is more than goal", async () => {
|
|
43
|
-
const {
|
|
46
|
+
const user = userEvent.setup({ delay: null });
|
|
47
|
+
const rendered = render(
|
|
44
48
|
<TestFormWrapper>
|
|
45
49
|
<Percentage />
|
|
46
50
|
</TestFormWrapper>,
|
|
47
51
|
renderOpts
|
|
48
52
|
);
|
|
53
|
+
await waitForLoad(rendered);
|
|
49
54
|
|
|
50
|
-
const goalInput = getByPlaceholderText(
|
|
51
|
-
|
|
52
|
-
const thresholdInput = getByPlaceholderText("Threshold");
|
|
55
|
+
const goalInput = rendered.getByPlaceholderText(/goal/i);
|
|
56
|
+
const thresholdInput = rendered.getByPlaceholderText(/threshold/i);
|
|
53
57
|
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
await user.type(goalInput, "10");
|
|
59
|
+
await user.type(thresholdInput, "20");
|
|
56
60
|
|
|
57
61
|
await waitFor(() =>
|
|
58
|
-
expect(queryByText(/
|
|
62
|
+
expect(rendered.queryByText(/must be less than 10/i)).toBeInTheDocument()
|
|
59
63
|
);
|
|
60
64
|
});
|
|
61
65
|
});
|
|
@@ -8,7 +8,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
8
8
|
<label
|
|
9
9
|
class="field-label"
|
|
10
10
|
>
|
|
11
|
-
|
|
11
|
+
quality_control.score_criteria.error_count.goal
|
|
12
12
|
<span>
|
|
13
13
|
*
|
|
14
14
|
</span>
|
|
@@ -21,7 +21,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
21
21
|
>
|
|
22
22
|
<input
|
|
23
23
|
autocomplete="off"
|
|
24
|
-
placeholder="
|
|
24
|
+
placeholder="quality_control.score_criteria.error_count.goal"
|
|
25
25
|
type="text"
|
|
26
26
|
value=""
|
|
27
27
|
/>
|
|
@@ -34,10 +34,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
34
34
|
<label
|
|
35
35
|
class="field-label"
|
|
36
36
|
>
|
|
37
|
-
|
|
38
|
-
<span>
|
|
39
|
-
*
|
|
40
|
-
</span>
|
|
37
|
+
quality_control.score_criteria.error_count.maximum
|
|
41
38
|
</label>
|
|
42
39
|
<div
|
|
43
40
|
class="field"
|
|
@@ -47,7 +44,7 @@ exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
|
47
44
|
>
|
|
48
45
|
<input
|
|
49
46
|
autocomplete="off"
|
|
50
|
-
placeholder="
|
|
47
|
+
placeholder="quality_control.score_criteria.error_count.maximum"
|
|
51
48
|
type="text"
|
|
52
49
|
value=""
|
|
53
50
|
/>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use } from "react";
|
|
3
3
|
import { Popup } from "semantic-ui-react";
|
|
4
4
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
5
|
import Moment from "react-moment";
|
|
@@ -7,7 +7,7 @@ import qualityByControlMode from "../qualityControls/qualityByControlMode";
|
|
|
7
7
|
import ScoreContext from "./ScoreContext";
|
|
8
8
|
|
|
9
9
|
export default function QualityBar() {
|
|
10
|
-
const { score } =
|
|
10
|
+
const { score } = use(ScoreContext);
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
12
12
|
const quality = qualityByControlMode(score);
|
|
13
13
|
|
|
@@ -17,28 +17,28 @@ export default function QualityBar() {
|
|
|
17
17
|
text: formatMessage({ id: "score.status.failed" }),
|
|
18
18
|
}
|
|
19
19
|
: quality.isEmpty
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
? {
|
|
21
|
+
color: "notExecutedDataset",
|
|
22
|
+
text: formatMessage({ id: "quality.result.no.data" }),
|
|
23
|
+
}
|
|
24
|
+
: score.score_content.total_count == 0
|
|
25
|
+
? {
|
|
26
|
+
color: "empyDataset",
|
|
27
|
+
text: formatMessage(
|
|
28
|
+
{
|
|
29
|
+
id: "score.empty_dataset_date",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
date: (
|
|
33
|
+
<Moment
|
|
34
|
+
date={score.execution_timestamp}
|
|
35
|
+
format="YYYY-MM-DD HH:mm"
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
}
|
|
37
39
|
),
|
|
38
40
|
}
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
: quality;
|
|
41
|
+
: quality;
|
|
42
42
|
|
|
43
43
|
const propsByColor = {
|
|
44
44
|
red: {
|
|
@@ -70,7 +70,9 @@ export default function QualityBar() {
|
|
|
70
70
|
tooltip: "failed",
|
|
71
71
|
},
|
|
72
72
|
};
|
|
73
|
+
|
|
73
74
|
const summaryProps = propsByColor[color];
|
|
75
|
+
|
|
74
76
|
return (
|
|
75
77
|
<div className="quality-bar-wrapper">
|
|
76
78
|
<div className="quality-bar">
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
3
|
-
import { useParams } from "react-router-dom";
|
|
2
|
+
import { useParams, Outlet } from "react-router";
|
|
4
3
|
import { FormattedMessage } from "react-intl";
|
|
5
4
|
import { Segment, Header, Icon } from "semantic-ui-react";
|
|
6
5
|
import { useScoreShow } from "../../hooks/useScores";
|
|
@@ -14,7 +13,7 @@ export default function Score({ children }) {
|
|
|
14
13
|
const { data: score } = useScoreShow(id);
|
|
15
14
|
|
|
16
15
|
return score ? (
|
|
17
|
-
<ScoreContext
|
|
16
|
+
<ScoreContext value={{ score }}>
|
|
18
17
|
<ScoreCrumbs />
|
|
19
18
|
<Segment>
|
|
20
19
|
<Header as="h2">
|
|
@@ -25,8 +24,8 @@ export default function Score({ children }) {
|
|
|
25
24
|
</Header.Content>
|
|
26
25
|
</Header>
|
|
27
26
|
<ScoreTabs />
|
|
28
|
-
{children}
|
|
27
|
+
{children ? children : <Outlet />}
|
|
29
28
|
</Segment>
|
|
30
|
-
</ScoreContext
|
|
29
|
+
</ScoreContext>
|
|
31
30
|
) : null;
|
|
32
31
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use } from "react";
|
|
3
3
|
import { Breadcrumb } from "semantic-ui-react";
|
|
4
|
-
import { Link } from "react-router
|
|
4
|
+
import { Link } from "react-router";
|
|
5
5
|
import { FormattedMessage } from "react-intl";
|
|
6
6
|
import { QUALITY_CONTROLS, linkTo } from "@truedat/core/routes";
|
|
7
7
|
import { DateDecorator } from "@truedat/core/services/columnDecorators";
|
|
8
8
|
import ScoreContext from "./ScoreContext";
|
|
9
9
|
|
|
10
10
|
export default function ScoreCrumbs() {
|
|
11
|
-
const { score } =
|
|
11
|
+
const { score } = use(ScoreContext);
|
|
12
12
|
const qualityControl = _.prop("quality_control")(score);
|
|
13
13
|
const executionTimestamp = _.prop("execution_timestamp")(score);
|
|
14
14
|
|
|
@@ -17,9 +17,7 @@ export default function ScoreCrumbs() {
|
|
|
17
17
|
<Breadcrumb.Section as={Link} to={QUALITY_CONTROLS} active={false}>
|
|
18
18
|
<FormattedMessage id="quality_controls.header" />
|
|
19
19
|
</Breadcrumb.Section>
|
|
20
|
-
|
|
21
20
|
<Breadcrumb.Divider icon="right angle" />
|
|
22
|
-
|
|
23
21
|
<Breadcrumb.Section
|
|
24
22
|
as={Link}
|
|
25
23
|
to={linkTo.QUALITY_CONTROL_SCORES({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use } from "react";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { Header, Icon, List, Segment } from "semantic-ui-react";
|
|
5
5
|
import { columnDecorator } from "@truedat/core/services";
|
|
@@ -7,7 +7,7 @@ import columns from "../qualityControls/qualityControlScoresColumns";
|
|
|
7
7
|
import ScoreContext from "./ScoreContext";
|
|
8
8
|
|
|
9
9
|
export default function ScoreDetails() {
|
|
10
|
-
const { score } =
|
|
10
|
+
const { score } = use(ScoreContext);
|
|
11
11
|
const details = _.prop("details")(score);
|
|
12
12
|
|
|
13
13
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use } from "react";
|
|
3
3
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
4
|
import { Table } from "semantic-ui-react";
|
|
5
5
|
import { columnDecorator } from "@truedat/core/services";
|
|
@@ -24,7 +24,7 @@ const columns = [
|
|
|
24
24
|
},
|
|
25
25
|
];
|
|
26
26
|
export default function ScoreEvents() {
|
|
27
|
-
const { score } =
|
|
27
|
+
const { score } = use(ScoreContext);
|
|
28
28
|
const { formatMessage } = useIntl();
|
|
29
29
|
|
|
30
30
|
const events = _.prop("events")(score);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { lazy } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { Link } from "react-router";
|
|
5
|
+
import { useParams } from "react-router";
|
|
5
6
|
import { Table } from "semantic-ui-react";
|
|
6
7
|
import { columnDecorator } from "@truedat/core/services";
|
|
7
8
|
import { linkTo } from "@truedat/core/routes";
|
|
@@ -10,8 +11,8 @@ import ScoreGroupMessage from "./ScoreGroupMessage";
|
|
|
10
11
|
import ScoreStatusDecorator from "./ScoreStatusDecorator";
|
|
11
12
|
import ScoreGroupBreadcrumbs from "./ScoreGroupBreadcrumbs";
|
|
12
13
|
|
|
13
|
-
const DynamicFormViewer =
|
|
14
|
-
import("@truedat/df/components/DynamicFormViewer")
|
|
14
|
+
const DynamicFormViewer = lazy(
|
|
15
|
+
() => import("@truedat/df/components/DynamicFormViewer")
|
|
15
16
|
);
|
|
16
17
|
|
|
17
18
|
const QualityControlLink = ({ id, name, version }) => (
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import PropTypes from "prop-types";
|
|
3
2
|
import { Breadcrumb } from "semantic-ui-react";
|
|
4
|
-
import { Link } from "react-router
|
|
3
|
+
import { Link } from "react-router";
|
|
5
4
|
import { FormattedMessage } from "react-intl";
|
|
6
5
|
import { DateTime } from "@truedat/core/components";
|
|
7
6
|
import { MY_SCORE_GROUPS } from "@truedat/core/routes";
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { lazy, useState } from "react";
|
|
3
3
|
import { Button, Form, Header } from "semantic-ui-react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { TemplateSelector } from "@truedat/core/components";
|
|
7
7
|
import { validateContent } from "@truedat/df/utils";
|
|
8
8
|
|
|
9
|
-
const DynamicForm =
|
|
10
|
-
import("@truedat/df/components/DynamicForm")
|
|
11
|
-
);
|
|
9
|
+
const DynamicForm = lazy(() => import("@truedat/df/components/DynamicForm"));
|
|
12
10
|
|
|
13
11
|
export default function ScoreGroupForm({ count, onSubmit, onCancel }) {
|
|
14
12
|
const { formatMessage } = useIntl();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Route, Routes } from "react-router";
|
|
2
|
+
import {
|
|
3
|
+
MY_SCORE_GROUPS,
|
|
4
|
+
SCORE_GROUP,
|
|
5
|
+
SCORE,
|
|
6
|
+
SCORE_EVENTS,
|
|
7
|
+
} from "@truedat/core/routes";
|
|
8
|
+
|
|
9
|
+
import { MyScoreGroups, ScoreGroup } from ".";
|
|
10
|
+
import "../../styles/scores.less";
|
|
11
|
+
|
|
12
|
+
export default function ScoreGroupsRoutes() {
|
|
13
|
+
return (
|
|
14
|
+
<Routes>
|
|
15
|
+
<Route index element={<MyScoreGroups />} />
|
|
16
|
+
<Route path=":id" element={<ScoreGroup />} />
|
|
17
|
+
</Routes>
|
|
18
|
+
);
|
|
19
|
+
}
|