@truedat/dq 4.53.6 → 4.53.8

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 (27) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +5 -5
  3. package/src/api/mutations.js +8 -0
  4. package/src/components/ConditionSummary.js +35 -26
  5. package/src/components/ImplementationActions.js +16 -0
  6. package/src/components/ImplementationSearchResults.js +9 -1
  7. package/src/components/ImplementationSummary.js +20 -14
  8. package/src/components/ImplementationsRoutes.js +12 -0
  9. package/src/components/NewRuleImplementation.js +62 -40
  10. package/src/components/QualityRoutes.js +7 -0
  11. package/src/components/RuleImplementation.js +1 -9
  12. package/src/components/__tests__/ImplementationSummary.spec.js +1 -1
  13. package/src/components/__tests__/NewRuleImplementation.spec.js +49 -45
  14. package/src/components/__tests__/__fixtures__/NewRuleImplementationProps.js +25 -23
  15. package/src/components/__tests__/__fixtures__/newRuleImplementationHelper.js +11 -12
  16. package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +62 -1
  17. package/src/components/ruleImplementationForm/FiltersGrid.js +1 -1
  18. package/src/components/ruleImplementationForm/FiltersGroup.js +22 -20
  19. package/src/components/ruleImplementationForm/RuleImplementationForm.js +62 -25
  20. package/src/components/ruleImplementationForm/ValidationsForm.js +1 -2
  21. package/src/messages/en.js +9 -3
  22. package/src/messages/es.js +9 -3
  23. package/src/reducers/ruleImplementation.js +4 -1
  24. package/src/reducers/ruleRedirect.js +3 -0
  25. package/src/routines.js +1 -0
  26. package/src/sagas/index.js +3 -0
  27. package/src/sagas/restoreImplementation.js +24 -0
@@ -12,6 +12,7 @@ import {
12
12
  deleteRule,
13
13
  publishImplementation,
14
14
  rejectImplementation,
15
+ restoreImplementation,
15
16
  submitImplementation,
16
17
  updateRule,
17
18
  uploadRules,
@@ -56,6 +57,8 @@ export const ruleRedirect = (state = initialState, { type, payload, meta }) => {
56
57
  return payload?.redirectUrl || state;
57
58
  case rejectImplementation.SUCCESS:
58
59
  return payload?.redirectUrl || state;
60
+ case restoreImplementation.SUCCESS:
61
+ return payload?.redirectUrl || state;
59
62
  default:
60
63
  return state;
61
64
  }
package/src/routines.js CHANGED
@@ -71,6 +71,7 @@ export const openImplementationFilter = createRoutine(
71
71
  );
72
72
  export const openRuleFilter = createRoutine("OPEN_RULE_FILTER");
73
73
  export const publishImplementation = createRoutine("PUBLISH_IMPLEMENTATION");
74
+ export const restoreImplementation = createRoutine("RESTORE_IMPLEMENTATION");
74
75
  export const rejectImplementation = createRoutine("REJECT_IMPLEMENTATION");
75
76
  export const removeImplementationFilter = createRoutine(
76
77
  "REMOVE_IMPLEMENTATION_FILTERS"
@@ -21,6 +21,7 @@ import { fetchRulesRequestSaga } from "./fetchRules";
21
21
  import { fetchSegmentResultsRequestSaga } from "./fetchSegmentResults";
22
22
  import { publishImplementationRequestSaga } from "./publishImplementation";
23
23
  import { rejectImplementationRequestSaga } from "./rejectImplementation";
24
+ import { restoreImplementationRequestSaga } from "./restoreImplementation";
24
25
  import { searchRuleImplementationsRequestSaga } from "./searchRuleImplementations";
25
26
  import { submitImplementationRequestSaga } from "./submitImplementation";
26
27
  import { updateRemediationRequestSaga } from "./updateRemediation";
@@ -54,6 +55,7 @@ export {
54
55
  fetchSegmentResultsRequestSaga,
55
56
  publishImplementationRequestSaga,
56
57
  rejectImplementationRequestSaga,
58
+ restoreImplementationRequestSaga,
57
59
  searchRuleImplementationsRequestSaga,
58
60
  submitImplementationRequestSaga,
59
61
  updateRemediationRequestSaga,
@@ -88,6 +90,7 @@ export default [
88
90
  fetchSegmentResultsRequestSaga(),
89
91
  publishImplementationRequestSaga(),
90
92
  rejectImplementationRequestSaga(),
93
+ restoreImplementationRequestSaga(),
91
94
  searchRuleImplementationsRequestSaga(),
92
95
  submitImplementationRequestSaga(),
93
96
  updateRemediationRequestSaga(),
@@ -0,0 +1,24 @@
1
+ import { call, put, takeLatest, getContext } from "redux-saga/effects";
2
+ import { RESTORE_IMPLEMENTATION } from "../api/mutations";
3
+ import { restoreImplementation } from "../routines";
4
+
5
+ export function* restoreImplementationSaga({ payload }) {
6
+ const client = yield getContext("client");
7
+ try {
8
+ const { id, redirectUrl } = payload;
9
+ yield put(restoreImplementation.request({ id }));
10
+ const { data } = yield call(client.mutate, {
11
+ mutation: RESTORE_IMPLEMENTATION,
12
+ variables: payload,
13
+ });
14
+ yield put(restoreImplementation.success({ data, redirectUrl }));
15
+ } catch (error) {
16
+ yield put(restoreImplementation.failure(error.message));
17
+ } finally {
18
+ yield put(restoreImplementation.fulfill());
19
+ }
20
+ }
21
+
22
+ export function* restoreImplementationRequestSaga() {
23
+ yield takeLatest(restoreImplementation.TRIGGER, restoreImplementationSaga);
24
+ }