@truedat/dq 4.53.7 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.53.8] 2022-10-17
4
+
5
+ ### Added
6
+
7
+ - [TD-5027] support for restoring deprecated `Implementations`
8
+
3
9
  ## [4.53.7] 2022-10-14
4
10
 
5
11
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.53.7",
3
+ "version": "4.53.8",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -34,7 +34,7 @@
34
34
  "@testing-library/jest-dom": "^5.16.4",
35
35
  "@testing-library/react": "^12.0.0",
36
36
  "@testing-library/user-event": "^13.2.1",
37
- "@truedat/test": "4.53.7",
37
+ "@truedat/test": "4.53.8",
38
38
  "babel-jest": "^28.1.0",
39
39
  "babel-plugin-dynamic-import-node": "^2.3.3",
40
40
  "babel-plugin-lodash": "^3.3.4",
@@ -93,8 +93,8 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@apollo/client": "^3.6.4",
96
- "@truedat/core": "4.53.7",
97
- "@truedat/df": "4.53.7",
96
+ "@truedat/core": "4.53.8",
97
+ "@truedat/df": "4.53.8",
98
98
  "graphql": "^15.5.3",
99
99
  "path-to-regexp": "^1.7.0",
100
100
  "prop-types": "^15.8.1",
@@ -114,5 +114,5 @@
114
114
  "react-dom": ">= 16.8.6 < 17",
115
115
  "semantic-ui-react": ">= 0.88.2 < 2.1"
116
116
  },
117
- "gitHead": "beccd8ba2a5af9a3e0e1690b97d7c756b59e9c2b"
117
+ "gitHead": "56190c74eddc249134cb973cc21470c36a4701d0"
118
118
  }
@@ -23,3 +23,11 @@ export const PUBLISH_IMPLEMENTATION = gql`
23
23
  }
24
24
  }
25
25
  `;
26
+
27
+ export const RESTORE_IMPLEMENTATION = gql`
28
+ mutation restoreImplementation($id: ID!) {
29
+ restoreImplementation(id: $id) {
30
+ id
31
+ }
32
+ }
33
+ `;
@@ -12,6 +12,7 @@ import {
12
12
  submitImplementation,
13
13
  publishImplementation,
14
14
  rejectImplementation,
15
+ restoreImplementation,
15
16
  deleteImplementation,
16
17
  } from "../routines";
17
18
  import ExecutionPopup from "./ExecutionPopup";
@@ -59,6 +60,7 @@ export const ImplementationActions = ({
59
60
  deleteImplementation,
60
61
  publishImplementation,
61
62
  rejectImplementation,
63
+ restoreImplementation,
62
64
  ruleImplementation,
63
65
  submitImplementation,
64
66
  }) => {
@@ -96,6 +98,18 @@ export const ImplementationActions = ({
96
98
  }
97
99
  />
98
100
  ) : null}
