@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
|
-
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 { QUALITY_CONTROLS } from "@truedat/core/routes";
|
|
7
6
|
|
|
@@ -11,7 +10,6 @@ export default function QualityControlCrumbs({ qualityControl }) {
|
|
|
11
10
|
<Breadcrumb.Section as={Link} to={QUALITY_CONTROLS} active={false}>
|
|
12
11
|
<FormattedMessage id="quality_controls.header" />
|
|
13
12
|
</Breadcrumb.Section>
|
|
14
|
-
|
|
15
13
|
<Breadcrumb.Divider icon="right angle" />
|
|
16
14
|
<Breadcrumb.Section active>{qualityControl.name}</Breadcrumb.Section>
|
|
17
15
|
</Breadcrumb>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { lazy, useState, Fragment } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { Button, Container, Dropdown, Divider, Form } from "semantic-ui-react";
|
|
@@ -17,11 +17,11 @@ import ControlProperties, {
|
|
|
17
17
|
defaultForMode as defaultControlPropertiesForMode,
|
|
18
18
|
} from "./ControlProperties";
|
|
19
19
|
|
|
20
|
-
const SelectableDynamicForm =
|
|
21
|
-
import("@truedat/df/components/SelectableDynamicForm")
|
|
20
|
+
const SelectableDynamicForm = lazy(
|
|
21
|
+
() => import("@truedat/df/components/SelectableDynamicForm")
|
|
22
22
|
);
|
|
23
|
-
const SourceSelector =
|
|
24
|
-
import("@truedat/cx/sources/components/SourceSelector")
|
|
23
|
+
const SourceSelector = lazy(
|
|
24
|
+
() => import("@truedat/cx/sources/components/SourceSelector")
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
export default function QualityControlEditor({
|
|
@@ -124,7 +124,6 @@ export default function QualityControlEditor({
|
|
|
124
124
|
</FieldLabel>
|
|
125
125
|
)}
|
|
126
126
|
/>
|
|
127
|
-
|
|
128
127
|
<Controller
|
|
129
128
|
control={control}
|
|
130
129
|
name="name"
|
|
@@ -168,7 +167,6 @@ export default function QualityControlEditor({
|
|
|
168
167
|
/>
|
|
169
168
|
)}
|
|
170
169
|
/>
|
|
171
|
-
|
|
172
170
|
<Controller
|
|
173
171
|
control={control}
|
|
174
172
|
name="source_id"
|
|
@@ -176,7 +174,6 @@ export default function QualityControlEditor({
|
|
|
176
174
|
render={({ field: { onChange, value } }) => (
|
|
177
175
|
<Form.Field required>
|
|
178
176
|
<label>{formatMessage({ id: "dataViews.form.source" })}</label>
|
|
179
|
-
|
|
180
177
|
<SourceSelector
|
|
181
178
|
disabled={isModification}
|
|
182
179
|
value={value + ""}
|
|
@@ -185,7 +182,6 @@ export default function QualityControlEditor({
|
|
|
185
182
|
</Form.Field>
|
|
186
183
|
)}
|
|
187
184
|
/>
|
|
188
|
-
|
|
189
185
|
<Controller
|
|
190
186
|
name={"control_mode"}
|
|
191
187
|
control={control}
|
|
@@ -218,10 +214,8 @@ export default function QualityControlEditor({
|
|
|
218
214
|
</Form.Field>
|
|
219
215
|
)}
|
|
220
216
|
/>
|
|
221
|
-
|
|
222
217
|
<ScoreCriteria />
|
|
223
218
|
<ControlProperties />
|
|
224
|
-
|
|
225
219
|
<Divider hidden />
|
|
226
220
|
<Container textAlign="right">
|
|
227
221
|
{onPublish && allowedToPublish ? (
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { FormattedMessage } from "react-intl";
|
|
5
|
-
import { useParams } from "react-router
|
|
4
|
+
import { useParams, Outlet } from "react-router";
|
|
6
5
|
import { Header, Icon, Segment, Grid, Label } from "semantic-ui-react";
|
|
7
6
|
import { colorForStatus } from "@truedat/core/services/statusColor";
|
|
8
7
|
|
|
@@ -25,7 +24,7 @@ export default function QualityControlHeader({ children }) {
|
|
|
25
24
|
: ["pause", "orange"];
|
|
26
25
|
|
|
27
26
|
return (
|
|
28
|
-
<QxContext
|
|
27
|
+
<QxContext value={context}>
|
|
29
28
|
<QualityControlCrumbs qualityControl={qualityControl} />
|
|
30
29
|
<Segment loading={loading}>
|
|
31
30
|
{!_.isEmpty(qualityControl) ? (
|
|
@@ -36,7 +35,6 @@ export default function QualityControlHeader({ children }) {
|
|
|
36
35
|
<Icon circular name="archive" />
|
|
37
36
|
<Header.Content>
|
|
38
37
|
{qualityControl.name}
|
|
39
|
-
|
|
40
38
|
<Header.Subheader>
|
|
41
39
|
<div className="control-subheader">
|
|
42
40
|
<Label className="no-margin">
|
|
@@ -73,11 +71,11 @@ export default function QualityControlHeader({ children }) {
|
|
|
73
71
|
/>
|
|
74
72
|
</Label>
|
|
75
73
|
<QualityControlTabs />
|
|
76
|
-
{children}
|
|
74
|
+
{children ? children : <Outlet />}
|
|
77
75
|
</>
|
|
78
76
|
) : null}
|
|
79
77
|
</Segment>
|
|
80
|
-
</QxContext
|
|
78
|
+
</QxContext>
|
|
81
79
|
);
|
|
82
80
|
}
|
|
83
81
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { use } from "react";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { Table } from "semantic-ui-react";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { columnDecorator } from "@truedat/core/services";
|
|
7
7
|
import { Loading } from "@truedat/core/components";
|
|
8
|
-
import { Link } from "react-router
|
|
8
|
+
import { Link } from "react-router";
|
|
9
9
|
import { linkTo } from "@truedat/core/routes";
|
|
10
10
|
import QxContext from "../QxContext";
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ const translateDecorator = (id) =>
|
|
|
13
13
|
id ? <FormattedMessage id={id} defaultMessage={id} /> : null;
|
|
14
14
|
|
|
15
15
|
export default function QualityControlsHistory() {
|
|
16
|
-
const { qualityControl, loading } =
|
|
16
|
+
const { qualityControl, loading } = use(QxContext);
|
|
17
17
|
const versions = _.propOr([], "versions")(qualityControl);
|
|
18
18
|
|
|
19
19
|
const columns = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { use, useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { Button, Container, Form, Header } from "semantic-ui-react";
|
|
4
4
|
import { useForm, Controller } from "react-hook-form";
|
|
@@ -9,7 +9,7 @@ import { useQualityControlUpdateMain } from "../../hooks/useQualityControls";
|
|
|
9
9
|
|
|
10
10
|
export default function QualityControlManageDomain({ handleOpen }) {
|
|
11
11
|
const { formatMessage } = useIntl();
|
|
12
|
-
const { qualityControl, mutate } =
|
|
12
|
+
const { qualityControl, mutate } = use(QxContext);
|
|
13
13
|
|
|
14
14
|
const { trigger: updateMainQualityControl, isMutating: isMutatingMain } =
|
|
15
15
|
useQualityControlUpdateMain(qualityControl.id);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Route, Switch } from "react-router-dom";
|
|
1
|
+
import { Route, Routes } from "react-router";
|
|
3
2
|
import {
|
|
4
3
|
QUALITY_CONTROLS_DEPRECATED,
|
|
5
4
|
QUALITY_CONTROLS_DRAFTS,
|
|
@@ -34,84 +33,58 @@ export default function QualityControlRoutes() {
|
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
return (
|
|
37
|
-
<
|
|
36
|
+
<Routes>
|
|
38
37
|
<Route
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
render={() => (
|
|
38
|
+
index
|
|
39
|
+
element={
|
|
42
40
|
<SearchContextProvider
|
|
43
41
|
{...searchProps}
|
|
44
42
|
defaultFilters={{ status: "published" }}
|
|
45
43
|
>
|
|
46
44
|
<QualityControls />
|
|
47
45
|
</SearchContextProvider>
|
|
48
|
-
|
|
46
|
+
}
|
|
49
47
|
/>
|
|
50
48
|
<Route
|
|
51
|
-
|
|
52
|
-
path=
|
|
53
|
-
|
|
49
|
+
// QUALITY_CONTROLS_DEPRECATED = "/qualityControls/deprecated";
|
|
50
|
+
path="deprecated"
|
|
51
|
+
element={
|
|
54
52
|
<SearchContextProvider
|
|
55
53
|
{...searchProps}
|
|
56
54
|
defaultFilters={{ status: "deprecated" }}
|
|
57
55
|
>
|
|
58
56
|
<QualityControls />
|
|
59
57
|
</SearchContextProvider>
|
|
60
|
-
|
|
58
|
+
}
|
|
61
59
|
/>
|
|
62
60
|
<Route
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
render={() => (
|
|
61
|
+
path="drafts"
|
|
62
|
+
element={
|
|
66
63
|
<SearchContextProvider
|
|
67
64
|
{...searchProps}
|
|
68
|
-
defaultFilters={{
|
|
69
|
-
status: ["draft", "pending_approval", "rejected"],
|
|
70
|
-
}}
|
|
65
|
+
defaultFilters={{ status: "draft" }}
|
|
71
66
|
>
|
|
72
67
|
<QualityControls />
|
|
73
68
|
</SearchContextProvider>
|
|
74
|
-
|
|
69
|
+
}
|
|
75
70
|
/>
|
|
71
|
+
<Route path="new" element={<NewQualityControl />} />
|
|
76
72
|
<Route
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
render={() => <NewQualityControl />}
|
|
73
|
+
path=":id/version/:version/edit"
|
|
74
|
+
element={<EditQualityControl />}
|
|
80
75
|
/>
|
|
81
76
|
<Route
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
render={() => <EditQualityControl />}
|
|
77
|
+
path=":id/version/:version/new_draft"
|
|
78
|
+
element={<NewDraftQualityControl />}
|
|
85
79
|
/>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
path={
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<Switch>
|
|
96
|
-
<Route
|
|
97
|
-
exact
|
|
98
|
-
path={QUALITY_CONTROL}
|
|
99
|
-
render={() => <QualityControl />}
|
|
100
|
-
/>
|
|
101
|
-
<Route
|
|
102
|
-
exact
|
|
103
|
-
path={QUALITY_CONTROL_HISTORY}
|
|
104
|
-
render={() => <QualityControlHistory />}
|
|
105
|
-
/>
|
|
106
|
-
<Route
|
|
107
|
-
exact
|
|
108
|
-
path={QUALITY_CONTROL_SCORES}
|
|
109
|
-
render={() => <QualityControlScores />}
|
|
110
|
-
/>
|
|
111
|
-
</Switch>
|
|
112
|
-
</QualityControlHeader>
|
|
113
|
-
)}
|
|
114
|
-
/>
|
|
115
|
-
</Switch>
|
|
80
|
+
|
|
81
|
+
<Route path=":id/version/:version" element={<QualityControlHeader />}>
|
|
82
|
+
<Route index element={<QualityControl />} />
|
|
83
|
+
|
|
84
|
+
<Route path="history" element={<QualityControlHistory />} />
|
|
85
|
+
|
|
86
|
+
<Route path="scores" element={<QualityControlScores />} />
|
|
87
|
+
</Route>
|
|
88
|
+
</Routes>
|
|
116
89
|
);
|
|
117
90
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
3
|
import { Checkbox, Table } from "semantic-ui-react";
|
|
5
4
|
import { columnDecorator } from "@truedat/core/services";
|
|
@@ -22,7 +21,6 @@ export default function QualityControlRow({
|
|
|
22
21
|
/>
|
|
23
22
|
</Table.Cell>
|
|
24
23
|
) : null}
|
|
25
|
-
|
|
26
24
|
{columns.map((column, i) => (
|
|
27
25
|
<Table.Cell
|
|
28
26
|
key={i}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { Fragment, useContext } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { useParams, Link } from "react-router
|
|
4
|
+
import { useParams, Link } from "react-router";
|
|
5
5
|
import { Button, Table, Label, Message, Icon } from "semantic-ui-react";
|
|
6
6
|
import { ConfirmModal, Loading } from "@truedat/core/components";
|
|
7
7
|
import { columnDecorator } from "@truedat/core/services";
|
|
@@ -85,7 +85,7 @@ export default function QualityControlScores() {
|
|
|
85
85
|
})}: ${version}`
|
|
86
86
|
: null;
|
|
87
87
|
return (
|
|
88
|
-
<
|
|
88
|
+
<Fragment key={key}>
|
|
89
89
|
{tagLabel ? (
|
|
90
90
|
<Table.Row>
|
|
91
91
|
<Table.Cell>
|
|
@@ -125,13 +125,15 @@ export default function QualityControlScores() {
|
|
|
125
125
|
content={formatMessage({
|
|
126
126
|
id: "score.actions.delete.confirmation.content",
|
|
127
127
|
})}
|
|
128
|
-
onConfirm={() =>
|
|
128
|
+
onConfirm={() =>
|
|
129
|
+
deleteScore({ id: `${score.id}` }).then(mutate)
|
|
130
|
+
}
|
|
129
131
|
/>
|
|
130
132
|
) : null}
|
|
131
133
|
</Table.Cell>
|
|
132
134
|
) : null}
|
|
133
135
|
</Table.Row>
|
|
134
|
-
</
|
|
136
|
+
</Fragment>
|
|
135
137
|
);
|
|
136
138
|
})}
|
|
137
139
|
</Table.Body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Menu } from "semantic-ui-react";
|
|
3
|
-
import { Link, useLocation
|
|
2
|
+
import { Link, useLocation } from "react-router";
|
|
3
|
+
import { useParams } from "react-router";
|
|
4
4
|
import { FormattedMessage } from "react-intl";
|
|
5
5
|
import { linkTo } from "@truedat/core/routes";
|
|
6
6
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
-
import { Link
|
|
4
|
+
import { Link } from "react-router";
|
|
5
|
+
import { useNavigate } from "react-router";
|
|
5
6
|
import {
|
|
6
7
|
Button,
|
|
7
8
|
Checkbox,
|
|
@@ -25,7 +26,7 @@ import QualityControlsLabelResults from "./QualityControlsLabelResults";
|
|
|
25
26
|
|
|
26
27
|
export const QualityControls = () => {
|
|
27
28
|
const { formatMessage } = useIntl();
|
|
28
|
-
const
|
|
29
|
+
const navigate = useNavigate();
|
|
29
30
|
|
|
30
31
|
const { data } = useAuthorizedAction({
|
|
31
32
|
action: "writeQualityControls",
|
|
@@ -132,7 +133,7 @@ export const QualityControls = () => {
|
|
|
132
133
|
|
|
133
134
|
triggerCreateScoreGroup(body).then(({ data }) => {
|
|
134
135
|
const id = _.prop("data.id")(data);
|
|
135
|
-
|
|
136
|
+
navigate(linkTo.SCORE_GROUP({ id }));
|
|
136
137
|
});
|
|
137
138
|
};
|
|
138
139
|
|
|
@@ -195,10 +196,11 @@ export const QualityControls = () => {
|
|
|
195
196
|
qualityControlsToExecute={_.size(selectedQualityControls)}
|
|
196
197
|
/>
|
|
197
198
|
<Dimmer.Dimmable dimmed={loading}>
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
{loading ? (
|
|
200
|
+
<Dimmer active inverted>
|
|
201
|
+
<Loader />
|
|
202
|
+
</Dimmer>
|
|
203
|
+
) : null}
|
|
202
204
|
<QualityControlsTable
|
|
203
205
|
addAll={addAll}
|
|
204
206
|
checkedAll={allChecked()}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import PropTypes from "prop-types";
|
|
3
2
|
import { FormattedMessage } from "react-intl";
|
|
4
3
|
import { Label } from "semantic-ui-react";
|
|
@@ -22,7 +21,6 @@ export const QualityControlsLabelResults = ({
|
|
|
22
21
|
/>
|
|
23
22
|
)}
|
|
24
23
|
</Label>
|
|
25
|
-
|
|
26
24
|
{!loading && executeQualityControlOn ? (
|
|
27
25
|
<Label className="quality-controls-label-results">
|
|
28
26
|
<FormattedMessage
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
|
-
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Link } from "react-router
|
|
3
|
+
import { Link } from "react-router";
|
|
5
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
6
5
|
import { Checkbox, Table, Header, Icon } from "semantic-ui-react";
|
|
7
6
|
import { linkTo } from "@truedat/core/routes";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { use } from "react";
|
|
2
2
|
import { useFormContext } from "react-hook-form";
|
|
3
3
|
import { Segment } from "semantic-ui-react";
|
|
4
4
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
@@ -10,7 +10,7 @@ import Percentage from "./scoreCriterias/Percentage";
|
|
|
10
10
|
|
|
11
11
|
export default function ScoreCriteria() {
|
|
12
12
|
const { watch } = useFormContext();
|
|
13
|
-
const context =
|
|
13
|
+
const context = use(QxContext);
|
|
14
14
|
|
|
15
15
|
const controlMode = watch("control_mode");
|
|
16
16
|
|
|
@@ -23,9 +23,9 @@ export default function ScoreCriteria() {
|
|
|
23
23
|
|
|
24
24
|
return controlMode ? (
|
|
25
25
|
<Segment>
|
|
26
|
-
<QxContext
|
|
26
|
+
<QxContext value={{ ...context, field: "score_criteria" }}>
|
|
27
27
|
{scoreCriteriaForMode[controlMode]}
|
|
28
|
-
</QxContext
|
|
28
|
+
</QxContext>
|
|
29
29
|
</Segment>
|
|
30
30
|
) : null;
|
|
31
31
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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";
|
|
3
|
+
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
|
+
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
4
5
|
import { REFERENCE_DATASETS_HEADERS_QUERY } from "@truedat/dd/api/queries";
|
|
5
6
|
import { messages } from "@truedat/qx/components/__tests__/__fixtures__/helper";
|
|
6
|
-
import TestFormWrapper from "@truedat/qx/components/common/TestFormWrapper";
|
|
7
7
|
import ControlProperties, { defaultForMode } from "../ControlProperties";
|
|
8
8
|
|
|
9
9
|
const dataSet = {
|
|
@@ -11,6 +11,7 @@ const dataSet = {
|
|
|
11
11
|
name: "dataset1",
|
|
12
12
|
headers: ["campo1", "campo2"],
|
|
13
13
|
};
|
|
14
|
+
|
|
14
15
|
const referenceDatasetsMock = {
|
|
15
16
|
request: { query: REFERENCE_DATASETS_HEADERS_QUERY },
|
|
16
17
|
result: { data: { referenceDatasets: [dataSet], loading: false } },
|
|
@@ -19,7 +20,6 @@ const referenceDatasetsMock = {
|
|
|
19
20
|
const renderOpts = {
|
|
20
21
|
mocks: [referenceDatasetsMock],
|
|
21
22
|
messages,
|
|
22
|
-
fallback: "lazy",
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const defaultValues = {
|
|
@@ -35,17 +35,14 @@ const defaultValues = {
|
|
|
35
35
|
|
|
36
36
|
describe("<ControlProperties />", () => {
|
|
37
37
|
it("matches the latest snapshot with ratio", async () => {
|
|
38
|
-
const
|
|
38
|
+
const rendered = render(
|
|
39
39
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
40
40
|
<ControlProperties />
|
|
41
41
|
</TestFormWrapper>,
|
|
42
42
|
renderOpts
|
|
43
43
|
);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
expect(container.querySelector(".loader")).not.toBeInTheDocument()
|
|
47
|
-
);
|
|
48
|
-
expect(container).toMatchSnapshot();
|
|
44
|
+
await waitForLoad(rendered);
|
|
45
|
+
expect(rendered.container).toMatchSnapshot();
|
|
49
46
|
});
|
|
50
47
|
|
|
51
48
|
it("matches the latest snapshot with count", async () => {
|
|
@@ -53,16 +50,14 @@ describe("<ControlProperties />", () => {
|
|
|
53
50
|
...defaultValues,
|
|
54
51
|
control_mode: "count",
|
|
55
52
|
};
|
|
56
|
-
const
|
|
53
|
+
const rendered = render(
|
|
57
54
|
<TestFormWrapper defaultValues={countDefaultValues}>
|
|
58
55
|
<ControlProperties />
|
|
59
56
|
</TestFormWrapper>,
|
|
60
57
|
renderOpts
|
|
61
58
|
);
|
|
62
|
-
await
|
|
63
|
-
|
|
64
|
-
);
|
|
65
|
-
expect(container).toMatchSnapshot();
|
|
59
|
+
await waitForLoad(rendered);
|
|
60
|
+
expect(rendered.container).toMatchSnapshot();
|
|
66
61
|
});
|
|
67
62
|
});
|
|
68
63
|
|