@truedat/qx 8.6.7 → 8.7.1
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
|
@@ -5,7 +5,7 @@ import { Divider, Header, Form, Segment } from "semantic-ui-react";
|
|
|
5
5
|
import { useFormContext, Controller } from "react-hook-form";
|
|
6
6
|
|
|
7
7
|
const SourceSelector = lazy(
|
|
8
|
-
() => import("@truedat/cx/sources/components/SourceSelector")
|
|
8
|
+
() => import("@truedat/cx/sources/components/SourceSelector"),
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
const InformationForm = ({
|
|
@@ -34,7 +34,7 @@ const InformationForm = ({
|
|
|
34
34
|
rules={{
|
|
35
35
|
required: formatMessage(
|
|
36
36
|
{ id: "form.validation.required" },
|
|
37
|
-
{ prop: formatMessage({ id: "dataViews.form.name" }) }
|
|
37
|
+
{ prop: formatMessage({ id: "dataViews.form.name" }) },
|
|
38
38
|
),
|
|
39
39
|
}}
|
|
40
40
|
render={({
|
|
@@ -16,7 +16,7 @@ export default function SelectionForm({ setStepInformation, stepInformation }) {
|
|
|
16
16
|
|
|
17
17
|
const fields = _.flow(
|
|
18
18
|
_.map.convert({ cap: false })((q, id) => ({ ...q, id })),
|
|
19
|
-
reduceQueryableFields(formatMessage)
|
|
19
|
+
reduceQueryableFields(formatMessage),
|
|
20
20
|
)(queryables);
|
|
21
21
|
|
|
22
22
|
useEffect(() => {
|
|
@@ -5,12 +5,12 @@ import { Button, Divider, Grid, Icon, Form, Step } from "semantic-ui-react";
|
|
|
5
5
|
import { FormProvider, useForm, useFieldArray } from "react-hook-form";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
8
|
+
import CancelButton from "../actions/CancelButton";
|
|
9
|
+
import DataViewSummary from "../DataViewSummary";
|
|
8
10
|
import InformationForm from "./InformationForm";
|
|
9
11
|
import DatasetForm from "./DatasetForm";
|
|
10
12
|
import AggregationForm from "./AggregationForm";
|
|
11
13
|
import SelectionForm from "./SelectionForm";
|
|
12
|
-
import CancelButton from "../actions/CancelButton";
|
|
13
|
-
import DataViewSummary from "../DataViewSummary";
|
|
14
14
|
|
|
15
15
|
export default function SimpleDataViewEditor({
|
|
16
16
|
selectedDataView,
|
|
@@ -54,7 +54,7 @@ export default function SimpleDataViewEditor({
|
|
|
54
54
|
const ok = await trigger(stepInformation[step]["fieldNames"]);
|
|
55
55
|
const content = ok ? { status: "valid" } : { status: "error" };
|
|
56
56
|
return [step, content];
|
|
57
|
-
})(steps)
|
|
57
|
+
})(steps),
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
setStepState({ ...stepState, ..._.fromPairs(validations) });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { List, Header, Icon, Label, Segment } from "semantic-ui-react";
|
|
4
|
+
import { ExpressionViewer } from "@truedat/qx/components/common/ClauseViewer";
|
|
4
5
|
import {
|
|
5
6
|
getAggregateFields,
|
|
6
7
|
getGroupByFields,
|
|
7
8
|
} from "../queryableSummaryHelpers";
|
|
8
9
|
import { getColorById } from "../queryableFunctions";
|
|
9
|
-
import { ExpressionViewer } from "@truedat/qx/components/common/ClauseViewer";
|
|
10
10
|
|
|
11
11
|
export default function GroupBy({ queryable }) {
|
|
12
12
|
const { formatMessage } = useIntl();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { List, Icon, Label, Header, Segment } from "semantic-ui-react";
|
|
4
|
-
import { getJoinInfo } from "../queryableSummaryHelpers";
|
|
5
4
|
import ClauseViewer from "@truedat/qx/components/common/ClauseViewer";
|
|
5
|
+
import { getJoinInfo } from "../queryableSummaryHelpers";
|
|
6
6
|
import JoinTypeIcon from "../queryableProperties/JoinTypeIcon";
|
|
7
7
|
import { getColorById } from "../queryableFunctions";
|
|
8
8
|
import "@truedat/qx/styles/Expression.less";
|
|
@@ -12,55 +12,57 @@ export default function Join({ queryable }) {
|
|
|
12
12
|
const joinResource = getJoinInfo(queryable);
|
|
13
13
|
const color = getColorById(queryable.id);
|
|
14
14
|
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
<List
|
|
26
|
-
<List.
|
|
27
|
-
<List.
|
|
28
|
-
<
|
|
29
|
-
<div
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{joinResource.name}
|
|
44
|
-
</Label>
|
|
45
|
-
</div>
|
|
46
|
-
{joinResource.alias && (
|
|
47
|
-
<>
|
|
48
|
-
<b style={{ marginRight: 4, marginLeft: 4 }}>as</b>
|
|
15
|
+
return (
|
|
16
|
+
joinResource && (
|
|
17
|
+
<>
|
|
18
|
+
<Header as="h5">
|
|
19
|
+
<Icon name="linkify" size="small" />
|
|
20
|
+
<Header.Content>
|
|
21
|
+
{formatMessage({ id: "dataViews.form.queryable.join" })}
|
|
22
|
+
</Header.Content>
|
|
23
|
+
</Header>
|
|
24
|
+
<Segment>
|
|
25
|
+
<List size="big">
|
|
26
|
+
<List.Item>
|
|
27
|
+
<List.Content>
|
|
28
|
+
<List.Description className="description-flex-wrap text-break-word">
|
|
29
|
+
<div style={{ display: "flex", rowGap: 5, flexWrap: "wrap" }}>
|
|
30
|
+
<div
|
|
31
|
+
style={{
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<JoinTypeIcon type={joinResource.joinType} />
|
|
37
|
+
<Label horizontal>
|
|
38
|
+
{formatMessage({
|
|
39
|
+
id: `queryables.resource.selector.${joinResource.type}`,
|
|
40
|
+
})}
|
|
41
|
+
</Label>
|
|
42
|
+
</div>
|
|
49
43
|
<Label color={color} className="text-break-word">
|
|
50
|
-
{joinResource.
|
|
44
|
+
{joinResource.name}
|
|
51
45
|
</Label>
|
|
52
|
-
</>
|
|
53
|
-
)}
|
|
54
|
-
{joinResource.clauses && _.size(joinResource.clauses) > 0 && (
|
|
55
|
-
<div style={{ marginTop: 4, width: "100%" }}>
|
|
56
|
-
<ClauseViewer clause={joinResource.clauses} />
|
|
57
46
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
{joinResource.alias && (
|
|
48
|
+
<>
|
|
49
|
+
<b style={{ marginRight: 4, marginLeft: 4 }}>as</b>
|
|
50
|
+
<Label color={color} className="text-break-word">
|
|
51
|
+
{joinResource.alias}
|
|
52
|
+
</Label>
|
|
53
|
+
</>
|
|
54
|
+
)}
|
|
55
|
+
{joinResource.clauses && _.size(joinResource.clauses) > 0 && (
|
|
56
|
+
<div style={{ marginTop: 4, width: "100%" }}>
|
|
57
|
+
<ClauseViewer clause={joinResource.clauses} />
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
</List.Description>
|
|
61
|
+
</List.Content>
|
|
62
|
+
</List.Item>
|
|
63
|
+
</List>
|
|
64
|
+
</Segment>
|
|
65
|
+
</>
|
|
66
|
+
)
|
|
65
67
|
);
|
|
66
68
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useIntl } from "react-intl";
|
|
3
3
|
import { List, Header, Icon, Segment } from "semantic-ui-react";
|
|
4
|
-
import { getSelectFields } from "../queryableSummaryHelpers";
|
|
5
4
|
import { ExpressionViewer } from "@truedat/qx/components/common/ClauseViewer";
|
|
5
|
+
import { getSelectFields } from "../queryableSummaryHelpers";
|
|
6
6
|
|
|
7
7
|
export default function Select({ queryable }) {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
@@ -14,7 +14,12 @@ const hasValidClauses = (clauses) => {
|
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
_.size(expressions) > 0 &&
|
|
17
|
-
_.some(
|
|
17
|
+
_.some(
|
|
18
|
+
(expr) =>
|
|
19
|
+
!_.isNil(expr?.value?.name) &&
|
|
20
|
+
(!_.isNil(expr?.value?.args?.arg1?.value) ||
|
|
21
|
+
!_.isNil(expr?.value?.args?.arg2?.value)),
|
|
22
|
+
)(expressions)
|
|
18
23
|
);
|
|
19
24
|
})(clauses);
|
|
20
25
|
};
|
|
@@ -65,7 +65,7 @@ export default function FunctionEditor({
|
|
|
65
65
|
rules={{
|
|
66
66
|
required: formatMessage(
|
|
67
67
|
{ id: "form.validation.required" },
|
|
68
|
-
{ prop: formatMessage({ id: "functions.form.name" }) }
|
|
68
|
+
{ prop: formatMessage({ id: "functions.form.name" }) },
|
|
69
69
|
),
|
|
70
70
|
}}
|
|
71
71
|
render={({
|
|
@@ -85,14 +85,14 @@ describe("<FunctionEditor />", () => {
|
|
|
85
85
|
await user.click(rendered.getByRole("option", { name: /true/i }));
|
|
86
86
|
|
|
87
87
|
await waitFor(() =>
|
|
88
|
-
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled()
|
|
88
|
+
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled(),
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
await user.click(rendered.getByRole("button", { name: /cancel/i }));
|
|
92
92
|
expect(onCancel).toHaveBeenCalledTimes(0);
|
|
93
93
|
|
|
94
94
|
await user.click(
|
|
95
|
-
rendered.getByRole("button", { name: /modal-negative-action/i })
|
|
95
|
+
rendered.getByRole("button", { name: /modal-negative-action/i }),
|
|
96
96
|
);
|
|
97
97
|
expect(onCancel).toHaveBeenCalledTimes(0);
|
|
98
98
|
|
|
@@ -102,7 +102,7 @@ describe("<FunctionEditor />", () => {
|
|
|
102
102
|
expect(rendered.container).toMatchSnapshot();
|
|
103
103
|
|
|
104
104
|
await user.click(
|
|
105
|
-
rendered.getByRole("button", { name: /modal-affirmative-action/i })
|
|
105
|
+
rendered.getByRole("button", { name: /modal-affirmative-action/i }),
|
|
106
106
|
);
|
|
107
107
|
expect(onCancel).toHaveBeenCalledTimes(1);
|
|
108
108
|
});
|
|
@@ -118,7 +118,7 @@ describe("<FunctionEditor />", () => {
|
|
|
118
118
|
expect(onDelete).toHaveBeenCalledTimes(0);
|
|
119
119
|
|
|
120
120
|
await user.click(
|
|
121
|
-
rendered.getByRole("button", { name: /modal-negative-action/i })
|
|
121
|
+
rendered.getByRole("button", { name: /modal-negative-action/i }),
|
|
122
122
|
);
|
|
123
123
|
expect(onDelete).toHaveBeenCalledTimes(0);
|
|
124
124
|
|
|
@@ -128,7 +128,7 @@ describe("<FunctionEditor />", () => {
|
|
|
128
128
|
expect(rendered.container).toMatchSnapshot();
|
|
129
129
|
|
|
130
130
|
await user.click(
|
|
131
|
-
rendered.getByRole("button", { name: /modal-affirmative-action/i })
|
|
131
|
+
rendered.getByRole("button", { name: /modal-affirmative-action/i }),
|
|
132
132
|
);
|
|
133
133
|
expect(onDelete).toHaveBeenCalledTimes(1);
|
|
134
134
|
});
|
|
@@ -147,13 +147,13 @@ describe("<FunctionEditor />", () => {
|
|
|
147
147
|
await user.click(rendered.getByRole("option", { name: /true/i }));
|
|
148
148
|
|
|
149
149
|
await waitFor(() =>
|
|
150
|
-
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled()
|
|
150
|
+
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled(),
|
|
151
151
|
);
|
|
152
152
|
|
|
153
153
|
await user.click(rendered.getByRole("button", { name: /save/i }));
|
|
154
154
|
|
|
155
155
|
await waitFor(() =>
|
|
156
|
-
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled()
|
|
156
|
+
expect(rendered.getByRole("button", { name: /save/i })).toBeEnabled(),
|
|
157
157
|
);
|
|
158
158
|
|
|
159
159
|
expect(onSubmit.mock.calls[0][0]).toEqual({
|
|
@@ -9,7 +9,7 @@ describe("<FunctionParams />", () => {
|
|
|
9
9
|
const rendered = render(
|
|
10
10
|
<TestFormWrapper>
|
|
11
11
|
<FunctionParams />
|
|
12
|
-
</TestFormWrapper
|
|
12
|
+
</TestFormWrapper>,
|
|
13
13
|
);
|
|
14
14
|
await waitForLoad(rendered);
|
|
15
15
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -22,7 +22,7 @@ describe("<FunctionParams />", () => {
|
|
|
22
22
|
const rendered = render(
|
|
23
23
|
<TestFormWrapper defaultValues={defaultValues}>
|
|
24
24
|
<FunctionParams />
|
|
25
|
-
</TestFormWrapper
|
|
25
|
+
</TestFormWrapper>,
|
|
26
26
|
);
|
|
27
27
|
await waitForLoad(rendered);
|
|
28
28
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -38,11 +38,11 @@ describe("<FunctionParams />", () => {
|
|
|
38
38
|
const rendered = render(
|
|
39
39
|
<TestFormWrapper watcher={watcher}>
|
|
40
40
|
<FunctionParams />
|
|
41
|
-
</TestFormWrapper
|
|
41
|
+
</TestFormWrapper>,
|
|
42
42
|
);
|
|
43
43
|
await waitForLoad(rendered);
|
|
44
44
|
await user.click(
|
|
45
|
-
rendered.getByRole("button", { name: /functions.form.add_param/i })
|
|
45
|
+
rendered.getByRole("button", { name: /functions.form.add_param/i }),
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
const nameInput = () =>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { lazy, use } from "react";
|
|
2
2
|
import { Header } from "semantic-ui-react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import QxContext from "../QxContext";
|
|
5
4
|
import { makeTagOptionsSelector } from "@truedat/core/selectors";
|
|
6
5
|
import { linkTo } from "@truedat/core/routes";
|
|
6
|
+
import QxContext from "../QxContext";
|
|
7
7
|
|
|
8
8
|
const ConceptLinkForm = lazy(
|
|
9
|
-
() => import("@truedat/lm/components/ConceptLinkForm")
|
|
9
|
+
() => import("@truedat/lm/components/ConceptLinkForm"),
|
|
10
10
|
);
|
|
11
11
|
|
|
12
12
|
const selectTagOptions = makeTagOptionsSelector("quality_control");
|
|
@@ -2,7 +2,7 @@ import { lazy, use } from "react";
|
|
|
2
2
|
import QxContext from "../QxContext";
|
|
3
3
|
|
|
4
4
|
const QualityControlConcepts = lazy(
|
|
5
|
-
() => import("@truedat/lm/components/QualityControlConcepts")
|
|
5
|
+
() => import("@truedat/lm/components/QualityControlConcepts"),
|
|
6
6
|
);
|
|
7
7
|
|
|
8
8
|
const ConceptLinks = () => {
|
|
@@ -5,32 +5,34 @@ import { FormattedMessage } from "react-intl";
|
|
|
5
5
|
import { Header, Icon } from "semantic-ui-react";
|
|
6
6
|
|
|
7
7
|
const DynamicFormViewer = lazy(
|
|
8
|
-
|
|
8
|
+
() => import("@truedat/df/components/DynamicFormViewer"),
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
export default function ContentSummary({ qualityControl }) {
|
|
12
|
-
|
|
12
|
+
if (!qualityControl) return null;
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const { df_type, dynamic_content, domain_ids } = qualityControl;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
return (
|
|
17
|
+
df_type && (
|
|
18
|
+
<>
|
|
19
|
+
<Header as="h5">
|
|
20
|
+
<Icon name="info" size="small" />
|
|
21
|
+
<Header.Content>
|
|
22
|
+
<FormattedMessage id="quality_control.form.information" />
|
|
23
|
+
</Header.Content>
|
|
24
|
+
</Header>
|
|
25
|
+
<DynamicFormViewer
|
|
26
|
+
boxLayout
|
|
27
|
+
template={df_type}
|
|
28
|
+
content={dynamic_content}
|
|
29
|
+
domainIds={domain_ids}
|
|
30
|
+
/>
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
ContentSummary.propTypes = {
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
+
qualityControl: PropTypes.object,
|
|
38
|
+
};
|
|
@@ -2,8 +2,8 @@ import { use, lazy } from "react";
|
|
|
2
2
|
import { Controller, useFormContext } from "react-hook-form";
|
|
3
3
|
import { Form, Segment } from "semantic-ui-react";
|
|
4
4
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
5
|
-
import ResourceWithValidation from "./controlProperties/ResourceWithValidation";
|
|
6
5
|
import { useIntl } from "react-intl";
|
|
6
|
+
import ResourceWithValidation from "./controlProperties/ResourceWithValidation";
|
|
7
7
|
|
|
8
8
|
const SourceSelector = lazy(
|
|
9
9
|
() => import("@truedat/cx/sources/components/SourceSelector"),
|
|
@@ -4,8 +4,8 @@ import { FormattedMessage } from "react-intl";
|
|
|
4
4
|
import { Header, Icon, Segment, List, Label } from "semantic-ui-react";
|
|
5
5
|
import { Loading } from "@truedat/core/components";
|
|
6
6
|
import ClauseViewer from "@truedat/qx/components/common/ClauseViewer";
|
|
7
|
-
import DataViewSummary from "../dataViews/DataViewSummary";
|
|
8
7
|
import { useDataViewFetch } from "@truedat/qx/hooks/useDataViews";
|
|
8
|
+
import DataViewSummary from "../dataViews/DataViewSummary";
|
|
9
9
|
import { getColorById } from "../dataViews/queryableFunctions";
|
|
10
10
|
|
|
11
11
|
const ratioViewProps = {
|
|
@@ -16,7 +16,7 @@ export default function EditQualityControl() {
|
|
|
16
16
|
const { trigger, isMutating } = useQualityControlUpdateDraft(id);
|
|
17
17
|
const { data, loading: qualityControlLoading } = useQualityControl(
|
|
18
18
|
id,
|
|
19
|
-
version
|
|
19
|
+
version,
|
|
20
20
|
);
|
|
21
21
|
const qualityControl = data?.data;
|
|
22
22
|
const loading = qualityControlLoading || isMutating;
|
|
@@ -38,7 +38,7 @@ const ConfirmToggleActiveModal = ({ onConfirm, qualityControl }) => {
|
|
|
38
38
|
size="small"
|
|
39
39
|
content={formatMessage(
|
|
40
40
|
{ id: `quality_controls.actions.${action}.confirmation.content` },
|
|
41
|
-
{ name: <i>{name}</i> }
|
|
41
|
+
{ name: <i>{name}</i> },
|
|
42
42
|
)}
|
|
43
43
|
onConfirm={() => onConfirm()}
|
|
44
44
|
/>
|
|
@@ -70,7 +70,7 @@ const ConfirmDeletionModal = ({ qualityControl, onConfirm }) => {
|
|
|
70
70
|
size="small"
|
|
71
71
|
content={formatMessage(
|
|
72
72
|
{ id: `quality_controls.actions.delete.confirmation.content` },
|
|
73
|
-
{ name: <i>{name}</i> }
|
|
73
|
+
{ name: <i>{name}</i> },
|
|
74
74
|
)}
|
|
75
75
|
onConfirm={() => onConfirm()}
|
|
76
76
|
/>
|
|
@@ -121,7 +121,7 @@ export default function QualityControlActions() {
|
|
|
121
121
|
"execute",
|
|
122
122
|
"link_to_business_concept",
|
|
123
123
|
"link_to_data_structure",
|
|
124
|
-
])
|
|
124
|
+
]),
|
|
125
125
|
),
|
|
126
126
|
_.map((action) => {
|
|
127
127
|
const actionIcon = {
|
|
@@ -175,7 +175,7 @@ export default function QualityControlActions() {
|
|
|
175
175
|
onClick: () => updateStatus(action),
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
})
|
|
178
|
+
}),
|
|
179
179
|
)(actions);
|
|
180
180
|
|
|
181
181
|
const onCreateScoreGroup = ({ content, df_type }) => {
|
|
@@ -4,9 +4,7 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { useIntl } from "react-intl";
|
|
5
5
|
import { Button, Divider, Grid, Icon, Form, Step } from "semantic-ui-react";
|
|
6
6
|
import { FormProvider, useForm } from "react-hook-form";
|
|
7
|
-
import {
|
|
8
|
-
ConfirmModal,
|
|
9
|
-
} from "@truedat/core/components";
|
|
7
|
+
import { ConfirmModal } from "@truedat/core/components";
|
|
10
8
|
import useActionDomains from "@truedat/core/hooks/useActionDomains";
|
|
11
9
|
import QxContext from "@truedat/qx/components/QxContext";
|
|
12
10
|
import { fieldsFromResource } from "@truedat/qx/components/dataViews/queryableFunctions";
|
|
@@ -29,10 +27,9 @@ export default function QualityControlEditor({
|
|
|
29
27
|
const [activeStep, setActiveStep] = useState(0);
|
|
30
28
|
const [stepInformation, setStepInformation] = useState({});
|
|
31
29
|
const [stepState, setStepState] = useState({});
|
|
32
|
-
const { data: domainsData, loading: loadingDomains } =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
30
|
+
const { data: domainsData, loading: loadingDomains } = useActionDomains({
|
|
31
|
+
action: "publishQualityControls",
|
|
32
|
+
});
|
|
36
33
|
const domains = _.propOr([], "domains")(domainsData);
|
|
37
34
|
const { data: functionsData } = useFunctions();
|
|
38
35
|
const functions = functionsData?.data;
|
|
@@ -50,7 +47,7 @@ export default function QualityControlEditor({
|
|
|
50
47
|
const { domain_ids: domainIds } = formData;
|
|
51
48
|
|
|
52
49
|
const allowedToPublish = _.every((domainId) =>
|
|
53
|
-
_.find({ id: `${domainId}` })(domains)
|
|
50
|
+
_.find({ id: `${domainId}` })(domains),
|
|
54
51
|
)(domainIds);
|
|
55
52
|
|
|
56
53
|
const updateStepInformation = (key, data) =>
|
|
@@ -62,7 +59,7 @@ export default function QualityControlEditor({
|
|
|
62
59
|
const ok = await trigger(stepInformation[step]["fieldNames"]);
|
|
63
60
|
const content = ok ? { status: "valid" } : { status: "error" };
|
|
64
61
|
return [step, content];
|
|
65
|
-
})(steps)
|
|
62
|
+
})(steps),
|
|
66
63
|
);
|
|
67
64
|
|
|
68
65
|
setStepState({ ...stepState, ..._.fromPairs(validations) });
|
|
@@ -126,12 +123,10 @@ export default function QualityControlEditor({
|
|
|
126
123
|
};
|
|
127
124
|
|
|
128
125
|
const controlProperties = watch("control_properties");
|
|
129
|
-
const resource =
|
|
126
|
+
const resource =
|
|
127
|
+
controlProperties?.resource || controlProperties?.errors_resource;
|
|
130
128
|
|
|
131
|
-
const fields = fieldsFromResource(
|
|
132
|
-
resource?.embedded?.name,
|
|
133
|
-
0
|
|
134
|
-
)({ resource });
|
|
129
|
+
const fields = fieldsFromResource(resource?.embedded?.name, 0)({ resource });
|
|
135
130
|
|
|
136
131
|
const currentQualityControl = watch();
|
|
137
132
|
|
|
@@ -188,18 +183,14 @@ export default function QualityControlEditor({
|
|
|
188
183
|
/>
|
|
189
184
|
</div>
|
|
190
185
|
<QxContext value={{ fields, functions }}>
|
|
191
|
-
<div
|
|
192
|
-
style={{ display: activeStep == 1 ? "block" : "none" }}
|
|
193
|
-
>
|
|
186
|
+
<div style={{ display: activeStep == 1 ? "block" : "none" }}>
|
|
194
187
|
<ControlPropertiesForm
|
|
195
188
|
isModification={isModification}
|
|
196
189
|
stepInformation={stepInformation[1]}
|
|
197
190
|
setStepInformation={updateStepInformation}
|
|
198
191
|
/>
|
|
199
192
|
</div>
|
|
200
|
-
<div
|
|
201
|
-
style={{ display: activeStep == 2 ? "block" : "none" }}
|
|
202
|
-
>
|
|
193
|
+
<div style={{ display: activeStep == 2 ? "block" : "none" }}>
|
|
203
194
|
<SegmentationForm
|
|
204
195
|
stepInformation={stepInformation[2]}
|
|
205
196
|
setStepInformation={updateStepInformation}
|
|
@@ -4,10 +4,10 @@ import { useEvents } from "@truedat/audit/hooks/useEvents";
|
|
|
4
4
|
import { useTemplate } from "@truedat/core/hooks";
|
|
5
5
|
import PropTypes from "prop-types";
|
|
6
6
|
import { use, useMemo } from "react";
|
|
7
|
-
import QxContext from "../QxContext";
|
|
8
|
-
import { getParsedEvents } from "./events/getParsedEvents";
|
|
9
7
|
import { useIntl } from "react-intl";
|
|
10
8
|
import Moment from "react-moment";
|
|
9
|
+
import QxContext from "../QxContext";
|
|
10
|
+
import { getParsedEvents } from "./events/getParsedEvents";
|
|
11
11
|
|
|
12
12
|
const MESSAGE_ID = 0;
|
|
13
13
|
const MESSAGE_PARAMS = 1;
|
|
@@ -55,10 +55,10 @@ export default function QualityControlHeader({ children }) {
|
|
|
55
55
|
searchRelations(structureLinksPayload),
|
|
56
56
|
]).then(([conceptResponse, structureResponse]) => {
|
|
57
57
|
const conceptCount = parseInt(
|
|
58
|
-
conceptResponse?.headers?.["x-total-count"] || "0"
|
|
58
|
+
conceptResponse?.headers?.["x-total-count"] || "0",
|
|
59
59
|
);
|
|
60
60
|
const structureCount = parseInt(
|
|
61
|
-
structureResponse?.headers?.["x-total-count"] || "0"
|
|
61
|
+
structureResponse?.headers?.["x-total-count"] || "0",
|
|
62
62
|
);
|
|
63
63
|
setConceptLinkCount(conceptCount);
|
|
64
64
|
setStructureLinkCount(structureCount);
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
useQualityControlsSearch,
|
|
17
17
|
useQualityControlsFilters,
|
|
18
18
|
} from "../../hooks/useQualityControls";
|
|
19
|
+
import { ScoreContextProvider } from "../scores/ScoreContext";
|
|
19
20
|
import QualityControls from "./QualityControls";
|
|
20
21
|
import QualityControl from "./QualityControl";
|
|
21
22
|
import QualityControlHeader from "./QualityControlHeader";
|
|
@@ -28,7 +29,6 @@ import ConceptLinks from "./ConceptLinks";
|
|
|
28
29
|
import ConceptLinkNew from "./ConceptLinkNew";
|
|
29
30
|
import StructureLinks from "./StructureLinks";
|
|
30
31
|
import StructureLinkNew from "./StructureLinkNew";
|
|
31
|
-
import { ScoreContextProvider } from "../scores/ScoreContext";
|
|
32
32
|
import QualityControlEvents from "./QualityControlEvents";
|
|
33
33
|
|
|
34
34
|
const LoaderQualityControlScores = () => {
|
|
@@ -71,7 +71,7 @@ export function QualityControlScores({ columns }) {
|
|
|
71
71
|
const versionsMap = _.flow(
|
|
72
72
|
_.prop("versions"),
|
|
73
73
|
_.map((qcv) => [qcv.version_id, qcv]),
|
|
74
|
-
_.fromPairs
|
|
74
|
+
_.fromPairs,
|
|
75
75
|
)(qualityControl);
|
|
76
76
|
|
|
77
77
|
const scoreRows = _.flow(
|
|
@@ -84,9 +84,9 @@ export function QualityControlScores({ columns }) {
|
|
|
84
84
|
...score,
|
|
85
85
|
quality_control: qcv,
|
|
86
86
|
firstInVersion: indexWithinVersion == 0,
|
|
87
|
-
}))
|
|
87
|
+
})),
|
|
88
88
|
),
|
|
89
|
-
_.reduce((acc, versionScores) => [...acc, ...versionScores], [])
|
|
89
|
+
_.reduce((acc, versionScores) => [...acc, ...versionScores], []),
|
|
90
90
|
)(scores);
|
|
91
91
|
|
|
92
92
|
return loading ? (
|
|
@@ -31,7 +31,7 @@ function QualityControlSelectorContent({
|
|
|
31
31
|
const handleSelect = (qualityControl) => {
|
|
32
32
|
if (disabled) return;
|
|
33
33
|
const selectedQualityControl = _.find(
|
|
34
|
-
(qc) => qc.quality_control_id === qualityControl.quality_control_id
|
|
34
|
+
(qc) => qc.quality_control_id === qualityControl.quality_control_id,
|
|
35
35
|
)(qualityControls);
|
|
36
36
|
setSelectedQualityControl(qualityControl);
|
|
37
37
|
onSelect && onSelect(selectedQualityControl || qualityControl);
|