101
+ {actions?.restore ? (
102
+ <Button
103
+ primary
104
+ content={formatMessage({ id: "actions.restore" })}
105
+ onClick={() =>
106
+ restoreImplementation({
107
+ id,
108
+ redirectUrl: linkTo.IMPLEMENTATION({ implementation_id: id }),
109
+ })
110
+ }
111
+ />
112
+ ) : null}
99
113
  {actions?.reject ? (
100
114
  <Button
101
115
  secondary
@@ -132,6 +146,7 @@ ImplementationActions.propTypes = {
132
146
  deleteImplementation: PropTypes.func,
133
147
  publishImplementation: PropTypes.func,
134
148
  rejectImplementation: PropTypes.func,
149
+ restoreImplementation: PropTypes.func,
135
150
  ruleImplementation: PropTypes.object,
136
151
  submitImplementation: PropTypes.func,
137
152
  };
@@ -149,5 +164,6 @@ export default connect(mapStateToProps, {
149
164
  deleteImplementation,
150
165
  publishImplementation,
151
166
  rejectImplementation,
167
+ restoreImplementation,
152
168
  submitImplementation,
153
169
  })(ImplementationActions);
@@ -5,7 +5,10 @@ import { connect } from "react-redux";
5
5
  import { Dimmer, Header, Icon, Loader, Segment } from "semantic-ui-react";
6
6
  import { FormattedMessage } from "react-intl";
7
7
  import { useActiveRoute } from "@truedat/core/hooks";
8
- import { IMPLEMENTATIONS_PENDING } from "@truedat/core/routes";
8
+ import {
9
+ IMPLEMENTATIONS_PENDING,
10
+ IMPLEMENTATIONS_DEPRECATED,
11
+ } from "@truedat/core/routes";
9
12
  import { getExecutionQuery } from "../selectors";
10
13
  import RuleImplementationsActions from "./RuleImplementationsActions";
11
14
  import RuleImplementationsLabelResults from "./RuleImplementationsLabelResults";
@@ -24,11 +27,16 @@ const usePrevious = (value) => {
24
27
 
25
28
  export const ImplementationSearchResultsHeader = () => {
26
29
  const pending = useActiveRoute(IMPLEMENTATIONS_PENDING);
30
+ const deprecated = useActiveRoute(IMPLEMENTATIONS_DEPRECATED);
27
31
  const header = pending
28
32
  ? "implementations.header.manage"
33
+ : deprecated
34
+ ? "implementations.header.deprecated"
29
35
  : "implementations.header";
30
36
  const subheader = pending
31
37
  ? "implementations.subheader.manage"
38
+ : deprecated
39
+ ? "implementations.subheader.deprecated"
32
40
  : "implementations.subheader";
33
41
  return (
34
42
  <Header as="h2">
@@ -117,16 +117,22 @@ const DatasetSummary = ({ rows, alias }) =>
117
117
  {_.has("structure")(row) && (
118
118
  <Table.Cell>
119
119
  {_.path("structure.type")(row) !== "reference_dataset" ? (
120
- <Link
121
- to={linkTo.STRUCTURE({
122
- id: _.pathOr("", "structure.id")(row),
123
- })}
124
- >
125
- <p className="highlighted">
126
- <Icon name="table" size="small" />
127
- {`"${path(_.propOr({}, "structure")(row))}"`}
128
- </p>
129
- </Link>
120
+ _.path("structure.id")(row) ? (
121
+ <Link
122
+ to={linkTo.STRUCTURE({
123
+ id: _.path("structure.id")(row),
124
+ })}
125
+ >
126
+ <p className="highlighted">
127
+ <Icon name="table" size="small" />
128
+ {`"${path(_.propOr({}, "structure")(row))}"`}
129
+ </p>
130
+ </Link>
131
+ ) : (
132
+ <FormattedMessage
133
+ id={`ruleImplementation.summary.invalid_structure`}
134
+ />
135
+ )
130
136
  ) : (
131
137
  <span>
132
138
  <Icon name="list ol" size="small" />{" "}
@@ -23,6 +23,7 @@ import {
23
23
  IMPLEMENTATION_STRUCTURES,
24
24
  IMPLEMENTATION,
25
25
  IMPLEMENTATIONS,
26
+ IMPLEMENTATIONS_DEPRECATED,
26
27
  IMPLEMENTATIONS_PENDING,
27
28
  } from "@truedat/core/routes";
28
29
  import {
@@ -340,6 +341,17 @@ export const ImplementationsRoutes = ({
340
341
  />
341
342
  )}
342
343
  />
344
+ <Route
345
+ exact
346
+ path={IMPLEMENTATIONS_DEPRECATED}
347
+ render={() => (
348
+ <Implementations
349
+ defaultFilters={{
350
+ status: ["deprecated"],
351
+ }}
352
+ />
353
+ )}
354
+ />
343
355
  </Switch>
344
356
  );
345
357
  };
@@ -6,6 +6,7 @@ import {
6
6
  EXECUTION_GROUP,
7
7
  EXECUTION_GROUPS,
8
8
  IMPLEMENTATIONS,
9
+ IMPLEMENTATIONS_DEPRECATED,
9
10
  IMPLEMENTATIONS_PENDING,
10
11
  RULES,
11
12
  } from "@truedat/core/routes";
@@ -55,6 +56,12 @@ const QualityRoutes = () => {
55
56
  authorized ? <ImplementationsRoutes /> : <Unauthorized />
56
57
  }
57
58
  />
59
+ <Route
60
+ path={IMPLEMENTATIONS_DEPRECATED}
61
+ render={() =>
62
+ authorized ? <ImplementationsRoutes /> : <Unauthorized />
63
+ }
64
+ />
58
65
  </>
59
66
  );
60
67
  };
@@ -27,15 +27,7 @@ export const RuleImplementation = ({ children, ruleImplementation }) => {
27
27
  </Grid.Column>
28
28
  <Grid.Column width={8} textAlign="right">
29
29
  <>
30
- {deletedAt ? (
31
- <Label
32
- className="alert warning"
33
- content={formatMessage({
34
- id: "ruleImplementation.props.status.deprecated",
35
- })}
36
- icon={{ name: "warning circle", color: "red" }}
37
- />
38
- ) : (
30
+ {deletedAt ? null : (
39
31
  <Subscription
40
32
  resource={ruleImplementation}
41
33
  resourceType="implementation"
@@ -78,9 +78,11 @@ export default {
78
78
  "implementations.execute.filtered": "{count} implementations to execute",
79
79
  "implementations.header": "Quality Implementations",
80
80
  "implementations.header.manage": "Implementation Management",
81
+ "implementations.header.deprecated": "Deprecated Implementations",
81
82
  "implementations.search.placeholder": "Search implementations...",
82
83
  "implementations.subheader": "Quality implementations list and details",
83
84
  "implementations.subheader.manage": "Implementation Versions in Progress",
85
+ "implementations.subheader.deprecated": "List of deprecated quality implementations",
84
86
  "implementationsStructures.delete.confirmation.content":
85
87
  "The relation will be deleted. Are you sure?",
86
88
  "implementationsStructures.delete.confirmation.header":
@@ -438,7 +440,6 @@ export default {
438
440
  "ruleImplementation.props.reference_dataset": "Reference dataset",
439
441
  "ruleImplementation.props.reference_dataset.placeholder":
440
442
  "Search reference dataset",
441
- "ruleImplementation.props.status.deprecated": "Deprecated Implementation",
442
443
  "ruleImplementation.props.structure": "Structure",
443
444
  "ruleImplementation.props.structure.alias": "Alias",
444
445
  "ruleImplementation.props.structure.placeholder": "Search structure",
@@ -460,6 +461,7 @@ export default {
460
461
  "ruleImplementation.summary.population": "Population",
461
462
  "ruleImplementation.summary.source": "Data source",
462
463
  "ruleImplementation.summary.structure": "Structure",
464
+ "ruleImplementation.summary.invalid_structure": "Invalid structure",
463
465
  "ruleImplementation.summary.system": "System",
464
466
  "ruleImplementation.summary.validations": "Validations",
465
467
  "ruleImplementation.summary.values": "Values",
@@ -79,9 +79,12 @@ export default {
79
79
  "implementations.execute.filtered": "{count} implementaciones a ejecutar",
80
80
  "implementations.header": "Implementaciones de calidad",
81
81
  "implementations.header.manage": "Gestión de Implementaciones",
82
+ "implementations.header.deprecated": "Implementaciones archivadas",
82
83
  "implementations.search.placeholder": "Buscar implementaciones...",
83
84
  "implementations.subheader":
84
85
  "Listado y detalle de implementaciones de calidad",
86
+ "implementations.subheader.deprecated":
87
+ "Listado de implementaciones de calidad archivadas",
85
88
  "implementations.subheader.manage":
86
89
  "Versiones de Implementaciones en Progreso",
87
90
  "implementationsStructures.delete.confirmation.content":
@@ -447,8 +450,6 @@ export default {
447
450
  "ruleImplementation.props.reference_dataset": "Datos de referencia",
448
451
  "ruleImplementation.props.reference_dataset.placeholder":
449
452
  "Buscar datos de referencia",
450
- "ruleImplementation.props.status.deprecated":
451
- "Esta Implementación está archivada",
452
453
  "ruleImplementation.props.structure": "Estructura",
453
454
  "ruleImplementation.props.structure.alias": "Alias",
454
455
  "ruleImplementation.props.structure.placeholder": "Buscar estructura",
@@ -470,6 +471,7 @@ export default {
470
471
  "ruleImplementation.summary.population": "Población",
471
472
  "ruleImplementation.summary.source": "Origen de datos",
472
473
  "ruleImplementation.summary.structure": "Estructura",
474
+ "ruleImplementation.summary.invalid_structure": "Estructura inválida",
473
475
  "ruleImplementation.summary.system": "Sistema",
474
476
  "ruleImplementation.summary.validations": "Validaciones",
475
477
  "ruleImplementation.summary.values": "Valores",
@@ -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
+ }