@truedat/dq 4.43.0 → 4.43.3
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/CHANGELOG.md +22 -3
- package/package.json +5 -5
- package/src/api.js +2 -0
- package/src/components/ConditionSummary.js +1 -0
- package/src/components/FieldSummary.js +86 -0
- package/src/components/ImplementationSummary.js +11 -1
- package/src/components/NewRemediation.js +27 -20
- package/src/components/NewRuleImplementation.js +42 -6
- package/src/components/RemediationPlan.js +47 -78
- package/src/components/RuleImplementationProperties.js +2 -1
- package/src/components/RuleImplementationResultTabs.js +113 -0
- package/src/components/RuleImplementationResults.js +1 -1
- package/src/components/RuleResult.js +108 -0
- package/src/components/{ExecutionDetails.js → RuleResultDetails.js} +4 -21
- package/src/components/RuleResultRemediationLoader.js +44 -0
- package/src/components/RuleResultRemediations.js +47 -0
- package/src/components/RuleResultRow.js +0 -3
- package/src/components/RuleResultSegmentRow.js +83 -0
- package/src/components/RuleResultSegments.js +102 -0
- package/src/components/RuleResultSegmentsLoader.js +34 -0
- package/src/components/RuleResultsRoutes.js +73 -0
- package/src/components/RuleRoutes.js +4 -14
- package/src/components/RuleSelector.js +5 -2
- package/src/components/__test_samples__/NewRuleImplementationProps.js +22 -2
- package/src/components/__tests__/ExecutionDetails.spec.js +5 -5
- package/src/components/__tests__/NewRuleImplementation.spec.js +27 -7
- package/src/components/__tests__/RuleResultSegmentsLoader.spec.js +32 -0
- package/src/components/__tests__/__snapshots__/ExecutionDetails.spec.js.snap +2 -30
- package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +1211 -1217
- package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -0
- package/src/components/index.js +2 -2
- package/src/components/ruleImplementationForm/DatasetForm.js +4 -1
- package/src/components/ruleImplementationForm/FieldsGrid.js +57 -0
- package/src/components/ruleImplementationForm/FieldsGroup.js +107 -0
- package/src/components/ruleImplementationForm/RuleImplementationForm.js +45 -0
- package/src/components/ruleImplementationForm/SegmentsForm.js +35 -0
- package/src/components/ruleImplementationForm/__tests__/DataSetForm.spec.js +0 -1
- package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +27 -10
- package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +315 -91
- package/src/messages/en.js +7 -0
- package/src/messages/es.js +7 -0
- package/src/reducers/__tests__/segmentResult.spec.js +46 -0
- package/src/reducers/index.js +2 -0
- package/src/reducers/ruleImplementation.js +1 -0
- package/src/reducers/segmentResults.js +19 -0
- package/src/routines.js +3 -0
- package/src/sagas/__tests__/fetchSegmentResults.spec.js +78 -0
- package/src/sagas/fetchSegmentResults.js +30 -0
- package/src/sagas/index.js +3 -0
- package/src/services/encodeRawContent.js +5 -5
- package/src/styles/remediationPlan.less +5 -0
- package/src/styles/ruleImplementationForm/DatasetForm.less +5 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { compile } from "path-to-regexp";
|
|
2
|
+
import { call, put, takeLatest } from "redux-saga/effects";
|
|
3
|
+
import { apiJson, JSON_OPTS } from "@truedat/core/services/api";
|
|
4
|
+
import { fetchSegmentResults } from "../routines";
|
|
5
|
+
import { API_SEGMENT_RESULTS } from "../api";
|
|
6
|
+
|
|
7
|
+
export function* fetchSegmentResultsSaga({ payload }) {
|
|
8
|
+
try {
|
|
9
|
+
const { rule_result_id } = payload;
|
|
10
|
+
const url = compile(API_SEGMENT_RESULTS)({
|
|
11
|
+
rule_result_id,
|
|
12
|
+
});
|
|
13
|
+
yield put(fetchSegmentResults.request());
|
|
14
|
+
const { data } = yield call(apiJson, url, JSON_OPTS);
|
|
15
|
+
yield put(fetchSegmentResults.success(data));
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (error.response) {
|
|
18
|
+
const { status, data } = error.response;
|
|
19
|
+
yield put(fetchSegmentResults.failure({ status, data }));
|
|
20
|
+
} else {
|
|
21
|
+
yield put(fetchSegmentResults.failure(error.message));
|
|
22
|
+
}
|
|
23
|
+
} finally {
|
|
24
|
+
yield put(fetchSegmentResults.fulfill());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function* fetchSegmentResultsRequestSaga() {
|
|
29
|
+
yield takeLatest(fetchSegmentResults.TRIGGER, fetchSegmentResultsSaga);
|
|
30
|
+
}
|
package/src/sagas/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { fetchRuleImplementationRequestSaga } from "./fetchRuleImplementation";
|
|
|
17
17
|
import { fetchRuleImplementationsRequestSaga } from "./fetchRuleImplementations";
|
|
18
18
|
import { fetchRuleRequestSaga } from "./fetchRule";
|
|
19
19
|
import { fetchRulesRequestSaga } from "./fetchRules";
|
|
20
|
+
import { fetchSegmentResultsRequestSaga } from "./fetchSegmentResults";
|
|
20
21
|
import { searchRuleImplementationsRequestSaga } from "./searchRuleImplementations";
|
|
21
22
|
import { setRuleImplementationStatusRequestSaga } from "./setRuleImplementationStatus";
|
|
22
23
|
import { updateRemediationRequestSaga } from "./updateRemediation";
|
|
@@ -46,6 +47,7 @@ export {
|
|
|
46
47
|
fetchRuleImplementationsRequestSaga,
|
|
47
48
|
fetchRuleRequestSaga,
|
|
48
49
|
fetchRulesRequestSaga,
|
|
50
|
+
fetchSegmentResultsRequestSaga,
|
|
49
51
|
searchRuleImplementationsRequestSaga,
|
|
50
52
|
setRuleImplementationStatusRequestSaga,
|
|
51
53
|
updateRemediationRequestSaga,
|
|
@@ -76,6 +78,7 @@ export default [
|
|
|
76
78
|
fetchRuleImplementationsRequestSaga(),
|
|
77
79
|
fetchRuleRequestSaga(),
|
|
78
80
|
fetchRulesRequestSaga(),
|
|
81
|
+
fetchSegmentResultsRequestSaga(),
|
|
79
82
|
searchRuleImplementationsRequestSaga(),
|
|
80
83
|
setRuleImplementationStatusRequestSaga(),
|
|
81
84
|
updateRemediationRequestSaga(),
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
|
|
3
|
-
const encodeValue = value => (_.isNil(value) ? value : btoa(value));
|
|
3
|
+
const encodeValue = (value) => (_.isNil(value) ? value : btoa(value));
|
|
4
4
|
|
|
5
|
-
const encodeProps = o =>
|
|
5
|
+
const encodeProps = (o) =>
|
|
6
6
|
_.flow(
|
|
7
|
-
_.pick(["dataset", "population", "validations"]),
|
|
7
|
+
_.pick(["dataset", "population", "validations", "segments"]),
|
|
8
8
|
_.mapValues(encodeValue),
|
|
9
9
|
_.assign(o)
|
|
10
10
|
)(o);
|
|
11
11
|
|
|
12
|
-
export const encodeRawContent = ruleImplementation =>
|
|
12
|
+
export const encodeRawContent = (ruleImplementation) =>
|
|
13
13
|
_.has("raw_content.dataset")(ruleImplementation)
|
|
14
14
|
? {
|
|
15
15
|
...ruleImplementation,
|
|
16
|
-
raw_content: encodeProps(ruleImplementation.raw_content)
|
|
16
|
+
raw_content: encodeProps(ruleImplementation.raw_content),
|
|
17
17
|
}
|
|
18
18
|
: ruleImplementation;
|