@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.
Files changed (52) hide show
  1. package/CHANGELOG.md +22 -3
  2. package/package.json +5 -5
  3. package/src/api.js +2 -0
  4. package/src/components/ConditionSummary.js +1 -0
  5. package/src/components/FieldSummary.js +86 -0
  6. package/src/components/ImplementationSummary.js +11 -1
  7. package/src/components/NewRemediation.js +27 -20
  8. package/src/components/NewRuleImplementation.js +42 -6
  9. package/src/components/RemediationPlan.js +47 -78
  10. package/src/components/RuleImplementationProperties.js +2 -1
  11. package/src/components/RuleImplementationResultTabs.js +113 -0
  12. package/src/components/RuleImplementationResults.js +1 -1
  13. package/src/components/RuleResult.js +108 -0
  14. package/src/components/{ExecutionDetails.js → RuleResultDetails.js} +4 -21
  15. package/src/components/RuleResultRemediationLoader.js +44 -0
  16. package/src/components/RuleResultRemediations.js +47 -0
  17. package/src/components/RuleResultRow.js +0 -3
  18. package/src/components/RuleResultSegmentRow.js +83 -0
  19. package/src/components/RuleResultSegments.js +102 -0
  20. package/src/components/RuleResultSegmentsLoader.js +34 -0
  21. package/src/components/RuleResultsRoutes.js +73 -0
  22. package/src/components/RuleRoutes.js +4 -14
  23. package/src/components/RuleSelector.js +5 -2
  24. package/src/components/__test_samples__/NewRuleImplementationProps.js +22 -2
  25. package/src/components/__tests__/ExecutionDetails.spec.js +5 -5
  26. package/src/components/__tests__/NewRuleImplementation.spec.js +27 -7
  27. package/src/components/__tests__/RuleResultSegmentsLoader.spec.js +32 -0
  28. package/src/components/__tests__/__snapshots__/ExecutionDetails.spec.js.snap +2 -30
  29. package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +1211 -1217
  30. package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -0
  31. package/src/components/index.js +2 -2
  32. package/src/components/ruleImplementationForm/DatasetForm.js +4 -1
  33. package/src/components/ruleImplementationForm/FieldsGrid.js +57 -0
  34. package/src/components/ruleImplementationForm/FieldsGroup.js +107 -0
  35. package/src/components/ruleImplementationForm/RuleImplementationForm.js +45 -0
  36. package/src/components/ruleImplementationForm/SegmentsForm.js +35 -0
  37. package/src/components/ruleImplementationForm/__tests__/DataSetForm.spec.js +0 -1
  38. package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +27 -10
  39. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +315 -91
  40. package/src/messages/en.js +7 -0
  41. package/src/messages/es.js +7 -0
  42. package/src/reducers/__tests__/segmentResult.spec.js +46 -0
  43. package/src/reducers/index.js +2 -0
  44. package/src/reducers/ruleImplementation.js +1 -0
  45. package/src/reducers/segmentResults.js +19 -0
  46. package/src/routines.js +3 -0
  47. package/src/sagas/__tests__/fetchSegmentResults.spec.js +78 -0
  48. package/src/sagas/fetchSegmentResults.js +30 -0
  49. package/src/sagas/index.js +3 -0
  50. package/src/services/encodeRawContent.js +5 -5
  51. package/src/styles/remediationPlan.less +5 -0
  52. 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
+ }
@@ -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;
@@ -1,3 +1,7 @@
1
+ .new-remedation-container {
2
+ padding-top: 1rem;
3
+ }
4
+
1
5
  .ui.button.button-edit-remediation {
2
6
  float: right;
3
7
  margin-left: 5px;
@@ -5,4 +9,5 @@
5
9
 
6
10
  .ui.actions.remediation {
7
11
  float: right;
12
+ padding: 2rem;
8
13
  }
@@ -1,3 +1,8 @@
1
1
  #add-structure-button {
2
2
  margin-top: 12px;
3
+ }
4
+
5
+ .segment-trash-buttom {
6
+ // padding-left: 6rem;
7
+ padding-top: 1rem;
3
8
  }